The half of the Summer of Code period seems to have passed so quickly as a Cray XT4 prints out "hello world". This not only means these machines are very fast, but also that I enjoyed much of the time i spent working on my project. Lets have a quick overview what has been done so far, and what is to be done in the second term.
In short the drawing module provides an easy, FAPI-like syntax for other modules to create SVG based graphics. It supports all the basic SVG shapes, and Path, group, as well as basic styling (fill, stroke, opacity), and all available (in the specification) transformations.
In case of a complex shape, the path SVG element can be used. The module offers a way to define the points explicitly, giving the long series of point coordinates that would otherwise go after the d attribute of the element:
<path d="M 100 100 L 300 100 L 200 300 z" fill="red" stroke="blue" stroke-width="3" />
The example is the syntax for a red triangle in SVG. Via the Drawing API:
$canvas['path_example'] = array(
'#type' => 'drawing_path',
'#explicit' => TRUE,
'#points' => 'M 100 100 L 300 100 L 200 300 z',
'#stroke' => 'blue',
'#stroke-width' => 3,
'#fill' => 'red',
For a more machine-friendly way a structured array syntax is also provided, as well for the polyline SVG element. There is a simple demo about the potential usage of more complex paths can be found here. There is also a capability to have already saved SVG files displayed, but due to a more complex browser-dependence issue this needs more work and testing.
The array syntax can be used to build other functionality around displaying graphics, like using it for graphs, a graphing API. A basic API for graphs is included in the current (5.x-2.x-dev) release of drawing module, you can check out a small demo here.
To be done
Though most of my milestones previously set are met, there is still a lot to do. First of all I am intending to do a great code cleanup, and finishing the graphing module. To help developers, who would be interested in the project, my next priority is to assemble a complete documentation on the drawing module, its syntax. For demonstration several examples (like those on the links above) can be found in the module releases tarball on the project page. These will be probably removed, but to be found in the documentation if necessary.
Any comment, suggestion, criticism is appreciated.