Skip to content

Commit 22a9396

Browse files
committed
event: fix regression in pie interactions
1 parent c56c585 commit 22a9396

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/plots/cartesian/graph_interact.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ fx.hover = function(gd, evt, subplot) {
305305
function hover(gd, evt, subplot) {
306306
if(subplot === 'pie') {
307307
gd.emit('plotly_hover', {
308-
event: evt,
308+
event: evt.originalEvent,
309309
points: [evt]
310310
});
311311
return;

src/traces/pie/plot.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ module.exports = function plot(gd, cdpie) {
8585
slicePath = sliceTop.selectAll('path.surface').data([pt]),
8686
hasHoverData = false;
8787

88-
function handleMouseOver() {
89-
var evt = d3.event;
90-
88+
function handleMouseOver(evt) {
9189
// in case fullLayout or fullData has changed without a replot
9290
var fullLayout2 = gd._fullLayout,
9391
trace2 = gd._fullData[trace.index],
@@ -128,16 +126,16 @@ module.exports = function plot(gd, cdpie) {
128126
outerContainer: fullLayout2._paper.node()
129127
});
130128

129+
evt.originalEvent = d3.event;
131130
Fx.hover(gd, evt, 'pie');
132131

133132
hasHoverData = true;
134133
}
135134

136-
function handleMouseOut() {
137-
var evt = d3.event;
138-
135+
function handleMouseOut(evt) {
136+
evt.originalEvent = d3.event;
139137
gd.emit('plotly_unhover', {
140-
event: evt,
138+
event: d3.event,
141139
points: [evt]
142140
});
143141

0 commit comments

Comments
 (0)