Skip to content
PACKAGES

columnGeometry()

Derive the sanitized geometry for a flow container and column layout.

import { columnGeometry } from "@graphrefly/ts/solutions/reactive-layout";
function columnGeometry(
container: FlowContainer,
columns: FlowColumns | undefined,
): {
readonly paddingX: number;
readonly paddingY: number;
readonly count: number;
readonly gap: number;
readonly width: number;
readonly height: number;
readonly columnWidth: number;
}
ParameterTypeDescription
containerFlowContainerContainer dimensions and padding.
columnsFlowColumns | undefinedOptional column configuration.

The resolved padding, width, height, and per-column width.

columnGeometry({ width: 800, height: 600 }, { count: 2, gap: 24 });

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