You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by "Adam R. B. Jack" <aj...@trysybase.com> on 2004/04/02 21:40:36 UTC

Generating SVG from Python

Anybody see an reason (licensing, other) why we should not use this:

    http://www2.sfk.nl/svg

in Gump? [I found nothing else via Google. I also looked on python.org
(including in the package index) and in ASPN cookbook.]

We use logging [we even bundle it for Python 2.2], we use wxPython, so any
reason we oughtn't use this? We could make it optional (detect if it is
installed, or not.)

I'd like to use it to generate some SVG images. I believe that some browsers
can render [right term?] them raw (IE just seemed to, albeit slowly), but I
also believe that Forrest uses Batik to generate PNG (I assume for browser
portability). Again, I'll try to make this optional, so folks don't have to
give up the cycles if they don't wish to.

I'd like to start simple (perhaps generate some slider type images to show
FOG values, etc.) Eventually I'd like to draw some graphs representing
dependency tress, etc.

Any feedback? Any objections?

regards,

Adam
--
Experience the Unwired Enterprise:
http://www.sybase.com/unwiredenterprise
Try Sybase: http://www.try.sybase.com


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: Generating SVG from Python

Posted by Antoine Lévy-Lambert <an...@antbuild.com>.
Adam R. B. Jack wrote:

>Anybody see an reason (licensing, other) why we should not use this:
>
>    http://www2.sfk.nl/svg
>
>in Gump? [I found nothing else via Google. I also looked on python.org
>(including in the package index) and in ASPN cookbook.]
>
>  
>
The license seems OK for me (see below)

>I'd like to use it to generate some SVG images. I believe that some browsers
>can render [right term?] them raw (IE just seemed to, albeit slowly), but I
>also believe that Forrest uses Batik to generate PNG (I assume for browser
>portability). Again, I'll try to make this optional, so folks don't have to
>give up the cycles if they don't wish to.
>
>  
>
 I am a SVG fan, so +1.
If somebody is interested, I know how to install the Adobe SVG Plugin in 
FireFox on Windows
(not easy, I found some information about this at different places on 
mozilla forums).

>I'd like to start simple (perhaps generate some slider type images to show
>FOG values, etc.) Eventually I'd like to draw some graphs representing
>dependency tress, etc.
>
>Any feedback? Any objections?
>
>  
>
No Objection !

Cheers, :-)

Antoine

Here is the license notice I found in the source code of SVGdraw.py 
(there seems not to be any separate
license file).

##Copyright (c) 2002, Fedor Baart & Hans de Wit (Stichting 
Farmaceutische Kengetallen)
##All rights reserved.
##
##Redistribution and use in source and binary forms, with or without 
modification,
##are permitted provided that the following conditions are met:
##
##Redistributions of source code must retain the above copyright notice, 
this
##list of conditions and the following disclaimer.
##
##Redistributions in binary form must reproduce the above copyright notice,
##this list of conditions and the following disclaimer in the 
documentation and/or
##other materials provided with the distribution.
##
##Neither the name of the Stichting Farmaceutische Kengetallen nor the 
names of
##its contributors may be used to endorse or promote products derived 
from this
##software without specific prior written permission.
##
##THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
"AS IS"
##AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
##IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
PURPOSE ARE
##DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
LIABLE
##FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
##DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
##SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
##CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
LIABILITY,
##OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 
THE USE
##OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

##Thanks to Gerald Rosennfellner for his help and useful comments.


Here a programming example from the same source file :

    d=drawing()
    #then you create a SVG root element
    s=svg()
    #then you add some elements eg a circle and add it to the svg root 
element
    c=circle()
    #you can supply attributes by using named arguments.
    c=circle(fill='red',stroke='blue')
    #or by updating the attributes attribute:
    c.attributes['stroke-width']=1
    s.addElement(c)
    #then you add the svg root element to the drawing
    d.setSVG(s)
    #and finaly you xmlify the drawing
    d.toXml()
   



---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: Generating SVG from Python

Posted by "Adam R. B. Jack" <aj...@trysybase.com>.
"Nicola Ken Barozzi" <ni...@apache.org> wrote:

> It does not seem easier to use than simply outputting SVG as text strings.

I'm starting to agree with you, but as I get started w/ SVG (the 700 page
spec is too much to consume in one sitting, and I certainly won't print it)
it is nice to have some guidance/samples/framework. If I become an SVG pro I
can remove/replace.

> > I'd like to start simple (perhaps generate some slider type images to
show
> > FOG values, etc.) Eventually I'd like to draw some graphs representing
> > dependency tress, etc.
>
> For charts I'm getting there. I've finished importing the xml system in
> JCharts and I'm now working on integrating it in Forrest :-)

Cool, then I'll avoid charts. I've done simple 'scales icons' (green = %
success, red = % fail/prereq) and I'm learning. My goal is a dependency tree
diagram annotated with details, and I have a plan that I think will allow me
to achieve that. I want to draw the dependency tree for a project, with
color/thickness depecting FOG up the stack, and such.

This is a lot of fun, the first real extension I've found time to do.

Let me know if you need anything from me, for your charting.

BTW: Are you as comfortable charting from XML as from SQL/RDBMS? If we move
to that, does it help you?

regards,

Adam


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: Generating SVG from Python

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Adam R. B. Jack wrote:
> Anybody see an reason (licensing, other) why we should not use this:
> 
>     http://www2.sfk.nl/svg
> 
> in Gump? 

It does not seem easier to use than simply outputting SVG as text strings.

...
> I'd like to use it to generate some SVG images. I believe that some browsers
> can render [right term?] them raw (IE just seemed to, albeit slowly), but I
> also believe that Forrest uses Batik to generate PNG (I assume for browser
> portability).

Correct.

It also generates svgs and thus pngs from ASCII files:

   http://incubator.apache.org/incubation/Process_Description.html

The source of the image:

http://cvs.apache.org/viewcvs.cgi/incubator/site/incubation/incubation-process.aart?view=markup

...
> I'd like to start simple (perhaps generate some slider type images to show
> FOG values, etc.) Eventually I'd like to draw some graphs representing
> dependency tress, etc.

For charts I'm getting there. I've finished importing the xml system in 
JCharts and I'm now working on integrating it in Forrest :-)

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: Generating SVG from Python

Posted by Leo Simons <ls...@jicarilla.org>.
Adam R. B. Jack wrote:
> Anybody see an reason (licensing, other) why we should not use this

not really.

> Any feedback? Any objections?

probably a good idea to get in touch with the author :D

-- 
cheers,

- Leo Simons

-----------------------------------------------------------------------
Weblog              -- http://leosimons.com/
IoC Component Glue  -- http://jicarilla.org/
Articles & Opinions -- http://articles.leosimons.com/
-----------------------------------------------------------------------
"We started off trying to set up a small anarchist community, but
  people wouldn't obey the rules."
                                                         -- Alan Bennett


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org