Skip to content
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

allow user to set zoom/scale limits for choropleth maps #5191

Open
mojoaxel opened this issue Oct 4, 2020 · 2 comments · May be fixed by #5192 or #7371
Open

allow user to set zoom/scale limits for choropleth maps #5191

mojoaxel opened this issue Oct 4, 2020 · 2 comments · May be fixed by #5192 or #7371
Labels
feature something new P3 backlog

Comments

@mojoaxel
Copy link
Contributor

mojoaxel commented Oct 4, 2020

Feature request to limit the zoom of choropleth-maps.

Because there are no axis I recommend limit the scaling factor. This could be dome e.g. by introducing two new setting minScale and maxScale on the layout.geo.projectionobject.

minScale/maxScale must be positive numbers:

  • 0 = 0% minimal zoom (1 pixel)
  • 1 = 100% zoom (original size)
  • 2 = 200% zoom (double the original size)

https://jsbin.com/vudibul/edit?js,console,output

layout = {  
    geo: {
      projection: {
        // initial scale
        scale: 0.75,
        
        /**************************************
         minscale/maxscale are not yet supported
         *************************************/
        minScale: 0.5, // 50%
        maxScale: 1    //100%
      }
    }
  };

Related:

mojoaxel added a commit to fllstx/plotly.js that referenced this issue Oct 5, 2020
@mojoaxel mojoaxel linked a pull request Oct 5, 2020 that will close this issue
mojoaxel added a commit to fllstx/plotly.js that referenced this issue Oct 6, 2020
@mebaysan
Copy link

I used that technique to re-layout when it overrides the max or min limits.

https://community.plotly.com/t/how-to-set-a-limit-for-zoom-in-out-feature/2574/6?u=mebaysan

mojoaxel added a commit to fllstx/plotly.js that referenced this issue Jun 10, 2024
mojoaxel added a commit to fllstx/plotly.js that referenced this issue Jun 10, 2024
mojoaxel added a commit to fllstx/plotly.js that referenced this issue Jun 10, 2024
mojoaxel added a commit to fllstx/plotly.js that referenced this issue Jun 10, 2024
@gvwilson gvwilson self-assigned this Jul 3, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson changed the title Set zoom/scale limits for choropleth maps allow user to set zoom/scale limits for choropleth maps Aug 9, 2024
@gvwilson gvwilson added feature something new P3 backlog labels Aug 9, 2024
@chinnichaitanya
Copy link

Look forward to this!

camdecoster pushed a commit that referenced this issue Feb 18, 2025
camdecoster pushed a commit that referenced this issue Feb 18, 2025
@camdecoster camdecoster linked a pull request Feb 22, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 backlog
Projects
None yet
4 participants