randyzwitch / streamlit-folium

Streamlit Component for rendering Folium maps
https://folium.streamlit.app/
MIT License
468 stars 176 forks source link

Added link to JS for realtime #179

Closed hansthen closed 5 months ago

hansthen commented 5 months ago

Closes #174.

I am a contributing developer of Folium and the developer of the Folium realtime plugin. Great work on streamlit-folium! I use Folium mainly from streamlit, so your package is really useful to me.

To fix the issue I added a link to the javascript file for realtime plugin to the component's public/index.html. I am curious though if streamlit-folium could not be changed to generate these links based on the Folium generated map. We are updating the Folium code base so that users can and and override javascript and css files at runtime. This would break the currently hardcoded list of javascript and css links.

The Folium generated code contains links to include the required javascript and css files. Is there some way these could be included in the generated code?

randyzwitch commented 5 months ago

I am curious though if streamlit-folium could not be changed to generate these links based on the Folium generated map...

Can you split this off into its own issue? If it works, that does seem desirable, but I don't know that it does/the idea will get lost once this obvious fix is merged

blackary commented 5 months ago

LGTM, thanks!

re: using folium to specify the JS and CSS, I have thought about that before https://github.com/randyzwitch/streamlit-folium/issues/115, but haven't come up with a great way to do it. That would certainly help with issues like this where Folium gets updated and knows what new JS packages are to be included.

hansthen commented 5 months ago

I am curious though if streamlit-folium could not be changed to generate these links based on the Folium generated map...

Can you split this off into its own issue? If it works, that does seem desirable, but I don't know that it does/the idea will get lost once this obvious fix is merged

Done.