Skip to content

JSON

JSON is a text format for structured data: labels and values inside curly braces, lists inside square brackets. Programs use it to pass data to each other.

json
{"country": "Chile", "year": 2007, "continents": ["Americas"]}

If it looks like a Python dictionary, that's because it nearly is one. JSON always uses double quotes, and it writes true, false and null where Python writes True, False and None.

Every Altair chart becomes JSON in the end: a Vega-Lite specification that the browser draws. chart.to_json() shows it.

Learn more

  • Vega-Lite

    Vega-Lite is a language for describing charts in JSON: you name the data, the mark and which column goes on each axis, and a renderer draws it. Altair writes Vega-Lite for you.

  • Altair

    Altair (Vega-Altair) is a Python package for making charts by describing them: you say which column goes on each axis, color or size, and it writes the Vega-Lite that draws the chart.

All terms