Popup lazy by default
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
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?
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.
Given this discussion I'll go ahead and close this issue. Making the popups lazy by default doesn't seem to give much benefit over the downside of having a breaking change. When somebody embeds a graph, they can then make the popup lazy explicitly, while the majority of popups will probably just be text. Thanks Bastien for sharing the idea and engaging in the discussion!