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

Eugene Lazutkin eugene at lazutkin.com
Mon Jun 5 13:55:15 EDT 2006

Tom Trenka wrote:
> I'm sorry I haven't commented on this yet, I'm still looking it over.  
> First impressions: it seems to be ok but it doesn't really seem to allow 
> for attaching any kind of events to individual rendering definitions 
> directly (just like Canvas doesn't)...at least at first run-through.

surface.endPath() returns a DOM node, which can be used for attaching 
events in using dojo.event.connect().

> I'll look it over well today and post more commentary.  I do agree with 
> the Canvas emulation approach (although I would consider going back to 
> OpenGL and seeing if there's more we can do) but I would definitely like 

I still remember OpenGL reasonably well. What exactly caught your eye?

> to have a better definition of why this is being proposed; what problems 
> does it solve and how?  This was my initial issue with coming up with a 
> vector API; it seemed like I was working on a solution that had no 
> (well-defined) problem.

Sorry for leaving whys out.

It allows writing graphical widgets (e.g., charts of any kind) in a 
browser-independent way. Why do I want that? We keep all code for such 
widgets in one place instead of in SVG/VML/Canvas-specific files. It 
buys us:

1) Write a chart once.
2) Debug its logic once.
3) Reduce our overall code base.
4) If user uses several graphical widgets, we can reduce the download size.

Why vector graphics? Why DOM-based approach? I want an _interactive_ 
graphics instead of pretty pictures.

1) Interact with charts: DOM-based event processing --- connect directly 
to your objects.
2) Animate objects: DOM-based picture modification (not in the spec yet, 
see notes in the original proposal).
3) Print your charts at printer's resolution.

My short-term goal is: "As a proof of concept I want to have a simple 
demo, which shows a pie chart. When user hovers or clicks on a pie 
piece, a tooltip pops up offering additional information. Ideally it 
should work with both SVG and VML seamlessly. Canvas-able browsers 
should show the same picture, but no fancy tooltips."

I hope it clarifies the intent. I am looking forward to your comments 
and more questions.



More information about the dojo-contributors mailing list