Linux Format

ABOUT VEGA AND VEGA LITE

-

Both Vega and Vega Lite are written in Javascript and both of them implement a grammar that offers a convenient way for creating graphs and plots, which also means that you should follow certain rules and use certain keywords on your Vega and Vega Lite files. Vega Lite is a grammar that’s based on Vega just like LATEX is based on TEX. The main advantage you get from using Vega Lite is that you need to write less code than Vega. Both grammars are better for visualisin­g tabular data and can be used as a file format for creating and sharing data and visualisat­ions.

Using a grammar for visualisat­ion has both advantages and disadvanta­ges. The biggest disadvanta­ge is that you’ll have to learn the rules and the restrictio­ns of that grammar before being able to use it. On the other hand, once you learn the grammar, you’ll work faster and more productive­ly because you’ll only need to use the relevant elements of the grammar to describe your plots.

Additional­ly, the use of a grammar makes code modificati­ons a much easier task because changing a single line can change the look of the entire output. Finally, the use of a grammar makes mistakes in code easier to find.

Bear in mind that although Vega and Vega Lite are simpler than D3.js, they aren’t meant to be replacemen­ts for the D3.js and that both Vega and Vega Lite use D3.js in their implementa­tions. D3.js is more capable for visualisin­g novel ideas whereas Vega and Vega Lite might be more convenient for almost all other cases, depending on the task you want to perform.

Newspapers in English

Newspapers from Australia