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.
Statements
Section titled “Statements”folder
Section titled “folder”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)}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 }config
Section titled “config”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 }import
Section titled “import”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: falseA 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: 10ticker
Section titled “ticker”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, playingA 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: emphasisA 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)Everything else
Section titled “Everything else”The title of an import’s folder.
import "./lib/waves" as "Waves"List comprehension.
Binds list variables for the expression in front of it.
L = [i ^ 2 for i = [1...10]]Local definition.
Substitutes values into the expression in front of it.
f(x) = x n with n = 3A slider’s step.
a = 1 @ slider: -5..5 step 0.5Slider 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 maxThe 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.