[IPython-dev] interactive javascript controls

Jason Grout jason-sage@creativetrax....
Sat Dec 29 10:27:11 CST 2012


Just FYI, I'm experimenting with ways to add javascript controls with 
bidirectional communication to have interactive controls.  I'm 
implementing these in the Sage cell server, but using the IPython 
infrastructure and communication protocols (but with my own custom 
messages for control updates and the like).  Here is the thread about it 
on sage-notebook:

https://groups.google.com/forum/?fromgroups=#!topic/sage-notebook/KHRyuUMxnN8

and here is a currently-working example:

http://aleph.sagemath.org/?q=504efe00-85d4-4047-9315-1398ffb0efb9&lang=sage

showing how to implement a new control (that lets you pick a 2d point) 
and have other sliders associated with the variables that interactively 
update with the following code:

with interactive_namespace(x=4,y=20):
     Point2D('x','y').create()
     slider('x', (0,100)).create()
     slider('y', (0,100)).create()
     ExpressionBox('x').create()

Again, just FYI...I'm still experimenting quite a bit, but trying to 
keep things general enough to be useful to go into IPython eventually.

Thanks,

Jason

--
Jason Grout


More information about the IPython-dev mailing list