Talk:SVG

ZSVG
copied from User Talk:Clange

Where I could do with some help is with SVG and specifically with ZSVG which is SVG implemented using DTML in Zope. I found some interesting examples the other day at http://www.zope.org/Members/aho/ZSVG_Graph_1_2_0/ZSVG_Graph_1_2_0 and I have been attempting to adapt this without (so far) a lot of success. I will put some more background to my interests on my page at User:fletchjp. --Fletchjp 15:01, 3 January 2008 (CET)

I am using this code inside the combination of Plone http://plone.org/ and Zwiki http://zwiki.org/FrontPage both based on Zope http://www.zope.org/ - one of the interesting things is that there is little interest in RDF within the Zope set up. The only place I have seen any mention is in the CPS project http://www.cps-project.org/ which also uses Zope.

What I want to do with ZSVG is to be able to present as graphs the outcome of various calculations. I have some codes in C++ which do a lot of what I want to do, which involves symbolic algebra. For one example, see a paper I gave some years ago, http://www.ceac.aston.ac.uk/research/staff/jpf/papers/paper25/index.php At the end of the paper, Section 5, I discuss using MathML. I have moved on from that paper and these days use Ruby rather than Tcl as the top level language. I am moving to support Python as well as that is what Zope runs on and I prefer the environment to Ruby On Rails which is into a different market.

Coming back to the ZVSG_Graph code, I have made some progress with the DTML, in getting the parameters into the example code. It then crashes inside the XML part, which I have no way of debugging. I was thinking to backtrack and build some simpler examples of SVG and get going that way, as I have no need of the particular bar charts in the example. I need x y plots, such as Excel calls a scatter plot.

--Fletchjp 15:17, 3 January 2008 (CET)

Fred's reply
I tried to install ZSVG, but it turns out it belongs to the larger framework of Zope that I was not able to install. About your project, it deals with technical matters that I'm not really conversant with. Nevertheless, I would be really happy if you can extract a standalone SVG generator from Zope to produce diagrams. I also read quickly the introduction and end of your paper and I have a will quite similar: using a computer algebra to draw SVG graphs and even more to author scientific documents with MathML formulae. I talked a bit about this idea in the section "MathML can be exported to / imported from computer algebra systems" of my page http://www.maths-informatique-jeux.com/international/why_you_should_use_mathml.php.

What I want to do is to combined Amaya (the W3C's editor) and a computer algebra system (I think about Maxima, because it is free and is a general-purpose CAS) so that they can exchange data. The first produces valid XHTML+MathML pages and also deals with SVG (and even animated SVG see http://www.maths-informatique-jeux.com/international/mathml_with_other_standards/index.php ). The current problems with Maxima are that its implementation of MathML is not good and the plots it produces are not in SVG. Hence I believe I could rather experiment the interaction of Amaya with the CAS you have work on.

Comment from John
Thank you for the comments. Yes, ZSVG works with Zope, hence the Z in the name. There is a layer of code which is DTML, which is a Zope extension of HTML which conveys parameters to code written in SVG which actually does the graph. My guess is that the SVG code should be portable (standard). I don't know if it is used with MathML anywhere. If you haven't got Zope installed then forget ZSVG. I have it installed in my Zope and therefore can get at the XML code.

How you would get on with GiNaC would depend on what system you are running. It only works with the gcc C++ compiler and this means either a Unix system or else a cygwin system. It is in C++ language and needs to be compiled, except when compiled into a run time library and linked to Ruby or Python using SWIG. That is why I do my work with it on a Linux hosted within my Windows PC as a separate task.

--Fletchjp 22:51, 3 January 2008 (CET)

More about GiNaC
I have Amaya with Linux, and it is compiled using gcc (and I suppose is is used too for the Windows and Mac version), so I would be able to use GiNaC. I read on the WebSite of GiNaC :

"Its design is revolutionary in a sense that contrary to other CAS it does not try to provide extensive algebraic capabilities and a simple programming language but instead accepts a given language (C++) and extends it by a set of algebraic capabilities."

Hence I can directly integrate it using a C++ library. I would be interested to know more about its capabilities, and its interaction with MathML and SVG...

Reply about GiNaC
Fred

You can use GiNaC in any program written in C++, which then of course needs to be compiled. I wanted to be able to change the program without recompilation, so I used SWIG to interface GiNaC to Ruby and could integrate it also with other C++ libraries as I needed. I use this in my GlucSym project.

There is also a separate project to interface GiNaC to Python. I have just downloaded it and will test it when I get a chance.

I don't think that GiNaC can produce MathML directly. What I did was to add some extra code to my Ruby interface to generate content MathML. That has not got beyond the stage of proving the concept, but I see no reason why it should not be done for Python as well.

That work could then be integrated with other tools to pass information to SVG or other ways of web presentation.

One of the reasons I am interested in Zope is that it provides a way of incorporating Python code into web operations, in such a way that a Zope on Linux could call to run time libraries e.g. GiNaC. It is a matter of putting together a number of different tools.

One other thing. I think one of the problems I have with MathML is overcome in OpenMath - the ability to extend by adding user defined types. I want that for my work on Clifford Algebra. Objects in Clifford Algebra can be thought of as a Complex Number only more so.

--Fletchjp 13:23, 4 January 2008 (CET)