Skip to content

Add mouse event to plotly_click, plotly_hover and plotly_unhover #1505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 30, 2017
4 changes: 3 additions & 1 deletion src/traces/pie/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ module.exports = function plot(gd, cdpie) {
hasHoverData = false;

function handleMouseOver(evt) {
evt.originalEvent = d3.event;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!


// in case fullLayout or fullData has changed without a replot
var fullLayout2 = gd._fullLayout,
trace2 = gd._fullData[trace.index],
Expand All @@ -97,6 +99,7 @@ module.exports = function plot(gd, cdpie) {
// or if hover is turned off
if(gd._dragging || fullLayout2.hovermode === false ||
hoverinfo === 'none' || hoverinfo === 'skip' || !hoverinfo) {
Fx.hover(gd, evt, 'pie');
return;
}

Expand Down Expand Up @@ -126,7 +129,6 @@ module.exports = function plot(gd, cdpie) {
outerContainer: fullLayout2._paper.node()
});

evt.originalEvent = d3.event;
Fx.hover(gd, evt, 'pie');

hasHoverData = true;
Expand Down