[IPython-dev] Feasilibity of widgets/layout for mimicking this

Adam Hughes hughesadam87 at gmail.com
Wed Aug 20 18:29:26 EDT 2014


Thanks for the help!  Nicholas, that's amazing; thank you for hacking this
just for our sake!  That's really cool of you.

The mailing list was having issues the last few days, so I actually started
a github discussion on this thread.  I'd just like to share that, where
Doug graciously helped me a great deal, and I posted a few followup
concerns.  Obviously they may become moot with all of the cool stuff coming
up.  Here's the link though in case you'd like to check it out and add
anything further.

As I elaborate on that link, the holy grail for us would be able to load
widgets anytime the user wants a GUI.  These widgets would need to accept
input data, and return output data.  For example in the example Nicholas
shared, I'd like the user to be able to pass in a matrix, calculate the
synchronous spectra, and then use that for further analysis in subsequent
cells in the primary notebook.  Having that as a capability would be huge
for us, because we envision a mixed API/GUI workflow.


On Wed, Aug 20, 2014 at 6:15 PM, Nicholas Bollweg <nick.bollweg at gmail.com>

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

More information about the IPython-dev mailing list