The vega-embed module provides advanced support for embedding interactive Vega views into web pages. The primary features include:
- Load Vega specs from source text, parsed JSON, or URLs.
- Add action links such as “View Source” and “Open in Vega Editor”.
- Parameterize visualizations with auto-generated dynamic query widgets.
This last feature provides a powerful and convenient way to interact with a visualization by adding interactive widgets such as sliders, text fields, dropdown menus, and radio boxes. For Vega specifications without interactive signals defined, vega-embed provides rewriting rules for injecting interactivity into an existing spec.
For more, see the documentation on the Vega wiki.
vega-embed.js and view the test examples, you must have npm installed.
npm installin the vega-embed folder to install dependencies.
npm run build. This will invoke browserify to bundle the source files into vega-embed.js, and then uglify-js to create the minified vega-embed.min.js.
- Run a local webserver (e.g.,
python -m SimpleHTTPServer 8000) in the vega-embed folder and then point your web browser at the test directory (e.g.,