[IPython-dev] datavis with ipython notebook

Mark Voorhies mark.voorhies at ucsf.edu
Fri Jan 27 17:19:04 EST 2012


On Friday, January 27, 2012 02:07:38 pm Mark Voorhies wrote:
> On Friday, January 27, 2012 01:35:04 pm Bartosz Telenczuk wrote:
> > 
> > I completely agree, it would be really nice to enable user interaction with the plots in notebooks. If I am not mistaken, Sage has also a similar feature.
> >  
> >  I have played with dynamic plots in ipython notebook a bit. The idea is that I add some javascript to SVG generated from matlplotlib (based on an example from matplotlib website). It works well for me (in Firefox and Chrome), but the limitation is that currently one cannot feed the data based on user interaction back to the interpreter.
> 
> SVG supports links on elements by putting them inside an anchor element with an xlink:href attribute.
> Firefox supports this (left click to open link in current tab, middle click to open link in new tab, right
> click context menu not supported).  I haven't tested in Chrome, but it is supported in old versions of webkit.
> 
> So, a baroque feedback strategy would be to make localhost GET requests via these links to communicate
> user actions.
> 
> Not sure if the links should point at the tornado instance running the notebook or at a separate server instance
> (which seems cleaner, but also seems prone to threading issues).
> 
> Haven't actually tried this yet, but I've been playing quite a bit with xlink:href and xlink:title in SVG to mark
> up NetworkX outputs.
> 
> --Mark

Here (attached) is an example of xlink:href/xlink:title in an SVG (in this case, linking some gene annotation
databases to a graph of inferred relationships between genes and annotations).

There is a nice description of SVG linking (including links to an element within an SVG with optional transformation)
in chapter 17 of the SVG spec:
   http://www.w3.org/TR/SVG11/linking.html

--Mark

> 
> >  
> >  I attach my sample notebook for testting (when you click on one of text(!) labels: 'rabbit' or 'frog' some bars should disappear)
> >  
> >  Bartosz
> >  
> >  
> > 
> >  On 27.01.2012, at 18:34, Brian Granger wrote:
> >  
> >  > We would definitely like to support this but there are some technical
> >  > problems with injecting Javascript into the page dynamically that we
> >  > will have to work out before this is possible.
> >  > 
> >  > On Thu, Jan 26, 2012 at 11:09 PM, Chen-Shan Chin <cschin at infoecho.net> wrote:
> >  >> Hi, All, is it possible to let the backend python process to talk with some good javascript based visualization library running on a browser?  It that works, ipython will be a great tool for developing infovis.  Any comment on this?  I think I might try a little to whether it is feasible.  Or, is there something like that already?
> >  >> 
> >  >> --Jason Chin
> >  >> _______________________________________________
> >  >> IPython-dev mailing list
> >  >> IPython-dev at scipy.org
> >  >> http://mail.scipy.org/mailman/listinfo/ipython-dev
> >  > 
> >  > 
> >  > 
> >  
> >  Bartosz Telenczuk
> >  
> >  Institute for Theoretical Biology
> >  Humboldt University of Berlin, Germany
> >  Phone: +4930/2093-8838
> >  Homepage: http://neuroscience.telenczuk.pl
> >  
> >  
> >  
> > _______________________________________________
> >  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 --------------
A non-text attachment was scrubbed...
Name: catalases2.svg
Type: image/svg+xml
Size: 142312 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20120127/ca611993/attachment.svg>


More information about the IPython-dev mailing list