I've just released my Poorman's Trends Rails plugin as an excuse to do something with my GitHub account. Much like its distant cousin, Poor Man's CRM, this software aims to be plug-and-play, self-sufficient and useful enough to make sense of existing data.
3 Steps to get it:
- Install into vendor/plugins with
./script/plugin install git://github.com/choonkeat/poormans-trends.git - Add 1 line into your existing controller, e.g.
admin_controller.rbinclude Poormans::Trends - Point your browser to
http://yourserver/admin/poormans_trendsand Viola!
You should see a simple page greeting you, like in this screenshot:
Pick a Model class, and you should see some pretty graphs making their AJAXy entrance:
What's happening is that a few interesting columns are picked up from
the Model's table and a few popular values are picked up from those
columns. A count is done for all of them, divided up by weeks and
spitted out as HTML tables. These tables are then turned into pretty
charts using the nice HTML-table-to-canvas javascript library from Filament Group.
Without configuration nor knowledge of what your application does, is there any hope that it can make sense?
That's where the "picking of interesting columns" come in. Assuming zero domain knowledge of your application, I'd say the foreign keys are most interesting (in Rails convention, any column ending with "_id"), together with sub-classes ("type" and any columns ending with "_type"). The time aspect relies on the Rails convention of using "created_at".
The end result actually looks pretty good for something requiring no configuration! :-)



Cool. I am going to try this. I think this comes really close to what I was looking for. I would like to make the "trends" panel of my site myself, so this could very well be a good starting point. Thank you.
Posted by: S2 | April 16, 2008 at 09:39 PM
@s2 lemme know how it works out for ya! :-D
Posted by: choonkeat | April 17, 2008 at 12:58 AM
Dude, I've been wanting something like this for ages! I have a half assed version implemented, but this looks really great. Can't wait to try it out.
Posted by: Chris | April 17, 2008 at 03:29 AM
Okay, got it all setup and it rocks. Great starting point, going to start tweaking the graphs and whatnot to suit my app. Thanks!
Posted by: Chris | April 17, 2008 at 06:03 AM
@chris fork it! ;-)
Posted by: choonkeat | April 17, 2008 at 11:08 AM
Nice work!
Cool to see our charts get some use. Do you have a link to a working implementation?
Posted by: Scott | June 23, 2008 at 12:00 AM