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

Diamond

diamondBlock elementGraph

A diamond shape positioned at (x, y) with a given size. Supports fill, opacity, and color customization.

Attributes

xImplicit
parametised-number
X coordinate.The head shorthand supplies it: diamond:value
Default0
y
parametised-number
Y coordinate.
Default0
size
parametised-number
Size.
Default1
colour
colour
Also written: colorColour.
Defaultpurple
fill
boolean
Fill shape.
Defaulttrue
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

diamond(x: 0; y: 0; size: 2)
diamond(x: -1; y: -1; size: 1.2; opacity: 0.8)
On this page
AttributesAllowed inExamples
Diamond · Internote