Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added width and background options for svg and png #15

Open
szufan opened this issue Jun 10, 2021 · 3 comments
Open

Added width and background options for svg and png #15

szufan opened this issue Jun 10, 2021 · 3 comments

Comments

@szufan
Copy link

szufan commented Jun 10, 2021

Hello -

I've noticed when writing trees to file with gotree draw svg and gotree draw png tip labels get cut off. I think, for SVG at least, this is because only +60 is added to the width (and height) parameters. This can be fixed by editing the svg attribute width="100%" or replacing width with overflow="visible". Could one of these be made default, or added as an option? This is also an issue with PNGs, but I do not have a workaround for that.

Another issue with PNGs is that the transparent background appears gray in Dark Mode. Could an option be added to create PNGs with a white background?

I tested the above with the following newick (sorry, .nwk not an accepted upload):

(long-label-20:0.0001775,(long-label-21:0,((long-label-12:0,long-label-13:0.000076,long-label-08:0,long-label-08-1:0,(long-label-09:0,really-long-label-11:0.000034):0.000069,long-label-07:0,long-label-19:0):0.000034,long-label-10:0,long-label-10-1:0,long-label-10-2:0,long-label-06:0,long-label-05:0,long-label-17:0,long-label-02:0,long-label-04:0,long-label-03:0,long-label-01:0):0.000102):0.0001775);

Using:
gotree draw svg < in.nwk

gotree draw png < in.nwk

Thanks,
Sara

@fredericlemoine
Copy link
Collaborator

Hello,

That is something I wanted to work on for a long time. The commits solve part of the drawing issues (especially with "normal" layout), but there are still work to do with circular and radial layouts.

Frédéric

@szufan
Copy link
Author

szufan commented Jun 11, 2021

Thank you @fredericlemoine ! Could you release this for conda users?

@fredericlemoine
Copy link
Collaborator

Sure, I will do it soon. In the mean time, you can also open your svg files with inkscape, and modify the dimension of the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants