Skip to content
PACKAGES

metricKey()

Build a stable measurement cache key.

import { metricKey } from "@graphrefly/ts/solutions/reactive-layout";
function metricKey(
text: string,
font: string,
): string
ParameterTypeDescription
textstringText input.
fontstringFont string.

A deterministic cache key for the text/font pair.

metricKey("Hello", "16px sans-serif");

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