Skip to content

LayoutStrategy (core)

Defined in: types.ts:71

Maps a continuous depth to a pose. Must be pure and must write into out rather than allocating. Depth 0 is the front card; negative depth is exiting.

import { fan, type LayoutStrategy } from '@rpxl/riffle'
const layout: LayoutStrategy = fan({ scaleStep: 0.1 })

readonly name: string

Defined in: types.ts:73

The layout’s own name, for debugging. fan()’s is 'fan'.

pose(depth, geometry, out): Pose

Defined in: types.ts:75

Writes out’s fields for depth and returns it.

number

LayoutGeometry

Pose

Pose


stepTravel(geometry): number

Defined in: types.ts:77

Pixels the front card travels to advance one position.

LayoutGeometry

number