MAIDR Documentation - v3.69.0
    Preparing search index...
    • 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:

      1. Victory renders each data component's elements with role="presentation" on the individual data shapes.
      2. We query for the expected SVG tag (e.g. rect for bars) that carries role="presentation".
      3. We skip elements that belong to other layers by tracking which elements were already claimed.
      4. Each claimed element receives a data-maidr-victory-<layerIndex> attribute so MAIDR can select them deterministically.

      Parameters

      • container: HTMLElement

        The DOM node wrapping the Victory chart

      • layer: VictoryLayerInfo

        The extracted layer info

      • layerIndex: number

        Numeric index for generating unique attribute names

      • claimed: Set<Element>

        Set of elements already claimed by prior layers

      Returns string | CandlestickSelector | BoxSelector[] | undefined

      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).