Is it possible to add a dropdown to a choropleth map to change what data is used for an array of z values?
If so, are there any examples of how to do this?
Is it possible to add a dropdown to a choropleth map to change what data is used for an array of z values?
If so, are there any examples of how to do this?
I think I was writing Plot.ly JS in an older style from your documentation. I used your example and the code loads the JSON data amazingly faster now, thanks! But for some reason ālocationmode: 'USA-statesā isnāt working now (it was before) and itās displaying it as a global choropleth.
Hereās my code: https://codepen.io/dholger/pen/XVMmyy
Iām assuming a slider works with the choropleth the same way your dropdown example does? Thanks!
You must have made a typo somewhere. Thereās no reason for it to have stopped working. Unfortunately I canāt really help you as I donāt have access to your data arrays.
I donāt believe itās a typo? Because I copied everything from how the code was previously structured.
The old codeās ālocationmode: āUSA-statesāā property works and just shows the US: https://codepen.io/dholger/pen/gomdVe
But itās longer and doesnāt load as fast as the style of your example. And Iām working off your dropdown example for the other z values.
Thanks for your help!
Any ideas? Just added "locationmode: āUSA-statesā to your example on CodePen. It still displayed as a global map, although you could plot the boundaries of US states.
Would love for it to appear like the US choropleth from my earlier example. Like the one demoed in the documentation: https://plot.ly/javascript/choropleth-maps/#usa-choropleth-map
Iāve found a solution by adding the geo property āscope: āusaāā to only show the US, per your example on codepen: https://codepen.io/etpinard/pen/JKPxQo. Thanks!