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

categorical choropleths #2057

Merged
merged 2 commits into from
Jan 15, 2020
Merged

categorical choropleths #2057

merged 2 commits into from
Jan 15, 2020

Conversation

nicolaskruchten
Copy link
Contributor

No description provided.

@nicolaskruchten
Copy link
Contributor Author

missing docs, of course

locationmode=locationmode,
featureidkey=featureidkey,
geojson=geojson
if not hasattr(geojson, "__geo_interface__")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment here to explain why this is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, this is a special hook for geopandas... if you have a geopandas frame, it has a special property .geometry which has a special .__geo_interface__ property which returns GeoJSON, so doing this here allows the user to say px.choropleth(df, geojson=df.geometry,...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I was wondering whether this explanation could be added to the source code as a comment, for future maintainers

@emmanuelle
Copy link
Contributor

Looks good to me, and the example with the gapminder and continent color will be straightforward to add. It would be good practice to add it here but it can also be another PR, so 💃 for this part. The only issue I experienced is that when you hide a legend item you get the "double-click on the legend to isolate a trace" message, which I do not really understand (or it does not work), but this is not related to this PR.

@nicolaskruchten
Copy link
Contributor Author

the "double-click on the legend to isolate a trace" message, which I do not really understand (or it does not work)

it does work for me... although it is odd that it's just that one hint we give to users

@emmanuelle
Copy link
Contributor

💃

@emmanuelle
Copy link
Contributor

💃

@nicolaskruchten nicolaskruchten merged commit deaa889 into master Jan 15, 2020
@nicolaskruchten nicolaskruchten added this to the v4.5.0 milestone Jan 22, 2020
@nicolaskruchten nicolaskruchten deleted the choropleth_geojson branch June 19, 2020 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants