jupyter-widgets / ipyleaflet

A Jupyter - Leaflet.js bridge
https://ipyleaflet.readthedocs.io
MIT License
1.49k stars 364 forks source link

Fix choropleth used without initial choro_data #1038

Open HaudinFlorence opened 2 years ago

HaudinFlorence commented 2 years ago

Propose a solution for using Choropleth layer without giving an initial choro_data. Fix issue #934 In this implementation, when no dict is given for choro_data, a dict is built from the key of the geo_data and the affected value is zero for all keys. A check is performed to see wether all values of choro_data are identical (that means there is no geographical variation in the observed data that is not very likely) a warning is raised and the color and opacity attributed are set to the nan default ones.

no_initial_choro_data