MAIDR Documentation - v3.69.0
    Preparing search index...
    • Build per-series CSS selectors for line and area charts.

      Vega's render shape depends on whether multi-series come from a user-authored layered spec (alt.layer(...) / c1 + c2) or from a single mark with a color encoding (Vega's typical multi-series case):

      • Layered spec: each series lives in its own .layer_N_marks class, e.g. .layer_0_marks, .layer_1_marks. Per-series addressing is by class.

      • Color-encoded multi-series in one mark: Vega emits N sibling <g class="mark-line role-mark layer_0_marks"> groups (NOT .marks), each containing exactly one <path>. All groups share the same class chain, so CSS :nth-child(N) cannot distinguish them and :nth-of-type(N) would also count unrelated <g> siblings (axes, legend). Per-series addressing must be done at the JS layer by indexing querySelectorAll(...) results in document order.

      • Single-series: one <path> in either .marks or .layer_0_marks depending on whether mark sugar (mark.point: true, mark.line: true) caused Vega to expand into siblings.

      For ALL non-layered cases, this function emits N copies of the same selector matching every line <path> under any line-mark group; the caller (LineTrace.mapViaPathParsing) is expected to resolve the Nth series via document-order indexing (Svg.selectNthElement(sel, r)).

      Parameters

      • mark: string
      • seriesCount: number
      • layerIndex: number
      • isLayered: boolean

      Returns string[]