We want "views" such as graphs, maps and tables for our data:
Data --> View
We also have our data in a (Tabular) Data Package so in fact we want:
(Tabular) Data Package --> Views
We therefore need:
- A way to describe the view in JSON in our Data Package
- Code that takes (JSON view + Data) -> visualization or table in HTML + JS (or PNG etc)
This leads us to wanting:
Data Package View Spec!
Data Package View spec and code
Spec is in progress here: https://github.com/dataprotocols/dataprotocols/issues/77
Code for the purposes of developing and testing a spec is here: https://github.com/okfn/datapackage-render-js
We are currently focusing on code as it is only by trying stuff out that we can design a good spec (rough consensus and running code)
- We invented something like this in ReclineJS back in 2011.
- Using ReclineJS these render to live HTML.
- Used for current data.okfn.org views.
- Now there is Vega and Vega-lite which render out to d3 based graphs.
- Plan to use this for the future
Benefits of vega / vega-lite:
- Full power of d3 and a lot of customizability.
- Lots of graph types
- Log scales
- Nice stuff in vega e.g. embeddability and rendering to svg or png etc etc
- Ability to transform data (using vega transform stuff) -- though this is not perfect and we'd like to backport this ...
Things to improve with vega / vega-lite:
- Complexity: vega is verbose and pretty complex and that is still true of vega-lite (though it is better). We probably even simpler at least for common simple options like line graphs. For example we currently have things like this:
"series": [ "VIXClose" ]
- Integration: atm vega has its only data typing and data definition stuff. Would be nice if it used JSON Table Schema more. In any case we need to use JTS in generating some of the vega stuff if we can ...