project#
Interfaces#
NodeRect#
Defined in: arranger/src/project.ts:93
A block’s node rectangle on the canvas: its top left corner and its size.
Extends#
Properties#
height#
readonlyheight:number
Defined in: layout/src/arrangement.ts:11
Inherited from#
width#
readonlywidth:number
Defined in: layout/src/arrangement.ts:10
Inherited from#
x#
readonlyx:number
Defined in: arranger/src/project.ts:94
y#
readonlyy:number
Defined in: arranger/src/project.ts:95
Variables#
ARRANGEMENT_GAP#
constARRANGEMENT_GAP:32=32
Defined in: arranger/src/project.ts:90
The gap, in canvas units, between two blocks of an arranged canvas, and between two rows or columns.
Functions#
arrangedPlaces()#
arrangedPlaces(
nodes,arranged,start):Map<string, {x:number;y:number; }>
Defined in: arranger/src/project.ts:123
Where the blocks lie on a canvas arranged arranged (arrangedOf on the
arranger), by block id: their nodes, given in the order they are packed
in with their rectangles, packed in that order by layout’s packed
(docs/drawing.md in TimeToShare, section 8.6) from start (the
packingOrigin of the blocks’ stated places), ARRANGEMENT_GAP apart,
in a matrix of arranged.columns columns. Each block’s stated x and
y are kept and not used; a free canvas uses them again.
Parameters#
nodes#
readonly (NodeRect & object)[]
arranged#
start#
{ x: number; y: number; } | undefined
Returns#
Map<string, { x: number; y: number; }>
blockPlaces()#
blockPlaces(
view,metrics,pane?):Map<string, {x:number;y:number; }>
Defined in: arranger/src/project.ts:162
Where every block of view lies on the canvas, by id: packed in index
order where the workspace arranges its blocks (arrangedPlaces, from the
packingOrigin of their places), at nodePosition otherwise.
Parameters#
view#
metrics#
FontMetrics
pane?#
Returns#
Map<string, { x: number; y: number; }>
blocksInOrder()#
blocksInOrder(
view): readonlyBlock[]
Defined in: arranger/src/project.ts:74
The blocks of a view by their parent, then their index (ids break ties), memoized by the view: a view is immutable.
Parameters#
view#
Returns#
readonly Block[]
insideOf()#
insideOf(
manifest,drawing,element,raised?):ReadonlySet<string>
Defined in: arranger/src/project.ts:36
The keys of the element addresses drawing draws inside element, the ID
of a group or a timeline of manifest (core’s contains), or of every
address it draws but the block’s background when element is null, the
whole block; a named timestamp that draws nothing counts as drawn where
the canvas shows it in its place (affordancesOf, raised naming the
root whose ancestor cards are raised, raisedRoot, else null, as the
block node draws them). Memoized by the drawing, the element and the
root, so an unchanged node keeps the identical set.
Parameters#
manifest#
drawing#
element#
string | null
raised?#
string | null = null
Returns#
ReadonlySet<string>
livePlacement()#
livePlacement(
block,position,values,drawing):LivePlacement
Defined in: arranger/src/project.ts:305
The placement of block as a gesture shows it: the previewed values
over the stored ones, drawing the drawing its node shows, and x, y
the place origin of the node where the canvas has it, position, the
drawing placing its origin at drawing.origin in the block (nodePosition
inverted).
Parameters#
block#
position#
x#
number
y#
number
values#
Partial<Block>
drawing#
Returns#
packingOrigin()#
packingOrigin(
places): {x:number;y:number; } |undefined
Defined in: arranger/src/project.ts:104
Where an arranged canvas packs its blocks from: the top left of every
block’s stated place (nodePosition), the least x and the least y,
so the arrangement stays where it is whichever block comes first;
undefined without a block.
Parameters#
places#
readonly object[]
Returns#
{ x: number; y: number; } | undefined
project()#
project(
view,selection,previous,metrics,editing,pane?):BlockNode[]
Defined in: arranger/src/project.ts:214
One node per block of view, in index order. A node lies at
nodePosition, or where an arranged workspace packs it (blockPlaces); its size is the drawing’s times the block’s scale,
given as width, height and measured so Svelte Flow never measures
it, and its zIndex is the block’s rank among its siblings. With
editing, the innermost open editor, every node of another block is
outside it: not selectable, not draggable and of class tilie-outside;
the edited block’s node is not draggable either, its inside naming what
the editor edits, read with the root the editor raises (raisedRoot), so
it names what the node draws. A node of previous whose block, drawing, position,
rank, selection and editor are unchanged is returned as the same object,
so Svelte Flow skips it.
Parameters#
view#
selection#
previous#
readonly BlockNode[]
metrics#
FontMetrics
editing#
Editing | null