I would like to share my proposal (already submitted) with the community, in the hope to receive some feedback regarding ideas on what SVG could be used in the future in later modules, and also regarding how you would like to have such an API implemented. Any feedback is very much appreciated. I started to collect ideas, and possible targets for this project here. I am also planning to do a small investigation into KML.
I cut out not relevant parts, such as Bio, Roadmap and Success Criteria.
Abstract
This project is about to implement a generic graphic library and an SVG drawing API according to the SVG 1.1 specifications, creating a platform upon wich developers can build specific graphic modules for various purposes.
The Project
I will focus on implementing a developer-friendly API for creating and handling valid SVG primitives. Aiming for an API I will but merely implement the basic shapes, provide clean usage and modification possibilities for other modules. To do that I have to create a library for drawing, therefore the project will consist of two parts. First implementing a drawing module, that consists of a drawing library of simple shapes and a canvas management part:
- lines, path, polyline
- shapes: rectangle, ellipse
- text
- canvas management (objects have relative coordinates within canvas, objects within canvas can be handled together)
with simple properties (ability to set linewidth and color, and the fill color of shapes). These settings will be done via the hook system in a general drawing.module.
The second part is an SVG toolkit, which can draw and modify the drawable shapes. Three groups of function will exist in this kit:
- general SVG behaviour control (validity checking via javascript, ability to turn it on/off)
- drawing SVG shapes
- distorting functions (Modification of shapes, basic distortions like rotate, skew, optimal calculation of their new coordinates. From my studies I am familiar with vectors and their transformations, therefore it will be a relatively easy task to implement these basic distortion functions. For later usage these transformations drastically widen the range of possible applications. Since this is pure vectorgeometry, with general formalism it could be implemented in the drawing.module too.)
Benefits for Drupal
- The implementation of a generic geometry module allows developers to use it for implementing different drawing related modules easily, and it reduces their redundancy of implementing the same geometry over and over again (such projects could be image request with overlays, graphical statistic interface with graphs etc). The support for canvas will help creating and manipulating complex objects easily.
- The support for SVG is a step towards a not yet widely used specification, but by implementing an SVG drawing API, matured in time Drupal will provide a modern, fast, dynamic graphic system. Though SVG is not yet fully (or at all) supported by many browsers, all signs indicate it will become a mainstream format.
Benefit for the Community
Practical fields, such as geography, cartography are already actively using SVG, exploiting its dynamism, to handle parts of an image separately, e.g. via asynchronous calls to a database. Astrophysicists and astronomers work with extremely huge databases, and users use the data extracted from them (starmaps, data from surveys). Exploiting the dynamic features of SVG (async calls for filter change, scale change etc) would reduce the database servers usage by only requesting the needed information. Combining it with Drupal could allow professionals to interact (people from far away institutes often work in one group) and could also help students to get involved more easily in the making of science (allowing students to contribute, which is not an easy task these days).

Comments
This is fascinating stuff,
This is fascinating stuff, and I am definitely looking forward to seeing this functionality. Do you plan to have it be purely hook and code driven, or will the end-user be able to use it as a web-based mspaint? Or is that up to other authors building on this?
Best of luck, and the community is here to support you. :)
Drupal Dojo - Thelifeofme.com
purely hook
Thank you for the support, im really happy to be part of the community.
According to what I planned the end-user wont see much about this particular module, more like about the modules built upon this. This will only allow other modules basically to say "dude, draw a rectangle here, and here in svg please." and it will use these modules to do so. But it would be able for a module writer to create a painting module, where you can create a complex canvas structure, and save it.
I was considering to provide basic canvas structures, for example a structure for a graph would contain two axes, and some scaling, but I feel this might be out of scope.
Very nifty - I agree, the
Very nifty - I agree, the scope you've described sounds plenty challenging enough without having to design some kind of nightmarish ajax interface tie-in to allow the end-user to harass it directly.
Drupal Dojo - Thelifeofme.com
in case you are interested
in case you are interested you are welcome to join the graphing-svg group, there is a more detailed plan on the general drawing module, and i am soon planning to make one for the SVG too.