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

Static widgets #16

Closed
jdfreder opened this Issue May 5, 2015 · 42 comments

Comments

Projects
@jdfreder
Copy link
Contributor

jdfreder commented May 5, 2015

Depends on #13

Originally planned for 3.0, static widgets allow widgets to be exported using nbconvert. The mechanism of state storage has yet to be decided.

@jdfreder jdfreder added the proposal label May 5, 2015

@jdfreder jdfreder modified the milestones: 4.0, 5.0 May 5, 2015

@stsievert

This comment has been minimized.

Copy link
Contributor

stsievert commented May 27, 2015

+1. If I'm interpreting correctly, it's a widget that you can embed on any webpage/get raw HTML. I would love to see this and am currently using the unsupported ipywidgets.

@TMorville

This comment has been minimized.

Copy link

TMorville commented Oct 21, 2015

+1. Using Nbconvert or Nbviewer with widgets would be neat feature for teaching people without access to ipython/jupyter.

@jdfreder jdfreder modified the milestones: 6.0, 5.0 Dec 8, 2015

@akhmerov akhmerov referenced this issue Dec 8, 2015

Closed

Switch from jakevdp/ipywidgets to holoviews #85

4 of 4 tasks complete
@michaelaye

This comment has been minimized.

Copy link

michaelaye commented Feb 27, 2016

I'm confused, is it correct that currently nothing like this on Jake's blog is possible with the official ipywidgets? https://jakevdp.github.io/blog/2013/12/05/static-interactive-widgets/

@bcordo

This comment has been minimized.

Copy link

bcordo commented Apr 20, 2016

@michaelaye did you confirm? Also looking for something with the same functionality.

@bcordo

This comment has been minimized.

Copy link

bcordo commented Apr 20, 2016

This looks great guys btw. Looking forward!

@kulla

This comment has been minimized.

Copy link

kulla commented Jun 1, 2016

+1

1 similar comment
@desilinguist

This comment has been minimized.

Copy link

desilinguist commented Sep 8, 2016

+1

@georgebv

This comment has been minimized.

Copy link

georgebv commented Sep 18, 2016

https://github.com/jakevdp/ipywidgets-static
The problem is solved here, though native widgets look much batter. Is anyone working on this right now?

@GandaG

This comment has been minimized.

Copy link

GandaG commented Sep 19, 2016

@georgebv You can tell from his own example that it no longer works. Would absolutely love to see this feature though!

@sripakpa

This comment has been minimized.

Copy link

sripakpa commented Sep 20, 2016

+1

@sripakpa

This comment has been minimized.

Copy link

sripakpa commented Sep 20, 2016

How is the feature described in this ticket related/different from the feature to have interactive widgets embedded into static web pages illustrated here?

@georgebv

This comment has been minimized.

Copy link

georgebv commented Sep 20, 2016

The point is not having widgets in the static web page. It is about making them interact with the output (by storing all the possible output combinations in the html file).

@damianavila

This comment has been minimized.

Copy link
Contributor

damianavila commented Sep 21, 2016

I know @SylvainCorlay is going to write something (post) about this soon, see this comment: #758 (comment)

@tbsexton

This comment has been minimized.

Copy link

tbsexton commented Sep 26, 2016

@damianavila I will be watching this; I have a reveal.js presentation .html file and would like an interactive slider/plot combination to be usable on my static site as opposed to only while using RISE.

@jbednar

This comment has been minimized.

Copy link

jbednar commented Nov 15, 2016

@SylvainCorlay, can you confirm whether there will soon be static export of ipywidgets? We're at this very moment trying to find a different widget library so that we can switch to it for that feature alone, but if we should be staying with ipywidgets and just need to hold on for a few days longer, please let us know!

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Nov 15, 2016

Yes! There is already. For example on http://jupyter.org/widgets, widgets are live.

With 6.0 in a few days, widgets will also be embeddable in sphinx documentation.

Nbconvert will follow.

@jbednar

This comment has been minimized.

Copy link

jbednar commented Nov 15, 2016

Great, thanks! The live widgets at that link are great, but none of those are for the standard sliders, selection boxes, text entry boxes, etc. that we are using ipywidgets for. Presumably those are also now supported? Nbconvert is indeed my main use case, but we can probably work with Sphinx if that's the only currently supported way.

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Nov 15, 2016

All of these are supported. The widgets in that page are built upon ipywidgets. I will add a tab with some simple dropdowns and buttons.

We have had static widgets since 5.0. The nbconvert part is the only reason why this issue is not closed yet.

@jbednar

This comment has been minimized.

Copy link

jbednar commented Nov 15, 2016

Sounds great. Getting nbconvert support is crucial for people even to know that static support is available. Presumably documentation is also needed before closing the issue?

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Nov 15, 2016

Yes. We are currently formalizing the spec for the format of the serialized widgets. cf #901

@jbednar

