-
Notifications
You must be signed in to change notification settings - Fork 31
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
Scale barplot thicknesses relative to tree size; makes default layout barplot lengths look thicker; fix a small Colorer bug #442
Conversation
Relevant to biocore#276. The reliance on max displacement (which doesn't seem to have an analogue in the unrooted layout? or maybe we can sort of treat it the same way as circ layout, idk) means that this might be too specific a solution to apply to line width thicknesses, but it should make using barplots a lot less painful
The following artifacts were built for this PR: empire-biplot.qzv, empire.qzv, empress-tree.qzv, just-fm.qzv, plain.qzv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great just one small suggestion!
should address @ElDeveloper comment
Thanks @ElDeveloper! Should be addressed now. I also noticed a small bug where barplot border lengths weren't being scaled in the same way that the other barplot lengths were being scaled -- that should be fixed in 56552f5. (I also changed the default barplot length from 50 to 10, since I think borders being 5% of the tree thickness looked a bit weird -- in practice this looks similar to the previous default setting before this PR.) |
Thanks @fedarko! |
Part of the work on #276. This should make barplots look more consistent between the rectangular and circular layouts, and in particular make circular layout barplots' defaults look a lot more legible. Barplot lengths, rather than being in arbitrary units, are now scaled by the tree "thickness" (root to farthest tip width in the rectangular layout, 2 * that distance for the circular layout).
Old:
New:
Note 1: currently I have this set so that the default barplot layer length, 100, is equal to 1/10th of the tree "thickness." If folks would prefer a thinner default setting, we can adjust the scaling code as needed.
Note 2: I also noticed and fixed a small problem with the Colorer module, where the "freebie" problems with barplot borders we discussed in #400 re-emerged. Basically, this was because
rgbToFloat()
was being called on a GL array (with colors in the range [0, 1]), not on an RGB array (with colors in the range [0, 255]) -- so the RGB float colors didn't match. I added and tested some code to do the RGB -> GL conversion. I also bit the bullet and added a test that verifies that the "freebie" checking works (i.e. unnecessary triangles aren't being drawn), and added some extra barplot testing code.