GraphReFlyTS

API Reference

measuredWidth()

Normalize a width-like value into a finite, non-negative width.

Import

import { measuredWidth } from "@graphrefly/ts/solutions/reactive-layout";

Signature

function measuredWidth(value: number | { readonly width: number }): number

Parameters

ParameterTypeDescription
valuenumber | { readonly width: number }Width value or object with a width field.

Returns

A non-negative width.

Example

measuredWidth({ width: 24 });

Source

packages/ts/src/solutions/reactive-layout/segment.ts