views:

64

answers:

4

This is a high-level question about web frameworks, that as a desktop app developer, I don't have much knowledge of.

I am planning to build a web application which visualizes some data stored in a database. I plan on using Rails for user query. For visualization, the Raphael JS library looks good. Would it be a considerable task trying to connect Rails with this library?

Any recommendations for substitutes for these 2 are welcome.

+1  A: 

Ryan Bates talk about charts (including Raphael) in this Railscasts, Im pretty sure It's a good starting point.

jpemberthy
+1  A: 

Raphael is a self-contained JS library, the server-side framework/language you pick is really unimportant. You can't just plug one into the other though, you'll have to figure out how to supply Raphael with the data it needs in the format it expects. Rails will be no better or worse than any other framework at this.

meagar
A: 

There should be no issues especially since Rails 3 has made a point of being JS-library agnostic.

Doing a quick cursory search I saw this library that might merit your consideration. Doesn't appear to do pie charts but otherwise it looks good: Flot

That particular library is made to integrate with jQuery, which is a popular and well-documented JS library that Rails 3 plays very nicely with.

MattC
+3  A: 

There isn't really much that needs to be done to connect Rails and Raphaël. Raphaël is a Javascript library, and so runs entirely on the client, and Rails is a web application framework, running on the server. All you really need to do to integrate them are include Raphaël on your page, and provide data to it in a format easy to use from Javascript; using RESTful controllers which provide data in JSON should make it easy for you to load data using XMLHttpRequest from the client, which you can then display using Raphaël.

Brian Campbell