This website is for Vega-Lite v4. Go to the main Vega-Lite homepage for the latest release.

Parameter Types

Edit this page

Reference documentation for common parameter types expected by Vega-Lite specification properties.

Documentation Overview

Primitive Types

Any

Accepts any literal value, including a string, number, boolean, or null.

Array

Accepts array values. For example: [], [1, 2, 3], ["foo", "bar"]. If individual array items must adhere to a specific type, bracket notation – such as Number[] or String[] – is used to indicate the item type.

In most cases, arrays may also have signal references as items. For example: [{"signal": "width"}, {"signal": "height"}].

Boolean

Accepts boolean values. For example: true, false.

Color

Accepts a valid CSS color string. For example: #f304d3, #ccc, rgb(253, 12, 134), steelblue.

Expression Reference (ExprRef)

An object with an expr property defining a Vega Expression.

For example, we can set mark color to be {expr: "lab(50,10,30)"}.

Expression

To enable custom calculations, Vega-Lite uses Vega’s expression language for writing basic formulas. Each datum object can be referred using bound variable datum.

Please read the Vega documentation for expressions for details.

Number

Accepts number values. For example: 1, 3.14, 1e5.

Object

Accepts general object literals. For example: {"left":5, "right":30, "top":5, "bottom":50}. The valid object property names and types will vary across parameters; read the individual parameter descriptions for more information.

String

Accepts general string values. For example: "bold", "step-before", "". The valid object property names and types may vary across parameters; read the individual parameter descriptions for more information.

Text

Accepts string values or arrays of strings (for multi-line text).

URL

Accepts a valid URL string linking to external site or resource. For example: "data/stocks.csv", "images/logo.png", "https://vega.github.io/".

Special Object Types

Please see the following pages for other special object types: