Value 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.
On this page
#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 number, written as a numeric literal:
3, -2.5, 0.35. An attribute may hold it to whole numbers or to a range, and a value outside is refused with an error that names the limit.Accepts
IntegerDecimal3
-2.5
0.35parametised-numberA number, or an expression that works out to one and may read the scene's parameters:
2*a + 1 moves when a control moves a.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
booleanTrue or false, or a condition that comes to one. Written out,
true, false, yes or no, in any case. In an attribute group the name alone means true — curve(dashed) — and ! before it means false: curve(!dashed), which is how an attribute that defaults to true is turned off. Any condition may stand in their place, without braces: hidden: t > 3, hidden: #q.attempts >= 2, hidden: not shown. One over a slider's letter or a live value is decided as the page renders, so hidden: t > 3 hides the mark once the slider passes 3.Accepts
truefalseyesnoa conditiontrue
no
t > 3
#q.attempts >= 2 and not #q.correct#Colour
colour-listColours read in written order, bare,
blue, teal, or in parentheses, (blue, teal). Every colour the colour type takes: the nine hues, each optionally prefixed light- or dark-, neutral, and the literals hex(0064FA) and rgb(0, 100, 250). Square brackets are not a list.Accepts
Comma-separated coloursblue, teal, orange, grey
light-blue, dark-blue
teal, hex(0064fa), neutral#Lists
string-listText values separated by commas.
Accepts
Comma-separated text valuesChrome, Safari, Firefoxnumber-listNumbers separated by commas.
Accepts
Comma-separated integers or decimals65, 19, 4, 12
1.5, 2.0, 3.7parametised-number-listNumbers separated by commas, each of which may be an expression in the scene's parameters.
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.areaerror-seriesA mark's error bars, one entry per reading, paired by data row. A series is each reading's half-width, so 0.3 on a reading of 4.2 spans 3.9 to 4.5. An interval is each bar's two ends, for an uncertainty that is not symmetric: two columns joined by
.., or every entry written as low..high. Entries are all half-widths or all intervals, never a mix.Accepts
Comma-separated half-widthsA dataset column of half-widths: #id.columnTwo columns as an interval: #id.low .. #id.highComma-separated intervals: low..high0.3, 0.2, 0.4
#runs.sd
#trials.lo .. #trials.hi
0.71..1.12, 0.80..1.30index-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-listPoints written
(x, y) and separated by commas; either coordinate may be an expression in the scene's parameters.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 - 1region-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, lonregion-anchorA place, in either of the two ways a geographic environment names one: a
region-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
#tokyoflowchart-pointA place on a flowchart 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.5flowchart-anchorA place on the frame, in either of the two ways a flowchart environment names one: a
flowchart-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
#nucleusflowchart-ref#id naming a box or pin in the same flowchart 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 range, both ends included. An end may be left open —
..5 is everything up to 5, 5.. everything from 5 — or left out of the range with a < beside the dots: 0..<5 stops short of 5, 0<.. starts just above 0. A descending range is a compile error, and takes only a range with both ends ((n: 0..<3) runs 0, 1, 2). 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..to..tofrom..from..<tofrom<..to0..6
..<0
1, 2, 3, 7..11parametised-intervalAn interval in square brackets,
[from, to], whose ends may be expressions in the scene's parameters.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-stepThe distance between grid lines along one axis:
auto, or a positive number.Accepts
autoPositive integerauto
2
5#Expressions
parametised-expressionA maths expression that may read the scene's parameters.
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
durationA length of time, written with its unit:
500ms or 1.5s. A number without a unit is refused.Accepts
Integer duration500
750
1200duration-autoA duration written with its unit,
1200ms or 1.2s, or auto, which leaves the length to the scene.Accepts
autoInteger durationauto
1200cue-anchorWhen a cue fires: a step index, where
0 is the start of the scene and 1 the first ===; a time from the start of the scene, 1.5s; or a step and a delay after it, 2 + 500ms. An index past the scene's last step is a compile error.Accepts
Step indexAbsolute timestep + offset2
1500ms
2 + 500msoptional-cue-anchorA cue anchor, or
none: the cue does not fire on its own.Accepts
nullStep indexAbsolute timestep + offsetnull
2
4 + 1.5s#References
referenceAn
#id naming another construct, or #id.member naming one of its attributes or a dataset's column. It compiles to a binding that is resolved while the internote renders, so the value follows the construct it names. A template's attribute declares which constructs it accepts with targets: node or micronode names, 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