I’ve been trying to learn about client-side testing, and have started learning about Jasmine. I started working on an example, which is on my github at https://github.com/ragingsquirrel3/my-jasmine-example. I haven’t written any specs… yet.
Monthly Archives: October 2012
Adding Bar Graphs to quacky-charts
This week, I’m going to try to add some new kinds of graphs to quacky-charts. I think I’m going to start with bar graphs, using Rickshaw.js. I already have a little JS base to work from here: http://jsfiddle.net/ragingsquirrel3/HfAMc/. Now, it’s just time to coffeescriptize it, and get the server-side generators and builders up!
quacky-charts, one week in
Last week, I published a very basic version of quacky-charts, a gem that I’ve been working on. The goal of quacky-charts is to give Rails developers the ability to build pie charts using client-side tools (D3, for now), and configure them using a simple, Ruby syntax. My plan for quacky-charts is to make it work well for pie charts, and then try to add some additional chart and graph types once I’m comfortable with the pie chart builder. In the past week, I’ve accomplished some goals, including:
- some basic RSpec tests
- CoffeeScript D3 initialization drawing charts from data configured in the controller
- clean configuration syntax
Next week, I’m going to work on some additional features. Ideally, I’d like to get some sort of client-side testing framework in place.
Introducing quacky-charts, a gem to add D3 pie charts to Rails apps
I just started a new open-source project at https://github.com/ragingsquirrel3/quacky-charts. The goal is to provide a powerful, easy-to-use (and customize) tool for Rails developers to quickly add graphs to their apps. I know, there are a lot of tools out there already. However, I’ve found that most of the best tools (D3, Rickshaw.js) are JavaScript tools. I want to abstract these tools to move the configuration to Ruby. It will be perfect for Rails developers who don’t have the time or experience to configure these tools on the client-side.
Although the basic functionality is already there, it’s still VERY much a work in progress. So far, it only draws pie charts with random data. That will change very soon. Here are some things I want to achieve as soon as possible:
- the ability to configure data from the controller, and have the chart draw itself based on that data
- rspec testing
- additional graph types
Stay tuned for updates!
Simple D3 Pie Chart Example
All the D3 pie chart examples out there are pretty complicated and crowded with features you probably don’t want. Here’s an example of one that’s pretty basic: http://jsfiddle.net/ragingsquirrel3/qkHK6/. I’m still working to make it simpler.
It’s based on this example: https://github.com/mbostock/d3/blob/master/examples/donut/donut.html.
Just for Fun: A Rails 3 Boilerplate with HAML, Mongoid, and Twitter Bootstrap
Lately, I’ve been exploring some tools that make life easier for Rails developers. I decided to make a boilerplate app that has a few of my favorite tools installed and ready to go. Specifically, this app has HAML, Mongoid, and Twitter Bootstrap. With these tools included, it is easy to develop powerful, beautiful Rails 3 apps.
In the future, I’d like to edit this boilerplate to include some additional tools. Eventually, I’d like to write a post, explaining how I installed these tools. For now, here’s the code: https://github.com/ragingsquirrel3/super-rails-boilerplate.