Monday, March 23rd, 2009

dojo.gfx in detail

Category: Articles, Dojo


Matthew Russell wrote the most in depth article on dojo.gfx that I have seen. It appeared in Linux Journal and has now been re-printed online.

The article runs the gamut. It starts off discussing the place that dojo.gfx lives in the Dojo world:

Then we learn about how gfx abstracts on top of the various underlying graphics subsystems that various browsers expose (Canvas, SVG, VML, Flash, Silverlight, …). gfx will choose for you automatically, or you can ask to use a particular rendered:

  1. <script type="text/javascript"
  2.    djConfig="gfxRenderer:'canvas'"
  3.    src="">
  4. </script>

Then we delve into the drawing API itself:

< view plain text >
  1. dojo.addOnLoad(function() {
  2.     var node = dojo.byId("surface");
  3.     var surface = dojox.gfx.createSurface(node, 600, 600);
  5.     rect1 = surface.createRect({
  6.         /* x and y default to (0,0) */
  7.         width : 200,
  8.         height:200
  9.     })
  10.     .setFill("red")
  11.     .setTransform([
  12.         dojox.gfx.matrix.translate(200,200),
  13.         dojox.gfx.matrix.rotategAt(45,100,100)
  14.     ])
  15.     ;
  16. });

From here Matthew covers topics such as manipulating groups, and how you can make areas moveable, and the 2D charting API.

Related Content:

  • A devil in detail
    In 1992 Cliff Stanford set up Demon, the UK's first low-cost Internet service provider. Cliff Saran catches up with him a...
  • Losing it in the detail
    Managers responsible for network security are being hampered by too many products and too many services, writes Andrew...
  • Detailed comparison: Antivirus
    Read the detailed comparisons on how the six all-in-one appliances reviewed in this bakeoff compared in supported protocols, reporting and updating...
  • Detailed comparison: Firewall
    How did the six all-in-one appliances reviewed in this bakeoff compare in application proxies, user authentication and other rule elements, and...
  • Internet flaw details revealed
    Security researcher Dan Kaminsky unveiled more details about a fundamental design flaw in the way the internet works at the Black Hat security...

Posted by Dion Almaer at 6:42 am
1 Comment

4.1 rating from 27 votes

1 Comment »

Comments feed TrackBack URI

Small correction: the Flash backend is being worked on but not finished yet, the rest (SVG, VML, Canvas, and Silverlight) are fully operational.

Comment by elazutkin — March 23, 2009

Leave a comment

You must be logged in to post a comment.