-
Notifications
You must be signed in to change notification settings - Fork 77
Would be nice if SVG trees could have the tip labels rotated by 90 degrees #26
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
Comments
The only tricky issue with this is the overall spacing. The bottom padding would need to be tweaked to allow space for the labels, which means we'd need some way to measure the size of the labels. AFAICT, this is impossible in SVG. Possibly the simplest option is to have a y_padding=(bottom, top) argument which can be tweaked by the user. We need something like this anyway for some labels, as they are not being rendered correctly with some font sizes, etc. |
For a rough first pass I think you could not bother accommodating label space, and simply allow users to re-frame the svg after the fact, which I know is easy in e.g. inkscape. After all, the information is all there, just not visible until you re-frame. A bit yucky, but a usable solution. |
Just to note, this requires using the transform mixin for svgwrite, http://svgwrite.readthedocs.io/en/latest/classes/mixins.html#transform-mixin. To reframe using inkscape so that everything is in the canvas, you can do |
Good to know, thanks. |
We can now do this via SVG styles ( |
At the moment, for large trees with custom labels, labels from SparseTree.draw(format="svg") are bound to overlap. An option to rotate the labels by 90 degrees would be helpful, and probably very easy to code.
The text was updated successfully, but these errors were encountered: