-
Notifications
You must be signed in to change notification settings - Fork 73
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
Refactor text drawing #242
Refactor text drawing #242
Conversation
Codecov Report
@@ Coverage Diff @@
## master #242 +/- ##
==========================================
+ Coverage 86.66% 86.77% +0.11%
==========================================
Files 17 17
Lines 9446 9508 +62
Branches 1712 1727 +15
==========================================
+ Hits 8186 8251 +65
+ Misses 750 749 -1
+ Partials 510 508 -2
Continue to review full report at Codecov.
|
5c9a6db
to
9994f7c
Compare
Pinging @petrelharp, @hyanwong, @brianzhang01, @awohns, @gtsambos as tree-drawers. There's some significant updates to the text drawing API here, and it would be good to get some feedback. Firstly, we have nice rendering of tree sequences: hooray!
The drawing is done by the There's also a preliminary pass at drawing left-to-right trees using the
This basically works, but I still need to figure out how to create space for the labels along the branches. The reason I want to sort this out now is that I want to finalise the Questions:
The plan would then be to mirror the structure of this API in the |
Yay, looks good Jerome! I was literally just thinking today that it would be useful to be able to draw rotated trees, as I've come up with some ancestry-related stepwise functions that are best conceptualised with time on the horizontal axis (I will show you at our next f2f meeting). I think it would be more natural for these trees to be the other way around (ie. leaves on the left, root on the right). If so, then when you plot a sequence of left-aligned trees, the horizontal time axis will be the same for each tree. As it is, the same leaves on different trees will have different horizontal coordinates, which is a bit confusing given that they are all at time = 0. I also think this would be a bit more intuitive, since bigger (backwards-in)-time values would then be further to the right, just like on a number line. |
We'd definitely make sure that the nodes with the same time have the same x coordinates, which is true of the version above (but maybe your browser isn't rendering unicode correctly? This is a long-running issue, see #189). Having alignment="right" as well as "left" would also be a logical option. Shouldn't be that hard to do. |
Adds use_ascii option to draw_text to enable text drawing with non unicode chars. Closes tskit-dev#227 Closes tskit-dev#174
Closes tskit-dev#55 by raising a ValueError for any unsupported arguments.
efb5ecc
to
0ab5e2a
Compare
OK, this is looking like it's the right way to do things so I'm going to merge it. I'll open some issues tracking where we want to go with the tree drawing APIs once the SVG code has been cleaned up as well. |
this is wonderful. |
So I'm on |
The draw_text() and draw_svg() versions are experimental and aren't documented for the moment. I was planning to use them within the developer community for a bit before finalising the APIs and documenting fully. The long-term vision at the moment is that we'll keep the current Probably we'll add the Thanks for trying this stuff out --- please open issues if you have any feedback or spot any problems! |
No description provided.