the statistics layer · v1.13.0
The grid already knows what the data says.
A grid holds every number on the page and recomputes over them as the filters change. The statistics layer is that knowledge made reachable: a median or a 95th percentile in the totals row, a full column profile in a panel, and columns that track how a value has moved since you opened the page. Every figure is computed over the filtered rows, through the same column handles the totals row uses, so a median in the panel and a median in the footer are the same number by the same definition.
reductions in the totals row
More than a sum at the bottom.
A totals row usually means one thing: a sum. Here every numeric column names its own
reduction, so one footer reads a median price, a 95th-percentile bid, the deviation of the
day's change and the spread of volume at once. The reductions are kernels, more than twenty
of them, and they run over the filtered rows: narrow to one desk and every figure narrows
with it. Quantiles use the R type 7 definition, the one a spreadsheet's PERCENTILE
agrees with, so the number is the one a reviewer expects rather than one of the nine other
reasonable answers.
The same column, drawn: a histogram of the distribution the footer is reducing, with a density curve over the bars so the shape the median and the deviation describe is one you can see.
shadow columns
A column that remembers.
A shadow column is declared against another column and maintained by the grid. It has no field in the data, and it is not a computed column either, because its value depends on what happened before: the value the row had when the page loaded, how many times it has changed since, which way it is trending. It is a real column throughout, sortable, filterable, groupable, exportable, saveable into a view. The feed below is live, because a delta against a still data set is a column of zeroes.
Delta and percent change are measured against the value at page load, not the previous tick. Moves counts every change since; Streak counts consecutive moves in one direction and resets on a turn, because "seven rises" means something that "seven changes" does not.
the gesture nothing else does
Sort by places moved. Watch the top movers.
The second family of shadow columns answers where a row sits among the others rather than what it did before: rank, percentile, quartile, and the one that matters, places moved since the baseline. Because it is a real column, sorting by it is one gesture, and the result is a live top-movers view that reorders itself as the feed runs. Rank is computed over every tracked row rather than the filtered set, so the order does not shift under you as you filter, and the column never disagrees with itself between two views. "Mark all" in the rail resets every baseline to now, and the race starts again.
capability against a tolerance
The process, and the limits it has never heard of.
Declare the customer's tolerance on a column and the capability figures, a control chart and any out-of-tolerance rule all read the same limits. The chart draws two sets of lines that mean different things: the control limits, three sigma from the process itself, and the spec limits, dashed, which the process has never heard of. A point breaking a rule is marked.
is this column normal?
A straight line, or a story.
A Q-Q plot puts a column's quantiles against a normal distribution's. Points on the line are normal; a bend at the ends is a skew or a heavy tail. The reference line runs through the quartiles rather than being least-squares fitted, because a fitted line is dragged by the very tails you are inspecting.
every pair at once
Which columns move together.
Before the two-column questions below, the whole matrix: a correlogram reads every numeric column against every other and shades each cell by the correlation, so the pairs that move together and the pairs that do not are one glance rather than a search. It reads the filtered rows like everything else here, so narrowing the grid recomputes the matrix.
two columns from the API
And the figures a panel cannot hold.
The panel and the totals row cover a column at a time. grid.statistics
answers the two-column and whole-series questions directly: correlation and regression,
weighted averages and quantiles, volatility and drawdown over a date-ordered series. Declare
a tolerance on a column and the process-capability figures, a control chart and any
out-of-tolerance rule all read the same limits, so Cpk well above
Ppk tells you the process drifted rather than that it is merely
variable.
// two columns at a time
grid.statistics.correlation('spend', 'revenue');
grid.statistics.regression('spend', 'revenue');
grid.statistics.weightedAverage('price', 'qty');
// a whole date-ordered series
grid.statistics.series('price', { by: 'date' });
// { volatility, growth, maxDrawdown, and more }
// declare a spec, get capability + a control chart
{ field: 'mm', type: 'number',
spec: { lower: 9.5, upper: 10.8, target: 10 } }
grid.statistics.capability('mm');
// { cp, cpk, pp, ppk, defectRate, violations, and more }
four desks, four grids
The same layer, in the room it was built for.
Each of these is a realistic grid where the types and the statistics belong together rather than being demonstrated at. Every one is live, and repaints in the low hundreds of milliseconds with a feed running.
-
A trading book
Money as a custom unit, shadow columns for change and rank, a running P&L and a live price feed, sorted by the top movers.
-
Analytical chemistry
Molarity, ppb and dose types, with one contaminated batch the outlier and z-score rules find and nothing else.
-
Manufacturing and process
A machined bore with a tolerance driving capability, drifting in one shift so Cpk and Ppk separate.
-
Fleet and network
Address, data-size and rate types, latency long-tailed so the 99th percentile is far from the median.
Process capability → Column profiling → Variation over time → Selection statistics → Running totals → The API →