[IPython-dev] Interactive Matplotlib in the browser
mdroe at stsci.edu
Fri Oct 12 15:49:01 EDT 2012
On 10/12/2012 03:40 PM, Jason Grout wrote:
> On 10/12/12 12:04 PM, Michael Droettboom wrote:
>> I found a better way -- recent versions of the websockets API do support
>> binary data. The magic incantation to put load binary data into an
>> image object is here:
> My main obstruction was figuring out how to get the image data into the
> canvas (correctly interpreted, etc). It seems that using putImage
> overwrites all pixels on the canvas, regardless of the transparency
> settings, at least from what I read.
True -- but rather than using putImage, I continued to use drawImage,
and it works like a charm. The weird bit is the way to get a special
url to an in-memory binary object:
imageObj.src = (window.URL || window.webkitURL).createObjectURL(
(where evt.data is a Blob object).
>> I've created a new github repo for this -- if we're going to collaborate
>> on this before it develops into a real patch against matplotlib and/or
>> ipython and/or sage that should be more convenient than using gists.
> Great. I may be somewhat offline for a few days, but mid-next week I'll
> be looking at this more for sure.
BTW -- in the latest incantation, I have animation working.
> IPython-dev mailing list
> IPython-dev at scipy.org
More information about the IPython-dev