WebBased Vector 2D Graphics

Dorai dorait at gmail.com
Sat Oct 6 10:15:18 EDT 2007


On Oct 5, 4:28 am, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
>  cj... at bath.ac.uk wrote:
> > Hi there
>
> > I currently have a Python program outputing to the command line,
> > durations of 'completed Steps' and 'data items' in relation to time
> > i.e.
>
> > --------------jfh
> >               ---------kl    //kl started after jfh finished
> >                     % Ds  //new data arrived at this point in time
> >                     -------pl (1)  //Details error with finsihed Step
> >                            *kl      // This step is now outputed but
> > due to error with pl is cancelled (no duration)
>
> > I am new to doing any web based development and don't have a clue
> > where to start! I just wondered what is the best way to output this
> > program to a web page graphically.
>
> > I want to be able to represent these durations "-----" as rectangles
> > and as the program runs the page will refresh every 10 seconds, thus
> > the boxes will expand with time until they have finished. New data
> > will also be represented in boxes with a different colour. I believe
> > some kind of script will have to be run which constantly updates the
> > html page after x seconds which then causes the web page to refresh
> > with the updated data.
>
> > Is there any way this web programming can be done in python. Or
> > perhaps I can use soemthing such as ajax?
>
> > As mentioned previously, I have never done any web based development
> > so don't really know what I'm talking about when trying to understand
> > how I can go from this Python program output to producing some
> > graphical output on a web page.
>
> You certainly need to get on speed with webdevelopment. Otherwise you will
> fail miserably.
>
> There are several options here:
>
>  - rendering a server-side image, deliver that embedded in a html-page
>
>  - render using html tags like DIV and the like, which allow for positioned
> colored rectangles and text, in pixel coordinates
>
>  - canvas tag, to render 2D-drawing-commands
>
>  - embedded SVG
>
> All that can be enriched with AJAX to have that fancy
> realtime-update-thingy.
>
> Diez

Great ideas.

Another approach would be to generate some simple metadata (simple
text, json or xml) on the server and use a javascript libraries (like
http://www.openjacob.org/draw2d.html). SVG is a more generic version
of this approach.




More information about the Python-list mailing list