[IPython-dev] Some new cell types for describing data analyses in IPy. Notebook

Jason Grout jason-sage at creativetrax.com
Thu Jul 4 05:50:44 EDT 2013


On 7/4/13 2:13 AM, Matthias BUSSONNIER wrote:
>
> This is one place where I sometime disagree with Brian, where I think
> input widget for codemirror would be great. To compare with Gabriel
> 'interactive'
> code cell, I would be more inclined to provide the ability to bind with
> get to Codemirror
> like in http://livecoding.io/3419309
> through reg-exp it bind to any variable in the codecell and pop a widget
> to change the value.
> you don't have to explicitly state which variable should be bound.
> Implementation detail CM provide a method to get token at cursor, which
> helps a lot…
> It has also the advantage of working without changing the cell type.

I think input widgets like the livecoding.io examples are a powerful way 
to input/change code.  In the end, you are just having the computer help 
you write code, instead of hand-typing each letter.  Rather than looking 
up a separate website that lets me pick an html color and gives me a hex 
value, then pasting that hex value into the IPython cell, the pop-up 
widget in the cell pastes or changes the hex value right there.

For another take on input widgets, see my proof-of-concept example here: 
http://bl.ocks.org/jasongrout/5378313  It would be easy to imagine a 
slider widget replacing a number, like:

n = <slider>

and a quick key to toggle between the slider and the number inside the 
codemirror widget.

FYI, we've had a short discussion on widgets already [1]

Thanks,

Jason

[1] 
https://github.com/ipython/ipython/issues/2802#issuecomment-16711626, 
and ensuing comments




More information about the IPython-dev mailing list