Version: @tanstack/charts 0.4.0
What happened
Wrapping ruleX in whenFocused(..., { match: "x" }) produces a focus layer whose children are permanently hidden — the mark renders into the DOM but never becomes visible on hover or keyboard focus, with no warning.
import { defineChart, lineY, ruleX, whenFocused } from "@tanstack/charts";
import { tooltip } from "@tanstack/charts/tooltip";
const xs = rows.map((r) => r.date);
const definition = defineChart({
marks: [
lineY(rows, { x: "date", y: "value" }),
// Intended: an axis-pointer style rule at the hovered x.
whenFocused(ruleX(xs), { match: "x" }),
],
x: { scale: scaleUtc },
y: { scale: scaleLinear },
focus: "group-x",
tooltip: { use: tooltip },
});
Why
focusedNodeKeys/collectFocusedNodes filter a focus layer's children by matching the layer's own interaction points against the focus state — but rules deliberately emit no points ("Rules emit no interaction points" per the rule reference), so the filter set is always empty and nothing ever shows.
Expected
Any of:
- point-less marks inside
whenFocused match by geometry (or are treated as always-matching within the layer),
- a dev-time warning ("whenFocused wraps a mark that emits no interaction points; it will never render"),
- a documentation note in the focus/rule references.
Context
We were building an ECharts-axisPointer-style dashed crosshair at the hovered x. Worked around it with a small custom mark (via createMarkWithScaleValues) that renders rule geometry and emits one matchable point per x — happy to share it if useful. The silent-never-renders behavior cost the most time; a warning alone would have saved it.
Version: @tanstack/charts 0.4.0
What happened
Wrapping
ruleXinwhenFocused(..., { match: "x" })produces a focus layer whose children are permanently hidden — the mark renders into the DOM but never becomes visible on hover or keyboard focus, with no warning.Why
focusedNodeKeys/collectFocusedNodesfilter a focus layer's children by matching the layer's own interaction points against the focus state — but rules deliberately emit no points ("Rules emit no interaction points" per the rule reference), so the filter set is always empty and nothing ever shows.Expected
Any of:
whenFocusedmatch by geometry (or are treated as always-matching within the layer),Context
We were building an ECharts-axisPointer-style dashed crosshair at the hovered x. Worked around it with a small custom mark (via
createMarkWithScaleValues) that renders rule geometry and emits one matchable point per x — happy to share it if useful. The silent-never-renders behavior cost the most time; a warning alone would have saved it.