Manual
Overview
Language
IntroductionScenes & structureText & inlineGraphsCode panesAnimationDataReuse & logicExpressions & parameters
Elements
Text
ParagraphHeading 1Heading 2Heading 3Heading 4Unordered ListDivider
Media
ImageTableEquation
Callouts
NoteDefinitionExampleTask
Graph
GraphLinePolygonCurveIntegralScatterHistogramPointSegmentVectorCircleSquareRectangleTriangleStarDiamondHexagonTextAxis labelAxis BraceFitResidualsContourHeatmapParameter
Code
Code canvasLines
Animation
CueDraw cueTrace cueHighlight cueSpotlight cueType cue
Structure
SceneStep
Reference
Internote Reference
Inline
Formatting
BoldItalicsInline CodeHighlightLink
Text colour
Red textOrange textYellow textGreen textTeal textBlue textPurple textPink textGrey text
Maths
Maths
Reference
Internote ReferenceValueConstant
Other
FootnoteIcon
Directives
DatasetIncludeConstantsTemplatePresetConditionalForIgnore
Keyframes
KeyframeZoom keyframe
Attribute types
?
  1. Elements
  2. Graph
  3. Text

Text

textBlock elementGraph

Freestanding text at (x, y) — a mark that is nothing but its label. Use it for annotations that belong to the plot itself rather than to any one mark: a region’s name, a caption inside the frame, a worked value.

Attributes

labelRequiredImplicit
rich-text
The text itself — rich, so `$maths$` and inline formatting render.The head shorthand supplies it: text:value
x
number
X coordinate of the anchor.
Default0
y
number
Y coordinate of the anchor.
Default0
size
number
Text size.
Default20
colour
colour
Also written: colorColour.
Defaultneutral
anchor
How the text sits on its point: `middle` centres it, `start` and `end` put its left or right edge there.
Defaultmiddle
hidden
boolean
Declared but not drawn. Animatable — `hidden: true !cue.to{false}(at: 2)` reveals it — and a hidden element still frames the plot, so the axes do not jump when it appears.
Defaultfalse
lock
boolean
Also written: lockedKeeps the reader from editing this element on an `editable:` graph.
Defaultfalse
z
parametised-number
Stacking order. Higher z renders on top; when omitted or equal, elements stack in document order (later on top).

Allowed in

canvas.graph { }cue { }cue.draw { }cue.trace { }cue.highlight { }cue.spotlight { }

Examples

text(label: local maximum; x: 2; y: 4.5)
text(label: $R^2 = 0.97$; x: 8; y: 1; anchor: start)
On this page
AttributesAllowed inExamples
Text · Internote