whitphx / stlite

In-browser Streamlit 🎈🚀
https://edit.share.stlite.net
Apache License 2.0
1.15k stars 55 forks source link

Support st.bokeh_chart #61

Open whitphx opened 2 years ago

whitphx commented 2 years ago

It raises an error such as

6.8fc22a8b.chunk.js:1 TypeError: Cannot read properties of undefined (reading 'embed')
    at BokehChart.tsx:109:13
    at BokehChart.tsx:123:5
    at Ls (6.8fc22a8b.chunk.js:1:1608317)
    at t.unstable_runWithPriority (6.8fc22a8b.chunk.js:1:1626130)
    at qi (6.8fc22a8b.chunk.js:1:1548488)
    at Ns (6.8fc22a8b.chunk.js:1:1607778)
    at 6.8fc22a8b.chunk.js:1:1607689
    at B (6.8fc22a8b.chunk.js:1:1625189)
    at E.port1.onmessage (6.8fc22a8b.chunk.js:1:1623911)
whitphx commented 1 year ago

The original Streamlit frontend loads the bokeh JS scripts from index.html and sets the global Bokeh object.

https://github.com/streamlit/streamlit/blob/1.13.0/frontend/public/index.html#L35-L41


If BokehJS is bundled to the Streamlit frontend, it becomes easier for stlite to import it too. -> https://github.com/streamlit/streamlit/issues/5528

whitphx commented 1 year ago

Experimental PR: #344

whitphx commented 1 year ago

Bokeh v3 is now installable on Pyodide, but Streamlit only supports v2.