Interactive Matplotlib in the browser

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.

Mike

A sample implementation using websockets instead of polling is here:

https://gist.github.com/3875846

It still requests the file, which causes a delay. I think doing a png diff sounds like a great idea. What if we also transfer the png diff over the websocket connection (maybe in a binary frame)?

Thanks,

Jason

···

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.

It is not clear to me that the stream of PNGs will win in the end. If
you make a single static plot of a large data set, that is way better
than trying to send the data to the browser and rendering it there.
But if you have to send hundreds or thousands of PNGs to get
interactivity, that benefit may be washed out. Especially if you have
multiple users interacting with plots - the server could quickly grind
to a halt. I think we should do tests to see how bad it gets, taking
into account the multiple user question. The one performance benefit
that I can think of is that you can tune the level of interactivity to
limit the data that comes back. For large data sets, users might be
willing to settle for less interactivity. That option doesn't exist
when you send all the data back.

Cheers,

Brian

···

On Thu, Oct 11, 2012 at 2:49 PM, Michael Droettboom <mdroe@...31...> 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.

Mike

_______________________________________________
IPython-dev mailing list
IPython-dev@...336...
http://mail.scipy.org/mailman/listinfo/ipython-dev

--
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@...882... and ellisonbg@...149...

As a bit of spiritual support for the underlying concept, I mostly use
matplotlib via exactly this mechanism, today. Except I didn't want to
modify matplotlib, so my solution is a bit more elaborate:
http://xpra.org/

There's an astonishing amount of nonsense involved in setting up a
headless X server, registering as a window manager and compositing
manager, fighting with the X keyboard model, etc., but at the end of
the day it just works by shipping PNG-style compressed screenshots
over the wire in one direction, and input events over the wire in the
other. Perhaps surprisingly, the result is dramatically more usable
over remote links than vanilla X forwarding is, and it's very
maintainable. So +1 to this approach.

-n

···

On Thu, Oct 11, 2012 at 10:49 PM, Michael Droettboom <mdroe@...31...> 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.