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