Follow the size of el. Each time its padding box changes,
target.resize gets its new width and height in CSS px, the size
measure gives. A size of 0, as in a hidden tab, is skipped.
Returns a function that stops following.
It also keeps the fallback height of measure right as the page
changes: an element shown with no content height gets it, and an
element the page gives a height of its own drops it.
The R and Python wrappers do this for every plot. In plain JavaScript,
call it once the plot is made, and call the function it returns before
destroy():
constplot = createVolcano(el, { data }); conststop = autoResize(el, plot); // later stop(); plot.destroy();
Follow the size of
el. Each time its padding box changes,target.resizegets its new width and height in CSS px, the size measure gives. A size of 0, as in a hidden tab, is skipped. Returns a function that stops following.It also keeps the fallback height of measure right as the page changes: an element shown with no content height gets it, and an element the page gives a height of its own drops it.
The R and Python wrappers do this for every plot. In plain JavaScript, call it once the plot is made, and call the function it returns before
destroy():