// The layout boxes of the scope's nodes: slot-parallel node-local extents read off the size, border and label columns — the one reading every built-in spaces by
ctx.nodeDimensions(slots?: ArrayLike<number>, options?: DimsOptions): LayoutNodeDimsThe layout boxes of the scope's nodes: slot-parallel node-local extents read off the size, border and label columns — the one reading every built-in spaces by. Labels are included when the run's nodeDimensionsIncludeLabels is true (default false), making the box asymmetric when a label hangs below the body; take max( -y1, y2) for a symmetric half. Headless label dimensions are estimates (16.4), exact once a renderer has laid the glyphs.
| Name | Description |
|---|---|
slots: ArrayLike<number>?Default: this.nodeSlots() | the node slots to measure (default |
options: DimsOptions?Default: {} |
|
Fields of options
| Name | Description |
|---|---|
includeLabels: boolean? | union the label box into each node's box (default true here; the
layouts pass their |
padding: number? | extra room around every node, split half per side (default 0) |
LayoutNodeDimsthe boxes, parallel to slots
Example
cy.layout({ impl: { run(ctx) { console.log(ctx.nodeDimensions().n); // 3} } }).run();