GraphReFlyTS

API Reference

layoutNextLine()

Lay out one line from a cursor, returning the next cursor for continuation.

Import

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

Signature

function layoutNextLine(
	segments: readonly PreparedSegment[],
	cursor: LayoutCursor,
	slotWidth: number,
	ctx?: LayoutNextLineContext,
): LayoutNextLineResult | null

Parameters

ParameterTypeDescription
segmentsreadonly PreparedSegment[]segments value used by the helper.
cursorLayoutCursorcursor value used by the helper.
slotWidthnumberslot width value used by the helper.
ctxLayoutNextLineContextNode execution context supplied by the dispatcher.

Returns

A LayoutNextLineResult | null value.

Example

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

Source

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