auspice icon indicating copy to clipboard operation
auspice copied to clipboard

Clip (or otherwise hide) tree elements that are out of frame

Open trvrb opened this issue 3 years ago • 3 comments

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

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

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

Possible solution
I'd assume that this could be accomplished either by:

  1. Doing something like SVG <clipPath> to clip out things out of frame
  2. Simply drawing a white background behind the axes elements

I'd assume that (2) would be the easier strategy.

trvrb avatar Apr 07 '21 05:04 trvrb

This also exposes another issue: our criterion for printing strain names implicitly assumes that the visible objects are evenly spaced on the screen.

rneher avatar Apr 07 '21 10:04 rneher

Maybe we should always hide tip labels in scatterplot and clock views? They will very often be occluding.

trvrb avatar Apr 07 '21 17:04 trvrb

Will be closed by #1383

jameshadfield avatar Aug 04 '21 04:08 jameshadfield