With opal-d3 I made intuitive ruby opal interface to D3 data-driver document visualization library. It's a great fit, as ruby is a great language for extracting and processing data, so it makes little sense to leave it for another language just for the final visualization step.
To use it, just gem install opal-d3. The gem includes example sinatra app.
What works and what doesn'tAbout 60% of D3 functionality is supported with nice ruby wrappers, including:
- delimiter-separated values
- number formats
- quad trees
- random numbers
- time formats
- time intervals
- voronoi diagrams
See it in actionI included a bunch of sample visualizations with the gem, which you can also view here.
Future workPull requests most welcome. If you're interested in helping, some ideas are:
It would be nice to have the remaining functionality - especially geographic code, and also wrappers for any popular D3 plugins.
The interface tries to follows intuitive ruby style as much as possible, but there are some cases where it's not clear what would be the right way. I don't expect any major API changes, but some minor bits could change.
It should generally be clear what ruby equivalent is, and there's plenty of specs and a bunch of examples in demo app, but there's no comprehensive documentation or tutorials as such.
It would be good to just include more examples showcasing various included functionality - sort of like d3.js's homepage has. Especially examples showing dynamic interaction are lacking.
If it becomes popular, the project could definitely use some better kind of home page on github pages.
Unlike coffeescript which is pretty much free, opal comes with performance cost. opal-d3 right now doesn't try to minimize it, so it would be nice to have some benchmarks, and make sure it doesn't do anything unnecessarily costly.
Included example sinatra app could definitely use source maps and in-browser ruby console for editing code without reloading.