<div dir="ltr"><div><div>Didn't see this when it was posted (and then didn't see cyrille's and brian's posts until just now! curse you gmail!), but in the meantime, hacked this together:<br><br><ul><li><a href="http://nbviewer.ipython.org/gist/anonymous/840b5cec9e19f3e39090">http://nbviewer.ipython.org/gist/anonymous/840b5cec9e19f3e39090</a></li>
</ul></div>Screenshot:<br><ul><li><a href="http://i.imgur.com/wP3VmWK.png">http://i.imgur.com/wP3VmWK.png</a></li></ul></div><div>Obviously lots of room for improvement, but I think you can see you can be very successful without writing any javacript at all.<br>
<br></div><div>There are some tricks: add_class and remove_class only happen to something that is actually on the page. <br><br></div><div>As for wrapping it all: you'll end up exposing:<br></div><ul><li>a function that returns the dialog widget<br>
</li><li>a function something that handles the add_remove class cleanup</li><ul><li>it might be fixed in the new stuff<br></li></ul><li>a function that will do both of the above and actually call IPython.display.display</li>
<ul><li>this should also return the widget, in case people want custom handlers, I guess?<br></li></ul></ul><div>As Brian says, though: really some great stuff coming up!<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Aug 20, 2014 at 4:15 AM, Cyrille Rossant <span dir="ltr"><<a href="mailto:cyrille.rossant@gmail.com" target="_blank">cyrille.rossant@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Adam,<br>
<br>
I'll do a tutorial about IPython widgets at EuroSciPy in a week [1].<br>
I'm notably planning to demonstrate how to build, in the notebook, a<br>
GUI like the one you showed. I'll put here the link to the GitHub repo<br>
when everything's ready.<br>
<br>
Best,<br>
Cyrille<br>
<br>
[1] <a href="https://www.euroscipy.org/2014/schedule/presentation/60/" target="_blank">https://www.euroscipy.org/2014/schedule/presentation/60/</a><br>
<br>
2014-08-17 19:54 GMT+02:00 hugadams <<a href="mailto:hughesadam87@gmail.com">hughesadam87@gmail.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> (Please disregard if doublepost; having some subscription issues)<br>
><br>
> Hello,<br>
><br>
> We are developing a spectroscopy library and want to put in some interactive<br>
> plots/utilities to make the software a bit more approachable to novices.<br>
> I'd really like to build the entire interactive plotting interface through<br>
> the notebook's new widget system.  My reasoning is as follows:<br>
><br>
>    - All static plots are already matplotlib-based, so we wouldn't have to<br>
> write a seperate plotting api<br>
>    - Notebooks are inherently browser-ready, so sharing plots would be great<br>
>          - Is it likely that static nbviewer will eventually support<br>
> widgets?  Since the data is required, I figured not...<br>
>    - Our tutorials are already in notebooks, so we'd like to be consistent.<br>
><br>
> I've watched all the videos I can find from the widgets, and think I'm fine<br>
> with the Python end; however, am finding it hard to come by lots of<br>
> information on controlling the layout of the widgets.  I know it's mostly<br>
> done in javascript, and I think the most complex view we will have will look<br>
> something like this:<br>
><br>
> <a href="https://sites.google.com/site/shigemorita/home/2dshige" target="_blank">https://sites.google.com/site/shigemorita/home/2dshige</a><br>
><br>
> How much time would you estimate a javascript novice ought to spend on<br>
> getting something like that in the notebook?  Can anyone share tutorials for<br>
> the layout portion of the widget API?  Any information is helpful.  Lastly,<br>
> does anyone have any hacky ideas of how to bury the source code so that the<br>
> widgets merely display, rather than the user copy/pasting the widget source<br>
> into a cell?<br>
><br>
> Thanks<br>
</div></div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
</div></div></blockquote></div><br></div>