Options
All
  • Public
  • Public/Protected
  • All
Menu

Landscape

Index

Type Aliases

Cell: Element & Layout

An extension of Element, adding the number of rows and columns the element will occupy in the final table rendering.

Criteria<TRecord>: Predicate<TRecord> & { metadata: Pair<keyof TRecord, TRecord[keyof TRecord]>[] }

Specialised criteria for landscape maps.

Type Parameters

  • TRecord

Dimension<TRecord>: Criteria<TRecord>[]

Type Parameters

  • TRecord

Element: Pair<string | number, any> & Style

The final text and class name to use when rendering cells in a table.

Functions

  • criteria<TRecord>(key: keyof TRecord): Callback<TRecord[keyof TRecord], Criteria<TRecord>>
  • Default criteria creator with simple metadata.

    Type Parameters

    • TRecord

    Parameters

    • key: keyof TRecord

      The property within the source data to use as

    Returns Callback<TRecord[keyof TRecord], Criteria<TRecord>>

  • merge(cells: Cell[][], onX: boolean, onY: boolean): void
  • Merge adjacent cells in a split table on the y and/or x axes.

    Parameters

    • cells: Cell[][]

      A table of Cells created by a previous call to splitX or splitY.

    • onX: boolean

      A flag to indicate that cells should be merged on the x axis.

    • onY: boolean

      A flag to indicate that cells should be merged on the y axis.

    Returns void

  • table<TRecord>(cube: Cube<TRecord>, y: Dimension<TRecord>, x: Dimension<TRecord>, getElement: Callback<TRecord, Element>, onX: boolean, method?: FunctionVA<number, number>): Cell[][]
  • Generates a table from a cube and it's axis.

    Type Parameters

    • TRecord

    Parameters

    • cube: Cube<TRecord>

      The source cube.

    • y: Dimension<TRecord>

      The y axis used in the pivot operation to create the cube.

    • x: Dimension<TRecord>

      The x axis used in the pivot operation to create the cube.

    • getElement: Callback<TRecord, Element>

      A callback to generate an element containing the details used in table rendering,

    • onX: boolean

      A flag to indicate if cells in cube containing multiple values should be split on the x axis (if not, the y axis will be used).

    • method: FunctionVA<number, number> = Math.max

      A function used to calculate how many rows or columns to split a row/column into based on the number of entries in each cell of that row/column. Defaults to Math.max, but other methods such as Least Common Multiple can be used for more precise table rendering.

    Returns Cell[][]

Generated using TypeDoc