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

HTMLExporter: Add a new output filter that excludes widgets if there is no state #1643

Merged
merged 1 commit into from
Oct 3, 2021

Conversation

martinRenou
Copy link
Member

This allows showing a static mimetype if the widget state is not available.

Example 1: Widget state not available, we render a static plot
nbconvert_static

Example 2: Widget state available, we render the widget (blank because the plot data is not part of the state (yet))
nbconvert_widget

This has no implication on Voila, voila continues rendering the widgets properly (this is because it will simply not use this filter):
voila

This is related to the work done in matplotlib/ipympl#343

This allows showing a static mimetype instead of a blank widget
@SylvainCorlay
Copy link
Member

SylvainCorlay commented Sep 22, 2021

@jasongrout do you think we could consider this for 6.2?

We just released ipympl 0.8 which now includes a PNG representation of figure widgets. This fallback mechanism will allow nbconvert to render static Matplotlib figures when the widget state is missing, like GitHub does.

Note: this is solving a longstanding issue and request from the community, so I am very happy about it.

@maartenbreddels
Copy link
Collaborator

Very nice! I think this makes total sense since if the state is not there, nothing can be done with the mime bundle entry. A potential future issue could be when the widget state is stored outside of the notebook, not something to worry about now.

@jasongrout
Copy link
Member

@jasongrout do you think we could consider this for 6.2?

I'm planning on releasing 6.2 tomorrow since there haven't been bug reports on the RC. I think this is a big enough change I'd rather do the release (rather than reset the RC timeline) and get it out the door, and immediately start the process for 6.3.

@jasongrout jasongrout added this to the 6.3 milestone Sep 24, 2021
@SylvainCorlay
Copy link
Member

Version 6.2 has been released a few days ago, and we haven't seen major breakage.
I think it is fine to start merging things in preparation for 6.3.

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

Successfully merging this pull request may close these issues.

4 participants