Quartz / Chartbuilder

A front-end charting application that facilitates easy creation of simple beautiful charts
http://quartz.github.io/Chartbuilder
MIT License
2.1k stars 354 forks source link

Modularise project (use AngularJS, add support for more chart libs) #125

Closed aendra-rininsland closed 10 years ago

aendra-rininsland commented 10 years ago

Hi again,

I've been given a load of requirements, some of which are brand-new charts not implemented in Gneisscharts. As Gneiss as those charts are (couldn't help myself), it'd be cool to make Chartbuilder more modular so the current crop of nice D3 frameworks (nvd3, c3js, etc.) can be easily added or removed.

I know this is a massive rewrite; I've looked at the code and really am not super sure where to start. However, it's seeming more and more like I'll have to do that myself anyway.

Things I can possibly see myself doing through this process:

a. Modularise config. All the config is done statically through the Chartbuilder.getDefaultConfig method. It would be trivial to abstract this into a external conf file and make it easier for news orgs to customise Chartbuilder (hereafter "CB") to their particular style.

b. Gruntify the project. I work with Yeoman all the time and wow, does it feel really strenuous to not have its idioms available when developing this. I might just steal the Gruntfile/package.json from generator-webapp to get the benefit of things like Livereload, automatic code linting, automatic Bower dependency insertion, et cetera.

c. Add AngularJS as a dependency. It feels like there is just way too much event handling. See chartbuilder.js ln. 962 to 1072 — all of this could be handled in a proper controller via Angular's two-way binding. There's also a tonne that could be done to make the code easier to read by using Angular (Using a MVC-style pattern would do wonders). This might be premature optimisation, though I get the feeling it would make stuff much more extensible — you could encapsulate various charting libraries into factories, which would then just be drop-in-place, and all the image generation code could be put into various services.

I'm sure there are a few others, which I'll add as I come across them. Let me know what you think — I basically have the next few weeks to get this rolling for one of our projects and I'd love to collaborate with anybody willing to help out with this. I'm currently using times/Chartbuilder#dev to develop on if anyone wants to fork my progress and jump right in. I've also enabled the fork's issue tracker so issues particular to the refactor don't clog the main issue queue (though, let me know if you'd rather I not do this).

aendra-rininsland commented 10 years ago

I've completed my fork, was a pretty substantial rewrite. If interested, it's at times/axisJS.

yanofsky commented 10 years ago

Hey aendrew, sorry for the lack of response on all your tickets! I'll take a look at this and everything else tomorrow.

Thank you!

mattshade commented 10 years ago

Nice work!

Sent from my iPhone

On Aug 12, 2014, at 8:30 PM, Ændrew Rininsland notifications@github.com wrote:

I've completed my fork, was a pretty substantial rewrite. If interested, it's at times/axisJS.

— Reply to this email directly or view it on GitHub.