Function dimension

Creates a Dimension from some source data that will be used to slice and dice.

  • Type Parameters

    • TCriteria

      The type of the seed data used to creat the dimension.

    • TValue

    Parameters

    • criteria: TCriteria[]

      The seed data for the dimension; one entry in the source array will be one point on the dimension.

    • generator: Function<TCriteria, Predicate<TValue>>

      A function that creates a Predicate for each point on the dimension. The following code creates a Dimension that will be used to evaluate Player objects during a pivot operation based on the value of their position property:

      const positions: string[] = ['Goalkeeper', 'Defender', 'Midfielder', 'Forward'];
      const x = dimension(positions, property<Player>('position'));

      See GitHub for a complete example.

    Returns Dimension<TValue>