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):
Subplot background wrapping – wrap bglayer <rect> elements in
<g id="axes_…"> groups so maidr can highlight subplots.
Stroke mirroring – maidr clones elements as hidden backups and
applies stroke to clones; a MutationObserver mirrors those changes
back onto the visible originals.
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.
React-container positioning – push maidr's react-container below
the chart by observing when it appears and adding padding.
Modebar accessibility – remove Plotly's toolbar from the tab
order and accessibility tree.
Click-to-focus – forward clicks on Plotly's overlay SVGs to
maidr's focusable wrapper.
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):
<rect>elements in<g id="axes_…">groups so maidr can highlight subplots.position:absoluteinside aposition:relativecontainer; inject overrides so maidr's<article>/<figure>wrapper doesn't collapse.