[IPython-dev] Interactive Matplotlib in the browser

Jason Grout jason-sage at creativetrax.com
Fri Oct 12 12:35:15 EDT 2012

On 10/11/12 4:49 PM, Michael Droettboom wrote:
> I have a proof-of-concept way to make interactive plots in the browser
> work using transparent PNGs described here:
> http://mdboom.github.com/blog/2012/10/11/matplotlib-in-the-browser-its-coming/
> No PRs yet, because this is miles from ready for that, but it would be
> helpful to get some feedback about how this works in different
> browsers/platforms/network environments etc.

I just want to point out that this may be another use-case for custom 
messages in IPython.  For example, a matplotlib figure, when it is 
drawn, could send the initial png over the websocket as a display_data 
message.  Matplotlib would then register a callback with IPython to 
handle any custom messages coming back from the javascript (routed 
according to the parent header).  When the javascript detects an event, 
it sends a message back to IPython, IPython calls the appropriate 
matplotlib callback, and matplotlib has the chance to send a new figure 
over.  The javascript side likewise has a callback registered to handle 
matplotlib's return messages.  These messages back and forth may make 
sense to have custom message types.



More information about the IPython-dev mailing list