python-visualization / branca

This library is a spinoff from folium, that would host the non-map-specific features.
https://python-visualization.github.io/branca/
MIT License
111 stars 63 forks source link

Update the colormap HTML representation #110

Closed HaudinFlorence closed 1 year ago

HaudinFlorence commented 2 years ago

Update the colormap HTML representation to match the way it renders on Folium maps. Here is a preview of the colormap used with Choropleth layer from ipyleaflet.

Screenshot from 2022-05-04 09-59-32

martinRenou commented 2 years ago

@ocefpaf it would be great if you could consider this PR for the next release :) We'd like to use branca more in ipyleaflet

HaudinFlorence commented 2 years ago

@ocefpaf it would be great if you could consider this PR for the next release :) We'd like to use branca more in ipyleaflet Screenshot from 2022-05-05 16-28-14-2

Here is another example of the use of Branca and the custom colormap in ipyleaflet

HaudinFlorence commented 1 year ago

@Conengmo @ocefpaf Another possible use of the customized Branca colormap proposed in this PR is with Heatmap layer (adaptation of the code investigated right now) . So this makes 3 layers possibly using this colormap in ipyleaflet :-). heatmap

davidbrochart commented 1 year ago

It looks like the maintainers are busy, we'd like to move forwards with this. Is there any way we can help you @ocefpaf? Maybe you can give one of us commit rights?

martinfleis commented 1 year ago

Also happy to help with branca and folium maintenance if needed.

HaudinFlorence commented 1 year ago

Hello, is there any way of making things progress on this PR please ? Many thanks.

Conengmo commented 1 year ago

I had to check, because I normally don't use the Colormap._repr_html_ method. It does look better this way! It would be nice to reuse more of the code/template we use in the 'normal' render function, but that shouldn't hold back this change.

I'll merge after the tests ran.

ocefpaf commented 1 year ago

Also happy to help with branca and folium maintenance if needed.

I completely missed this PR and the comments here, sorry. BTW, I'd love to take on your offer here. Does that still stands?

martinfleis commented 1 year ago

BTW, I'd love to take on your offer here. Does that still stands?

@ocefpaf Yeah, it does. Now that we have exposed folium in geopandas it seems beneficial to have a bit of overlap in maintenance to channel issues and fixes to the right place. And I hope it may also help shorten the release cycle of folium.

ocefpaf commented 1 year ago

@martinfleis I'm assuming you are in for branca and folium, right?

@HaudinFlorence are you or others in your team interested too? Would that be only branca b/c it is now an ipyleaflet dependency?

martinfleis commented 1 year ago

I'm assuming you are in for branca and folium, right?

Yup. Can't promise a ton of activity but some for sure.

ocefpaf commented 1 year ago

Can't promise a ton of activity but some for sure.

I'm sure it will be more than what I have been offering these projects lately :-)

HaudinFlorence commented 1 year ago

@HaudinFlorence are you or others in your team interested too? Would that be only branca b/c it is now an ipyleaflet dependency?

Thanks a lot for merging the PR @ocefpaf . We might indeed mainly contribute to branca to upstream features needed in ipyleaflet

martinRenou commented 1 year ago

Happy to help contribute too!

ocefpaf commented 1 year ago

You three should have access to branca and Martin also has access to folium. Thanks!

HaudinFlorence commented 1 year ago

You three should have access to branca and Martin also has access to folium. Thanks!

@ocefpaf Can you please re regive me access to Branca. I left the organization by mistake. Thanks.