[dojo-contributors] Re: Draft: Unified 2D graphics subsystem for Dojo

Tom Trenka ttrenka at gmail.com
Tue Jun 6 18:57:41 EDT 2006


Quick shot thoughts here:

I like the idea of using an SVG subset and using client-side XSLT to
> transform it to VML. That *ought* to get a picture into the browser faster
> than interpreting it with javascript. We could then lazily instantiate
> javascript objects from the generated DOM nodes as required for
> interactivity.


I'm thinking  (and hoping) that parts of this translation will be
Dojo-specific, in that attach points will be preserved.  If I do it right
(started working on it), the translation would happen *before* the Dojo
parser has at it--and we might even consider letting it be a separate build
kind of thing, so that you could have VML spit out at design time for
manipulation.  Certainly that would be a hell of a lot more efficient.

It may really be the Wrong Thing, but I'd like to do some benchmarking and
> prototypes to check -- I think there's a use for both Canvas-rendered
> graphics as well as DOM-oriented graphics. That's why I investigated the
> DirectAnimation api recently. It may be best to render some things one way
> and some another. Worth a try, at least.


I think that we should pursue both paths as well; there's nothing wrong with
having both a procedural and a declarative API, as long as they cooperate.
Of course, my end goal is that vector definitions are done in SVG only, and
Dojo handles the cross platform issues.

Just so we're clear, I'm proposing 2 things:
1. the SVG to VML translation
2. the drawing API

As far as transformations go, that was the latest thing I was working on
> for the drawing editor. I was finding it mandatory to perform them myself
> even for simple rotations -- I needed to do the matrix calculation both to
> be able to specify the center of rotation and to calculate the positions
> of the "handle" objects once the object they affect was rotated.
>
> For v1 of the library, what's the order of use cases?
>
> 1) Generic, canvas-compatible drawing surface for charting and widgets
> 2) DOM-style drawing objects for editable shapes
> 3) Animation for cartoons and presentational effects
> 4) Text effects? (VML and SVG both support text effects that HTML DIV
> elements cannot).
>

Animation for SVG (as implemented in FF) is poor right now--if you're
thinking that it will support SMIL-type structures.  However, animation
techniques that are used in Dojo for HTML work just fine right now as it is,
so I'd advocate not really worrying about that use case as of yet.

Text manipulation...that's another story.  My instinct is to say we use
mixed documents for that always (i.e. embed an HTML element inside an SVG
one for text handling, etc)...I'll have better info soon enough as to what's
possible in terms of transformations in VML.

trt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20060606/95a38ae0/attachment.htm 


More information about the dojo-contributors mailing list