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

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

Closed
gcaria opened this issue May 22, 2023 · 4 comments
Closed

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

gcaria opened this issue May 22, 2023 · 4 comments

Comments

@gcaria
Copy link

gcaria commented May 22, 2023

This comes from geopandas/geopandas#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
Copy link
Member

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:

  • add a parameter to hard-code white or black text color
  • add a parameter to add any inline CSS
  • add a parameter to add a CSS class, so users can define CSS for the legend text elsewhere

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
Copy link
Member

Related issue that proposes a background on colormaps: #124

@ThomasBur
Copy link
Contributor

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
Copy link
Member

Since #160 was merged we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants