What a click selects
The chart checks targets in this order and selects the first one with controls:- An axis label, an axis title or a legend item.
- A data mark, such as a bar, line or point, including nearby marks within the snapping distance.
- A grid line behind the marks.
- The chart background, if the Chart menu has controls.
- On the column: the group, titled “Region: North”.
- In the gap beside it: the band, titled “Quarter: Q4 ‘25”.
- On a grid line beyond the snapping distance: the grid lines.
- In empty space: the chart.
useGraphSelection reads the selection. An observations target includes its layer, scope and a predicate identifying the selected rows:
Narrowing with a double-click
A double-click narrows the selection:- A group’s mark narrows to that observation: North’s Q4 column alone.
- A discrete x-axis tick label selects its band if exactly one interactive layer has data at that value. Continuous and datetime ticks do not narrow.
- A legend item narrows to its group.
- A grid line, a band, the chart and empty space go no deeper.
Only targets with controls
A target is selectable when it has menu rows or a visibility button. Otherwise, hovering ignores it and clicks reach the element underneath. With the built-in menus:ruleandtilelayers have no menu. Clicking a tile selects the grid line or chart behind it.- Lines and areas support group selection only.
- Grouped bars support band selection. Stacked bars do not: changing a band’s color would give every stack segment the same color.
- Polar axes and grid lines offer only a visibility button.
- Custom geoms without a registered menu get a color row wherever their color can be changed.
editMenus to null removes its rows. Axes, legends and grids remain selectable through their visibility button; other targets become unselectable. See Custom menus.
One selection at a time
Each chart has one selected target. Clicking outside, pressing Escape, moving focus to the host page or another chart, or changing modes clears it. Only one chart on the page can have an active selection. Right-clicks and clicks on the edit menu or legend overflow control leave the selection unchanged. Removing the selected layer clears it. To control selection from outside the provider, useGraphHandle.setSelection([target]), getSelection() and subscribeSelection(listener). See Provider & renderer.
Keyboard
Selection shortcuts apply while focus is inside the chart or its menu. Text fields keep their own keyboard handling.- Escape closes an open popup, such as a color picker. Otherwise, it clears the selection and closes the menu.
- Tab and Shift+Tab move through menu controls. The menu receives focus when it opens; press Tab to reach its first control. The chart frame is not a Tab stop.
- Undo and redo shortcuts require
useGraphHistoryShortcuts.
Outlines
The hover outline previews what a click would select; the selected outline marks the current selection. Both sit outside the element’s shape, and touching shapes merge into one outline. The selected outline stays above the hover outline. The chart background has no hover outline. Style both withstyle.editOutline, or use .hover and .selected to style them separately:
getEditOutlineShapes for outlines that match the geom’s shape. See Geom renderers.
Related
- The edit menu — what opens beside the selection
- Commands & history — the commands a menu row dispatches, undo/redo shortcuts
- Geom renderers —
getEditOutlineShapesfor custom geoms - Styling —
style.editOutlineand its vocabulary

