ramnathv / rCharts

Interactive JS Charts from R
http://rcharts.io
Other
1.19k stars 654 forks source link

Think about rCharts.js #342

Open ramnathv opened 10 years ago

ramnathv commented 10 years ago

Here is the basic idea. A lot of code in rCharts essentially focuses on reshaping the data into a format that is accepted by a specific charting library. For reasons beyond my comprehension, every charting library seems to use its own custom data format, which makes it difficult to provide a single, consistent interface. In some cases, there is method behind this madness, especially, when the library supports multiple layers. In any case, the reason for those note is to strongly consider moving such manipulations into an rCharts.js file.

Here are some of the advantages that I foresee:

  1. This would allow other scripting languages like Python/Ruby etc to directly use rCharts bindings, since they only have to convert data into a single unified format.
  2. Having the data available in a standard structure would make it easier to support data querying operations and also adding interactive controls across the board.

The main challenge to this is my knowledge of javascript. I am using the lodash library which seems to take most of the pain out of it, but I really wish someone wrote a plyr for json!!

timelyportfolio commented 10 years ago

Very difficult for me to think of disadvantages besides challenge of an R coder writing JS. Not sure if this should happen before #340 but definitely think it should be on the roadmap, since the advantages you listed are very noteworthy. For those libraries that add layers, structure might just be layer containers holding data in same universal format.