Manual
The document
OverviewGrammarDocument headerSyntax cheatsheet Scene Step
Content
Text blocks
Paragraph Heading 1 Heading 2 Heading 3 Heading 4 List
Maths
Equation Maths
Tables & images
Table Image
Formatting
Bold Italics Inline Code Highlight
Text colours
Links & references
Link Footnote Icon Internote Reference
ValueWhere inline content works
Narrative only
Note Definition Example Task Divider
Graph pane
Graph
Curves & areas
Curve Integral
Data marks
Scatter Histogram
Fits
Fit Residuals
Surfaces
Contour Heatmap
Marks
Line Segment Vector Point Polygon Text
Shapes
Circle Square Rectangle Triangle Star Diamond Hexagon
Axis furniture
Axis label Axis Brace
Expressions
Code pane
Code Lines
Animation & interaction
Cues that wrap content
Cue Draw cue Trace cue Highlight cue Spotlight cue Type cue
Cues on a value
Value cue Zoom cue
Anchors & timing Parameter
Advanced features
Data Let Define Preset Include If For Ignore
Reference
All constructs A–ZAttribute types
Concepts
IdentifiersBody & detailDerived attributes
Guidance
The narrative contractWhat earns a place on the canvasParameter or cueHonest numbersCode demonstrates, never computesAuthor-attached data only
?
  1. Graph pane
  2. Expressions

Expressions

Writing maths a graph can plot, and the parameters a reader can move.

#Writing an expression

Wherever a graph wants a function, it takes a math expression in x: curve(expression: x^2 - 2x + 1), sin(a * x), 100 - 4.9x^2. Powers use ^, the usual functions are available by name, and multiplication may be implicit — 4.9x^2, 2(x + 1) and (m - px) / q with multi-letter parameter runs all parse.

x is the only free variable, with one exception: the surface marks contour and heatmap plot a function of the plane, so y is legal alongside it there and nowhere else.

#Parameters

A parameter declares a single-letter variable and hands the reader a slider for it. Every expression in the pane that mentions that letter re-evaluates as it moves, which is what makes a curve something to play with rather than something to look at.

canvas.graph{
    parameter#m(var: m; range: [0, 5]; default: 2)
    curve#f(expression: m * x)
    point(x: 1; y: m; label: $m$)
}

#Where expressions are accepted

Any attribute whose type carries parametised- takes an expression where a plain value would otherwise stand — a point's coordinates may be (a, 2a), a curve's domain [0, b], an integral's bound from: m - s. The attribute types page lists each of them and what it accepts; every reference page names the type of each of its attributes.

On this page
Writing an expressionParametersWhere expressions are accepted
PrivacyTermsContact Support
Expressions · Internote