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
hello
Introduction to Graphsrich-text
Inline Chalk content — formatted text, $maths$, links, and inline elements all render.Accepts
local maximum
the mean $\mu$single-char
Exactly one alphabetical character.Accepts
x
tNumbers
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
3
-2.5
0.35parametised-number
Number value that may reference parameters/expressions.Accepts
2
a
2*a+1ratio
One share over another, written as a fraction — the first environment's share of a split over the second's.Accepts
3/2
1/1True 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
true
noColour
colour-list
Comma-separated colour names: red, orange, yellow, green, teal, blue, purple, pink, grey, neutral, white, black.Accepts
blue, teal, orange, greycategory-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
Labor red, Coalition blue
Liberal red, Conservative blue, New Democratic orangeLists
string-list
Comma-separated list of strings.Accepts
Chrome, Safari, Firefoxnumber-list
Comma-separated list of numbers.Accepts
65, 19, 4, 12
1.5, 2.0, 3.7parametised-number-list
Comma-separated numbers, each of which may be a parameter expression.Accepts
1, 2, 4
a, 2*ahistogram-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
12
k
0, 10, 20, 30series
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
1, 2, 4
k, 2*k, 4*k
North, South, East
#islands.areaindex-list
Comma-separated indices and ranges. Letters map to positions (A=1).Accepts
1,3,5
1-4
A,C-Ecell-list
Spreadsheet-like cell references and ranges.Accepts
A1,B2
C3-C5Points and paths
parametised-coordinate-list
Coordinate pairs with optional parameterized values.Accepts
(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
(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
#flight
x^2 - 1geo-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
48.85, 2.35
35.68, 139.69
0, longeo-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
48.85, 2.35
#tokyodiagram-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
0.62, 0.31
0.5, 0.5diagram-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
0.62, 0.31
#nucleusdiagram-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
#pcr
#nucleusRanges and spacing
interval
An ascending inclusive range. A descending range is a compile error. This is a VALUE FORM, not 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
0..6
1, 2, 3, 7..11parametised-interval
Interval that can include parameter expressions in bounds.Accepts
[-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
0
2 * k
2024-03
Wed
90degaxis-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
[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
linear
logaxis-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
auto
radians
months
Red, Blue, Yellow
#sales.regiongrid-step
Grid spacing mode.Accepts
auto
2
5Expressions
parametised-expression
Math expression that may include parameter variables.Accepts
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
x^2 + y^2
sin(x) * cos(y) + aTiming and animation
duration
Animation duration value in milliseconds (internally normalized).Accepts
500
750
1200duration-auto
Either explicit duration or auto-calculated timing.Accepts
auto
1200cue-anchor
When something fires, in scene time: a step index, an absolute time, or a step with a time offset.Accepts
2
1500ms
2 + 500msoptional-cue-anchor
Nullable cue anchor — null means the cue never fires on its own.Accepts
null
2
4 + 1.5sReferences
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 for a dataset.Accepts
#flight
#fit.slopeFixed 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
xy
argand
polarExpressions
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
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
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
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
e^(i * t)
sqrt(13) * e^(i * t)
t + i t^2Lists
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
1 + i, 2 - i, -3i, 4
#roots.z