File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1276,7 +1276,7 @@ fx.click = function(gd,evt){
1276
1276
if ( gd . _hoverdata && evt && evt . target ) {
1277
1277
gd . emit ( 'plotly_click' , { points : gd . _hoverdata } ) ;
1278
1278
// why do we get a double event without this???
1279
- evt . stopImmediatePropagation ( ) ;
1279
+ if ( evt . stopImmediatePropagation ) evt . stopImmediatePropagation ( ) ;
1280
1280
}
1281
1281
} ;
1282
1282
Original file line number Diff line number Diff line change @@ -373,6 +373,12 @@ pie.plot = function(gd, cdpie) {
373
373
}
374
374
}
375
375
376
+ function handleClick ( evt ) {
377
+ gd . _hoverdata = [ pt ] ;
378
+ gd . _hoverdata . trace = cd . trace ;
379
+ Plotly . Fx . click ( gd , { target : true } ) ;
380
+ }
381
+
376
382
slicePath . enter ( ) . append ( 'path' )
377
383
. classed ( 'surface' , true )
378
384
. style ( { 'pointer-events' : 'all' } ) ;
@@ -381,7 +387,8 @@ pie.plot = function(gd, cdpie) {
381
387
382
388
sliceTop
383
389
. on ( 'mouseover' , handleMouseOver )
384
- . on ( 'mouseout' , handleMouseOut ) ;
390
+ . on ( 'mouseout' , handleMouseOut )
391
+ . on ( 'click' , handleClick ) ;
385
392
386
393
if ( trace . pull ) {
387
394
var pull = + ( Array . isArray ( trace . pull ) ? trace . pull [ pt . i ] : trace . pull ) || 0 ;
You can’t perform that action at this time.
0 commit comments