WebBased Vector 2D Graphics

C

cjt22

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.

Any help would be much appreciated
Chris
 
B

Bjoern Schliessmann

Is there any way this web programming can be done in python.

Sure. Minimalistic approaches include using CGI
(http://docs.python.org/lib/module-cgi.html)
or using Apache with mod_python directly. There are also web
frameworks for Python, but I don't know much about them.
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.

The above approaches allow you to directly print to the web page.
I'm not sure how you could display constant progress there. Perhaps
much simpler with mod_python than with CGI.

Regards,


Björn
 
C

cjt22

Sure. Minimalistic approaches include using CGI
(http://docs.python.org/lib/module-cgi.html)
or using Apache with mod_python directly. There are also web
frameworks for Python, but I don't know much about them.


The above approaches allow you to directly print to the web page.
I'm not sure how you could display constant progress there. Perhaps
much simpler with mod_python than with CGI.

Regards,

Björn

Thanks Bjorn
The above approaches allow you to directly print to the web page.

Would this mean I wouldn't be able to have any fancy graphics outputed
such as the rectangles I mentioned before with different filled in
colours?

Cheers
Chris
 
D

Diez B. Roggisch

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
 
R

Robin Becker

Diez said:
(e-mail address removed) wrote:
........

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

simple rectangles are pretty easy though. I did a progress bar here
http://www.jessikat.plus.com/pbar.html with a bit of javascript.

The other side of the information usually involves ajax call backs to determine
how much of the job has been done etc etc. I seem to remember doing that for a
project a while back. As I recall we had a cgi script that did

action "start" start off a long running job that detached itself from the web
server so the response could be made short

action "query" find out from an output file how much of the job has been done.

A javascript timeout periodically performed the query request and used the
response to update the ticker.
 
B

Bjoern Schliessmann

On Oct 5, 11:43 am, Bjoern Schliessmann <usenet-

Would this mean I wouldn't be able to have any fancy graphics
outputed such as the rectangles I mentioned before with different
filled in colours?

No, it wouldn't. I suggest you followed Diez' recommendation.

Regards,


Björn
 
D

Dorai

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.
 
C

crazychrisy54

simple rectangles are pretty easy though. I did a progress bar herehttp://www.jessikat.plus.com/pbar.htmlwith a bit of javascript.

The other side of the information usually involves ajax call backs to determine
how much of the job has been done etc etc. I seem to remember doing that for a
project a while back. As I recall we had a cgi script that did

action "start" start off a long running job that detached itself from the web
server so the response could be made short

action "query" find out from an output file how much of the job has been done.

A javascript timeout periodically performed the query request and used the
response to update the ticker.

That is pretty much exactly what I want! Can I ask how you have
presented the bar on the page i.e. embedded into a canvas? because I
can't get this to work on netscape 7 (which is a requirement) and
wondered if there was a way to get around this?
Cheers

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top