Skip to content

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

Merged
merged 13 commits into from
Feb 28, 2024
Merged

Conversation

this-josh
Copy link
Contributor

This PR permits you to set the leaflet font size. This is helpful to make plots more legible in certain circumstances.

Copy link
Collaborator

@martinfleis martinfleis left a 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.

Copy link
Member

@Conengmo Conengmo left a 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.

if isinstance(value, (int, float)):
return f"{value}rem"

if "rem" not in value:
Copy link
Member

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.)

Copy link
Contributor Author

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.

Copy link
Member

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!

@Conengmo Conengmo merged commit 6c85ddd into python-visualization:main Feb 28, 2024
@Conengmo
Copy link
Member

Thanks @this-josh!

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.

3 participants