473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

WebBased Vector 2D Graphics

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

Oct 5 '07 #1
7 1648
cj***@bath.ac.uk wrote:
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

--
BOFH excuse #369:

Virus transmitted from computer to sysadmins.

Oct 5 '07 #2
On Oct 5, 11:43 am, Bjoern Schliessmann <usenet-
mail-0306.20.chr0n...@spamgourmet.comwrote:
cj...@bath.ac.uk wrote:
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

--
BOFH excuse #369:

Virus transmitted from computer to sysadmins.
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

Oct 5 '07 #3
cj***@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
Oct 5 '07 #4
Diez B. Roggisch wrote:
cj***@bath.ac.uk 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.
--
Robin Becker

Oct 5 '07 #5
cj***@bath.ac.uk wrote:
On Oct 5, 11:43 am, Bjoern Schliessmann <usenet-
>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?
No, it wouldn't. I suggest you followed Diez' recommendation.

Regards,
Björn

--
BOFH excuse #437:

crop circles in the corn shell

Oct 6 '07 #6
On Oct 5, 4:28 am, "Diez B. Roggisch" <de...@nospam.web.dewrote:
cj...@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.

Oct 6 '07 #7
On Oct 5, 12:41 pm, Robin Becker <ro...@reportlab.comwrote:
Diez B. Roggisch wrote:
cj...@bath.ac.uk 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 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.
--
Robin Becker- Hide quoted text -

- Show quoted text -
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

Oct 16 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Markus Elfring | last post by:
Hello, A lot of clipart libraries offer free raster images. I am looking for a similar collection for vector graphics. Do you know a gallery or archive for the following formats? - Scalable...
8
by: Stefan Burger | last post by:
Those of you who are in need for drawing vector lines might be interested in the following code. DrawLine( x1, y1, x2, y2, color ) draws a vector line from any Point x1,y1 to any Point x2,y2 in...
3
by: Ska | last post by:
I've just finished to write the 0.1b release of amanith ( www.amanith.org) a library to handle vector graphics fully written in ANSI C++ with STL, it's crossplatform (win, linux, bsd, mac, irix for...
0
by: Eric | last post by:
I'm also interested in finding out more about using vector graphics when designing the UI in Windows forms applications. I know a lot about GDI+ and raster graphics, but vector graphics is a new...
4
by: Nick K. | last post by:
Is there any native ,Net assemblies or open C# source code that can perform vector to raster conversion?
1
by: juvi | last post by:
Hi, is there a tool for Vector Graphics Maps creation? (maybe a free version?) If yes: Can I use the created map with Microsoft MapPoint? Would it be possible to create a map of a building and...
5
by: Bytter | last post by:
Hi ppl, I've already posted this message through the mailing-list, but it seems it never arrived here. Strange... Anyway: I need to render high-quality vector graphics with Python. I was...
1
by: Jay | last post by:
I'd like to experiment a little bit with vector graphics in python. When I say 'vector graphics' I don't mean regular old svg-style. I mean vector game style as in simulation of vector beam drawn...
4
by: clintonG | last post by:
Boy that's a helluva subject heh? But that's what I'm looking for. A navigation control that has a series of rectangles (each representing a star in the pattern) where each rectangle is connected...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.