Showing a pyLDAvis html

Hi @lyqht - Streamlit doesn’t currently support embedding HTML/js, but we’re thinking about ways to implement this safely and sanely. (There’s a ticket we just opened to track one particular way this might be done, using iframes, here.)

Re: your link to another HTML file - out of the box, Streamlit does not (currently) support serving files from your filesystem. This functionality is also under consideration, but in the meantime you have a few options:

  • Host your static files via a second webserver. For example, you could use Python’s built-in http.server to accomplish this. Note that this server will have to run on a different port from Streamlit, so your links to website/assets will have to include the port that you start the separate server from (e.g. http://10.12.200.18:8000/website/assets/..., if you run the server on port 8000.)
  • Modify the Streamlit code to support serving static files. There’s a Gist that demonstrates this and a feature request for supporting file serving directly in Streamlit, if you’re interested in following progress on that.
2 Likes