[CentralOH] GUI Tools Survey
issac.kelly at gmail.com
Wed Aug 11 16:06:01 CEST 2010
Hmm, saying 'canvas' is interesting as well,
I'm sure that there is an SVG library somewhere, and that could be used with
HTML5 canvas drawing (AFAIK)
The problem will be browser support for a few (12?) more months
On Wed, Aug 11, 2010 at 9:53 AM, Eric Floehr <eric at intellovations.com>wrote:
> The book "Matplotlib for Python Developers" has an entire chapter on
> embedding Matplotlib output (or generating it in realtime) on the web, using
> a number of different frameworks:
> 1. CGI (via Apache's mod_cgi)
> 2. mod_python
> 3. Django
> 4. Pylons
> For Django (as that's what I'm familiar with) in your view code you use
> matplotlib.backends.backend_agg.FigureCanvasAgg as your canvas you plot the
> Figure on. Then instead of rendering a template response, you create an
> HttpResponse with content_type 'image/png' (or any of the types FigureCanvas
> supports) and print the bits to the response (the FigureCanvas takes a "file
> like" object or a string filename, and HttpResponse is a file-like object
> (i.e. has a write method)), like:
> fig = Figure()
> canvas = FigureCanvasAgg(fig)
> ... do your plot stuff ...
> response = django.http.HttpResonse(content_type='image/png')
> Only the last two lines are specific to the web framework, everything else
> is generic plot generation that can be used in a regular GUI, etc.
> So whatever URL you have defined for the image, it will return the png.
> On Wed, Aug 11, 2010 at 9:26 AM, James - Atlantix <james at atlantixeng.com>wrote:
>> The survey is a great idea, and hopefully will provide some very useful
>> feedback. My main concern about Web based GUI's is the ability to add rich
>> math content to them, such as with Matplotlib output. Has anyone any
>> experience in this?
>> CentralOH mailing list
>> CentralOH at python.org
> CentralOH mailing list
> CentralOH at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the CentralOH