Cell Summaries
Summary
- AdapTable provides comprehensive summary information of selected cells in AG Grid
- A table shows summaries of the cells using multiple operations
- Developers can add their own custom summary operations which will also be evaluated
AdapTable provides useful summary information about the currently selected cells in AG Grid.
Caution
Cell Summaries are provided only for selected cells in a single numeric column
This summary information is displayable in 3 locations:
- the Cell Summary Dashboard Toolbar
- the Cell Summary Tool Panel
- the Cell Summary Status Bar
Each of these contains 3 UI elements:
- DropDown to allow you to choose a Summary Operation (AdapTable stores the most recently selected)
- Label showing the summarised value of the currently selected cells (using the Summary Operation)
- Info button which opens a popup showing summaries for all the available Summary Operations
Cell Summary Types
There are 2 types 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
| Operation | Description of Summarised Data |
|---|---|
Sum | Total of all selected cells |
Average | Average of all selected cells |
Median | Middle (value) of all selected cells (when ordered) |
Mode | Most common cell value |
Distinct | Count of distinct selected cell values |
Max | Highest selected Cell Value |
Min | Lowest selected Cell Value |
Count | Number of selected cells |
Weighted Avg | Weighted Average |
Only | Value of all selected cells if they all match |
Std Deviation | Shows Standard Deviation for selected cells |
Note
The Weighted Average summary requires a defined Weighted Column, see Guide to Weighted Averages for more info
- This example selects some cells in the
Github Starscolumn (using methods in AdapTable's Grid API) - It displays the Sum of their values in the Cell Summary Toolbar, Tool Panel and Status Bar
- Select different cell ranges and different Summary Operations in the
Cell Summarydashboard and see the results - Alternatively right-click and select Cell Summary to open a popup with different summary functions
- Switch between the 2 Layouts and note that Cell Summaries are available in both Table and Pivot Layouts
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
- This example selects some cells in the pivoted
MIT License / Github Starscolumn - Despite it being a automated pivot column, the
sumof the selected cells appears in the Cell Summary Toolbar and Status Bar
- Switch to the
Pivot Agg Layout(which shows Pivot Aggregations but no Pivot Columns) and select some cells
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 cellSummaryOperations property in Cell Summary Options.
cellSummaryOperations
Each custom operation contains a summary function that will be invoked by AdapTable when it is required.
- This example contains a custom cell Summary called
Most Stars - It returns the
Namecolumn value for the row in the selected cell range which has the highestGithub Starscolumn value
Expand to see the Custom Cell Summaries
- Select a few date cells in the Grid and then pick
MINfrom the Cell Summary dropdown
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
numericDisplayFormatproperty in Cell Summary Options - using the default format of 2 fraction digits
numericDisplayFormat
- This example provides a custom Display Format for the
Github StarsColumn which is reflected in the Cell Summary (we select some cells using AdapTable's Grid API) - We also provide an implementation for
numericDisplayFormatproperty in Cell Summary Options which is used when cells in other columns are selected
- Select cells in the
Github Watcherscolumn and note that thenumericDisplayFormatproperty's value is used
Ticking Cell Summaries
AdapTable will update Cell Summaries in real time as the selected cell values change.
- This example selects a group of cells in the
Github Starscolumn and mimics ticking data by periodically updating the column - We see the Cell Summary update as the values in Selected Cells tick
Displaying Cell Summaries
FAQ
Can we add our own Summary Operations?
Yes, you can provide them in cellSummaryOperationDefinitions property of Cell Summary Options
Can we use Cell Summaries in Pivot Layouts? Yes, this was was introduced in Version 20 of AdapTable