-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Auto center/zoom for scattermapbox #3434
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
Comments
This is equivalent to |
Oh to be clear, I thought this would just call the native MapBox fitBounds after rendering, and not actually write the data back to the figure :) |
Of course - we can avoid pushing |
#4419 implements (or attempts to) Mapbox subplots should be able to reuse much of the logic there. |
Awesome! Sorely needed in Mapbox-land :) |
Hello! Are there any updates on this feature? This is one feature that would really save my dash app a lot of troubles! |
Is there any update on this for mapbox subplots? I'm moving from geo to mapbox subplots and would have to manually find the zoom levels for each (over 5000) region (can get the center from d3.geoCentroid). Is there any way to access the calculated or inferred |
We’ll definitely post an update once we have one :) I don’t have a good workaround for you at the moment either unfortunately. |
This issue has been tagged with A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort. Sponsorship range: $10k-$15k What Sponsorship includes:
Please include the link to this issue when contacting us to discuss. |
It seems that Plotly Express already find the right level of zoom and center... How is it done? |
Plotly Express does not automatically fix the zoomlevel, and the center is just done with the centroid of the scatter points. Note that the problem in Plotly.js is a bit more complex as a mapbox subplot can have multiple traces on it, including choropleths etc. Plotly Express has access to the entire dataset up front, and |
Right now it seems like the best workaround is to add layout
To center and zoom in manually |
Right now with
scattermapbox
we have to manually setcenter
andzoom
but it would be great to have a flag that uses the built-in Mapbox machine to fit bounds. Something likelayout.mapbox.fitbounds: true | false
https://www.mapbox.com/mapbox-gl-js/example/fitbounds/
The text was updated successfully, but these errors were encountered: