-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add ability to set font size in plot #1879
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
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.
Nice change! Minor comment in the code.
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.
Thanks for your effort @this-josh! It’s a nice improvement and I’m sure we can merge it soon.
I found a typo, and I added a question, hope to hear your thinking on it.
folium/utilities.py
Outdated
if isinstance(value, (int, float)): | ||
return f"{value}rem" | ||
|
||
if "rem" not in value: |
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.
Why must the unit be rem? Why not also allow px or em for example?
This behavior seems very related to https://github.com/python-visualization/branca/blob/f3d866f598a194f9acd30e24e1affe52a32a9f05/branca/utilities.py#L412, which is a generic function to parse any html/css size. (But had hardcoded ‘px’ as default unit.)
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.
Good point, I've updated it to accept em
and px
.
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.
Thanks! The default could still be rem if you like.
I noticed some test may fail, once that’s solved I’ll go ahead and merge it!
Co-authored-by: Frank Anema <[email protected]>
made px the default in line with _parse_size.
Thanks @this-josh! |
This PR permits you to set the leaflet font size. This is helpful to make plots more legible in certain circumstances.