(core) add 'Aggregate Values' option to chart config

Summary:
  - adds the `aggregate values` option to chart config
    - aggregation is performed by turning table into summary table
    - change columns options of xaxis and split series selectors to be the source table columns when `aggregate values` is on
    - change xAxis and split series computed to hold colId instead of column id
    - change GristDoc saveViewSection routine to preserve old sections viewFields and options
  - Rename `Group data` into `split series`

quip doc: https://grist.quip.com/tAsCAuv8RiMa/Charts-data-aggregation#temp:C:QcK0ce13e1e8ae64048988f44f9c

Test Plan: Adds ChartAggregate.ts nbrowser test.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3336
This commit is contained in:
Cyprien P
2022-04-07 12:10:58 +02:00
parent 64369df4c3
commit 98ac2f7e5b
5 changed files with 231 additions and 49 deletions

View File

@@ -166,10 +166,10 @@ export class ViewLayout extends DisposableWithEvents implements IDomComponent {
// Freezes the layout until the passed in promise resolves. This is useful to achieve a single
// layout rebuild when multiple user actions needs to apply, simply pass in a promise that resolves
// when all user actions have resolved.
public async freezeUntil(promise: Promise<unknown>): Promise<void> {
public async freezeUntil<T>(promise: Promise<T>): Promise<T> {
this._freeze = true;
try {
await promise;
return await promise;
} finally {
this._freeze = false;
this._rebuildLayout(this.layoutSpec.peek());