Plotly.js: No way to disable mouse-scroll zoom for geo subplots

Created on 23 Dec 2015  路  17Comments  路  Source: plotly/plotly.js

I have heard a few reports of folks struggling to disable mouse-zoom. First stage could be updating our docs to assert that this is currently not supported. Second stage is to support it.

feature

Most helpful comment

All 17 comments

We need to better define what layout.dragmode and config.scrollZoom do and how they play together.

As config.scrollZoom is set to false by default and geo scrolling is enable by default, we can't make config.scrollZoom a geo object option.

I think the solution here would to add an attribute, possibly layout.geo.scrollmode / layout.scene.scrollmode and later move config.scrollZoom to layout.scrollmode for cartesian plots.

Just wondering if this has been addressed yet. Thanks!

@mattfarkas No.

It would be nice if scroll zoom was a layout attribute such as dragmode and hovermode. Likewise it would be nice to have an 'after click' event.

My use case is that I have a page with a bunch of plots where I by and large want scroll zoom but only when the user is actually trying ot interact with the chart. I want them to indicate this roughly by clicking on the chart (ie to pan). When this happens, i'd want to toggle scroll zoom on. If i don't do this, the first chart the user wheels over will snipe the events.

Seems this has been open for almost a year now without any progress having been made on it. I'm just wondering if anyone has started work on it... or - if not - has anyone at least given it some thought to the point where they have an idea what needs to be done?

I may be able to put in some work on this but being new to plotly, i'm not sure what needs to be done. On my initial read-through I thought i new what needed to be done but once I attempted a fix it didn't actually work as expected.

any guidance would be appreciated...

@avnerkantor Thanks so much! I actually never came across that. That does resolve my needs.

@bpostlethwaite I wonder if https://plot.ly/javascript/disable-zoom/ is sufficient to close this issue. It allows for the disabling of scroll & zoom on an axis by using the fixedrange attribute of the [xy]axis layout parameter, as can be seen in this example: http://codepen.io/plotly/pen/PZPPPj

It does seem like the fixedrange attribute needs to be documented a bit better though... since i didn't come initially come across it in my search.

never mind on the documentation... its actually there. don't understand why i personally didn't see it the first time! doh! Thanx again @avnerkantor

@etpinard's call on that one

A minor point: setting fixedrange: false still captures the mouse event, and the overall document isn't scrolling when wheeling over a plot, though that's a user expectation with mostly static content.

This still seems to be an issue, there is no way to disable zoom & pan on geo maps :(

@dancrisan, try using staticPlot: true, this worked for my situation.

https://plot.ly/javascript/configuration-options/#making-a-static-chart

@heisler3030 That unfortunately disables hovering, so you won't be able to see the city names and their value, so not really a working solution =[

I'm also interested in a way to disable zoom and pan on chloropleth maps without disabling hover. Right now setting fixedrange to true for both axes doesn't seem to work.

Static Plot works, but I'd like to be able to keep the hover text. If I paste my layout into the the disable zoom codepen, it works. And if I change my plot type to scatter it works. Seems like it's something to do with the geoLayer.

Is there possibly a way to require a ctrl + mouse event to zoom/pan? That may work.

Is this feature now available for choropleth maps in the latest plotly.js version?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pynklu picture pynklu  路  3Comments

chriddyp picture chriddyp  路  3Comments

WG- picture WG-  路  3Comments

bryaan picture bryaan  路  3Comments

n-riesco picture n-riesco  路  3Comments