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

Dynamically load javascript and css links #181

Conversation

hansthen
Copy link
Contributor

@hansthen hansthen commented Apr 17, 2024

Dynamically load javascript and css links.

This change will inspect the Folium map and then add included js and css links to the page. I managed to fix the tests.

Javascript and typescript are not my main languages. Suggestions on how to improve this are welcome.

@hansthen hansthen marked this pull request as draft April 17, 2024 23:07
@hansthen hansthen changed the title First version that works Dynamically load javascript and css links Apr 18, 2024
@hansthen hansthen marked this pull request as ready for review April 18, 2024 18:19
@hansthen hansthen marked this pull request as draft April 18, 2024 21:18
Horribly mutilated code. Still needs to be cleaned up.
There is also code included to ensure we can run without
any js links, which is a should not happen scenario.

Need to test this later and see if it can be removed again.

Also, Dual Map tests do not work, but this is because
the dual map feature is also broken.
@hansthen
Copy link
Contributor Author

Closes issue #180

@hansthen hansthen marked this pull request as ready for review April 20, 2024 10:05
Copy link
Collaborator

@blackary blackary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so great! I tested it locally, and seems to work very well.

It should allow for much greater automatic support for new functionality in Folium. Thanks so much!

@randyzwitch randyzwitch merged commit 71099a5 into randyzwitch:master Apr 25, 2024
4 checks passed
@hansthen
Copy link
Contributor Author

This is so great! I tested it locally, and seems to work very well.

It should allow for much greater automatic support for new functionality in Folium. Thanks so much!

That's nice to hear. I am impressed (and a little intimidated) by how you managed to update Folium at runtime from inside streamlit.

@hansthen hansthen deleted the issue_180_generate_js_and_css_links_dynamically branch April 25, 2024 17:06
hansthen added a commit to hansthen/streamlit-folium that referenced this pull request May 4, 2024
* First version that works

Horribly mutilated code. Still needs to be cleaned up.

* WIP tests fixed

There is also code included to ensure we can run without
any js links, which is a should not happen scenario.

Need to test this later and see if it can be removed again.

Also, Dual Map tests do not work, but this is because
the dual map feature is also broken.

* Fix DualMap

* Black

* Dummy change to trigger build rerun
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.

None yet

3 participants