Attribute types

Every value you write is text until the attribute it lands in parses it. Each type below is one way of reading that text — what it accepts, and how it is written. A value its attribute cannot parse is an error at compile time, with the reason named: nothing is silently converted or dropped.

Text

string
Any text.
Accepts
Any text
hello
Introduction to Graphs
rich-text
Inline Chalk content — formatted text, $maths$, links, and inline elements all render.
Accepts
Any inline Chalk
local maximum
the mean $\mu$
single-char
Exactly one alphabetical character.
Accepts
Single letter
x
t

Numbers

number
A numeric literal. class decides whether a fractional part is allowed AND the compiled shape — integer emits a JSON integer, decimal a float.
Accepts
IntegerDecimal
3
-2.5
0.35
parametised-number
Number value that may reference parameters/expressions.
Accepts
NumberParameter-based expression
2
a
2*a+1
ratio
One share over another, written as a fraction — the first environment's share of a split over the second's.
Accepts
a/b
3/2
1/1

True or false

boolean
A true/false flag, matched in any case. In an attribute group the name alone means true — curve(dashed) — and ! before it means false: curve(!dashed). The negated form is how you turn off an attribute that defaults to true.
Accepts
truefalseyesno
true
no

Colour

colour-list
Comma-separated colour names: red, orange, yellow, green, teal, blue, purple, pink, grey, neutral, white, black.
Accepts
Comma-separated colour names
blue, teal, orange, grey
category-colours
A categorical legend, written category then hue: Labor red, Coalition blue. Categories the list does not name take the next unused hue, so nothing in the data silently vanishes.
Accepts
Comma-separated category-then-hue pairs
Labor red, Coalition blue
Liberal red, Conservative blue, New Democratic orange

Lists

string-list
Comma-separated list of strings.
Accepts
Comma-separated text values
Chrome, Safari, Firefox
number-list
Comma-separated list of numbers.
Accepts
Comma-separated integers or decimals
65, 19, 4, 12
1.5, 2.0, 3.7
parametised-number-list
Comma-separated numbers, each of which may be a parameter expression.
Accepts
Comma-separated numbers or expressions
1, 2, 4
a, 2*a
histogram-bins
A histogram's bins: how many, or where their edges fall. One number is a count — 12, or parametised, k, so a slider re-bins the sample — and it needs readings to bin. Two or more are the edges themselves, in order, one more than there are bars, and may be unequal. A single edge is not a grid, so a lone number is never read as one.
Accepts
A count: a number or parameter expressionComma-separated bin edges
12
k
0, 10, 20, 30
series
One axis of a multipoint mark (x:/y: on scatter, line, polygon, bar): comma-separated entries, each a number, a parameter expression, or a name — or a dataset column bound whole, #islands.area. The axis decides how an entry reads: numbers and expressions on a numeric axis, names on a categorical one. The two axes pair by position.
Accepts
Comma-separated numbers, expressions or namesA dataset column: #id.column
1, 2, 4
k, 2*k, 4*k
North, South, East
#islands.area
index-list
Comma-separated indices and ranges. Letters map to positions (A=1).
Accepts
Single indexComma-separated listRange
1,3,5
1-4
A,C-E
cell-list
Spreadsheet-like cell references and ranges.
Accepts
A1A1,B2A1-C3
A1,B2
C3-C5

Points and paths

parametised-coordinate-list
Coordinate pairs with optional parameterized values.
Accepts
(x,y) pairs
(0,0),(1,1)
(a,2),(b,3)
angle-arm
One arm of an angle, in either of the two ways an arm is named: a point it runs through, or a bearing in degrees anticlockwise from the positive x axis. A point announces itself with its parentheses and its comma, so a bearing that happens to open with a bracket — (a + b) * 2 — is still read as the expression it is. Either form may be parametised, so an arm can follow a reader's slider.
Accepts
(x, y)Degrees
(4, 1)
30
(cos(t), sin(t))
curve-path
The curve to follow: a #id reference to a curve or fit, or an expression in x given directly.
Accepts
#idExpression in x
#flight
x^2 - 1
geo-coordinate
A place on the earth, written LATITUDE FIRST: 48.85, 2.35 is Paris. Either half may be a parametised expression, so a place can ride a slider or a keyframe.
Accepts
lat, lon
48.85, 2.35
35.68, 139.69
0, lon
geo-anchor
A place, in either of the two ways a geographic environment names one: a geo-coordinate, or #id naming a marker the same environment already draws. The reference form is what lets a map that pins Tokyo also be framed on Tokyo without writing the coordinate twice.
Accepts
lat, lon#id of a marker in the same environment
48.85, 2.35
#tokyo
diagram-point
A place on a diagram environment's content frame, as fractions: 0.62, 0.31 is 62% across and 31% from the top. The origin is the TOP LEFT and y runs DOWN — the way a position is read off an image — unlike the graph's y-up coordinates. Both halves are plain numbers between 0 and 1.
Accepts
u, v — fractions of the frame, 0 to 1
0.62, 0.31
0.5, 0.5
diagram-anchor
A place on the frame, in either of the two ways a diagram environment names one: a diagram-point, or #id naming a box or pin the same environment already draws. The reference form is what lets a frame that labels the nucleus also be focused on the nucleus without writing the fraction twice.
Accepts
u, v#id of a box or pin in the same environment
0.62, 0.31
#nucleus
diagram-ref
#id naming a box or pin in the same diagram environment — an arrow's endpoints. Nothing else is accepted, and an id no box or pin declares is a compile error.
Accepts
#id of a box or pin in the same environment
#pcr
#nucleus

