metricKey()
Build a stable measurement cache key.
Import
Section titled “Import”import { metricKey } from "@graphrefly/ts/solutions/reactive-layout";Signature
Section titled “Signature”function metricKey( text: string, font: string,): stringParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
text | string | Text input. |
font | string | Font string. |
Returns
Section titled “Returns”A deterministic cache key for the text/font pair.
Example
Section titled “Example”metricKey("Hello", "16px sans-serif");Source
Section titled “Source”packages/ts/src/solutions/reactive-layout/segment.ts