Skip to content

vega/vega

Vega: A Visualization Grammar

Vega Examples

Vegais avisualization grammar,a declarative format for creating, saving, and sharing interactive visualization designs. With Vega you can describe data visualizations in a JSON format, and generate interactive views using either HTML5 Canvas or SVG.

For documentation, tutorials, and examples, see theVega website.For a description of changes between Vega 2 and later versions, please refer to theVega Porting Guide.

Build Instructions

For a basic setup allowing you to build Vega and run examples:

  • Clonehttps://github /vega/vega.
  • Runyarnto install dependencies for all packages. If you don't have yarn installed, seehttps://yarnpkg /en/docs/install.We useYarn workspacesto manage multiple packages within thismonorepo.
  • Once installation is complete, runyarn testto run test cases, or runyarn buildto build output files for all packages.
  • After running eitheryarn testoryarn build,runyarn serveto launch a local web server — your default browser will open and you can browse to the"test"folder to view test specifications.

This repository includes the Vega website and documentation in thedocsfolder. To launch the website locally, first runbundle installin thedocsfolder to install the necessary Jekyll libraries. Afterwards, useyarn docsto build the documentation and launch a local webserver. After launching, you can openhttp://127.0.0.1:4000/vega/to see the website.

Internet Explorer Support

For backwards compatibility, Vega includes ababel-ifiedIE-compatible version of the code in thepackages/vega/build-es5directory. Older browser would also require several polyfill libraries:

<scriptsrc= "https://cdnjs.cloudflare /ajax/libs/babel-polyfill/7.4.4/polyfill.min.js"></script>
<scriptsrc= "https://cdn.jsdelivr.net/npm/[email protected]/runtime.min.js"></script>
<scriptsrc= "https://cdn.jsdelivr.net/npm/[email protected]/dist/fetch.umd.min.js"></script>

Contributions, Development, and Support

Interested in contributing to Vega? Please see ourcontribution and development guidelines,subject to ourcode of conduct.

Looking for support, or interested in sharing examples and tips? Post to theVega discussion forumor join theVega slack organization!We also have examples available asObservable notebooks.

If you're curious about system performance, see somein-browser benchmarks.Read about future plans inour roadmap.