@shumoku/core · 0.4.0 · function
resolveNodeSize
Resolve a node's display size — returns the node's own `size` if set, otherwise asks the engine for its body size. Pass `engine` to share its TextMeasurer cache with other queries. Without one, a process-wide default engine is created lazily; this is fine for one-off helpers but not ideal for hot loops where explicit control matters.
resolveNodeSize(node: { label?: string | string[]; size?: { height: number; width: number }; spec?: NodeSpec }, engine?: LayoutEngine): { height: number; width: number } Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
node | { label?: string | string[]; size?: { height: number; width: number }; spec?: NodeSpec } | No additional description. | — |
engine | LayoutEngine | No additional description. | — |
Returns
{ height: number; width: number }