@@ -152,41 +152,60 @@ The `onInitialized`, `onUpdate` and `onPurge` props are all functions which will
152152
153153Event handlers for specific [ ` plotly.js ` events] ( https://plotly.com/javascript/plotlyjs-events/ ) may be attached through the following props:
154154
155- | Prop | Type | Plotly Event |
156- | ------------------------- | ---------- | ------------------------------ |
157- | ` onAfterExport ` | ` Function ` | ` plotly_afterexport ` |
158- | ` onAfterPlot ` | ` Function ` | ` plotly_afterplot ` |
159- | ` onAnimated ` | ` Function ` | ` plotly_animated ` |
160- | ` onAnimatingFrame ` | ` Function ` | ` plotly_animatingframe ` |
161- | ` onAnimationInterrupted ` | ` Function ` | ` plotly_animationinterrupted ` |
162- | ` onAutoSize ` | ` Function ` | ` plotly_autosize ` |
163- | ` onBeforeExport ` | ` Function ` | ` plotly_beforeexport ` |
164- | ` onBeforeHover ` | ` Function ` | ` plotly_beforehover ` |
165- | ` onButtonClicked ` | ` Function ` | ` plotly_buttonclicked ` |
166- | ` onClick ` | ` Function ` | ` plotly_click ` |
167- | ` onClickAnnotation ` | ` Function ` | ` plotly_clickannotation ` |
168- | ` onClickAnywhere ` | ` Function ` | ` plotly_clickanywhere ` |
169- | ` onDeselect ` | ` Function ` | ` plotly_deselect ` |
170- | ` onDoubleClick ` | ` Function ` | ` plotly_doubleclick ` |
171- | ` onFramework ` | ` Function ` | ` plotly_framework ` |
172- | ` onHover ` | ` Function ` | ` plotly_hover ` |
173- | ` onHoverAnywhere ` | ` Function ` | ` plotly_hoveranywhere ` |
174- | ` onLegendClick ` | ` Function ` | ` plotly_legendclick ` |
175- | ` onLegendDoubleClick ` | ` Function ` | ` plotly_legenddoubleclick ` |
176- | ` onRelayout ` | ` Function ` | ` plotly_relayout ` |
177- | ` onRelayouting ` | ` Function ` | ` plotly_relayouting ` |
178- | ` onRestyle ` | ` Function ` | ` plotly_restyle ` |
179- | ` onRedraw ` | ` Function ` | ` plotly_redraw ` |
180- | ` onSelected ` | ` Function ` | ` plotly_selected ` |
181- | ` onSelecting ` | ` Function ` | ` plotly_selecting ` |
182- | ` onSliderChange ` | ` Function ` | ` plotly_sliderchange ` |
183- | ` onSliderEnd ` | ` Function ` | ` plotly_sliderend ` |
184- | ` onSliderStart ` | ` Function ` | ` plotly_sliderstart ` |
185- | ` onSunburstClick ` | ` Function ` | ` plotly_sunburstclick ` |
186- | ` onTransitioning ` | ` Function ` | ` plotly_transitioning ` |
187- | ` onTransitionInterrupted ` | ` Function ` | ` plotly_transitioninterrupted ` |
188- | ` onUnhover ` | ` Function ` | ` plotly_unhover ` |
189- | ` onWebGlContextLost ` | ` Function ` | ` plotly_webglcontextlost ` |
155+ | Prop | Type | Plotly Event |
156+ | -------------------------- | ---------- | ------------------------------- |
157+ | ` onAfterExport ` | ` Function ` | ` plotly_afterexport ` |
158+ | ` onAfterPlot ` | ` Function ` | ` plotly_afterplot ` |
159+ | ` onAnimated ` | ` Function ` | ` plotly_animated ` |
160+ | ` onAnimating ` | ` Function ` | ` plotly_animating ` |
161+ | ` onAnimatingFrame ` | ` Function ` | ` plotly_animatingframe ` |
162+ | ` onAnimationInterrupted ` | ` Function ` | ` plotly_animationinterrupted ` |
163+ | ` onAutoSize ` | ` Function ` | ` plotly_autosize ` |
164+ | ` onBeforeExport ` | ` Function ` | ` plotly_beforeexport ` |
165+ | ` onBeforeHover ` | ` Function ` | ` plotly_beforehover ` |
166+ | ` onBeforePlot ` | ` Function ` | ` plotly_beforeplot ` |
167+ | ` onButtonClicked ` | ` Function ` | ` plotly_buttonclicked ` |
168+ | ` onClick ` | ` Function ` | ` plotly_click ` |
169+ | ` onClickAnnotation ` | ` Function ` | ` plotly_clickannotation ` |
170+ | ` onDeselect ` | ` Function ` | ` plotly_deselect ` |
171+ | ` onDoubleClick ` | ` Function ` | ` plotly_doubleclick ` |
172+ | ` onFramework ` | ` Function ` | ` plotly_framework ` |
173+ | ` onHover ` | ` Function ` | ` plotly_hover ` |
174+ | ` onIcicleClick ` | ` Function ` | ` plotly_icicleclick ` |
175+ | ` onLegendClick ` | ` Function ` | ` plotly_legendclick ` |
176+ | ` onLegendDoubleClick ` | ` Function ` | ` plotly_legenddoubleclick ` |
177+ | ` onLegendTitleClick ` | ` Function ` | ` plotly_legendtitleclick ` |
178+ | ` onLegendTitleDoubleClick ` | ` Function ` | ` plotly_legendtitledoubleclick ` |
179+ | ` onRelayout ` | ` Function ` | ` plotly_relayout ` |
180+ | ` onRelayouting ` | ` Function ` | ` plotly_relayouting ` |
181+ | ` onRestyle ` | ` Function ` | ` plotly_restyle ` |
182+ | ` onRedraw ` | ` Function ` | ` plotly_redraw ` |
183+ | ` onSelected ` | ` Function ` | ` plotly_selected ` |
184+ | ` onSelecting ` | ` Function ` | ` plotly_selecting ` |
185+ | ` onSliderChange ` | ` Function ` | ` plotly_sliderchange ` |
186+ | ` onSliderEnd ` | ` Function ` | ` plotly_sliderend ` |
187+ | ` onSliderStart ` | ` Function ` | ` plotly_sliderstart ` |
188+ | ` onSunburstClick ` | ` Function ` | ` plotly_sunburstclick ` |
189+ | ` onTransitioned ` | ` Function ` | ` plotly_transitioned ` |
190+ | ` onTransitioning ` | ` Function ` | ` plotly_transitioning ` |
191+ | ` onTransitionInterrupted ` | ` Function ` | ` plotly_transitioninterrupted ` |
192+ | ` onTreemapClick ` | ` Function ` | ` plotly_treemapclick ` |
193+ | ` onUnhover ` | ` Function ` | ` plotly_unhover ` |
194+ | ` onWebGlContextLost ` | ` Function ` | ` plotly_webglcontextlost ` |
195+
196+ To receive ` onClick ` or ` onHover ` for positions that are not over a trace, set
197+ ` clickanywhere ` or ` hoveranywhere ` in your ` layout ` . These are layout attributes
198+ rather than distinct events: the ordinary ` plotly_click ` / ` plotly_hover ` fire
199+ with an empty ` points ` array, plus ` xvals ` / ` yvals ` — arrays of the cursor
200+ position in data space, one entry per axis.
201+
202+ ``` javascript
203+ < Plot
204+ data= {data}
205+ layout= {{clickanywhere: true }}
206+ onClick= {(e ) => console .log (e .points , e .xvals , e .yvals )}
207+ / >
208+ ```
190209
191210## Examples
192211
0 commit comments