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)).
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 acolorencoding (Vega's typical multi-series case):Layered spec: each series lives in its own
.layer_N_marksclass, 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 indexingquerySelectorAll(...)results in document order.Single-series: one
<path>in either.marksor.layer_0_marksdepending 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)).