A simple way to render Vega-based visualizations.
- Create a chart with Vega. For demonstration purposes, use this bar chart from the Vega examples library.
- Base 64-encode your charts JSON chart spec. Make sure you use URL-safe base 64 encoding.
- Pass the encoded chart spec using the
d
query parameter tovega-chart-viewer
: https://swissmanu.github.io/vega-chart-viewer/?d=ewog...
The number of characters allowed in a URL is limited. As Vega chart specs tend to exceed this limit fast, vega-chart-viewer
supports gzipped chart specs, too:
- Create a chart with Vega.
- Gzip the JSON chart spec.
- Encode the gzipped data using URL-safe base 64.
- Pass the gzipped chart spec using the
d
query parameter tovega-chart-viewer
.