Events and Callbacks
Core Chart callbacks run in Python through a live notebook widget or framework
transport. Browser interactions continue to work in standalone HTML, but a
self-contained file has no Python process to call.
Core Python Callbacks
Supplying a callback enables its corresponding browser interaction. Callback payload details are still experimental during the alpha series.
Hover and click rows contain trace, canonical index, x, y, x_kind,
and y_kind. Depending on the mark's channels, they can also contain
color_value, color_category, or size_value. These are data dictionaries,
not DOM event objects or formatted tooltip strings.
Selection
Selection exposes:
per_trace—{trace_id: numpy_uint32_indices}in canonical row space.index— all selected indices concatenated; useper_tracewhen trace identity matters.xy(trace_id=0)— canonical f64 x/y arrays for one selected trace.len(selection)— total selected rows across traces.
Clearing selection delivers an empty Selection. Chart.select_range()
returns the same type without requiring a browser gesture.
Browser DOM Events
The client dispatches bubbling custom events from the chart root:
A live hover can emit an immediate resident readout followed by an exact update.
Consumers that only need the canonical Python row should use on_hover.
Reflex Adapter Events
The separate reflex-xy adapter intentionally uses semantic component props:
on_point_hover, on_point_click, on_select_end, and on_view_change.
Those are adapter props, not aliases accepted by core Chart. See the
Reflex integration for state-backed payloads.
on_select_end includes total, cleared, and either box bounds or the
data-space polygon used by a lasso selection.
Linked charts broadcast viewport ranges only. They do not automatically link selection state or cross-filter data.