onaio/zebra — pull request #912 by prabhasp (2014-11-03 11:25:37+00:00)
Title: 503 charts in om

Hi guys, this pull request
1. Closes #503 and does the charting client-side.
2. Ports the chart code so it works on both `clj` and `cljs`. Lots of nuances there. I also ported all of the testing of the charts to `clj` + `cljs`, which was also quite a bit.
3. Improves server-side charting a bit. This will mostly be in the context of embeddable charts. No spurious close button now.

However, there is one regression, and I tried a lot, but am having a lot of trouble implementing the very simple feature: the chart that you just added should show up at the top of the screen rather than the bottom. I think Om is doing some strange stuff if you don't just `conj` to a vector. If you would like to help (and i would certainly appreciate the help), please have a look at this [reversion](https://github.com/onaio/zebra/commit/c9a1075cc40e60f5cdc3e7d283603d5f9561ae66). I tried many other methods as well (including doing a `(vec (concat [fld] %))` instead of `(conj % fld)` in [this line](https://github.com/onaio/zebra/commit/c9a1075cc40e60f5cdc3e7d283603d5f9561ae66)). However, in both cases, the data download that is triggered is for the wrong "field" (ie, it always downloads teh data for `_submission_time`), and the other components never load.

Anyways, there is a lot of code here, so I think reviewing + commenting on what is here right now is good. If we can get this into master, I can figure out ordering hopefully on Wednesday.