Skip to content

Data argument is always undefined for plotly_unhover event on scatter3rd charts #5953

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

Closed
dwoznicki opened this issue Sep 28, 2021 · 0 comments

Comments

@dwoznicki
Copy link
Contributor

Current behavior

The plotly_unhover callback function only ever appears to receive undefined as an argument. Here's a codepen. Check the console for unhover data value.

Expected behavior

According to the event reference docs, it looks like the unhover callback should receive data on the point being unhovered.

Possible cause

Looking at the proto.render function in https://github.com/plotly/plotly.js/blob/master/src/plots/gl3d/scene.js, it looks like the unhover event gets passed a reference to oldEventData, but oldEventData does not get initialized in this path. Instead, it's set in the path that handles plotly_hover and plotly_click.

Perhaps oldEventData is meant to be stored as a member of the proto.render function so it can be accessed later for the unhover event?

proto.render = function() {

    // ...

    if(lastPicked !== null) {

        // ...

        this.oldEventData = eventData;
    } else {
        Fx.loneUnhover(svgContainer);
        gd.emit('plotly_unhover', this.oldEventData);
        this.oldEventData = undefined;
    }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants