Drawing

The React half: the hooks a surface is built on, the components it draws labels, maths and rich text with, the footer controls, and the geometry behind a mark.

@internote/canvas-sdk@internote/canvas-sdk/react65 exports

Also exported here, documented under @internote/canvas-sdk/host: BlankRenderContext, BlankElementRenderer.

#Components

Button
packages/canvas-sdk/src/react/chrome/Button.tsx:34
A button styled by the SDK's stylesheet, with an optional leading icon.

It is always type="button", so it never submits a form. Any other button attribute, className included, reaches the button.

<Button icon="play" iconOnly aria-label="Play" />

Also takes className, id and style. Any other prop is passed to the rendered element.

active
Whether the button shows as pressed, on the secondary background.
boolean
icon
A built-in icon name, or any element, drawn before the children.
BuiltinIconName | React.ReactElement
iconOnly
Whether the padding is square, for a button holding only an icon.
boolean
variant
The ground: the bordered surface, the accent colour, or transparent.
defaultprimaryghost
Default'default'
ExpressionValue
packages/canvas-sdk/src/content/expression-values.tsx:117
A bound expression in prose — what The slope is {{#f.slope}}. renders as.

Also takes className. Any other prop is passed to the rendered element.

expressionRequired
The bound expression to show; null shows an em dash.
ChalkExpression | null
options
How the number is formatted, such as its significant figures.
LiveValueFormatOptions
variables
Values for an equation's variables, by name.
Record<string, number>
FooterAction
packages/canvas-sdk/src/react/footer-actions.tsx:31
A button in an environment's footer, such as "Add point", with an optional picture or icon before its label.

Takes no className, style or id.

accent
What the picture on it is drawn in.
string
ariaLabel
The accessible name, where the caption alone does not say what the button does.
string
children
The button's caption.
ReactNode
disabled
Whether the button is shown but cannot be pressed.
boolean
hoverTint
The ground under the cursor — a step up from tint.
string
icon
An icon from the SDK's own set, drawn when there is no lead.
playpauseplusremovesettingslockeyeeyeOffchevronDownchevronUpchevronLeftchevronRight
lead
A picture of what the button makes, drawn in accent in place of the icon.
ReactNode
onClickRequired
Called when the button is pressed.
() => void
textColour
What its label is set in, against that ground.
string
tint
The button's ground — the palest tone of whatever it makes.
string
FooterCheck
packages/canvas-sdk/src/react/footer-controls.tsx:167
A checkbox, drawn with the same tick the colour swatches use, with an optional caption.

Takes no className, style or id.

ariaLabelRequired
The checkbox's accessible name.
string
checkedRequired
Whether the box is ticked.
boolean
label
A visible caption after the box.
string
onChangeRequired
Called when the reader toggles the box, with the new state.
(checked: boolean) => void
FooterColour
packages/canvas-sdk/src/react/footer-controls.tsx:210
A row of colour swatches in an environment's footer; the reader clicks one to choose it.

Takes no className, style or id.

ariaLabelRequired
The swatch group's accessible name.
string
onChangeRequired
Called when the reader picks a swatch, with its palette name.
(value: string) => void
optionsRequired
The palette names offered, one swatch each, in order.
string[]
resolveRequired
Palette name → a CSS colour, since the SDK holds no palette of its own.
(name: string) => string
valueRequired
The chosen palette name.
string
FooterDivider
packages/canvas-sdk/src/react/footer-text.tsx:67
A vertical hairline between the bar's groups — a reading and the control beside it, say.
FooterEditableValue
packages/canvas-sdk/src/react/footer-notation.tsx:235
A reading that can be typed into: the value as it is set, and a number field in its place while the reader is changing it.

The parameter element worked this way and it is worth keeping — a value on a slider is something you read far more often than you set, so it is written as maths until the moment it is not. Enter and blur commit, Escape puts the old value back.

Takes no className, style or id.

ariaLabelRequired
The accessible name of both the reading and the field.
string
displayRequired
How the value reads at rest — usually the maths it stands for.
ReactNode
max
The highest value a commit can give.
number
min
The lowest value a commit can give.
number
onCommitRequired
Called on Enter or blur with the typed number, clamped to min/max; not called for empty or non-numeric input.
(value: number) => void
step
The number field's step.
number
Default1
valueRequired
The current value, which the number field starts from.
number
FooterError
packages/canvas-sdk/src/react/footer-text.tsx:48
What went wrong with one row, said next to it.

Takes no className, style or id.

children
The message.
ReactNode
FooterExpression
packages/canvas-sdk/src/react/footer-notation.tsx:28
A run of notation: the fixed marks of an expression (y =, (, ,, )) with the writable parts between them.

Takes no className, style or id.

children
The notation: FooterSymbols and writable FooterValues or FooterMaths, in order.
ReactNode
FooterField
packages/canvas-sdk/src/react/footer-controls.tsx:23
A labelled control, in a row of them.

Takes no className, style or id.

childrenRequired
The control.
ReactNode
label
The caption set before the control.
ReactNode
FooterGrip
packages/canvas-sdk/src/react/footer-list.tsx:110
The grip a row is dragged by — the same glyph the design system's list field and the editor's block handles use, so a thing you can reorder looks the same wherever it is.

Takes no className, style or id.

ariaLabelRequired
The grip's accessible name, saying what it moves.
string
onPointerDownRequired
Called when the reader presses on the grip, with the event to start the drag from.
(event: React.PointerEvent<HTMLButtonElement>) => void
FooterList
packages/canvas-sdk/src/react/footer-list.tsx:22
A list in an environment's footer of the elements the reader has added, one FooterListRow per line.

Also takes className. Any other prop is passed to the rendered element.

children
The rows, each a FooterListRow.
ReactNode
FooterListRow
packages/canvas-sdk/src/react/footer-list.tsx:40
One row of a FooterList: a marker, the element's notation, and actions that show on hover.

Also takes style. Any other prop is passed to the rendered element.

actions
The row's own buttons (FooterRowAction), hidden until the row is hovered.
ReactNode
children
The row's notation — a FooterExpression.
ReactNode
detail
A second line, revealed by the row's own control.
ReactNode
dragging
Whether the row is the one being dragged in a reorder.
boolean
grip
The handle a reorderable row is dragged by; sits at the trailing edge.
ReactNode
lead
What the row is, at its leading edge — a FooterMarker.
ReactNode
muted
Present but not the reader's to change — held back from the rest.
boolean
FooterLocked
packages/canvas-sdk/src/react/footer-list.tsx:92
A lock icon for a FooterListRow the reader cannot edit, drawn where the drag handle would be.

Takes no className, style or id.

labelRequired
Why the row is locked; its accessible name and tooltip.
string
FooterMarker
packages/canvas-sdk/src/react/footer-list.tsx:141
The small coloured icon at the start of a FooterListRow that shows what kind of element the row is, drawn in the element's colour.

Takes no className, style or id.

ariaLabel
The accessible name when the marker is a button.
string
children
The mark itself, drawn by the environment in currentColor.
ReactNode
colourRequired
The element's CSS colour, which the mark is drawn in.
string
onClick
Called when the marker is pressed; without it the marker is not a button.
() => void
tint
The pale ground the mark sits on — its own hue, a shade of nothing.
string
FooterMath
packages/canvas-sdk/src/react/footer-notation.tsx:128
A text field for maths that shows the typeset formula until the reader clicks into it to edit.

Takes no className, style or id.

ariaLabelRequired
The field's accessible name.
string
invalid
Whether to mark the expression as not one the environment can use.
boolean
onChangeRequired
Called on every keystroke while editing, with the new text.
(value: string) => void
placeholder
Shown while the expression is empty.
string
readOnly
Set as maths, but not a field: a locked element is read, not edited.
boolean
valueRequired
The expression as the reader types it (x^2/4), converted to LaTeX for display.
string
FooterNote
packages/canvas-sdk/src/react/footer-text.tsx:36
A short, quiet piece of text.

Also takes className. Any other prop is passed to the rendered element.

children
The note's text.
ReactNode
FooterNumber
packages/canvas-sdk/src/react/footer-controls.tsx:50
A number, with its own steps — the design system's NumberField, in the footer's own controls.

Same arrangement: the field and a hairline-divided trailing cell holding the two steppers, the browser's own spinners hidden so a stray scroll cannot alter a value. While it is being typed in it holds whatever was typed — including states no number can be, such as empty — and settles on blur, so clearing the field to retype it does not fight back with a clamped value.

Takes no className, style or id.

ariaLabelRequired
The field's accessible name; the steppers are named "<label>: more" and "<label>: less".
string
invalid
Whether to mark the value as not one the environment can use.
boolean
max
The highest value the steppers and blur allow.
number
min
The lowest value the steppers and blur allow.
number
onChangeRequired
Called with the new text on every keystroke and stepper press, and with the clamped number on blur.
(value: string) => void
step
How far one stepper press moves the value; results land on the step's decimal places.
number
Default1
valueRequired
The field's text — a string, so it can hold an empty or half-typed number.
string
FooterReadout
packages/canvas-sdk/src/react/footer-text.tsx:21
A value the environment is reporting rather than asking for.

Also takes className. Any other prop is passed to the rendered element.

children
The value, as it reads.
ReactNode
muted
Whether to set it in the quieter tone.
boolean
FooterRowAction
packages/canvas-sdk/src/react/footer-actions.tsx:210
An icon button inside a FooterListRow, such as settings or remove, hidden until the row is hovered.

Takes no className, style or id.

active
Whether what the button opens is open; drawn pressed and exposed as aria-pressed.
boolean
ariaLabelRequired
The button's accessible name.
string
iconRequired
The icon from the SDK's set; chevronDown turns over while active.
playpauseplusremovesettingslockeyeeyeOffchevronDownchevronUpchevronLeftchevronRight
onClickRequired
Called when the button is pressed.
() => void
FooterScrollRow
packages/canvas-sdk/src/react/footer-actions.tsx:109
A row of controls too long for the space it has — the design system's ScrollRow, in the footer's own controls.

Same arrangement, for the same reasons: the arrows sit OVER each edge rather than beside the row, on the page's own background, so a row that fits reads as a plain flex row and a row that does not keeps its full width. They fade in only when there is something that way, and the class that shows them is written straight to the DOM — a browser holds React's re-renders back during a scroll gesture to keep the scroll itself smooth, so a state-driven arrow would lag the finger.

Also takes className. Any other prop is passed to the rendered element.

ariaLabel
The scrolling region's accessible name.
string
children
The controls in the row.
ReactNode
nextLabel
The right arrow's accessible name.
string
Default'Next'
previousLabel
The left arrow's accessible name.
string
Default'Previous'
scrollStep
How many items one arrow press advances by; a row whose first item is wider than half the view moves most of a view instead.
number
Default3
FooterSelect
packages/canvas-sdk/src/react/footer-controls.tsx:131
A choice from a list, as a native select in the footer's field style.

Takes no className, style or id.

ariaLabelRequired
The select's accessible name.
string
onChangeRequired
Called when the reader picks an option, with its value.
(value: string) => void
optionsRequired
The choices in order; an option without a label shows its value.
Array<{ value: string; label?: string }>
valueRequired
The chosen option's value.
string
FooterSlider
packages/canvas-sdk/src/react/footer-controls.tsx:270
A slider — track, the part of it that is set, and the handle.

Built rather than borrowed from the browser: a native range input styles differently in every engine, and this one has to sit in a row of maths without looking like it came from somewhere else. While a drag is running the handle follows the pointer exactly and the value it reports is stepped, which is the arrangement the parameter element used — a handle that jumps between steps under the finger feels broken even when the number is right.

Takes no className, style or id.

ariaLabelRequired
The slider's accessible name.
string
maxRequired
The value at the track's right end.
number
minRequired
The value at the track's left end.
number
onChangeRequired
Called as the reader drags, clicks, presses an arrow key or double-clicks, with the stepped value.
(value: number) => void
origin
Marked on the track, where there is one worth returning to — and the value a double-click returns to.
number
stepRequired
The grid reported values snap to, and how far one arrow key moves.
number
valueRequired
The current value.
number
FooterSpacer
packages/canvas-sdk/src/react/footer-text.tsx:58
Pushes what follows to the trailing edge.
FooterSymbol
packages/canvas-sdk/src/react/footer-notation.tsx:42
A fixed mark inside notation — y =, a bracket, an arrow.

Takes no className, style or id.

children
The mark's LaTeX source.
string
FooterValue
packages/canvas-sdk/src/react/footer-notation.tsx:56
A writable part of an expression — the field, inline in the notation.

Takes no className, style or id.

ariaLabelRequired
The field's accessible name.
string
invalid
Whether to mark the value as not one the environment can use.
boolean
onChangeRequired
Called on every keystroke, with the field's new text.
(value: string) => void
placeholder
Shown while the field is empty.
string
readOnly
Shown, not offered — a locked element's value reads as text.
boolean
title
The field's tooltip — room to say why a value is invalid.
string
valueRequired
The text in the field.
string
width
short for a coordinate, auto to take the room a formula needs.
shortauto
Default'auto'
HighlightRing
packages/canvas-sdk/src/react/attention.tsx:197
The rings of one running highlight, drawn over region.

Takes no className, style or id.

regionRequired
The box they are rasterised over.
Region
specRequired
The rings to draw, from highlightSpec.
HighlightSpec
Icon
packages/canvas-sdk/src/react/chrome/Icon.tsx:62
A glyph in a span, drawn in the current text colour at the current font size.

A glyph element is drawn as given; otherwise name picks one of the built-in 24×24 paths, and with neither the span holds an empty SVG. The built-in SVG is hidden from screen readers, so an icon that carries meaning needs an aria-label.

Also takes className. Any other prop is passed to the rendered element.

aria-label
The accessible name, set on the wrapping span.
string
glyph
Any element to draw instead of a built-in glyph; wins over name.
React.ReactElement
name
One of the SDK's built-in glyphs.
playpauserestartloopnextprevfullscreenexit-fullscreencopycheck
size
The icon's size, as a font size: a number is pixels, a string any CSS length.
number | string
Default'1em'
InlineContent
packages/canvas-sdk/src/react/surface-label.tsx:176
Renders compiled chalk inline content, such as a label with bold text or maths, as HTML.

Takes no className, style or id.

itemsRequired
A run of chalk inline content, or a plain string.
unknown
InlineTextFunction
packages/canvas-sdk/src/content/text-function-values.tsx:137
Renders a text-function micronode such as !format:comma{…}, !truncate:8{…} or !pad:6{…}, applied to its body's current text.

Takes no className, style or id.

attributes
The micronode's attributes, such as as: and places: for format, by name.
Record<string, unknown>
itemsRequired
The micronode's body, a string or inline content; live values in it are read from the store.
unknown
nameRequired
The text function to apply.
formatupperlowertitletruncatepad
LiveValuesProvider
packages/canvas-sdk/src/content/live-values.tsx:34
Makes one LiveValueStore the store every live value beneath it publishes to and reads from.

Without a provider, reads come back undefined, which displays as an em dash, and publishing does nothing.

Takes no className, style or id.

childrenRequired
The content that publishes and reads live values.
React.ReactNode
storeRequired
The document's store.
LiveValueStore
Maths
packages/canvas-sdk/src/react/math/Maths.tsx:59
Renders a LaTeX string as maths with KaTeX, re-rendering only when the string changes.

react-katex writes its output through dangerouslySetInnerHTML, so every render replaces a subtree of dozens of spans — the browser re-parses that HTML and lays it out again whether or not a character changed. An environment with a running animation renders every frame, which made every label on a plot and every reading in a footer a full typeset and relayout per frame.

Memoised on its source, so a formula that has not changed is not touched. Everything that sets maths goes through here. Notation that does not parse shows as the source text rather than an error.

Takes no className, style or id.

block
KaTeX's own DISPLAY MODE: a formula on a line of its own, centred.
boolean

Not the same thing as display, and the difference is not only layout. display sets \displaystyle on an inline formula, which grows the glyphs and puts limits over their operators — right for a reading in a footer, which has to sit in the row beside its label. Display mode is the mode itself, and some notation is admitted in no other: align* and the other alignment environments are refused inline, whatever \displaystyle says, so a body that aligns has to come through here.

childrenRequired
The LaTeX source.
string
display
Display-size glyphs — a reading standing out in a row — still set inline.
boolean
ParameterGlyph
packages/canvas-sdk/src/react/parameter-glyph.tsx:42
A dial for a parameter the reader moves; a clock for one the scene sweeps.

Takes no className, style or id.

sweptRequired
Whether the scene drives this letter — a clock rather than a dial.
boolean
ParameterRow
packages/canvas-sdk/src/react/ParameterRow.tsx:33
One parameter, as a row: what it is called, where it stands, and a slider over what it ranges across.

The same row whoever is driving the letter. A cue.parameter sweeping through its years gets exactly what a hand-dragged parameter gets, because a reader looking at a moving number wants the same two things — to read it, and to be able to take hold of it. Dragging a swept one displaces it and it plays on from there; the transport that plays it sits in the TOOLBAR, where it drives the step's whole choreography rather than this one letter, and this panel folds away, which is no reason for the clock to stop.

Takes no className, style or id.

axisRequired
The parameter this row is for.
ParameterAxis
onChangeRequired
Called as the reader drags or types a new one.
(next: number) => void
valueRequired
Where it stands right now.
number
RichLabel
packages/canvas-sdk/src/react/surface-label.tsx:81
One label, anchored at a point on the surface.

The box is deliberately roomy and transparent; the flex alignment inside it is what puts the text exactly where align and baseline say. Nothing is clipped to it, so a label never loses a descender to its own container.

Also takes className. Any other prop is passed to the rendered element.

align
Where the anchor sits along the label's width.
startmiddleend
Default'middle'
baseline
Where the anchor sits against its height.
abovebelowcentre
Default'above'
colour
Text colour; the label inherits the mark's when given.
string
contentRequired
The attribute's inline value (or a plain string).
unknown
maxWidth
A width the words must fit inside, wrapping onto further lines rather than running past it. Without it a label is one line however long it is, which is right for nearly all of them — only a named tick standing in a gutter has a hard edge to respect.
number
rotate
Degrees, about the anchor — for a name turned up the side of an axis.
number
sizeRequired
Font size in pixels (already unit-scaled).
number
xRequired
Anchor point, in pixels.
number
yRequired
Anchor point, in pixels.
number
SymbolGlyph
packages/canvas-sdk/src/content/symbols.tsx:262
One !symbol, drawn at the size and colour of the text around it.

The SVG is labelled rather than hidden: a symbol stands in for a word (a tick for "yes", a house for "house"), so a reader who cannot see it loses the sentence, not a decoration.

Also takes className. Any other prop is passed to the rendered element.

name
The name: the author wrote. An unknown one draws nothing.
string

#Hooks

useEnvironmentSession
packages/canvas-sdk/src/react/use-environment-session.ts:18
Reactive view of an environment's session-tier state — the sanctioned way a Surface and a Footer share instrument state (they are separate component trees; the session store is their common ground and notifies on writes).
<S>(ctx: EnvironmentContext, initial: () => S): [
    S,
    (updater: (previous: S) => S) => void
]
useLiveValue
packages/canvas-sdk/src/content/live-values.tsx:54
The current value of #nodeId.member, live; undefined without a provider or publisher.
(nodeId: string | null, member: string | null): number | undefined
useLiveValueStore
packages/canvas-sdk/src/content/live-values.tsx:47
Returns the nearest LiveValuesProvider's store, or null outside one.
(): LiveValueStore | null
usePanZoomGestures
packages/canvas-sdk/src/react/use-pan-zoom-gestures.ts:65
Binds both gestures to ref for as long as it is mounted and enabled.
<V>(ref: React.RefObject<HTMLElement | null>, options: PanZoomOptions<V>): void
usePublishLiveValues
packages/canvas-sdk/src/content/live-values.tsx:75
Publish a set of computed values, keeping the store in step with what this component computed last: a slot it stops publishing WHILE ALIVE is cleared, so a value that becomes uncomputable reads as absent rather than stale.
(entries: ReadonlyArray<LiveValueEntry>): void

Unmounting deliberately clears NOTHING. An environment leaves the tree when its scene scrolls away, but its session state — the reader's parameters, the fit they chose — persists, and the environment will resume it on return. The published values are the prose-visible face of that same state, so they persist with it; clearing on unmount would flash every citation back to an em dash whenever the reader scrolled past the environment's scene.

useSurfaceMetrics
packages/canvas-sdk/src/react/use-surface-metrics.ts:50
Measures the surface and re-measures it whenever it resizes or the host enters or leaves presentation.
(
    containerRef: React.RefObject<HTMLElement | null>,
    svgRef: React.RefObject<SVGSVGElement | null>,
    presenting: boolean,
): SurfaceMetrics

presenting is ctx.isPresenting; passing it is what schedules the settle-measure after the portal restage.

useTransient
packages/canvas-sdk/src/react/use-transient.ts:34
This environment's current reading on channel, re-rendering when it changes.
<T>(channel: TransientValue<T>, where: Addressed): T | null
useTransientCollection
packages/canvas-sdk/src/react/use-transient.ts:45
Every member's reading on channel for this environment.
<T>(channel: TransientCollection<T>, where: Addressed): readonly T[]

#Functions

leaderLine
packages/canvas-sdk/src/geometry/leader.ts:48
The line from a mark to a label that has been carried away from it.
(
    placement: LabelBoxPlacement,
    anchorX: number,
    anchorY: number,
    u: number,
    clear?: number,
): {
    x1: number;
    y1: number;
    x2: number;
    y2: number;
} | null

It starts clear of the mark's own ink and stops at the edge of the label's box, so it points at the words without touching either — a leader that runs under the letters reads as a strikethrough. Null when the two are close enough that the line would be shorter than the gaps at its ends, which is the case a leader is not for.

makeArrowhead
packages/canvas-sdk/src/geometry/arrowheads.ts:25
A notched arrowhead at a tip, pointing along the direction (cos, sin), in pixels.
(
    tipX: number,
    tipY: number,
    cos: number,
    sin: number,
    arrowSize: number,
    base: number,
): {
    points: string;
    trimX: number;
    trimY: number;
}

points is the four-point SVG polygon; base is its length from tip to back and arrowSize sets its width. trimX/trimY is where the line it caps should end, inside the notch, so the stroke does not poke through the tip.

sampleShapePoints
packages/canvas-sdk/src/geometry/polygon-sampling.ts:50
Sample N perimeter points for any supported shape (12-o'clock start, clockwise).
(x: number, y: number, r: number, type: string, n: number): Vec2[]
asksForAlignment
packages/canvas-sdk/src/react/math/Maths.tsx:28
Whether a body asks to be ALIGNED — an & of its own, outside any environment it opens for itself.
(latex: string): boolean
highlightSpec
packages/canvas-sdk/src/react/attention.tsx:74
A running cue.highlight as the rings to draw right now: none before the anchor, deepest mid-window, gone by the end.
(
    node: CompiledNode,
    runtime: EnvironmentContext["animation"],
    unit: number,
    id: string,
): HighlightSpec | null
holdsSpotlight
packages/canvas-sdk/src/react/attention.tsx:172
Whether a spotlight is running anywhere inside these nodes.
(nodes: CompiledNode[], runtime: EnvironmentContext["animation"]): boolean
parseToLatex
packages/canvas-sdk/src/react/math/parseToLatex.ts:207
Converts maths typed in plain shorthand, such as x^2/4 or sqrt(2), into LaTeX that KaTeX can render.
(input: string): string
PublishLiveValues
packages/canvas-sdk/src/content/live-values.tsx:105
Publishes live values from JSX; the component form of usePublishLiveValues, which renders nothing.
({ entries }: { entries: ReadonlyArray<LiveValueEntry>; }): null
renderRichText
packages/canvas-sdk/src/content/renderRichText.tsx:69
Renders inline content — text runs, bound expressions and micronodes — as React nodes, styled by the SDK's ine-rt-* classes.
(nodes: RichTextNode[] | string, options?: RichTextOptions): React.ReactNode

A string is returned as is. It renders bold, italic, code, highlight, link (in a new tab), latex (with KaTeX, showing the source on a parse error), symbol, the colour names, and the six text functions; a bound expression renders as its live value. footnote, cite and internote go to the host's renderers in options when given, and to a plain fallback otherwise: a native tooltip, a raised dot, and a link to /{id}. An unknown micronode renders its body; a list or a block break renders nothing.

spotlightStrength
packages/canvas-sdk/src/react/attention.tsx:143
How strongly a spotlight is holding the environment, 0 when none is.
(nodes: CompiledNode[], runtime: EnvironmentContext["animation"]): number

A spotlight is purely the dimming: everything else on the environment goes down around its content, which is left at full strength. No rings — a highlight is what rings something, and the two can be used together.

#Constants

MARK_RADIUS
packages/canvas-sdk/src/geometry/leader.ts:37
The box a mark's own ink is assumed to occupy, so no leader starts on it.
number
SPOTLIGHT_DIM
packages/canvas-sdk/src/react/attention.tsx:127
How far the rest of the environment goes down while a spotlight is on it.
number
SYMBOL_GLYPHS
packages/canvas-sdk/src/content/symbols.tsx:50
The drawing for each SymbolName, as the children of a 16×16 <svg>.
Record<SymbolName, React.ReactNode>

#Interfaces

LabelBoxPlacement
packages/canvas-sdk/src/geometry/leader.ts:22
Where a label sits and how big the box reserved for it is.
heightRequired
The height of that box.
number
widthRequired
The box that was reserved for it — what a leader stops at.
number
xRequired
The centre of the label's box, in pixels.
number
yRequired
The centre of the label's box, in pixels.
number
PanZoomOptions
packages/canvas-sdk/src/react/use-pan-zoom-gestures.ts:39
What an environment supplies to usePanZoomGestures: the arithmetic, not the binding.
baseRequired
The view a gesture starts from: the one already queued this frame, else the reader's, else the one the surface drew. Null declines the gesture.
V | null
clamp
Applied to every queued view — the limits the reader may not leave.
V
commitRequired
Called at most once a frame, with the view as it settled.
void
drag
The view after the pointer moved from from to to, or null to ignore it. Absent means this surface does not pan — a polar plot zooms about its origin and has no pan, for the same reason a compass rose is not draggable.
V | null
enabledRequired
Without it nothing is bound at all — the reader may not move this view.
boolean
resetRequired
Double-click: hand the frame back to the author.
void
wheelRequired
The view after one wheel notch, or null to ignore it.
V | null
PointerAt
packages/canvas-sdk/src/react/use-pan-zoom-gestures.ts:31
Where the pointer was, in client coordinates.
xRequired
Client x, as the event reported it.
number
yRequired
Client y, as the event reported it.
number
Region
packages/canvas-sdk/src/react/attention.tsx:115
The box a highlight's rings are rasterised over, in environment coordinates.
heightRequired
How tall the box is.
number
widthRequired
How wide the box is.
number
xRequired
Left edge.
number
yRequired
Top edge.
number
SurfaceMetrics
packages/canvas-sdk/src/react/use-surface-metrics.ts:32
A surface's measured box, and the unit every length inside it is expressed against.
heightRequired
The SVG's own height in viewBox units.
number
unitRequired
--cnv-unit as pixels — 17 reading, 22 presenting.
number
widthRequired
The SVG's own width in viewBox units — never the padded container's.
number

#Types

BuiltinIconName
packages/canvas-sdk/src/react/chrome/Icon.tsx:26
The glyphs Icon draws by name, without the host supplying an SVG.
playpauserestartloopnextprevfullscreenexit-fullscreencopycheck
LabelAlign
packages/canvas-sdk/src/react/surface-label.tsx:43
Where the anchor sits along the label's width.
startmiddleend
LabelBaseline
packages/canvas-sdk/src/react/surface-label.tsx:45
Where the anchor sits against the label's height.
abovebelowcentre

Last updated