Vega: A Visualization Grammar
vega.github.io
vega.github.io
* Vega - Talked about in this thread
* nvd3 - Meant to work in similar style as D3, supports extension. Seems popular
* Epoch - Real-time charts are purpose-built to be performant and low-overhead. Limited number of visualization types
* D4 - Extends D3 instead of wrapping it. Separation of data from view
* C3js - Easier API. extendable.
* rickshaw - Mainly for time series data. Supports extensions. Works in similar style as D3.
Vega: https://trifacta.github.io/vega/
nvd3: http://nvd3.org/
Epoch: https://fastly.github.io/epoch/
D4: https://github.com/heavysixer/d4
C3js: http://c3js.org/
rickshaw: http://code.shutterstock.com/rickshaw/
XCharts: http://tenxer.github.io/xcharts/
D3xter: https://github.com/NathanEpstein/D3xter
Metrics Graphics: https://github.com/mozilla/metrics-graphics
TauCharts: http://www.taucharts.com/
N3: https://github.com/n3-charts
Dangle: http://www.fullscale.co/dangle/
I feel a spreadsheet coming on...
EDIT: Big list here: https://github.com/wbkd/awesome-d3
Being declarative is much better than being imperative and configuration files seem like a natural fit for a declarative system, but they lack expressiveness. They are hard to make generic and lend themselves to repetition and fragility (in my experience).
I'd say that composition wins over configuration. If you provide a domain specific language with a set of useful primitives, users can leverage it to describe what they want with more flexibility and freedom.
For concrete examples within js-land, look at gulp.js[1], connect[2]-style middleware, and JSX[3]. All of them describe their structure with code, in a composable, pluggable, reusable fashion.
That being said, with a robust enough representation like Vega's, I bet you could write code that dynamically builds the final JSON structure.
[1]: http://gulpjs.com/
[configuration files] lack expressiveness.
They are hard to make generic and lend themselves
to repetition and fragility
That's exactly what I would say about an imperative scheme, also from experience. I'd say that composition wins over configuration
That too, makes not sense to me.As to the second point, the prime example I had in mind was the difference between Grunt/WebPack and gulp. Grunt encourages gigantic configuration files while gulp provides a set of primitives which can be programmatically manipulated and composed to produce the desired effect.
I think what could make this into something really useful would be the addition of special directives. MongoDB is a good example for this, as they have enriched their query language with a special operator syntax (e.g. $in, $all, $or) that allows the user to specify e.g. logical constraints.
Recently I developed a similar descriptive language for describing patterns in source code ASTs, which uses YAML as a default output format and features some regular-expression like operators that make matching of complex patterns containing e.g. repetitions, references and loops possible (for some examples, see http://docs.quantifiedcode.com/patterns/language/index.html).
Personally, I have always preferred YAML over JSON as a serialization language, since it is much more concise, easier to write (after some getting used to) and comes with handy features like anchors/references, which make e.g. self-referencing documents or variable definition much easier.
I love the concept, but since this is presented as a "grammar", it would make sense to provide a specification of it, in addition to the examples.
Great work!
Vega-lite is currently under development, but some initial examples are available here: https://uwdata.github.io/vega-lite
Deleted comment
Primary focus? A few comments mention it; none of them are high on the page, some of them are downvoted.