Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News jsFiction Releases jsDraw2D Javascript Library

jsFiction Releases jsDraw2D Javascript Library

This item in japanese

jsFiction announces the release of jsDraw2D, a Javascript library that allows developers to create graphics that include: basic shapes (e.g. polygon, arc, circle), filled shapes, and Bezier curves (linear, quadratic, cubic). Developers can also change the default origin of the coordinate system to any point in the div element containing the graphics and can choose either default or Cartesian coordinate systems. jsDraw2D also allows you to specify the scale of the drawing.

jsDraw2D joins a small but growing number of products that offer Web developers the ability to deliver advanced graphics capability using native Javascript. Like most of its competitors, this product is restricted to a handful of browsers: IE 7, Mozilla Firefox 3, Google Chrome, Opera 9.64 and Safari 4. Browsers must support some of the HTML5 specification, especially the use of the canvas tag.

Delivering interesting graphics in a Web browser has been a challenge for some time. Developers had to master yet another technology like Flash or Flex (along with the associated browser plug-in to run the code) or utilize low level tools like SVG or VML. Several alternatives have been offered with the intent to simplify graphical development and delivery. Walter Zorn's DHTML library provides simple shapes and lines in a javascript vector graphic library. Raphael is another example that wraps SVG or VML within javascript to create DOM consistent objects. Another example of a javascript library that provides simple graphic capability is Ortho. jsDraw2D offers some advanced capabilities (Bezier curves and scaling are two examples) that other libraries do not.

Perhaps the most sophisticated and capable Javascript based graphics offering is Sun's Lively Kernel project. Lively Kernel is a javascript implementation of Morphic, the graphics system developed for the Self programming language but most often encountered in Squeak (Smalltalk). Lively Kernel includes development tools that allow JavaScript applications to be inspected and modified from within the system itself. Unfortunately, Sun recently terminated this project so its future lies in the Open Source world.

jsDraw2D is the initial offering from jsFiction but they have plans to "create various innovative JavaScript libraries or applications that can help JavaScript developers, web developers or webmasters to extend the capability and functionality of the JavaScript." jsDraw2D is available as open source under the LGPL license.

Rate this Article