Parameter Types
Edit this pageReference documentation for common parameter types expected by Vega-Lite specification properties.
Parameter Type Reference
Literal Values
# Any or *
Accepts any literal value, including a string, number, boolean, or null
.
# Array or Type[]
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
.
# DateTime
A DateTime object (in filter transform, scale domain, and axis/legend values) must have at least one of the following properties:
Property | Type | Description |
---|---|---|
year | Number |
Integer value representing the year. |
quarter | Number |
Integer value representing the quarter of the year (from 1-4). |
month | Number | String |
One of: (1) integer value representing the month from |
date | Number |
Integer value representing the date from 1-31. |
day | Number | String |
Value representing the day of a week. This can be one of: (1) integer value – |
hours | Number |
Integer value representing the hour of a day from 0-23. |
minutes | Number |
Integer value representing the minute segment of time from 0-59. |
seconds | Number |
Integer value representing the second segment (0-59) of a time value |
milliseconds | Number |
Integer value representing the millisecond segment of time. |
For example {"year": 2006, "month": "jan", "date": 1}
represents Jan 1, 2006.
# 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 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 string values. For example: "bold"
, "step-before"
, ""
.
# URL
Accepts a valid URL string linking to external site or resource. For example: "data/stocks.csv"
, "images/logo.png"
, "https://vega.github.io/"
.