geometry#
Interfaces#
Bounds#
Defined in: layout/src/geometry.ts:202
An axis-aligned rectangle by its edges.
Properties#
bottom#
readonlybottom:number
Defined in: layout/src/geometry.ts:206
left#
readonlyleft:number
Defined in: layout/src/geometry.ts:203
right#
readonlyright:number
Defined in: layout/src/geometry.ts:205
top#
readonlytop:number
Defined in: layout/src/geometry.ts:204
Circle#
Defined in: layout/src/geometry.ts:21
A circle at (cx, cy) of radius r.
Properties#
cx#
readonlycx:number
Defined in: layout/src/geometry.ts:22
cy#
readonlycy:number
Defined in: layout/src/geometry.ts:23
r#
readonlyr:number
Defined in: layout/src/geometry.ts:24
LineGeometry#
Defined in: layout/src/geometry.ts:37
A line’s stroke from x1 to x2 at y, and the marks at its start and its end.
Properties#
end#
readonlyend: readonlyLineMark[]
Defined in: layout/src/geometry.ts:42
start#
readonlystart: readonlyLineMark[]
Defined in: layout/src/geometry.ts:41
x1#
readonlyx1:number
Defined in: layout/src/geometry.ts:38
x2#
readonlyx2:number
Defined in: layout/src/geometry.ts:39
y#
readonlyy:number
Defined in: layout/src/geometry.ts:40
Type Aliases#
LineMark#
Defined in: layout/src/geometry.ts:31
One mark at an end of a line: its circle, its arrowhead or diamond (a
polygon, filled or drawn in outline), or one of its chevrons.
Functions#
boundsOf()#
boundsOf(
element,measure):Bounds
Defined in: layout/src/geometry.ts:267
The geometric bounds of an element (section 6.7): its outline, no stroke width counted; a brace or a jump by its points, controls included; a text by its advance width from its anchor and its ascent and descent.
Parameters#
element#
measure#
Returns#
brace()#
brace(
__namedParameters):PathCommand[]
Defined in: layout/src/geometry.ts:132
The brace of a region from x1 to x2, arms at yb, tip at (xm, ya)
(section 7.2), as the path commands it is written with. Each of its two
straight parts at ym, from x1 + k to xm − k and from xm + k to
x2 − k, is cut where the gaps it spans meet it (section 6.6, Elisions;
straightPart); its arms and tip are drawn whole.
Parameters#
__namedParameters#
Returns#
largestRightEdge()#
largestRightEdge(
elements,measure):number|undefined
Defined in: layout/src/geometry.ts:388
The largest right edge of some elements, or undefined when none has one.
Parameters#
elements#
readonly DrawnElement[]
measure#
Returns#
number | undefined
lineGeometry()#
lineGeometry(
element):LineGeometry
Defined in: layout/src/geometry.ts:54
The geometry of a line (sections 6.6, 7.2 and 8.3): its stroke to where it
stops (short of a diamond), its start circle or two left chevrons, and its
end mark: the arrowhead, 3w long and 3w wide; the circle; the diamond,
1.2w high; three chevrons where its length is not known, two where it
runs on; no mark at an end that lies in a gap (section 6.6, Elisions). A
chevron’s arms lie w, 2.5w and 4w from the end, each tip 1.5w
further, the inner one first.
Parameters#
element#
Returns#
rightEdge()#
rightEdge(
element,measure):number|undefined
Defined in: layout/src/geometry.ts:375
The right edge of an element’s content (section 6.7): its bounds’ right, none for the block, a frame or a card, which hold content and are none.
Parameters#
element#
measure#
Returns#
number | undefined
wedgePoints()#
Defined in: layout/src/geometry.ts:225
A wedge’s three points (sections 6.6 and 7.2): its tip (X, yt), then
the corners of its base (X + dx, y) in their order.
Parameters#
__namedParameters#
Pick<MarkerElement, "x" | "yt" | "corners">