[IPython-dev] Interactive Matplotlib in the browser

Brian Granger ellisonbg@gmail....
Fri Oct 12 15:53:08 CDT 2012


On Fri, Oct 12, 2012 at 9:35 AM, Jason Grout
<jason-sage@creativetrax.com> wrote:
> 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.

We can already do this type of round tripping without any custom
messages.  That is not to say that they wouldn't be useful though,
they might be.  But they are not required.

Cheers,

Brian

> Thanks,
>
> Jason
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com


More information about the IPython-dev mailing list