This repository was archived by the owner on Jun 3, 2024. It is now read-only.
File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,11 @@ export default class PlotlyGraph extends Component {
98
98
if ( fireEvent ) fireEvent ( { event : 'click' } ) ;
99
99
}
100
100
} ) ;
101
+ gd . on ( 'plotly_clickannotation' , ( eventData ) => {
102
+ const clickAnnotationData = eventData ;
103
+ if ( setProps ) setProps ( { clickAnnotationData} ) ;
104
+ if ( fireEvent ) fireEvent ( { event : 'clickannotation' } ) ;
105
+ } ) ;
101
106
gd . on ( 'plotly_hover' , ( eventData ) => {
102
107
const hoverData = filterEventData ( gd , eventData , 'hover' ) ;
103
108
if ( ! isNil ( hoverData ) ) {
@@ -196,6 +201,11 @@ PlotlyGraph.propTypes = {
196
201
* Data from latest click event
197
202
*/
198
203
clickData : PropTypes . object ,
204
+
205
+ /**
206
+ * Data from latest click annotation event
207
+ */
208
+ clickAnnotationData : PropTypes . object ,
199
209
200
210
/**
201
211
* Data from latest hover event
@@ -433,6 +443,7 @@ PlotlyGraph.propTypes = {
433
443
*/
434
444
dashEvents : PropTypes . oneOf ( [
435
445
'click' ,
446
+ 'clickannotation' ,
436
447
'hover' ,
437
448
'selected' ,
438
449
'relayout' ,
@@ -452,6 +463,7 @@ PlotlyGraph.propTypes = {
452
463
453
464
PlotlyGraph . defaultProps = {
454
465
clickData : null ,
466
+ clickAnnotationData : null ,
455
467
hoverData : null ,
456
468
selectedData : null ,
457
469
relayoutData : null ,
You can’t perform that action at this time.
0 commit comments