![]() |
Although Ortho is unable to draw diagonal or curved lines directly, you can combine Ortho primitives with images of these elements to construct a wider variety of graphics. Compared to using Flash or Canvas, this approach is a bit of a hack, but there is nothing wrong with that if it produces the result you want.
In the top left corner you see images of a circle. The circle is predrawn in a graphics application and then displayed with Ortho. You might use this in a graphing application.
The top right corner shows how images of two diagonal lines on transparent backgrounds can be stretched and overlaid to create more complex graphics.
In the lower right corner images of arrow heads and a diagonal line are combined with horizontal and vertical lines. This hack is a useful way to extend simple diagrams.
The diagonal lines in the lower left corner are all scaled versions of a single image of a diagonal line. Although the color/density of the lines does vary on scaling, this can still be a useful technique.
The central rounded box consists of five rectangles and four images of rounded corners. Bear in mind that this collection of objects can be easily grouped under a single DOM element so that the entire box can be bound to mouse events, etc. for user interaction.
You can program all of these directly in JavaScript but the combination of Prototype and Ortho makes this task much easier.
![]() |
Ortho © 2007 Robert Jones | Freely Distributable (MIT License) |
![]() |
Craic Computing LLC Seattle, WA, USA |