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. Polygon

Polygon

polygonBlock elementGraph

A filled or unfilled polygon shape. Connect multiple points to create custom shapes.

Attributes

dataRequiredImplicit
parametised-coordinate-list
Also written: pointsCoordinate list.The head shorthand supplies it: polygon:value
fill
boolean
Also written: filledFill polygon.
Defaulttrue
colour
colour
Also written: colorColour.
Defaultteal
opacity
number
Opacity.
Default1
label
rich-text
Text drawn beside the element — rich text, so `$maths$` and inline formatting render. Fades and draws with the element.
hidden
boolean
Declared but not drawn. Animatable — `hidden: true !cue.to{false}(at: 2)` reveals it — and unlike a `cue`, 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. Nothing at all on a graph that is not editable.
Defaultfalse
text-size
number
Text size.
Default20
z
parametised-number
Stacking order. Higher z renders on top; when omitted or equal, elements stack in document order (later on top).

Allowed content

Body { }Inline Chalk content (formatted text, inline math, links, and inline elements)

Allowed in

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

Examples

polygon(data: (0,0),(2,0),(1,2))
polygon(data: (-1,-1),(1,-1),(0,1); fill: false; colour: teal)
On this page
AttributesAllowed inExamples
Polygon · Internote