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
stringAny text.
Accepts
Any texthello
Introduction to Graphsrich-textInline Chalk content — formatted text,
$maths$, links, and inline elements all render.Accepts
Any inline Chalklocal maximum
the mean $\mu$single-charExactly one alphabetical character.
Accepts
Single letterx
tletter-listLetters separated by commas: single Latin letters or Greek letters by name (
alpha, Omega), either with a subscript after _ (x_1, v_max).Accepts
Comma-separated lettersx
w, L, v, t
x_1, x_2, alpha#Numbers
numberA numeric literal.
class decides whether a fractional part is allowed AND the compiled shape — integer emits a JSON integer, decimal a float.Accepts
IntegerDecimal3
-2.5
0.35parametised-numberNumber value that may reference parameters/expressions.
Accepts
NumberParameter-based expression2
a
2*a+1ratioOne share over another, written as a fraction — the first environment's share of a split over the second's.
Accepts
a/b3/2
1/1#True or false
booleanA 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
truefalseyesnotrue
no#Colour
colour-listComma-separated colours, read in written order. Every colour the
colour type takes: the nine hues, each optionally prefixed light- or dark-, neutral, and the hex(0064fa) literal. rgb(…) is the one colour a list cannot hold — its own commas would split it — so write a literal as hex() here.Accepts
Comma-separated coloursblue, teal, orange, grey
light-blue, dark-blue
teal, hex(0064fa), neutral#Lists
string-listComma-separated list of strings.
Accepts
Comma-separated text valuesChrome, Safari, Firefoxnumber-listComma-separated list of numbers.
Accepts
Comma-separated integers or decimals65, 19, 4, 12
1.5, 2.0, 3.7parametised-number-listComma-separated numbers, each of which may be a parameter expression.
Accepts
Comma-separated numbers or expressions1, 2, 4
a, 2*ahistogram-binsA 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 edges12
k
0, 10, 20, 30seriesOne 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.column1, 2, 4
k, 2*k, 4*k
North, South, East
#islands.areaindex-listComma-separated indices and ranges. Letters map to positions (A=1).
Accepts
Single indexComma-separated listRange1,3,5
1-4
A,C-Ecell-listSpreadsheet-like cell references and ranges.
Accepts
A1A1,B2A1-C3A1,B2
C3-C5complex-seriesA 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.column1 + i, 2 - i, -3i, 4
#roots.z#Points and paths
parametised-coordinate-listCoordinate pairs with optional parameterized values.
Accepts
(x,y) pairs(0,0),(1,1)
(a,2),(b,3)angle-armOne 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))graph-transformA map of a graph's plane, written in the notation that plane is mapped in. The ordinary plane takes a 2×2 matrix as its two ROWS, the way one is written on paper:
(1, 1), (0, 1) is (x, y) ↦ (x + y, y), and its columns are where the basis vectors land. Entries may be parametised. The argand plane takes a function of z instead, read as any other complex expression. A matrix announces itself with its rows, so a complex map that opens with a bracket — (1 + i) * z — is still read as the expression it is.Accepts
Matrix rows: (a, b), (c, d)A function of z(0, -1), (1, 0)
(1, k), (0, 1)
z^2
(z + 1/z) / 2curve-pathThe 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 - 1geo-coordinateA 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, lon48.85, 2.35
35.68, 139.69
0, longeo-anchorA 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 environment48.85, 2.35
#tokyodiagram-pointA 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 10.62, 0.31
0.5, 0.5diagram-anchorA 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 environment0.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
#id of a box or pin in the same environment#pcr
#nucleus#Ranges and spacing
intervalAn 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
from..to0..6
1, 2, 3, 7..11parametised-intervalInterval that can include parameter expressions in bounds.
Accepts
Interval-like syntax with expressions[-10, 10]
[a, b]axis-valueA 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 axis0
2 * k
2024-03
Wed
90degaxis-intervalAn 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-scaleHow 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
linearloglog2linear
logaxis-formatWhat a graph axis holds:
auto (decided from the marks), numbers, discrete, 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. So does discrete, which rules the axis at the NUMBERS its marks give — sorted, one stop each, evenly spaced however far apart the numbers are, ticked at those values and nowhere between them.Accepts
autonumbers, discrete, radians, degrees, datesmonths, weekdaysComma-separated namesA dataset column: #id.columnauto
radians
discrete
months
Red, Blue, Yellow
#sales.regiongrid-stepGrid spacing mode.
Accepts
autoPositive integerauto
2
5#Expressions
parametised-expressionMath expression that may include parameter variables.
Accepts
Expression stringx^2 + 2x + 1
sin(a*x)parametised-surface-expressionMath expression over the plane — the one place
y is legal alongside x — that may also reference parameters.Accepts
Expression in x and yx^2 + y^2
sin(x) * cos(y) + acurve-expressionA 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. min(a, b), max(a, b) and clamp(x, lo, hi) are how a function defined in pieces is written as one curve.Accepts
An expression in xAn expression in theta (polar)x^2
a * sin(b * x)
1 + cos(theta)
min(2x, 10)parametric-expressionOne coordinate of a curve that is a position in
t: an expression in t, the other letters parameters.Accepts
An expression in tcos(t)
a * sin(2t)complex-expressionA 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 parameters3 + 2i
(3 + 2i)^2
sqrt(13) * e^(i * a)
conj(z)complex-parametric-expressionA curve on the argand plane as z(t): a complex expression in
t.Accepts
A complex expression in te^(i * t)
sqrt(13) * e^(i * t)
t + i t^2maths-valueA maths answer: an expression that works out to a number, to a vector —
vec(3, -1), 2 vec(1, 2) + vec(0, 1) — or to a matrix, written row by row with semicolons between the rows — mat(1, 2; 3, 4), mat(2, 1; 1, 3) vec(3, -1) — or a bracketed tuple of numbers, (3, -1), which is a different answer from the vector with the same components. Matrices multiply as they do on paper, and a square one can be raised to a whole power. Read by the same parser a reader's typed answer goes through, so an expectation and an answer cannot be read two ways. nrt(x) is the nth root, n! the factorial, choose(n, r) and perm(n, r) count, a Greek letter is written by its name, _ subscripts a letter, and a number may be written in scientific notation (2.81e-5).Accepts
NumberExpression in the question's variables(a, b, …)vec(a, b, …)mat(a, b; c, d)8.1
w / (L v t)
(2016, 6.72)
vec(3, -1)
mat(0, -1; 1, 0)maths-formThe form a maths answer must be written in:
exact (no decimals), simplified (nothing left undone or redundant) or rounded(n) (a number to exactly n decimal places, n from 0 to 10).Accepts
exactsimplifiedrounded(n)exact
rounded(2)#Timing and animation
durationAnimation duration value in milliseconds (internally normalized).
Accepts
Integer duration500
750
1200duration-autoEither explicit duration or auto-calculated timing.
Accepts
autoInteger durationauto
1200cue-anchorWhen something fires, in scene time: a step index, an absolute time, or a step with a time offset.
Accepts
Step indexAbsolute timestep + offset2
1500ms
2 + 500msoptional-cue-anchorNullable cue anchor — null means the cue never fires on its own.
Accepts
nullStep indexAbsolute timestep + offsetnull
2
4 + 1.5s#References
referenceAn
#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
#id#id.member#flight
#fit.slope#Fixed choices
planeA 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
xxyargandpolarxy
argand
polar