Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support exporting all barplot legends, including color gradient and l…
…ength legends; export collapsed clade shapes and barplots (#392) * ENH: support collecting+exporting barplot legends * BUG: Fix legend SVG title centering; <g> => <svg> Also added a newline after </style> * BUG: Improve legend SVG for SVG importers -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) * STY: reorder/split up text and .title svg styles (the text styles are now across multiple lines) * MNT: hang on to continuous props in Legend for SVG similar to what we do for categorical export * ENH: add newlines to within gradient svgs make life less painful (tm) * MNT: abstract some code within legend export; grad svg work * MNT: Refactor colorer/legend handling of gradients 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) * ENH: Finish? gradient legend SVG exporting! 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...? * MNT: add explicit padding to right side of cat SVG 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 :100: * ENH: initial support for exporting length legends looks not great (gotta align max and min headers like in table) but good enough tm * ENH: make exported length legend look purdy * STY: pret * ENH: export collapsed clade shapes! #303 Actually not that bad. wack. * ENH: draw full rectangle for unrooted collapsing removes line in the middle * ENH/STY: use stroke on svg triangles; prettify * MNT: also use stroke for unrooted clade export * DOC: document todos for clade collapsing export * ENH: support exporting barplots in SVG! Need to use paths for circular barplot curves, and maybe better stuff for rect barplots. but it works :D * Update readme re: #303 fixes :D * PERF: Only specify stroke width for thick lines since default is 1 * MNT: apply shape-rendering to SVG 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. * MNT: make polygon exporting util func * MNT: attempt to fix bounding box stuff export is broken (height is somehow nan?) but at least this works now * STY: prettify * negate y coords and declare maxy in bb still broken but much less so * Space out adjacent polygon pts fixes things! hey this works now * PERF/BUG: don't even draw 0-length barplots previously they were showing up in the SVG, probs due to precision pbms. should beo k now * STY: prett * DOC: remove svg export disclaimer :D #303 * BUG: Fix #421 still gotta test, tho, which will likely need to be deferred until after fixing the other pbms with this pr and tests .______. * TST: fix a gradient svg test * specify combined svg * TST: split up test ref svgs by solo/html * TST: Fix most of the colorer tests * MNT: redo public attr stuff with a func approach is safer -- delegates checking that colorer is continuous to, well, colorer. * TST: unbreak colorer tests! * Say missing and/or not numeric in warning * TST: unbreak legend tests :D * STY: prettify tests * MNT: Drastically simplify legend exporting 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. * STY: pret * UNBREAK CONTINUOUS LEGENDS :D * Fix length legends * ENH: show missing/nonnumeric warn in grad legends * DOC: fix some docs stuff * fix stats format * populateTreeStats fixes * STY: whoops * MNT: Move radius bb expansion to sep function addresses a comment from @kwcantrell * PERF: don't cache barplot buffer addresses @kwcantrell comment. Required breaking up the barplot drawing stuff into a separate function that returns the coords * BUG: fix reversed continuous color map legends tldr gotta reverse the stop colors. reason this worked _before_ was that it was accessing the interpolator to build up the stop colors * simplify grad svg code a bit * TST: test reverse color gradient bug is fixed * STY * MNT: Simplify gradient ID / suffix stuff Addresses @kwcantrell comment. * DOC: fix documentation stuff wrt #400
- Loading branch information