[phylo] resize feature
As a user, I want an adapting memiescape. When the window width changes, or when we hide the tree, then it can resize itself accordingly.
Pre-requisites
- ratio issue: GraphViz returns a fixed ratio frame box, so we have to rigidify either the width or the height
- fluid width: it is simpler to fluidify the width value, so we have to delete svg attribute width for a CSS rule
100%
- observing change of wrapper dimensions: best done via a
ResizeObserver
(more info here) - light ~ warning: prevent unneeded calls (eg. the observer will trigger even if the element has already been printed and thus drawed)
a) Micro management
- aim: updating scalers used for transformation and zooming
- on dimension change: set new values, calling
onZoom
function, reapplysetAxis
- same behavior for the isoline
-
medium ~ time consuming: imperative
drawPhylo
business has to be re-write (intrication issue) -
light ~ warning:
onZoom
need an event transformation, how can we simulate it? If not, have to create another set of functions
b) Macro management
- aim: calling the whole
drawPhylo
function again - same behavior for the isoline
- light ~ UI issue: extra layer of micro management needed to keep selection and some options after a re-draw (too difficult for the viewBox position values though)
Solution a) fits the description with a qualitative UI/UX, more time consuming though