Cell Summaries

View as Markdown

Summary

  • AdapTable provides comprehensive summary information for selected cells in AG Grid numeric columns
  • A table shows summaries of those cells using multiple operations
  • Developers can add custom summary operations that are evaluated alongside the built-in ones

AdapTable provides useful summary information about the currently selected cells in AG Grid.

Important

Cell Summaries are provided only for selected cells in a single numeric column

This summary information is displayable in 3 locations:

Each of these contains three UI elements:

ElementPurpose
DropDownChoose a summary operation (AdapTable remembers the most recently selected)
LabelShows the summarised value for the currently selected cells using the chosen operation
Info buttonOpens the Cell Summary page in the Settings Panel, listing summaries for every available operation

Caution

  • Ensure that the CellSelectionModule has been provided in AG Grid Modules
  • Additionally make sure that the cellSelection property in AG Grid GridOptions is not set to false or null

Cell Summary Types

There are two kinds of Cell Summaries that can be displayed:

  • System Summary Operations provided by AdapTable
  • Custom Summary Operations provided by developers

Adaptable Cell Summaries

AdapTable provides a number of system Summary Operations which are available by default in the Cell Summary UI.

Note

These are all Aggregation Scalar Functions provided by - and evaluated by - AdapTableQL

OperationDescription of Summarised Data
SumTotal of all selected cells
AverageAverage of all selected cells
MedianMiddle (value) of all selected cells (when ordered)
ModeMost common cell value
DistinctCount of distinct selected cell values
MaxHighest selected Cell Value
MinLowest selected Cell Value
CountNumber of selected cells
Weighted AvgWeighted Average
OnlyValue of all selected cells if they all match
Std DeviationShows Standard Deviation for selected cells

Note

The Weighted Average summary requires a defined Weighted Column, see Guide to Weighted Averages for more info

Cell Summary
Fork
  • This example selects some cells in the Github Stars column (using methods in AdapTable's Grid API)
  • It displays the Sum of their values in the Cell Summary Toolbar, Tool Panel and Status Bar
Try It Out
  • Select different cell ranges and different Summary Operations in the Cell Summary dashboard and see the results
  • Alternatively right-click and select Cell Summary to open the Cell Summary page in the Settings Panel
  • Switch between the Table and Pivot layouts and note that Cell Summaries are available in both
Loading demo…

Pivot Layouts

Cell Summaries are also available in Pivot Layouts.

Note

Cell Summaries will operate on selected cells in both Pivot Columns and Pivot Aggregation Columns

Summarising Pivot Cells
Fork
  • This example selects some cells in the pivoted MIT License / Github Stars column
  • Despite it being an automated pivot column, the sum of the selected cells appears in the Cell Summary Toolbar and Status Bar
Try It Out
  • Switch to the Pivot Agg Layout (which shows Pivot Aggregations but no Pivot Columns) and select some cells
Loading demo…

Custom Cell Summaries

Developers can add their own custom summaries to provide bespoke information about selected cells.

Note

Custom Summaries will be added to the Summary Operations shipped by AdapTable and available for selection

This is done via the customCellSummaryOperations property in Cell Summary Options.

customCellSummaryOperations

Custom Cell Summary Operations

Each custom operation contains a summary function that will be invoked by AdapTable when it is required.

Custom Cell Summaries
Fork
  • This example contains a custom cell Summary called Most Stars
  • It returns the Name column value for the row in the selected cell range which has the highest Github Stars column value

Expand to see the Custom Cell Summaries

Try It Out
  • Select a range of cells in the Github Stars column, then choose Most Stars from the Cell Summary dropdown
Loading demo…

Formatting Cell Summaries

AdapTable will format Cell Summary values by evaluating the following list of rules (in the order given):

  • any Display Formats which have been provided for the Column (either by developers or end users)
  • a bespoke value supplied for the numericDisplayFormat property in Cell Summary Options
  • using the default format of 2 fraction digits

numericDisplayFormat

Format to use for Cell Summary values
Cell Summary Formatting
Fork
  • This example provides a custom Display Format for the Github Stars Column which is reflected in the Cell Summary (we select some cells using AdapTable's Grid API)
  • We also provide an implementation for numericDisplayFormat property in Cell Summary Options which is used when cells in other columns are selected
Try It Out
  • Select cells in the Github Watchers column and note that the numericDisplayFormat property's value is used
Loading demo…

Ticking Cell Summaries

AdapTable will update Cell Summaries in real time as the selected cell values change.

Cell Summary Ticking Data
Fork
  • This example selects a group of cells in the Github Stars column and mimics ticking data by periodically updating the column
  • We see the Cell Summary update as the values in Selected Cells tick
Loading demo…

FAQ

Can we add our own Summary Operations? Yes — use the customCellSummaryOperations property on Cell Summary Options.

Can we use Cell Summaries in Pivot Layouts? Yes — see the Pivot Layouts section above.

AdapTable Resources