A proposal for declaritive drawing (<replicate>) to be added into SVG

Please take a look at   http://srufaculty.sru.edu/david.dailey/svg/SVGOpen2010/replicate.htm  . Most of the examples work in the major five SVG browsers.

I have talked with a number of you over the past 1.5 years (since SVG/Nuremberg when the idea came to mind) about a <replicate> tag.  The idea is this: SVG with SMIL already has a mechanism for changing shape, position, color, etc. of objects over time. How about we consider taking snapshots of that movement and overlaying those snapshots to simulate something like a the <contour> (discussed in [1]) ?

It would be a declarative drawing tool, acting upon space much like SMIL acts upon time. It should be easy for authors to use, and my experiments with it in the past day or two since I got my code working, suggest that it is.

It would provide a way of making gradients (or rather gradient like objects) that are not linear nor radial [2], of making patterns that are non rectangular [2], and of making shapes that begin to approximate 2.5-dimensions.

Eric D. and some others suggested that it would be best, if I wish to pursue this, to actually build a working demonstration. I hope to present one at SVG Open in August/September, but in the meantime I hoped the WG could think about a nascent proposal, still being constructed (with plausible syntax for <replicate>, <replicateMotion>, <replicateTransform> etc.).

What it does so far is to use JavaScript to parse <replicate> tags (used much like <animate> tags) and then to clone nodes and place them into the DOM (ultimately, perhaps into a shadow DOM) with the replicateAttributes being modified over a specified number of intervals within the range specified.

Currently, it handles "from" and "to" for numeric values and rgb values, for a wide range of attributes. "values" is handled (I think properly) for numeric values only.

Extensions to replicateTransform are obvious, as would be the <replicateAttribute attributeName="d"> to overlay interpolated paths as in a <contour> map.  Replicating along a path, likewise would give us much of the same functionality as diffusion curves, I think, but not as much I think, since triangular blends as seen in the tri-colored teardrop are a bit kludgy as you will see. At the same time, however, the use of replicate to offer tilings and other patterns will make it considerably richer in scope.

The advantage is that the syntax and programming to handle replicate will be relatively easy, I think, for implementers, since so many parallels to <animate> exist. I should point out that the code underlying these examples was written in about four days, with most of that time spent hassling with cross browser issues in DOM handling. Individual implementers don't have to worry about cross-browser stuff.

Anyhow, a more complete presentation will be available in August, but I wanted to go ahead and mention and demonstrate this evolving proposal now, before the WG has made its mind up about the directions it will be heading.

>From an author's perspective, you will see that the markup code is remarkably concise yet readable and understandable.

Respectfully,
David


[1] http://srufaculty.sru.edu/david.dailey/svg/Spec.html
[2] http://srufaculty.sru.edu/david.dailey/svg/SVGOpen2008/edges_of_plausibility.htm

Received on Tuesday, 6 April 2010 18:01:19 UTC