MAIDR Documentation - v3.58.2
    Preparing search index...

    Function normalizePlotlySvg

    • Normalize a Plotly-rendered SVG so that maidr's core logic can treat it the same as a matplotlib SVG.

      Responsibilities handled here (all Plotly-specific):

      1. Subplot background wrapping – wrap bglayer <rect> elements in <g id="axes_…"> groups so maidr can highlight subplots.
      2. Stroke mirroring – maidr clones elements as hidden backups and applies stroke to clones; a MutationObserver mirrors those changes back onto the visible originals.
      3. CSS layout fixes – Plotly's SVG is position:absolute inside a position:relative container; inject overrides so maidr's <article>/<figure> wrapper doesn't collapse.
      4. React-container positioning – push maidr's react-container below the chart by observing when it appears and adding padding.
      5. Modebar accessibility – remove Plotly's toolbar from the tab order and accessibility tree.
      6. Click-to-focus – forward clicks on Plotly's overlay SVGs to maidr's focusable wrapper.

      Parameters

      • svg: SVGSVGElement

        The <svg class="main-svg"> element.

      • schema: Maidr

        The parsed MAIDR JSON schema.

      Returns void