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
110 stars 63 forks source link

Feature request: Option to change color of legend's text #130

Closed gcaria closed 3 weeks ago

gcaria commented 1 year ago

This comes from https://github.com/geopandas/geopandas/issues/2897, since geopandas.GeoDataFrame.explore() uses branca:

I wish I could plot a colormap also on tiles where dense forests have dark colors, but I can't read the colorbar's title and ticks since they are written with a black font.

Conengmo commented 1 year ago

Sounds like a good change to have, to be able to style the legend text. Shouldn’t be too complicated. I’m thinking we could:

I’m inclined to opt for 2. at the moment but I’m open for other opinions.

Help is welcome to work in this!

Conengmo commented 1 year ago

Related issue that proposes a background on colormaps: https://github.com/python-visualization/branca/issues/124

ThomasBur commented 3 months ago

I made a PR (#160) to resolve the issue, although it only allows SVG Recognised Colors, rather than arbitrary inline CSS like @Conengmo recommended.

I believe that should be sufficient for @gcaria's requirements, and to enable the resolving of geopandas/geopands#2897.

This is my first open-source contribution, so feel free to give any advice or tips :)

Conengmo commented 3 weeks ago

Since https://github.com/python-visualization/branca/pull/160 was merged we can close this issue.