API Reference
clampDimension()
Clamp an optional dimension to a finite, non-negative number.
Import
import { clampDimension } from "@graphrefly/ts/solutions/reactive-layout";
Signature
function clampDimension(value: number | undefined): number
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | undefined | Optional dimension. |
Returns
A non-negative dimension.
Example
clampDimension(undefined);
Source
packages/ts/src/solutions/reactive-layout/utils.ts