Skip to content

WaffleInput

Defined in: packages/waffle/src/types.ts:26

layoutWaffle’s one argument. The items array is treated as immutable: work is cached against it, so pass a new array when the dataset changes.

optional columns?: number

Defined in: packages/waffle/src/types.ts:11

Cells per row. Defaults to a square grid, the smallest that holds every mark. Pass 10 with 100 marks for the classic one-cell-per-percent waffle.

WaffleOptions.columns


dimensions: readonly Dimension[]

Defined in: packages/waffle/src/types.ts:30

Every dimension the items carry values for; the encoding picks among them.


optional encoding?: Encoding

Defined in: packages/waffle/src/types.ts:6

Which dimension drives what. Defaults to the first dimension arranging, colouring and shaping.

WaffleOptions.encoding


optional gap?: number

Defined in: packages/waffle/src/types.ts:13

The space between neighbouring cells, as a share of the cell pitch, 0 to 0.9. Defaults to 0.15.

WaffleOptions.gap


items: readonly Item[]

Defined in: packages/waffle/src/types.ts:28

One per cell (below the cap). Unique ids.


optional maxMarks?: number

Defined in: packages/waffle/src/types.ts:19

Above this many items, cells stand for several items each. Defaults to 1,000: 32 cells a row, each still a few pixels wide at phone width. A layout can exceed it slightly, since every combination of encoded categories needs a cell.

WaffleOptions.maxMarks