Skip to content

Keywords

A keyword is never a name: folder cannot be a variable. min and max are the exception - they mean something only after soft, and are the list functions everywhere else.

A folder of statements.

Groups statements in the expression list. The title is optional, and metadata written straight after the { styles the folder itself. Folders do not nest.

folder "Waves" { @ collapsed
y = sin(x)
}
Open in playground →

A table of columns.

Each entry is a column: x_1 = [1, 2, 3] is a header and its values, a bare expression is a computed column. Metadata straight after the { applies to every column.

table { x_1 = [1, 2, 3]; y_1 = [1, 4, 9] @ lines }
Open in playground →

Calculator settings.

The graph’s settings, one key: value to an entry. At most one per file, at the top level.

config { showGrid: false; xmin: -10; xmax: 10 }
Open in playground →

Bring in another file, as a folder.

The path is relative to this file, and .axis may be left off. The imported statements land in one folder, named after the file unless as names it.

import "./lib/waves" as "Waves" @ collapsed: false
Open in playground →

A picture on the graph.

A path beside this file, an http(s): URL or a data: URI.

image "./images/wave.png" @ center: (0, 0), width: 10
Open in playground →

Run an action over and over.

The graph’s ticker: an action, or a run of them, performed every tick. dt is the milliseconds since the last one. One per graph, at the top level.

ticker n -> n + dt @ minStep: 50, playing
Open in playground →

A named set of properties.

Properties written once and applied with use: name wherever a statement’s metadata goes. Styles may use other styles. Top level only.

style emphasis { color: RED; lineWidth: 4 }
y = x @ use: emphasis
Open in playground →

A named expression, substituted where it is used.

Replaced by its body wherever the name appears, with the arguments put in for the parameters. In scope everywhere, imports included. Top level only.

macro wave(k, phase) = sin(k * x + phase)
Open in playground →

The title of an import’s folder.

import "./lib/waves" as "Waves"
Open in playground →

List comprehension.

Binds list variables for the expression in front of it.

L = [i ^ 2 for i = [1...10]]
Open in playground →

Local definition.

Substitutes values into the expression in front of it.

f(x) = x n with n = 3
Open in playground →

A slider’s step.

a = 1 @ slider: -5..5 step 0.5
Open in playground →

Slider ends that may be dragged past.

soft makes both ends of a range soft; soft min or soft max only the one.

b = 0 @ slider: 0..10 soft max
Open in playground →

The lower end of a range.

After soft: only the lower end may be dragged past.

The upper end of a range.

After soft: only the upper end may be dragged past.