Vega-lite: Vega-Lite Shorthand

Created on 25 May 2017  路  5Comments  路  Source: vega/vega-lite

I am finding that it is still hard for users to directly write vega-lite by hand. Is there any plans to bring a vega-lite shorthand back?

Something like the following:

data(url/cars.json)
mark(point)
x(Horsepower, Q)
y(Miles_per_Gallon, Q)

which compiles to this

{
  "data": {"url": "data/cars.json"},
  "mark": "point",
  "encoding": {
    "x": {"field": "Horsepower","type": "Q"},
    "y": {"field": "Miles_per_Gallon","type": "Q"}
  }
}

Most helpful comment

Note that We have a shorthand as a part of CompassQL, but both CompassQL and its shorthand don't support composition yet and we currently don't plan to make the CompassQL supports composition within the next year as it is not needed in Voyager yet.

As Dom said, we might add a JS APIs wrapper for Vega-Lite similar to Altair #2280.

All 5 comments

Basically taking inspiration from Brunel specification for writing vis - http://brunel.mybluemix.net/docs/

We will not bring the shorthand because we think any wrapper should be an external library. There already exists great wrappers for example in Python (Altair). We have plans to write something similar in JavaScript (see https://github.com/vega/vega-lite/issues/2280).

Of course, you can write your own wrapper. However, I personally think that a wrapper embedded in an existing programming language is better because of the additional tooling you get. Vega-Lite will stay in JSON, which is compatible with almost every programming language and native to the web.

Note that We have a shorthand as a part of CompassQL, but both CompassQL and its shorthand don't support composition yet and we currently don't plan to make the CompassQL supports composition within the next year as it is not needed in Voyager yet.

As Dom said, we might add a JS APIs wrapper for Vega-Lite similar to Altair #2280.

Thanks for quick response. Will create myself for my use case.

Sure. You might find some of our approach in CompassQL helpful. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kanitw picture kanitw  路  4Comments

kanitw picture kanitw  路  3Comments

iliatimofeev picture iliatimofeev  路  3Comments

paintdog picture paintdog  路  4Comments

kanitw picture kanitw  路  3Comments