Draw your visualization on canvas!

Primer.js is a tiny JavaScript library that simplifies the workflow of creating graphics right in the HTML using the <canvas> object. Simply create a Primer() object in a DIV of your choice and then you’re ready to start drawing.

The library provides some basic shapes right away like curveTo, roundedRect and provides also interaction functionality like mouseout and mouseover. The syntax for the shapes differ a bit from AS3, what irritated me for a moment, but you get used to it after a short amount of time.

So, if you need to quickly draw a graph and provide some basic interaction functionality, primer is a neat package to use. There are some more powerful libraries out there like the Google Visualization API or Raphaël JS but judging after a first glance Primer.js deserves some attention.

Share this article

Subscribe for more

Give Feedback