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. Directives
  2. Dataset

Dataset

@dataDirective

Declares a named dataset — tabular data with named columns, written once and reached from anywhere in the document. Inline, the body is pipe-delimited rows under a header row that names the columns; attached, a CSV file supplies both. Every cell is a string until an attribute type parses it. Reach a column with {{#name.column}} to splice its cells as comma-separated text at compile time, or bind #name.column where an attribute takes a reference.

Attributes

srcImplicit
CSV attachment to fill the dataset from; the file's header row names the columns. Omit it to declare the rows inline in the body instead. Written in the head: @data#survey:plants.csv.The head shorthand supplies it: @data:value

Allowed content

Body { }header and rows, pipe-delimited (inline form only)

Examples

@data#islands{
    island | area   | species
    Baltra | 25.09  | 58
    Pinta  | 60.0   | 94
}
@data#survey:galapagos-plants-1973.csv
canvas.code{
    lines{
        area = np.array([{{#survey.area}}])
    }
}(
    language: python
)
On this page
AttributesExamples
Dataset · Internote