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

Popup lazy by default #1868

Open
BastienGauthier opened this issue Feb 1, 2024 · 2 comments
Open

Popup lazy by default #1868

BastienGauthier opened this issue Feb 1, 2024 · 2 comments

Comments

@BastienGauthier
Copy link
Contributor

BastienGauthier commented Feb 1, 2024

Hello map makers !

As for generic behaviour in python modules, should the Popup be lazy by default, to save some performances ?

I found the lazy behaviour only implemented here, so I guess the change is only to switch this default to True:
https://github.com/python-visualization/folium/blob/c18677fa38d3804dfdf24952d404ebcbe036d08f/folium/map.py#L438C1-L438C28

Regards,
Bastien

@Conengmo
Copy link
Member

Hi Bastien, interesting suggestion! I could argue for both sides, whether to keep it False or set it True. What you say makes sense. But maybe for some users it’s preferred to not have to wait when they open a Popup.

When in doubt regarding a choice for Folium, I tend to stick with how things are, rather than allow a breaking change. Changing the default is a breaking change, so that’s why I’m hesitant.

So my question to you is: is it more beneficial to change the default setting than the risk it costs of upsetting some users workflow?

@BastienGauthier
Copy link
Contributor Author

I guess it is only a matter of green computing good practice in this case. Anyway, I agree it could be a notable performance change for some people, so it would at least need a minor version of "FutureWarning" I guess.

Not sure if this could break anything though, I don't have any use case in mind. The only advantage of greedy behaviour would be if someone makes a graphs embeded in a few popup, and wants them instantly when clicked. But popups are often text, so the unitary loading time is negligible.

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

No branches or pull requests

2 participants