-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Move choropleth to class #1011
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
Move choropleth to class #1011
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The long term goal was to remove choropleth
entirely and leave only the GeoJson
class. I guess that people rely on it so much that we are promoting it to a first class citizen in folium
again 😄
Thanks for the review and merge @ocefpaf. I agree it's a bit of an outlier but it seems much used given the number of issues we get on it. By the way, the commits weren't squashed. Did the default setting changed? I'm not paying much attention to my commits since I thought we're squashing . |
Probably. I did not noticed that :-/
Same here. Not a big deal though. I'll take a better look next time before merging. |
Closes #981.
I have been meaning to do this for a while now :) Moving the
Map.choropleth()
method to its own class, so it's similar to all other folium types. This is not a super important change, but I think it makes our code base more consistent, which is good for developers, and makes our API more consistent, which is good for users.I haven't changed any functionality, except:
Choropleth
acceptsshow
,overlay
andcontrol
arguments like other layer types.Choropleth
a subclass ofFeatureGroup
and tweaked the rendering.reset
option, since it didn't do anything.Map.choropleth
method still works but raises aFutureWarning
Note about
ColorMap
:It needs
Map
as its parent, or we'd have to change branca. Also it cannot be included in theFeatureGroup
, so it cannot be toggled in layer control.Links to the changed notebooks:
Quickstart.ipynb
GeoJSON_and_choropleth.ipynb
I made sure the tests still work and updated the example notebooks. Didn't add a line to the changelog yet.
@ocefpaf or @jtbaker, want to review this one?