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

Ipywidgets don't render #520

Closed
kolibril13 opened this issue May 31, 2023 · 1 comment
Closed

Ipywidgets don't render #520

kolibril13 opened this issue May 31, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@kolibril13
Copy link
Contributor

kolibril13 commented May 31, 2023

Describe the bug

I downloaded the interactive notebook page :
https://myst-nb.readthedocs.io/en/latest/render/interactive.html
threw everything out except the dataframe and the slider widget and locally build a myst-nb sphinx page.
That worked fine and rendered correctly.
But as soon as I re-run the notebook and re-render the sphinx page, the widget slider is not shown anymore.

Reproduce the bug

image I've also noted that there is a modle_id metadata for the widget in the notebook from the website, but this metadata is missing for the re-rendered page: image

@agoose77 : I saw that you got widgets to work here: #491

If you have some free minutes, can you tell me what I'm doing wrong? :)

List your environment

build log:

% .venv/bin/sphinx-build  -nW -E --keep-going -b html . ./_build/html
Running Sphinx v5.3.0
myst v0.18.1: MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions=[], disable_syntax=[], all_links_external=False, url_schemes=('http', 'https', 'mailto', 'ftp'), ref_domains=None, highlight_code_blocks=True, number_code_blocks=[], title_to_header=False, heading_anchors=None, heading_slug_func=None, footnote_transition=True, words_per_minute=200, sub_delimiters=('{', '}'), linkify_fuzzy_links=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area')
myst-nb v0.17.2: NbParserConfig(custom_formats={}, metadata_key='mystnb', cell_metadata_key='mystnb', kernel_rgx_aliases={}, execution_mode='off', execution_cache_path='', execution_excludepatterns=(), execution_timeout=30, execution_in_temp=False, execution_allow_errors=False, execution_raise_on_error=False, execution_show_tb=False, merge_streams=False, render_plugin='default', remove_code_source=False, remove_code_outputs=False, code_prompt_show='Show code cell {type}', code_prompt_hide='Hide code cell {type}', number_source_lines=False, output_stderr='show', render_text_lexer='myst-ansi', render_error_lexer='ipythontb', render_image_options={}, render_figure_options={}, render_markdown_format='commonmark', output_folder='build', append_css=True, metadata_to_fm=False)
Using jupyter-cache at: /Users/jan-hendrik/projects/manim_share/_build/.jupyter_cache
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [100%] nb_manim_example                                                                                                                         
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] nb_manim_example                                                                                                                          
generating indices... genindex done
writing additional pages... search done
copying images... [100%] _build/jupyter_execute/853424a882625036c475e2c57d5ab95dc59c4ebc89ebc588cc3a949521155141.png                                               
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.

I'm using ipywidgets version '8.0.5'

@kolibril13 kolibril13 added the bug Something isn't working label May 31, 2023
@kolibril13
Copy link
Contributor Author

I've made some research and found ot that saving the state of a widget is currently not possible in VS Code microsoft/vscode-jupyter#4404 and also not in JupyterLab (but that might be possible in the next Jlab release again, see jupyter-widgets/ipywidgets#3790) .
The platform that currently supports saving widget states is classical jupyter notebook:
image

Saving the widget state with that makes them appear in MyST-NB 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant