Archive | January, 2009

02 January 2009 ~ 0 Comments

Serving SVGs with Ruby on Rails

I’ve been working with Rally’s Ruby API intermittently over the last several weeks, as part of a side project to create some alternative visualizations of SCRUM release progress.  I’ve just now finished gathering the data from Rally and am moving on to creating the charts.

My options are Google’s Chart API (or another hosted graph creator) or to install one of the more popular Ruby gems (Gruff Graphs or Scruffy) though this doesn’t appeal to me as they both require ImageMagick and I want to minimize platform dependency down to native Ruby.

After some recent experience with SVG at the office, it ocurred to me that having a designer make a nice looking chart in Adobe Ilustrator and exporting it to SVG would be pretty slick.  You start with a hardcoded chart as your template, insert some dynamism and you’re all set.  Though it looks like the SVG exporter is still using a DOCTYPE and this is no longer recommended; an easy fix though since it’s all XML (ta-da!).  This assumes your browser supports SVG (FF3, Safari 3, Opera, not IE7).  Fortunately my project is internally focused, so requiring an alternative browser is acceptable.  A luxury, I know ;-)

Thus began a small adventure into just about every Rails nook and cranny, so save yourself some time and learn from it!

Continue Reading