-
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
Support exporting all barplot legends, including color gradient and length legends; export collapsed clade shapes and barplots #392
Conversation
Also added a newline after </style>
-Use "long form" font specification for the style SVG (fixes problems with GIMP and Inkscape) -Put the style code higher up in the output legend SVG -- has the effect of applying the rect stroke to the topmost legend rect, which was a problem in Inkscape but not in chromium (:thonk:) -Add note about GIMP choking on dominant-baseline (tldr not worth worrying abt now i think)
(the text styles are now across multiple lines)
similar to what we do for categorical export
make life less painful (tm)
Now, things are split up into a "Solo" and "HTML" SVG -- the gradient shown on the page is a combo of these, and the one we export is just the Solo one. This makes scaling it properly for the export SO MUCH EASIER AHH All we gotta do now is just add in value text and update rowsUsed / maxLineWidth. think that should be good? oh also this is gonna explode the tests ofc. that is a job for TOMORROW MARCUS (tm)
IT WORKS SO WELL AOGIHDSOIGHJ something worth noting: there seems to be some unaccounted-for horizontal padding on the right side in the cat legend export. i matched it in the continuous legend export b/c it looks nice but worth looking into...?
it looks like things are the opposite from how i thought -- looks like the perceived extra space was just due to the boldfont used in estimating the texts (when you make the text bold it's almost snug with the border on the right side). may as well add the same padding as for the continuous legends so things look consistent ish. Still, this leaves it kinda unclear as to why continuous legends were so comparatively snug with the border until i added padding ... maybe boldface numbers are just not that bigger? idk UPDATE: yeah i checked it and bold numbers are basically the same size but bold letters are much larger. mystery solved 💯
looks not great (gotta align max and min headers like in table) but good enough tm
Actually not that bad. wack.
removes line in the middle
Need to use paths for circular barplot curves, and maybe better stuff for rect barplots. but it works :D
since default is 1
shoutouts to https://stackoverflow.com/a/53309814/10730311. this is very easy to configure (just a line in the svg header), so if users prefer different things we can document this.
export is broken (height is somehow nan?) but at least this works now
The following artifacts were built for this PR: empire-biplot.qzv, empire.qzv, empress-tree.qzv, just-fm.qzv, plain.qzv |
At least for cat legends -- no longer do we have to worry about rows and units and all that. each legend just returns its width and height, and that's all we care about.
That is looking super cool! |
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.
Thanks @fedarko! I just have a couple of comments.
addresses a comment from @kwcantrell
addresses @kwcantrell comment. Required breaking up the barplot drawing stuff into a separate function that returns the coords
tldr gotta reverse the stop colors. reason this worked _before_ was that it was accessing the interpolator to build up the stop colors
Thanks for the feedback @kwcantrell! I think all of your comments should be addressed now. I also realized that this PR introduced a bug where gradient legends (when the color reversing was selected) weren't getting reversed -- this was due to an error in how this PR used the chroma.js |
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 good, I just have a few (minor) comments.
empress/support_files/js/empress.js
Outdated
* | ||
* @returns {Object} Contains three entries: | ||
* -coords: An array of coordinate data, in the format | ||
* [x, y, r, g, b, ...] (TODO FOR SELF: Update this when |
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.
I believe the only thing that will need to change in empress.js
is this doc string.
Addresses @kwcantrell comment.
…k-fixes knock on wood
thanks @fedarko and @ElDeveloper |
Part of the work on #303.
Closes #421.
Required some substantial refactoring to the way gradient SVGs are stored in Empress, in order to make it easier to scale these differently within a legend.
Also as part of this PR, slightly changed the way numbers are formatted in the Tree Statistics (so now commas are used as thousands separators [at least for English locales], etc.)
TODOs:
and length legends [Add warning to length legends if missing / non-numeric values #391]) if there are missing / non-numeric values in the field. Currently this warning (which is already shown for gradient legends in the interface) is not included.