I (also it seems) submitted a proposal on the SVG drawing idea. I'm also posting a copy here to get any comments.
Please excuse any misnomers I might have. I'm calling it a Drawing Module, however I think API might be a more appropriate term. I currently only have a basic grasp on the structure of Drupal.
I've started a section on my personal site to put up more information located here.
Abstract
Currently, Drupal has no SVG (scalable vector graphics) generation capabilities
and limits a Drupal plug-in developer to either using external libraries (e.g.
PEAR's XML_SVG), manually generating SVG, or bypassing SVG entirely and using GD
(or any other similar graphics libraries).
I will implement a drawing module and a SVG plugin for said module into Drupal
to give plug-in developers SVG capabilities and keep open the choice to add
different drawing API's into the drawing module.
Some corrections: When I discuss the hierarchical, in the SVG spec as far as I can tell only the 'g' elements can have children. However as far as the drawing module is concerned I may let all objects have children (so I can render children based on the (x,y) coordinate system of their parents) or I may only let a subset of objects have children (namely the NULL/g object and possibly the rectangle/polygon object as this would be useful in GD and other libraries).
Detailed Description
Since SVG is an open, XML based standard, implementation should be basic, albeit
lengthy to ensure strict conformity and encompass a useful, but light weight
(due to time constraints), subset of SVG features into the drawing api.
I like to develop with an end use in mind to help give me a sense of direction,
and I mostly see a SVG module being used in the graphical representation of
statistics (e.g. a tool akin to Webalizer). Along these lines I will include
lines, arcs, circles, ellipses, rectangles, text, and filling/stroking functions
features to the core Drawing module as they are the most common among all
drawing libraries.
The drawing module will have basic canvas management, namely basic coordinate
systems and translated coordinate systems (based off of individual elements,
useful when placing text in relationship to its parent rectangle). The feature
set within the actual drawing module will be minimal to allow for easier
implementation of less feature-rich libraries (like GD).
I will develop the drawing module with the ability to have format specific
commands that other drawing functions may not have the ability to do. This
concerns SVG as I intend to implement béziers (curves, cubic, and quadratic),
gradients/patterns, CSS styling (based on a preset theme, or dynamically based
on the current theme), Metadata, linking, transformations, and basic fonts. If I
feel time permits I would like to implement SVG filter effects and provide a
developer the option to embed JavaScript to take advantage of SVG's scriptable
nature. Other SVG features (compositing, clipping, and animations) will be taken
into account as I develop so that there will be a place for either myself after
the end of this project or any other developer to come in and implement.
Each feature (except for styling, metadata, linking, etc.) will each be
transformable, implementing more complex canvas management features behind the
scenes.
Due to SVG's XML nature, I plan to implement the drawing module hierarchically
with SVG in mind. The idea is to give the image a DOM structure, allowing for
easy modification and, in particular, easy export to the SVG format. The
hierarchical nature will provide benefits to other libraries as well as the
developer does not need to worry about z-indexes and the order in he adds
elements to an image; he will merely have to be aware a child will be drawn on
top of a parent.
By the end of this project, projects like GraphStat
(http://drupal.org/node/33946) will be able to perform drawing operations with
much less code and be able to have the option for various outputs and libraries,
depending on the target users and hosting server's abilities.
Benefits to Drupal
-
Embracing open standards by implementing and at the same time promoting
them. -
Become leading edge (with concern to dynamic graphics) by facilitating
plug-in developers, enabling the development of more plug-ins and attracting
new developers.
Success Criteria
- Implementation of a highly modular and extensible drawing module.
- Implementation of a plug-in for said drawing module
- Null: Used for translated coordinate systems (in the SVG spec this would be a 'g' element).
- Lines: Lines, Poly-Lines, Arcs, and Béziers.
- Primitive Shapes: Circles, Ellipses, Rectangles, and Polygons.
- Text: Font (face, size, color, etc.), Display (rotation, kerning, etc.).
- Colors: Gradients and Patterns, Fills, Strokes.
- Others: CSS, Metadata, Transformations, and Linking
integration into current theme)
Other (Time-Dependant) Goals/Ideas
-
Editing existing graphics (more geared towards GD/ImageMagick
implementations). - SVG Filter effects.
- SVG scripting (and Interactivity).
- SVG Animations.
Road Map
-
Till Mid June: Learn and become intimately familiar with Drupal internals
and Drupal's theme engine. Make contacts with Drupal developers familiar
with modules similar or pertaining to this project as resources (along with
the mentors). -
Till End of June/Early July: Implement rudimentary drawing module and ensure
its working (create empty "shell" plug-in for testing and future use with
SVG plug-in). -
Till End of July/Early August: Implement SVG plug-in, making changes within
the drawing module where needed.
Testing will occur during the entire phase of the project. As the SVG module
nears completion I will begin releasing code so that I can enlist any interested
Developers in helping test both the drawing module and the SVG plug-in.
Comments
welcome
Hi, finally some competition :)
There is a graphing-svg group here: http://groups.drupal.org/graphing-svg, you might want to check it out.
Actually I think there is a
Actually I think there is a 3rd on it's way according to another email I got :-)
Competition is always good
Competition is always good :P
Good luck!