This comment has been minimized.

Copy link

jbednar commented Nov 15, 2016

With the goal of serialization being to generate and insert that HTML snippet directly, without user cutting and pasting? That does sound crucial for this to be usable in practice, thanks.

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Nov 15, 2016

I don't understand your question, but the html snippet feature will remain for those who want to embed in webpages, blogs.

The nbconvert question is more about the choice of how the widget state is stored in the notebook format.

@jbednar

This comment has been minimized.

Copy link

jbednar commented Nov 15, 2016

I just mean that nbconvert converts .ipynb to .html, and presumably when one does so one won't need to paste in the HTML snippets that create the widgets, by hand? Basically I just want the widgets to be preserved in the exported file, with the values they had at that time as their starting point, whether or not they are hooked up to anything that actually does something in the exported HTML. E.g. here's an example of a bunch of ipywidgets generated with static PNGs using nbconvert: https://anaconda.org/jbednar/paramnb/notebook

But that only works because of the embedded PNGs, whereas embedding the actual widgets would be so much cleaner. Basically I just want to be able to save things as .html and have it all work, insofar as it is possible. Perhaps @philippjfr and @jlstevens could explain better.

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Nov 15, 2016

👍 got that. Stay tuned. :) We are currently sprinting to get these things out.

@jbednar

This comment has been minimized.

Copy link

jbednar commented Nov 15, 2016

Fabulous! I'll hand you a drink as you sprint by, if I see you!

@jbednar

This comment has been minimized.

Copy link

jbednar commented Dec 8, 2016

How is the sprint coming? You guys must be winded by now if you've been running flat out for this long! :-)

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Dec 9, 2016

@jbednar

  • we have working static widgets in sphinx docs

    nbsphinx-screencast

    which is only waiting for the PR to get merged in another repo.

  • All the pieces are completed for nbviewer except an outstanding PR in nbconvert.

@jbednar

This comment has been minimized.

Copy link

jbednar commented Dec 9, 2016

That sounds great. Can't wait!

@michaelaye

This comment has been minimized.

Copy link

michaelaye commented Dec 9, 2016

Very nice. Just a quickie: i assume the readthedocs version is not yet working because of some final tweaks or am I maybe missing a plugin (using Safari on 10.11.6)?
screenshot 2016-12-09 10 20 59

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Dec 9, 2016

Indeed, stay tuned for the rtd rendering.

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Dec 11, 2016

@akhmerov

This comment has been minimized.

Copy link
Contributor

akhmerov commented Dec 11, 2016

Wow, nice! Out of curiousity, what is the chosen mechanism for state storage?

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Dec 11, 2016

@akhmerov check out the section of the documentation on embedding that got improved at the same time.

http://ipywidgets.readthedocs.io/en/latest/embedding.html

@michaelaye

This comment has been minimized.

Copy link

michaelaye commented Dec 11, 2016

Looks great!
But: The linked widgets are not linked in RTD:
http://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Basics.html#Linking-two-similar-widgets
Want a new GH issue for that?

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Dec 11, 2016

@michaelaye anything that requires a roundtrip to the backend will not work.

However, jslink and jsdlink do work on RTD.

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Dec 11, 2016

@michaelaye for things that require a kernel, we are thinking of using mybinder as a kernel provider (without the notebook) for embedded widgets. I got some example working but the documentation would probably not be the main purpose.

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Dec 14, 2016

We now support widgets rendering on nbviewer

Example here: http://nbviewer.jupyter.org/github/ipython/ipywidgets/blob/master/docs/source/examples/Widget%20Events.ipynb

This requires the widgets to be generated from the ipywidgets 6.0 (beta) or the current state of master and will be included in the next release.

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Dec 14, 2016

Really really glad to close this issue. Support of custom widgets and some css glitches will be worked on before the 6.0.

Thank you to everyone involved, especially @minrk @michaelpacer @jasongrout @takluyver @jdfreder.

@inodb

This comment has been minimized.

Copy link

inodb commented Dec 21, 2016

@SylvainCorlay Great stuff! Thanks so much for your work on this!

One question: in the nbviewer link at the top if I click on the button or hit enter in the submit field nothing happens. Is that expected? Thanks!

@SylvainCorlay

This comment has been minimized.

Copy link
Member

SylvainCorlay commented Dec 21, 2016

Yes. In these static embeddings, there is no python backend. Only the pure js things will work.

We are also working on a kernel-backed thing for full fledges apps.

@inodb

This comment has been minimized.

Copy link

inodb commented Dec 21, 2016

Gotcha! One more question: Is it possible to change plots using a radio button or a slider? Similar to http://nbviewer.jupyter.org/github/jakevdp/ipywidgets/blob/master/example.ipynb#Example-4:-Matplotlib-Figures

@dmadeka

This comment has been minimized.

Copy link
Contributor

dmadeka commented Dec 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment