Attribute types
Every value in Chalk is a string until an attribute's declared type parses it. These are the types the element reference links to — what each accepts, and what it looks like written down.
stringprimitive
Plain text value.Accepts
Any text
hello
Introduction to Graphs
x-axis labelnumberprimitive
Numeric value (integer or decimal).Accepts
IntegerDecimal
0
2
-3.5booleanprimitive
True/false toggle.Accepts
truefalse
true
falsecolourenum
Theme-aware named colour token.Values
neutralredorangeyellowgreentealbluepurplepinkgreywhiteblack
blue
neutralprogramming-languageenum
Language identifier for code/editor blocks. Supports many aliases.Values
autoplaintextjavascripttypescriptpythonjavagorustsqlchalkother
typescript
autohistogram-orientationenum
Direction of histogram bars.Values
verticalhorizontal
vertical
horizontalicon-nameenum
Name of the inline icon to display.Values
tickcross
tick
crossshape-typeenum
Marker shape used for scatter points.Values
circlesquarerectangletrianglestardiamondhexagon
circle
triangleeasing-functionenum
Animation timing function. `smooth` is the default; `linear` is constant speed.Values
linearsmooth
smooth
linearintervalcustom
Interval notation with inclusive/exclusive bounds.Accepts
[start, end](start, end)[start, end)(start, end]
[-10, 10]
(0, inf)
[-inf, inf]parametised-intervalcustom
Interval that can include parameter expressions in bounds.Accepts
Interval-like syntax with expressions
[-10, 10]
[a, b]grid-stepcustom
Grid spacing mode.Accepts
autoPositive integer
auto
2
5index-listcustom
Comma-separated indices and ranges. Letters map to positions (A=1).Accepts
Single indexComma-separated listRange
1,3,5
1-4
A,C-Ecell-listcustom
Spreadsheet-like cell references and ranges.Accepts
A1A1,B2A1-C3
A1,B2
C3-C5single-charcustom
Exactly one alphabetical character.Accepts
Single letter
x
tparametised-numbercustom
Number value that may reference parameters/expressions.Accepts
NumberParameter-based expression
2
a
2*a+1parametised-expressioncustom
Math expression that may include parameter variables.Accepts
Expression string
x^2 + 2x + 1
sin(a*x)parametised-coordinate-listcustom
Coordinate pairs with optional parameterized values.Accepts
(x,y) pairs
(0,0),(1,1)
(a,2),(b,3)durationcustom
Animation duration value in milliseconds (internally normalized).Accepts
Integer duration
500
750
1200duration-autocustom
Either explicit duration or auto-calculated timing.Accepts
autoInteger duration
auto
1200duration-or-integercustom
Either a duration value or a scene index integer.Accepts
DurationInteger index
0
500
2optional-duration-or-integercustom
Nullable version of duration-or-integer.Accepts
nullDurationInteger index
null
0
500optional-durationcustom
Nullable duration value.Accepts
nullInteger duration
null
300string-listcustom
Comma-separated list of strings.Accepts
Comma-separated text values
Chrome, Safari, Firefoxnumber-listcustom
Comma-separated list of numbers.Accepts
Comma-separated integers or decimals
65, 19, 4, 12
1.5, 2.0, 3.7colour-listcustom
Comma-separated list of colour names from the colour enum.Accepts
Comma-separated colour names
blue, teal, orange, greyorientationenum
Direction of a two-pane split.Values
horizontalvertical
horizontal
verticalratiocustom
One share over another, written as a fraction — the first pane's share of a split over the second's.Accepts
a/b
3/2
1/1interpolationenum
How a line gets from one reading to the next: `linear` joins them, `step` holds and jumps.Values
linearstep
linear
stepfit-modelenum
Model family for a fit.Values
polynomiallinear
polynomialelement-render-modeenum
How the element presents: 'inline' for a static display in place, 'environment' to expand into the board.Values
inlineenvironment
inline
environmentrich-textcustom
Inline Chalk content — formatted text, `$maths$`, links, and inline elements all render.Accepts
Any inline Chalk
local maximum
the mean $\mu$referencecustom
A `#id` reference to an element or dataset declared elsewhere in the document — with member access where an attribute or column is wanted.Accepts
#id#id.member
#survey
#fit-graph
#f.slopecoordinatecustom
A single (x, y) pair; either value may be a parameter expression.Accepts
(x, y)
(0, 0)
(a, 2)curve-pathcustom
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 - 1parametised-number-listcustom
Comma-separated numbers, each of which may be a parameter expression.Accepts
Comma-separated numbers or expressions
1, 2, 4
a, 2*aparametised-surface-expressioncustom
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) + asurface-colourcustom
How a surface is painted: a single hue from the colour palette, or a ramp — `multicolour` (full spectrum) or `temperature` (blue through white to red).Accepts
Colour namemulticolourtemperature
multicolour
temperature
bluecue-anchorcustom
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 + 500msoptional-cue-anchorcustom
Nullable cue anchor — null means the cue never fires on its own.Accepts
nullStep indexAbsolute timestep + offset
null
2
4 + 1.5s