plotomics
    Preparing search index...

    Function autoResize

    • 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():

      const plot = createVolcano(el, { data });
      const stop = autoResize(el, plot);
      // later
      stop();
      plot.destroy();

      Parameters

      • el: Element
      • target: { resize(width: number, height: number): void }

      Returns () => void