Skip to content

Wheel event registered on the canvas even though scrollZoom is disabled #6458

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
zfei opened this issue Feb 1, 2023 · 1 comment
Closed

Comments

@zfei
Copy link

zfei commented Feb 1, 2023

I'm plotting a 3d surface graph with scrollZoom disabled.

When scrolling the web page with the mouse on the canvas, the scrolling gets stuck, as the scene element is stilling capturing the wheel event somehow.

After some debugging, it looks like the culprit is we are registering a wheel event on the canvas regardless of whether the scrollZoom flag is true or not.

Can we not add the listener at all if scrollzoom is disabled?

const newData = {};
const dates = new Set();

timeseriesList.map((row) => {
    newData[row.symbol] = row.data;
    Object.keys(row.data).map(d => dates.add(d))
})

const dateArray = Array.from(dates);

var data = [{
    x: dateArray,
    y: symbols,
    z: symbols.map(symbol => dateArray.map(date => newData[symbol][date])),
    type: 'surface',
    colorscale: 'Portland',
}];
var layout = {
    title: title,
    autosize: true,
    height: 500,
    margin: {
        l: 65,
        r: 50,
        b: 65,
        t: 90,
    },
    scene: {
        xaxis: {
            calendar: 'chinese',
            autorange: 'reversed',
        },
        yaxis: {
            autorange: 'reversed',
        },
        aspectratio: { x: 4, y: 1, z: 1.5 },
        camera: {
            eye: { x: 0, y: 2, z: 0 },
            projection: {type: 'orthographic'},
        },
    },
};
Plotly.newPlot(
    container,
    data,
    layout,
    {
        // TODO: Need to unregister scroll event. Currently page scroll doesn't work.
        scrollZoom: false,
    },
);
@gvwilson
Copy link
Contributor

gvwilson commented Jul 4, 2024

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

@gvwilson gvwilson closed this as completed Jul 4, 2024
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