While this looks stellar and having a serializable format is cool too, I am personally not a fan of gigantic configuration files as this.
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.
I'd say we're in agreement w.r.t. the first point. While configuration files seem to be declarative in that they describe the properties of something rather than the steps to build it, they fall prey to many of the same issues that make imperative code inelegant.
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.
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/
[2]: https://github.com/senchalabs/connect.
[3]: https://facebook.github.io/jsx/