The panel's root svg element
The extracted layer info
Numeric index for generating unique attribute names
Set of elements already claimed by prior layers of the same panel (must not be shared across panels)
Per-chart (and, in multi-panel mode, per-panel) CSS scope prefix that disambiguates this panel's selectors page-wide
Panel index in multi-panel mode; null keeps the
original single-panel attribute naming
A CSS selector string, or undefined if elements could not be
matched (highlighting will gracefully degrade).
This relies on Victory's role="presentation" attribute on data
elements, which is a stable Victory convention (tested with v37).
If Victory changes this convention, selector tagging will silently
degrade and highlighting will stop working (audio/text/braille are
unaffected).
The emitted selectors are prefixed with scope (e.g. #<containerId> , or
#<containerId> [data-maidr-victory-panel="i"] in multi-panel mode) so
that MAIDR — which resolves selectors via page-global document.querySelector
— cannot match another Victory chart's (or panel's) identically-indexed
tags. The per-element tag attributes only need to be unique within their
own container, which scope plus the panel-folded names guarantee.
Finds the Victory data elements inside a container for a given layer, tags them with a unique data attribute, and returns the CSS selector that matches exactly those elements.
Strategy:
role="presentation"on the individual data shapes.rectfor bars) that carriesrole="presentation".data-maidr-victory-<layerIndex>attribute so MAIDR can select them deterministically.