swissmanu / vega-chart-viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vega-chart-viewer

A simple way to render Vega-based visualizations.

Basic Usage

  1. Create a chart with Vega. For demonstration purposes, use this bar chart from the Vega examples library.
  2. Base 64-encode your charts JSON chart spec. Make sure you use URL-safe base 64 encoding.
  3. Pass the encoded chart spec using the d query parameter to vega-chart-viewer: https://swissmanu.github.io/vega-chart-viewer/?d=ewog...

Advanced Usage

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:

  1. Create a chart with Vega.
  2. Gzip the JSON chart spec.
  3. Encode the gzipped data using URL-safe base 64.
  4. Pass the gzipped chart spec using the d query parameter to vega-chart-viewer.

About


Languages

Language:HTML 100.0%