Aller au contenu

layout

Ce contenu n’est pas encore disponible dans votre langue.

Utilities for layouting elements.

Type Aliases

LayoutBetweenOptions

type LayoutBetweenOptions: object;

Additional options for the space between layout utilities.

Type declaration

centerBased?
optional centerBased: boolean;

Whether to use a center based approach, or a bounds based approach. Defaults to bounds.

minGap?
optional minGap: number;

Min gap between elements.

Defined in

tmp/commons/src/lib/utils/layout.ts:121


LayoutOptions

type LayoutOptions: object;

Additional options for the layout utilities.

Type declaration

refPos?
optional refPos: number;

Index of the reference element. Defaults to 0.

Defined in

tmp/commons/src/lib/utils/layout.ts:27


LayoutRect

type LayoutRect: object;

Structure used by the layout utilities.

It represents a bounding rect for a layout element.

Type declaration

h
h: number;

Height of the bounding rect.

w
w: number;

Width of the bounding rect.

x
x: number;

Position on the x axis of top left corner.

y
y: number;

Position on the y axis of top left corner.

Defined in

tmp/commons/src/lib/utils/layout.ts:13

Functions

getAlignBetweenOffsets()

function getAlignBetweenOffsets(rects, options): Vector2D[]

Returns offsets to space elements evenly on the y axis with a minimum gap.

Parameters

rects: LayoutRect[]

Bounding rectangles of elements to align.

options: LayoutBetweenOptions = {}

Additional options for the layout.

Returns

Vector2D[]

Array of offsets for each element.

Defined in

tmp/commons/src/lib/utils/layout.ts:195


getAlignBottomOffsets()

function getAlignBottomOffsets(rects, options?): Vector2D[]

Returns offsets to align the bottoms of elements to the bottom of a reference element.

Parameters

rects: LayoutRect[]

Bounding rectangles of elements to align.

options?: LayoutOptions

Additional options for the layout.

Returns

Vector2D[]

Array of offsets for each element.

Defined in

tmp/commons/src/lib/utils/layout.ts:74


getAlignMiddleOffsets()

function getAlignMiddleOffsets(rects, options?): Vector2D[]

Returns offsets to align the middles of elements to the middle of a reference element.

Parameters

rects: LayoutRect[]

Bounding rectangles of elements to align.

options?: LayoutOptions

Additional options for the layout.

Returns

Vector2D[]

Array of offsets for each element.

Defined in

tmp/commons/src/lib/utils/layout.ts:84


getAlignTopOffsets()

function getAlignTopOffsets(rects, options?): Vector2D[]

Returns offsets to align the tops of elements to the top of a reference element.

Parameters

rects: LayoutRect[]

Bounding rectangles of elements to align.

options?: LayoutOptions

Additional options for the layout.

Returns

Vector2D[]

Array of offsets for each element.

Defined in

tmp/commons/src/lib/utils/layout.ts:64


getJustifyBetweenOffsets()

function getJustifyBetweenOffsets(rects, options): Vector2D[]

Returns offsets to space elements evenly on the x axis with a minimum gap.

Parameters

rects: LayoutRect[]

Bounding rectangles of elements to align.

options: LayoutBetweenOptions = {}

Additional options for the layout.

Returns

Vector2D[]

Array of offsets for each element.

Defined in

tmp/commons/src/lib/utils/layout.ts:134


getJustifyCenterOffsets()

function getJustifyCenterOffsets(rects, options?): Vector2D[]

Returns offsets to align the centers of elements to the center of a reference element.

Parameters

rects: LayoutRect[]

Bounding rectangles of elements to align.

options?: LayoutOptions

Additional options for the layout.

Returns

Vector2D[]

Array of offsets for each element.

Defined in

tmp/commons/src/lib/utils/layout.ts:114


getJustifyLeftOffsets()

function getJustifyLeftOffsets(rects, options?): Vector2D[]

Returns offsets to align the lefts of elements to the left of a reference element.

Parameters

rects: LayoutRect[]

Bounding rectangles of elements to align.

options?: LayoutOptions

Additional options for the layout.

Returns

Vector2D[]

Array of offsets for each element.

Defined in

tmp/commons/src/lib/utils/layout.ts:94


getJustifyRightOffsets()

function getJustifyRightOffsets(rects, options?): Vector2D[]

Returns offsets to align the rights of elements to the right of a reference element.

Parameters

rects: LayoutRect[]

Bounding rectangles of elements to align.

options?: LayoutOptions

Additional options for the layout.

Returns

Vector2D[]

Array of offsets for each element.

Defined in

tmp/commons/src/lib/utils/layout.ts:104