auspice
auspice copied to clipboard
Clip (or otherwise hide) tree elements that are out of frame
Context
Quite commonly there will be branches from phylotree that are just out of frame and fall alongside the x or y axis. This obscures the axis labels and generally looks messy.
This has been a minor issue since the beginning when zooming the tree with situations like:
![Screen Shot 2021-04-06 at 9 54 46 PM](https://user-images.githubusercontent.com/1176109/113812341-c97c9780-9722-11eb-86b2-d3eb76f6080d.png)
However, scatterplot view really exposes this issue further. See for example this view from https://dev.nextstrain.org/staging/ncov/global-with-dfreq?f_clade_membership=20J/501Y.V3&l=scatter&label=clade:20J/501Y.V3&scatterY=logistic_growth
![Screen Shot 2021-04-06 at 9 56 57 PM](https://user-images.githubusercontent.com/1176109/113812507-119bba00-9723-11eb-9666-02971787eb0b.png)
All the branch lines obscure my reading of the y axis and I can't see that the lower set of red tips have a value of 0 for logistic growth rate.
Description
I'd like plotting here to work like most plotting libraries where "ink" outside of the axes frame is hidden. Ie I'd like white in the dashed boxes with axes on top:
![Screen Shot 2021-04-06 at 9 56 57 PM](https://user-images.githubusercontent.com/1176109/113812765-8242d680-9723-11eb-851f-79020a90f497.png)
Possible solution
I'd assume that this could be accomplished either by:
- Doing something like SVG
<clipPath>
to clip out things out of frame - Simply drawing a white background behind the axes elements
I'd assume that (2) would be the easier strategy.
This also exposes another issue: our criterion for printing strain names implicitly assumes that the visible objects are evenly spaced on the screen.
Maybe we should always hide tip labels in scatterplot and clock views? They will very often be occluding.
Will be closed by #1383