nodes.svelte#

Classes#

CanvasNodes#

Defined in: arranger/src/nodes.svelte.ts:66

The nodes of a canvas, read from input whenever it changes.

Constructors#

Constructor#

new CanvasNodes(input, transient): CanvasNodes

Defined in: arranger/src/nodes.svelte.ts:156

The nodes of input; transient gives the preview of the host’s transient command, read apart from input so that a new one replaces its block’s node without projecting the view again.

Parameters#
input#

() => Projected

transient#

() => Preview | null

Returns#

CanvasNodes

Properties#

byId#

readonly byId: ReadonlyMap<string, BlockNode>

Defined in: arranger/src/nodes.svelte.ts:88

The projected nodes by block id.

nodes#

nodes: BlockNode[]

Defined in: arranger/src/nodes.svelte.ts:109

The nodes Svelte Flow shows: the projection, the previewed block’s node replaced. Svelte Flow writes the dragged positions into this value during a block drag; the next projection or preview replaces them.

preview#

preview: Preview | null

Defined in: arranger/src/nodes.svelte.ts:73

The block a gesture previews; shown, never stored, until the gesture ends.

previewed#

readonly previewed: BlockNode | null

Defined in: arranger/src/nodes.svelte.ts:96

The previewed block’s node, drawn at its preview: a gesture’s, else the transient command’s; null without either.

projected#

readonly projected: readonly BlockNode[]

Defined in: arranger/src/nodes.svelte.ts:81

One node per block of the view: re-run when the view, the selection or the editor changes.

resync#

resync: number

Defined in: arranger/src/nodes.svelte.ts:78

Bumped to show the projection again although nothing it reads changed: after Svelte Flow has set its nodes’ selected flags itself.

Methods#

boundsOf()#

boundsOf(id, box): Rect | undefined

Defined in: arranger/src/nodes.svelte.ts:129

The rectangle on the canvas of box of block id as shown, its preview’s while one is under way: the node’s for the block itself, a frame’s or a card’s where the shown drawing draws it; undefined where it is not shown.

Parameters#
id#

string

box#

DrawnBox

Returns#

Rect | undefined

live()#

live(dragged): LivePlacement | null

Defined in: arranger/src/nodes.svelte.ts:144

The placement of the previewed block, or else of block dragged, as shown, with the drawing its node shows; null without either.

Parameters#
dragged#

string | null

Returns#

LivePlacement | null

shown()#

shown(id): BlockNode | undefined

Defined in: arranger/src/nodes.svelte.ts:118

The node of block id as shown: its preview’s while one is under way.

Parameters#
id#

string

Returns#

BlockNode | undefined

Interfaces#

Preview#

Defined in: arranger/src/nodes.svelte.ts:35

The block a gesture or a transient command previews, and the view its command gives.

Properties#

id#

readonly id: string

Defined in: arranger/src/nodes.svelte.ts:36

view#

readonly view: View

Defined in: arranger/src/nodes.svelte.ts:37


Projected#

Defined in: arranger/src/nodes.svelte.ts:25

What the projection reads.

Properties#

editing#

readonly editing: Editing | null

Defined in: arranger/src/nodes.svelte.ts:29

metrics#

readonly metrics: FontMetrics

Defined in: arranger/src/nodes.svelte.ts:28

pane#

readonly pane: PaneSource | undefined

Defined in: arranger/src/nodes.svelte.ts:31

The pane of the canvas (Pane.view).

selection#

readonly selection: Selection

Defined in: arranger/src/nodes.svelte.ts:27

view#

readonly view: View

Defined in: arranger/src/nodes.svelte.ts:26