Ranges and spacing

interval
An ascending inclusive range. A descending range is a compile error. This is a VALUE FORM, not @for syntax — any attribute whose type admits an interval accepts one, and an interval may be a list item, which is how an attribute comes to accept 1, 2, 3, 7..11.
Accepts
from..to
0..6
1, 2, 3, 7..11
parametised-interval
Interval that can include parameter expressions in bounds.
Accepts
Interval-like syntax with expressions
[-10, 10]
[a, b]
axis-value
A place on a graph axis: a number or parameter expression on a numeric axis, a date literal on a dates axis, or a name on a categorical one. On the polar plane an angle takes 60deg.
Accepts
A number or expressionA name on a categorical axis
0
2 * k
2024-03
Wed
90deg
axis-interval
An interval on a graph axis — a domain, a band, a brace, a !cue.zoom window. Each end is a number or expression on a numeric axis, a date on a dates axis, or a name on a categorical one; an end left empty is unbounded.
Accepts
[start, end] with numbers or expressions[start, end] with names on a categorical axis
[0, 10]
[a, b]
[Tue, Thu]
[0, ]
axis-scale
How a graph axis places a value: linear, log (v at log₁₀ v) or log2. A transform of numbers, refused beside names, dates or angles.
Accepts
linearloglog2
linear
log
axis-format
What a graph axis holds: auto (decided from the marks), numbers, radians, degrees, dates, a preset series (months, weekdays), a written series of names, or a dataset column whose distinct cells are the names. A series makes the axis categorical.
Accepts
autonumbers, radians, degrees, datesmonths, weekdaysComma-separated namesA dataset column: #id.column
auto
radians
months
Red, Blue, Yellow
#sales.region
grid-step
Grid spacing mode.
Accepts
autoPositive integer
auto
2
5

Expressions

parametised-expression
Math expression that may include parameter variables.
Accepts
Expression string
x^2 + 2x + 1
sin(a*x)
parametised-surface-expression
Math expression over the plane — the one place y is legal alongside x — that may also reference parameters.
Accepts
Expression in x and y
x^2 + y^2
sin(x) * cos(y) + a

Timing and animation

duration
Animation duration value in milliseconds (internally normalized).
Accepts
Integer duration
500
750
1200
duration-auto
Either explicit duration or auto-calculated timing.
Accepts
autoInteger duration
auto
1200
cue-anchor
When something fires, in scene time: a step index, an absolute time, or a step with a time offset.
Accepts
Step indexAbsolute timestep + offset
2
1500ms
2 + 500ms
optional-cue-anchor
Nullable cue anchor — null means the cue never fires on its own.
Accepts
nullStep indexAbsolute timestep + offset
null
2
4 + 1.5s

References

reference
An #id pointer, compiled to a binding the renderer resolves. The attribute holds a pointer and nothing more. targets names node or micronode types, or @data for a dataset.
Accepts
#id#id.member
#flight
#fit.slope

Fixed choices

plane
A graph's plane — what a coordinate on its marks is: x a number line, xy the ordinary plane, argand the complex plane, polar (r, theta).
Accepts
xxyargandpolar
xy
argand
polar

Expressions

curve-expression
A curve's function of its plane's independent axis: an expression in x on the ordinary plane, in theta on the polar one. Parameters are the other letters; 60deg writes an angle in degrees.
Accepts
An expression in xAn expression in theta (polar)
x^2
a * sin(b * x)
1 + cos(theta)
parametric-expression
One coordinate of a curve that is a position in t: an expression in t, the other letters parameters.
Accepts
An expression in t
cos(t)
a * sin(2t)
complex-expression
A complex number, as an expression: a real term, an imaginary term with i, or any expression of them — ^ the principal power; abs, arg, conj, re, im and the ordinary functions. Single letters are parameters, read as complex.
Accepts
A complex literal: 3 + 2i, -i, 4An expression in i and the parameters
3 + 2i
(3 + 2i)^2
sqrt(13) * e^(i * a)
conj(z)
complex-parametric-expression
A curve on the argand plane as z(t): a complex expression in t.
Accepts
A complex expression in t
e^(i * t)
sqrt(13) * e^(i * t)
t + i t^2

Lists

complex-series
A series of complex numbers: complex expressions written out, comma-separated (a bare number a real), or a column of complex literals bound whole.
Accepts
Comma-separated complex expressionsA dataset column: #id.column
1 + i, 2 - i, -3i, 4
#roots.z