Ensure HoloViews is importable from a pyodide webworker
import asyncio
import sys
-from js import document
from bokeh.document import Document
from bokeh.embed.elements import script_for_render_items
@@ -31,6 +30,7 @@ async def _link(ref, doc):
_link_docs(doc, view.model.document)
def render_html(obj):
+ from js import document
if hasattr(sys.stdout, '_out'):
target = sys.stdout._out # type: ignore
else:
