• Groups rows by one or more levels – the engine behind AreaModelRowGroups (and pivot tables). One pass over the rows with nested Maps: keys are compared as values (1 and "1" are different groups, two dates of the same time one group); null, undefined and "" form one group (label "(empty)"), which is always last. Groups are ordered by the order of their level (default ascending); the rows of a group stay in source order. The rows are not changed.

    Aggregates are filled by aggregateRowGroups.

    Type Parameters

    • T = any

    Parameters

    Returns RowGroup<T>[]

    the groups of the top level (empty for no levels or no rows)

    Example

    const groups = groupRows(sales, ["region", "produkt"]);
    groups[0].label; // "Nord"
    groups[0].children[0].getRows(); // the rows of Nord › A

    Since

    1.1.94