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 names this panel's elements alone
Panel index in multi-panel mode; null keeps the
original single-panel attribute naming
Whatever names this layer's marks: one CSS selector for a series
the model can walk positionally, a string[] when the marks have
to be named one by one, a string[][] grid naming each segment of
a stack, or the structured selector a box or a candle needs.
undefined if the elements could not be matched, in which case
highlighting degrades gracefully.
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 they cannot match another Victory chart's identically-indexed tags
wherever they are read, nor another panel's: the panels share the chart MAIDR
resolves them in. 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.