PitchKit
API Reference@pitchkit/coreFunctions

wrapLabel()

function wrapLabel(text, maxChars): string[];

Defined in: packages/core/src/polar/labels.ts:123

Greedy word wrap at maxChars per line. A one-character word ("+", "&") stays with the word after it, or the word before it at the end, so a label never breaks into "Tackles +" / "Int". A single word longer than the limit keeps its own line rather than being split.

Parameters

ParameterType
textstring
maxCharsnumber

Returns

string[]

On this page