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

Hydrate ipywidget and anywidget from state on page load #428

Open
3 of 10 tasks
stevejpurves opened this issue Jul 14, 2024 · 0 comments
Open
3 of 10 tasks

Hydrate ipywidget and anywidget from state on page load #428

stevejpurves opened this issue Jul 14, 2024 · 0 comments

Comments

@stevejpurves
Copy link
Contributor

stevejpurves commented Jul 14, 2024

When a myst site loads we currently don't display ipywidgets and actually strip out the default text/plain and widgets mimebundle, swapping it out with a html placeholder fragment.

This is because we can't display ipywidgets without a kernel, as myst doesn't process the widget state and ensure it is a part of the built content.

Aim of this issue is to track progress on changing this and getting ipywidgets to hydrate on load

TODO:

  • extend thebe to include a new WidgetManager that can be used without a kernel (passive thebe manager thebe#756).
  • add more passive rendering to myst-theme to use the WidgetManager and ensure that widgets are hydrated from state (Rehydrate Widget State #426) from @dwootton 💪.
    • 🐞 widgets do not render on SSR load / page refresh (to reproduce, navigate to a page with widgets, then refresh the page - a "widget model not found" will be displayed, but the same page works fine when navigating to the page)
  • (mystmd) extend mystmd to process the widget state at notebook.metadata.widgets and get this onto the built .json (💦 building widget state mystmd#1382)
    • (mystmd) make any widgets state information that we build "out-of-band" so that it does not affect initial page load (ping @fwkoch)
    • (myst-theme) handle loading the out-of-band widget state
  • (myst-theme) display a small message when a user interacts with a widget that has no kernel
    • start the compute server (if compute is enabled) when a widget is touched
  • (myst-theme) there are timing issues because of the current way we render outputs
  • (myst-theme) support tlfdraw / anywidgets - styles no loading?
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

No branches or pull requests

1 participant