[IPython-dev] Widgets for non-Python kernels

Jonathan Frederic jon.freder at gmail.com
Tue Mar 18 17:52:52 EDT 2014


Andrew and I had a chance to talk on HipChat.  For those who weren't there,
I updated the IPEP because it was very out of date (
https://github.com/ipython/ipython/wiki/IPEP-23%3A-Backbone.js-Widgets).
 It still needs a lot of work but at least the information is correct now.
 I think this was the cause of the confusion.  I added a small section that
summarizes the steps required to display a widget.  For those of you who
are interested, but do not want to visit the full IPEP, see this excerpt:


   1. Open a comm with a target_name of WidgetModel. The widget manager
   watches for comms with the target_name="WidgetModel" and creates a
   widget model when that comm is created. The comm and widget model are
   automatically connected.
   2. Send a full state update message on the new comm (see the
*update* Back-end
   to front-end message spec in the IPEP). The full state should include the
   following:
   - msg_throttle and _view_name
      - _css and visible if a DOM widget view is specified for _view_name
      - The rest of the of the properties of the corresponding widget, i.e.
      disabled, value, min, etc...
      3. Send a display message on the comm (see the *display* Back-end to
   front-end message spec in the IPEP).

Cheers,
Jon


On Tue, Mar 18, 2014 at 1:20 PM, Doug Blank <doug.blank at gmail.com> wrote:

> On Tue, Mar 18, 2014 at 3:15 PM, Andrew Gibiansky
> <andrew.gibiansky at gmail.com> wrote:
> > Hey all,
> >
> > I'm trying to implement widgets in IHaskell, and am having a lot of
> > difficulty understanding what should go into this. I currently have Comms
> > implemented, so things can change the way they are displayed to use
> JS+comms
> > to be dynamic.
> >
> > However, it looks like widgets are significantly more than just that. At
> > least, they are output to a special widget area of the output cell. I
> > understand the general idea behind widgets but cannot understand the raw
> > underlying comm/networking protocol that gets them set up and working.
> >
> > So, a few questions to start with:
> >
> > How can I make, say, a slider widget appear in the frontend? My backend
> has
> > no Python in it whatsoever.
> > Which side sends the comm_open (backend or frontend)? Is it that the
> backend
> > sends a comm_open to the frontend with the proper target name, which then
> > creates the model, and later a display() can create the view?
> >
> > I apologize in advance if this is thoroughly documented somewhere; I read
> > the IPEP for backbone widgets and found that it described the
> architecture
> > but I could not understand how the backend actually dealt with the
> messages
> > and how and to whom they were sent. Also, the example notebooks are
> helpful
> > in terms of understanding the Python support for this, but didn't quite
> > answer my questions.
> >
> > Thanks!
> >
> > Andrew Gibiansky
>
> Andrew,
>
> We could attempt to share our ZMQServer.cs between Calico and F#, but
> your native F# is so clean looking that you may not want to :) You can
> see what is necessary to implement widgets here:
>
> https://bitbucket.org/ipre/calico/src/master/Source/Calico/Widgets.cs
> https://bitbucket.org/ipre/calico/src/master/Source/Calico/ZMQServer.cs
>
> This code is still being cleaned up, but I think we have everything
> implemented (traitlet-like behaviors, compositional widgets, etc).
>
> Hope that helps; if not feel free to ask a question.
>
> -Doug
>
> >
> >
> >
> > _______________________________________________
> > 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/20140318/ce8a9728/attachment.html>


More information about the IPython-dev mailing list