MAIDR Documentation - v4.4.0
    Preparing search index...
    • Internal

      Emits one highlight selector per series, by stamping each series' <path> with a MAIDR-owned data-maidr-line-index attribute and pinning it.

      LineTrace.mapToSvgElements requires one selector per line (it uses Svg.selectElement(selectors[r]) to grab a single <path> per series for path-parsing, or selectAllElements(selectors[r]) for per-point markers). A bare selector like "path.line" matches ALL line paths at once, so selectors.length (1) !== lineValues.length (N) → the model bails out and no highlight renders.

      Structural selectors (e.g. :nth-child(N)) are fragile to DOM reordering (legend/axis insertions, React re-renders, non-path siblings shifting nth-child indices), so the stamp is an attribute the binder owns, absolutely scoped by the SVG's id. This matches the Google Charts adapter's data-maidr-line-series / data-maidr-point convention and survives any DOM reordering that leaves the path itself intact.

      Parameters

      • root: Element

        The extraction root (the SVG, or a panel element).

      • selector: string

        The user-provided selector matching the series paths.

      • rowPaths: (Element | null)[]

        The <path> that produced each data row, parallel to the emitted rows. A null entry marks a row whose rendering path could not be reliably identified.

      • rowCount: number

        How many rows the layer emits.

      • Optionalpanel: D3PanelScope

        Optional panel scope for multi-panel binds.

      Returns string[] | undefined

      One selector per row, or undefined when a safe per-series selector cannot be emitted — the model then withdraws highlighting instead of highlighting the wrong series.