biocore / empress

A fast and scalable phylogenetic tree viewer for microbiome data analysis
BSD 3-Clause "New" or "Revised" License
48 stars 31 forks source link

Continue legend overflow on new line #534

Open kwcantrell opened 3 years ago

kwcantrell commented 3 years ago

It was brought up that some journals put restrictions on legend size. So, it would be nice to also allow legend text to continue on a new line.

We can set up a toggle on the legend that will either fit all legend text on single line (currently how its done) or continue legend text on a new line when overflow happens.

fedarko commented 3 years ago

This sounds like a nice idea. If I can ask, what sort of legend text is causing the problem? I know this is a problem with long taxonomy strings (e.g. species-level ones) -- but I'm sure these won't be the only problematic cases.

From a bit of messing around with the HTML, it should be possible to insert <br> tags into the legend label text (as shown in the first two categories below), although there's probs a cleaner way to do this.

image