Skip to content

Interface: ChartEvents ​

Event payloads by name (plan §7.5).

Properties ​

PropertyModifierTypeDescription
afterplotpublicundefinedThe pipeline finished and the frame is drawn (after every update call).
afterrenderpublicFrameInfo-
animatedpublicundefinedNo frame is left to play (also emitted when animate is given nothing to play).
animatingpublicundefinedchart.animate started playing frames (E7.4); nothing was playing before.
animatingframepublicAnimatingFrameEventA frame starts: its name (sliders move to it), the computed frame and its options.
animationinterruptedpublicundefinedQueued frames were dropped by an animate call with mode: 'next' or 'immediate'.
beforerenderpublicFrameInfoAround every rendered frame (ADR-007); the payload object is reused between frames.
clickpublicPointerEventDataA click on data points (E6.4). Not emitted when nothing is under the pointer.
clickannotationpublicAnnotationEventDataA click on an annotation with captureevents (E5.4).
deselectpublicundefinedThe selection was cleared (double-click or a click on empty space in select mode).
destroypublicundefinedThe chart was destroyed (chart.destroy() / purge(el)).
doubleclickpublicundefinedA double-click on the plot area (after doubleClick reset/autosize ran).
hoverpublicPointerEventDataThe pointer is over data points (E6.1); the payload lists them.
icicleclickpublicHierarchyClickEventDataA click on an icicle cell or path bar segment (E13.4; Plotly's plotly_icicleclick), ditto.
legendclickpublicLegendEventDataLegend item clicked; a listener returning false cancels the default toggle.
legenddoubleclickpublicLegendEventData-
redrawpublicobjectAfter extendTraces / prependTraces has been drawn (Plotly emits plotly_redraw then; it has no dedicated extend event). The payload repeats the call's arguments.
redraw.kindreadonly"extend" | "prepend"-
redraw.maxPointsreadonlyMaxPoints | undefined-
redraw.tracesreadonlyreadonly number[]-
redraw.updatereadonlyStreamUpdate-
relayoutpublicAttributeUpdateAfter a relayout: the applied layout edits (including implied autorange: false).
relayoutingpublicAttributeUpdateDuring a drag or scroll zoom / pan (throttled to animation frames): the axis ranges shown so far, as relayout edits ('xaxis.range[0]', …). A relayout follows when the gesture ends.
resizepublicobjectThe figure size changed (container resize with config.responsive, or a relayout).
resize.heightreadonlynumber-
resize.widthreadonlynumber-
restylepublicobjectAfter a restyle: the edits and the trace indices they applied to.
restyle.tracesreadonlyreadonly number[]-
restyle.updatereadonlyAttributeUpdate-
selectedpublicSelectionEventDataBox / lasso selection finished, or a point was click-selected (clickmode: 'select').
selectingpublicSelectionEventDataBox / lasso selection in progress (E6.3), throttled to animation frames.
sunburstclickpublicHierarchyClickEventDataA click on a sunburst sector (E13.2), emitted before click. A listener returning false cancels the drill-down and the click event (Plotly's plotly_sunburstclick); so does a click listener returning false.
transitionedpublicundefinedA transition finished and its final state is drawn.
transitioningpublicundefinedA transition (E7.3) starts: a frame, or react with layout.transition.
transitioninterruptedpublicundefinedA transition was cut short by another one (it jumps to its end state).
treemapclickpublicHierarchyClickEventDataA click on a treemap tile or path bar segment (E13.3; Plotly's plotly_treemapclick), emitted before click and cancelling like sunburstclick.
unhoverpublicPointerEventDataThe hovered points are gone (pointer moved away, left the chart, or chart.unhover()).
webglcontextlostpublicundefined-
webglcontextrestoredpublicundefined-

Released under the MIT License.