GraphReFlyTS

API Reference

computeBlockFlow()

Stack measured blocks vertically with margins and a fixed gap.

Import

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

Signature

function computeBlockFlow(
	blocks: readonly MeasuredBlock[],
	gap = 0,
): readonly PositionedBlock[]

Parameters

ParameterTypeDescription
blocksreadonly MeasuredBlock[]blocks value used by the helper.
gapunknowngap value used by the helper.

Returns

A readonly PositionedBlock[] value.

Example

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

Source

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