@finos/legend-application-repl 0.0.30 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/LegendREPLFrameworkProvider.js +1 -1
- package/lib/components/LegendREPLFrameworkProvider.js.map +1 -1
- package/lib/components/REPLStoreProvider.d.ts +1 -1
- package/lib/components/REPLStoreProvider.d.ts.map +1 -1
- package/lib/components/REPLStoreProvider.js +1 -1
- package/lib/components/REPLStoreProvider.js.map +1 -1
- package/lib/components/REPLWindow.d.ts +33 -0
- package/lib/components/REPLWindow.d.ts.map +1 -0
- package/lib/components/REPLWindow.js +117 -0
- package/lib/components/REPLWindow.js.map +1 -0
- package/lib/components/dataCube/DataCube.d.ts.map +1 -1
- package/lib/components/dataCube/DataCube.js +13 -9
- package/lib/components/dataCube/DataCube.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditor.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditor.js +13 -90
- package/lib/components/dataCube/editor/DataCubeEditor.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.js +3 -2
- package/lib/components/dataCube/editor/DataCubeEditorCodePanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.js +237 -6
- package/lib/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js +2 -2
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.d.ts +5 -0
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.js +130 -48
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.js.map +1 -1
- package/lib/{stores/dataCube/DataCubeDefaultConfig.d.ts → components/dataCube/editor/DataCubeEditorDeveloperPanel.d.ts} +4 -2
- package/lib/components/dataCube/editor/DataCubeEditorDeveloperPanel.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorDeveloperPanel.js +28 -0
- package/lib/components/dataCube/editor/DataCubeEditorDeveloperPanel.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.js +3 -2
- package/lib/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.js +3 -2
- package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.js +145 -5
- package/lib/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorHPivotsPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorHPivotsPanel.js +3 -2
- package/lib/components/dataCube/editor/DataCubeEditorHPivotsPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorShared.d.ts +47 -0
- package/lib/components/dataCube/editor/DataCubeEditorShared.d.ts.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorShared.js +188 -0
- package/lib/components/dataCube/editor/DataCubeEditorShared.js.map +1 -0
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.js +36 -3
- package/lib/components/dataCube/editor/DataCubeEditorSortsPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorVPivotsPanel.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorVPivotsPanel.js +3 -2
- package/lib/components/dataCube/editor/DataCubeEditorVPivotsPanel.js.map +1 -1
- package/lib/components/dataCube/grid/DataCubeGrid.d.ts +3 -0
- package/lib/components/dataCube/grid/DataCubeGrid.d.ts.map +1 -1
- package/lib/components/dataCube/grid/DataCubeGrid.js +190 -63
- package/lib/components/dataCube/grid/DataCubeGrid.js.map +1 -1
- package/lib/{stores/dataCube/DataCubeDefaultConfig.js → components/dataCube/grid/DataCubeGridShared.d.ts} +3 -2
- package/lib/components/dataCube/grid/DataCubeGridShared.d.ts.map +1 -0
- package/lib/components/dataCube/grid/DataCubeGridShared.js +25 -0
- package/lib/components/dataCube/grid/DataCubeGridShared.js.map +1 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridMenu.d.ts +23 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridMenu.d.ts.map +1 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridMenu.js +413 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridMenu.js.map +1 -0
- package/{src/stores/dataCube/DataCubeDefaultConfig.ts → lib/components/dataCube/grid/menu/DataCubeGridSortsMenu.d.ts} +4 -2
- package/lib/components/dataCube/grid/menu/DataCubeGridSortsMenu.d.ts.map +1 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridSortsMenu.js +83 -0
- package/lib/components/dataCube/grid/menu/DataCubeGridSortsMenu.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +14 -12
- package/lib/server/models/DataCubeQuery.d.ts +3 -5
- package/lib/server/models/DataCubeQuery.d.ts.map +1 -1
- package/lib/server/models/DataCubeQuery.js +0 -2
- package/lib/server/models/DataCubeQuery.js.map +1 -1
- package/lib/stores/{dataCube/REPLStore.d.ts → REPLStore.d.ts} +6 -4
- package/lib/stores/REPLStore.d.ts.map +1 -0
- package/lib/stores/{dataCube/REPLStore.js → REPLStore.js} +8 -5
- package/lib/stores/REPLStore.js.map +1 -0
- package/lib/stores/dataCube/{core/DataCubeEngine.d.ts → DataCubeInfrastructure.d.ts} +20 -4
- package/lib/stores/dataCube/DataCubeInfrastructure.d.ts.map +1 -0
- package/lib/stores/dataCube/{core/DataCubeEngine.js → DataCubeInfrastructure.js} +31 -3
- package/lib/stores/dataCube/DataCubeInfrastructure.js.map +1 -0
- package/lib/stores/dataCube/DataCubeState.d.ts +14 -5
- package/lib/stores/dataCube/DataCubeState.d.ts.map +1 -1
- package/lib/stores/dataCube/DataCubeState.js +37 -9
- package/lib/stores/dataCube/DataCubeState.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeConfiguration.d.ts +93 -0
- package/lib/stores/dataCube/core/DataCubeConfiguration.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeConfiguration.js +167 -0
- package/lib/stores/dataCube/core/DataCubeConfiguration.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeConfigurationBuilder.d.ts +25 -0
- package/lib/stores/dataCube/core/DataCubeConfigurationBuilder.d.ts.map +1 -0
- package/lib/stores/dataCube/core/DataCubeConfigurationBuilder.js +45 -0
- package/lib/stores/dataCube/core/DataCubeConfigurationBuilder.js.map +1 -0
- package/lib/stores/dataCube/core/DataCubeCoreState.d.ts +1 -1
- package/lib/stores/dataCube/core/DataCubeCoreState.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeCoreState.js +4 -4
- package/lib/stores/dataCube/core/DataCubeCoreState.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js +12 -12
- package/lib/stores/dataCube/core/DataCubeQueryBuilder.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts +99 -4
- package/lib/stores/dataCube/core/DataCubeQueryEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQueryEngine.js +149 -3
- package/lib/stores/dataCube/core/DataCubeQueryEngine.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts +19 -5
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.js +36 -6
- package/lib/stores/dataCube/core/DataCubeQuerySnapshot.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.js +42 -23
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotBuilder.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.js +6 -2
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotManager.js.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.d.ts +1 -3
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.d.ts.map +1 -1
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.js +2 -3
- package/lib/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.d.ts +3 -1
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.js +4 -2
- package/lib/stores/dataCube/editor/DataCubeEditorCodePanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.d.ts +36 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.js +66 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.d.ts +3 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.js +10 -0
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts +8 -3
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.js +20 -24
- package/lib/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorHPivotPanelState.d.ts +27 -0
- package/lib/stores/dataCube/editor/DataCubeEditorHPivotPanelState.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorHPivotPanelState.js +30 -0
- package/lib/stores/dataCube/editor/DataCubeEditorHPivotPanelState.js.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeEditorPanelState.d.ts +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.d.ts +13 -6
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.js +64 -19
- package/lib/stores/dataCube/editor/DataCubeEditorSortsPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts +8 -4
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorState.js +26 -17
- package/lib/stores/dataCube/editor/DataCubeEditorState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.d.ts +100 -0
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.d.ts.map +1 -0
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.js +450 -0
- package/lib/stores/dataCube/editor/DataCubeMutableConfiguration.js.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts +39 -2
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js +63 -3
- package/lib/stores/dataCube/grid/DataCubeGridClientEngine.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.js +0 -9
- package/lib/stores/dataCube/grid/DataCubeGridQueryBuilder.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.d.ts +4 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.js +330 -38
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js +16 -28
- package/lib/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridState.d.ts +16 -2
- package/lib/stores/dataCube/grid/DataCubeGridState.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridState.js +51 -21
- package/lib/stores/dataCube/grid/DataCubeGridState.js.map +1 -1
- package/package.json +20 -18
- package/src/components/LegendREPLFrameworkProvider.tsx +1 -1
- package/src/components/REPLStoreProvider.tsx +1 -1
- package/src/components/REPLWindow.tsx +179 -0
- package/src/components/dataCube/DataCube.tsx +44 -23
- package/src/components/dataCube/editor/DataCubeEditor.tsx +80 -186
- package/src/components/dataCube/editor/DataCubeEditorCodePanel.tsx +4 -2
- package/src/components/dataCube/editor/DataCubeEditorColumnPropertiesPanel.tsx +1044 -13
- package/src/components/dataCube/editor/DataCubeEditorColumnsPanel.tsx +2 -2
- package/src/components/dataCube/editor/DataCubeEditorColumnsSelector.tsx +264 -51
- package/src/components/dataCube/editor/DataCubeEditorDeveloperPanel.tsx +43 -0
- package/src/components/dataCube/editor/DataCubeEditorExtendedColumnsPanel.tsx +4 -2
- package/src/components/dataCube/editor/DataCubeEditorFilterPanel.tsx +4 -2
- package/src/components/dataCube/editor/DataCubeEditorGeneralPropertiesPanel.tsx +743 -13
- package/src/components/dataCube/editor/DataCubeEditorHPivotsPanel.tsx +4 -2
- package/src/components/dataCube/editor/DataCubeEditorShared.tsx +484 -0
- package/src/components/dataCube/editor/DataCubeEditorSortsPanel.tsx +103 -4
- package/src/components/dataCube/editor/DataCubeEditorVPivotsPanel.tsx +4 -2
- package/src/components/dataCube/grid/DataCubeGrid.tsx +314 -120
- package/src/components/dataCube/grid/DataCubeGridShared.tsx +45 -0
- package/src/components/dataCube/grid/menu/DataCubeGridMenu.tsx +441 -0
- package/src/components/dataCube/grid/menu/DataCubeGridSortsMenu.tsx +119 -0
- package/src/server/models/DataCubeQuery.ts +2 -6
- package/src/stores/{dataCube/REPLStore.ts → REPLStore.ts} +9 -6
- package/src/stores/dataCube/{core/DataCubeEngine.ts → DataCubeInfrastructure.ts} +40 -3
- package/src/stores/dataCube/DataCubeState.ts +44 -10
- package/src/stores/dataCube/core/DataCubeConfiguration.ts +220 -0
- package/src/stores/dataCube/core/DataCubeConfigurationBuilder.ts +60 -0
- package/src/stores/dataCube/core/DataCubeCoreState.ts +7 -4
- package/src/stores/dataCube/core/DataCubeQueryBuilder.ts +18 -18
- package/src/stores/dataCube/core/DataCubeQueryEngine.ts +157 -4
- package/src/stores/dataCube/core/DataCubeQuerySnapshot.ts +43 -6
- package/src/stores/dataCube/core/DataCubeQuerySnapshotBuilder.ts +49 -29
- package/src/stores/dataCube/core/DataCubeQuerySnapshotManager.ts +9 -2
- package/src/stores/dataCube/core/DataCubeQuerySnapshotSubscriber.ts +6 -5
- package/src/stores/dataCube/editor/DataCubeEditorCodePanelState.ts +5 -2
- package/src/stores/dataCube/editor/DataCubeEditorColumnPropertiesPanelState.ts +96 -0
- package/src/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.ts +12 -0
- package/src/stores/dataCube/editor/DataCubeEditorGeneralPropertiesPanelState.ts +31 -28
- package/src/stores/dataCube/editor/DataCubeEditorHPivotPanelState.ts +43 -0
- package/src/stores/dataCube/editor/DataCubeEditorPanelState.ts +1 -1
- package/src/stores/dataCube/editor/DataCubeEditorSortsPanelState.ts +92 -25
- package/src/stores/dataCube/editor/DataCubeEditorState.ts +32 -18
- package/src/stores/dataCube/editor/DataCubeMutableConfiguration.ts +641 -0
- package/src/stores/dataCube/grid/DataCubeGridClientEngine.ts +88 -3
- package/src/stores/dataCube/grid/DataCubeGridQueryBuilder.ts +0 -10
- package/src/stores/dataCube/grid/DataCubeGridQuerySnapshotAnalyzer.tsx +494 -45
- package/src/stores/dataCube/grid/DataCubeGridQuerySnapshotBuilder.ts +16 -36
- package/src/stores/dataCube/grid/DataCubeGridState.ts +73 -20
- package/tsconfig.json +13 -3
- package/lib/stores/dataCube/DataCubeDefaultConfig.d.ts.map +0 -1
- package/lib/stores/dataCube/DataCubeDefaultConfig.js.map +0 -1
- package/lib/stores/dataCube/REPLStore.d.ts.map +0 -1
- package/lib/stores/dataCube/REPLStore.js.map +0 -1
- package/lib/stores/dataCube/core/DataCubeEngine.d.ts.map +0 -1
- package/lib/stores/dataCube/core/DataCubeEngine.js.map +0 -1
|
@@ -14,32 +14,54 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import type { REPLStore } from '
|
|
17
|
+
import type { REPLStore } from '../REPLStore.js';
|
|
18
18
|
import { DataCubeGridState } from './grid/DataCubeGridState.js';
|
|
19
19
|
import { DataCubeEditorState } from './editor/DataCubeEditorState.js';
|
|
20
|
-
import {
|
|
21
|
-
import { DataCubeEngine } from './core/DataCubeEngine.js';
|
|
20
|
+
import { assertErrorThrown, uuid } from '@finos/legend-shared';
|
|
22
21
|
import { DataCubeQuerySnapshotManager } from './core/DataCubeQuerySnapshotManager.js';
|
|
23
22
|
import type { LegendREPLApplicationStore } from '../LegendREPLBaseStore.js';
|
|
24
23
|
import { DataCubeCoreState } from './core/DataCubeCoreState.js';
|
|
25
24
|
import { validateAndBuildQuerySnapshot } from './core/DataCubeQuerySnapshotBuilder.js';
|
|
25
|
+
import { action, makeObservable, observable } from 'mobx';
|
|
26
|
+
import type { DataCubeInfrastructure } from './DataCubeInfrastructure.js';
|
|
27
|
+
|
|
28
|
+
export class DataCubeTask {
|
|
29
|
+
uuid = uuid();
|
|
30
|
+
name: string;
|
|
31
|
+
startTime = Date.now();
|
|
32
|
+
endTime?: number | undefined;
|
|
33
|
+
|
|
34
|
+
constructor(name: string) {
|
|
35
|
+
this.name = name;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
end(): void {
|
|
39
|
+
this.endTime = Date.now();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
26
42
|
|
|
27
43
|
export class DataCubeState {
|
|
28
44
|
readonly replStore: REPLStore;
|
|
29
45
|
readonly application: LegendREPLApplicationStore;
|
|
30
|
-
readonly
|
|
46
|
+
readonly infrastructure: DataCubeInfrastructure;
|
|
31
47
|
readonly snapshotManager: DataCubeQuerySnapshotManager;
|
|
32
48
|
|
|
33
49
|
readonly core: DataCubeCoreState;
|
|
34
50
|
readonly grid: DataCubeGridState;
|
|
35
51
|
readonly editor: DataCubeEditorState;
|
|
36
52
|
|
|
37
|
-
readonly
|
|
53
|
+
readonly runningTasks = new Map<string, DataCubeTask>();
|
|
38
54
|
|
|
39
55
|
constructor(replStore: REPLStore) {
|
|
56
|
+
makeObservable(this, {
|
|
57
|
+
runningTasks: observable,
|
|
58
|
+
newTask: action,
|
|
59
|
+
endTask: action,
|
|
60
|
+
});
|
|
61
|
+
|
|
40
62
|
this.replStore = replStore;
|
|
41
63
|
this.application = replStore.applicationStore;
|
|
42
|
-
this.
|
|
64
|
+
this.infrastructure = replStore.dataCubeInfrastructure;
|
|
43
65
|
|
|
44
66
|
// NOTE: snapshot manager must be instantiated before subscribers
|
|
45
67
|
this.snapshotManager = new DataCubeQuerySnapshotManager(this);
|
|
@@ -48,8 +70,20 @@ export class DataCubeState {
|
|
|
48
70
|
this.editor = new DataCubeEditorState(this);
|
|
49
71
|
}
|
|
50
72
|
|
|
73
|
+
newTask(name: string): DataCubeTask {
|
|
74
|
+
const task = new DataCubeTask(name);
|
|
75
|
+
this.runningTasks.set(task.uuid, task);
|
|
76
|
+
return task;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
endTask(task: DataCubeTask): DataCubeTask {
|
|
80
|
+
task.end();
|
|
81
|
+
this.runningTasks.delete(task.uuid);
|
|
82
|
+
return task;
|
|
83
|
+
}
|
|
84
|
+
|
|
51
85
|
async initialize(): Promise<void> {
|
|
52
|
-
this.
|
|
86
|
+
const task = this.newTask('Initializing');
|
|
53
87
|
try {
|
|
54
88
|
await Promise.all(
|
|
55
89
|
[this.core, this.editor, this.grid].map(async (state) => {
|
|
@@ -57,7 +91,7 @@ export class DataCubeState {
|
|
|
57
91
|
await state.initialize();
|
|
58
92
|
}),
|
|
59
93
|
);
|
|
60
|
-
const result = await this.engine.getBaseQuery();
|
|
94
|
+
const result = await this.infrastructure.engine.getBaseQuery();
|
|
61
95
|
const initialSnapshot = validateAndBuildQuerySnapshot(
|
|
62
96
|
result.partialQuery,
|
|
63
97
|
result.sourceQuery,
|
|
@@ -65,11 +99,11 @@ export class DataCubeState {
|
|
|
65
99
|
);
|
|
66
100
|
initialSnapshot.timestamp = result.timestamp;
|
|
67
101
|
this.snapshotManager.broadcastSnapshot(initialSnapshot);
|
|
68
|
-
this.initState.complete();
|
|
69
102
|
} catch (error: unknown) {
|
|
70
103
|
assertErrorThrown(error);
|
|
71
104
|
this.application.notificationService.notifyError(error);
|
|
72
|
-
|
|
105
|
+
} finally {
|
|
106
|
+
this.endTask(task);
|
|
73
107
|
}
|
|
74
108
|
}
|
|
75
109
|
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
DEFAULT_BACKGROUND_COLOR,
|
|
19
|
+
DEFAULT_ERROR_FOREGROUND_COLOR,
|
|
20
|
+
DEFAULT_FOREGROUND_COLOR,
|
|
21
|
+
DEFAULT_NEGATIVE_FOREGROUND_COLOR,
|
|
22
|
+
DEFAULT_ROW_HIGHLIGHT_BACKGROUND_COLOR,
|
|
23
|
+
DEFAULT_ZERO_FOREGROUND_COLOR,
|
|
24
|
+
DEFAULT_GRID_LINE_COLOR,
|
|
25
|
+
DEFAULT_FONT_FAMILY,
|
|
26
|
+
DEFAULT_FONT_SIZE,
|
|
27
|
+
DEFAULT_FONT_BOLD,
|
|
28
|
+
DEFAULT_FONT_ITALIC,
|
|
29
|
+
DEFAULT_FONT_STRIKETHROUGH,
|
|
30
|
+
DEFAULT_TEXT_ALIGN,
|
|
31
|
+
DEFAULT_FONT_UNDERLINED,
|
|
32
|
+
DEFAULT_FONT_CASE,
|
|
33
|
+
DataCubeColumnKind,
|
|
34
|
+
type DataCubeFont,
|
|
35
|
+
type DataCubeFontTextAlignment,
|
|
36
|
+
type DataCubeFontFormatUnderlineVariant,
|
|
37
|
+
type DataCubeNumberScale,
|
|
38
|
+
type DataCubeSelectionStat,
|
|
39
|
+
type DataCubeColumnPinPlacement,
|
|
40
|
+
type DataCubeFontCase,
|
|
41
|
+
} from './DataCubeQueryEngine.js';
|
|
42
|
+
import { SerializationFactory, usingModelSchema } from '@finos/legend-shared';
|
|
43
|
+
import { createModelSchema, list, optional, primitive } from 'serializr';
|
|
44
|
+
|
|
45
|
+
export type DataCubeConfigurationColorKey =
|
|
46
|
+
| 'normal'
|
|
47
|
+
| 'zero'
|
|
48
|
+
| 'negative'
|
|
49
|
+
| 'error';
|
|
50
|
+
|
|
51
|
+
export class DataCubeColumnConfiguration {
|
|
52
|
+
name: string;
|
|
53
|
+
type: string;
|
|
54
|
+
|
|
55
|
+
kind: DataCubeColumnKind = DataCubeColumnKind.DIMENSION;
|
|
56
|
+
displayName?: string | undefined;
|
|
57
|
+
|
|
58
|
+
decimals?: number | undefined;
|
|
59
|
+
displayCommas = false;
|
|
60
|
+
negativeNumberInParens = false;
|
|
61
|
+
numberScale?: DataCubeNumberScale | undefined;
|
|
62
|
+
|
|
63
|
+
hPivotSortFunction?: string | undefined;
|
|
64
|
+
|
|
65
|
+
fontFamily?: DataCubeFont | undefined;
|
|
66
|
+
fontSize?: number | undefined;
|
|
67
|
+
fontBold?: boolean | undefined;
|
|
68
|
+
fontItalic?: boolean | undefined;
|
|
69
|
+
fontUnderline?: DataCubeFontFormatUnderlineVariant | undefined;
|
|
70
|
+
fontStrikethrough?: boolean | undefined;
|
|
71
|
+
fontCase?: DataCubeFontCase | undefined;
|
|
72
|
+
textAlign?: DataCubeFontTextAlignment | undefined;
|
|
73
|
+
normalForegroundColor?: string | undefined;
|
|
74
|
+
negativeForegroundColor?: string | undefined;
|
|
75
|
+
zeroForegroundColor?: string | undefined;
|
|
76
|
+
errorForegroundColor?: string | undefined;
|
|
77
|
+
normalBackgroundColor?: string | undefined;
|
|
78
|
+
negativeBackgroundColor?: string | undefined;
|
|
79
|
+
zeroBackgroundColor?: string | undefined;
|
|
80
|
+
errorBackgroundColor?: string | undefined;
|
|
81
|
+
|
|
82
|
+
blur = false;
|
|
83
|
+
hideFromView = false;
|
|
84
|
+
|
|
85
|
+
fixedWidth?: number | undefined;
|
|
86
|
+
minWidth?: number | undefined;
|
|
87
|
+
maxWidth?: number | undefined;
|
|
88
|
+
pinned?: DataCubeColumnPinPlacement | undefined;
|
|
89
|
+
displayAsLink = false;
|
|
90
|
+
linkLabelParameter?: string | undefined;
|
|
91
|
+
|
|
92
|
+
constructor(name: string, type: string) {
|
|
93
|
+
this.name = name;
|
|
94
|
+
this.type = type;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
static readonly serialization = new SerializationFactory(
|
|
98
|
+
createModelSchema(DataCubeColumnConfiguration, {
|
|
99
|
+
blur: primitive(),
|
|
100
|
+
decimals: optional(primitive()),
|
|
101
|
+
displayAsLink: primitive(),
|
|
102
|
+
displayCommas: primitive(),
|
|
103
|
+
displayName: optional(primitive()),
|
|
104
|
+
errorBackgroundColor: optional(primitive()),
|
|
105
|
+
errorForegroundColor: optional(primitive()),
|
|
106
|
+
fixedWidth: optional(primitive()),
|
|
107
|
+
fontBold: optional(primitive()),
|
|
108
|
+
fontCase: optional(primitive()),
|
|
109
|
+
fontFamily: optional(primitive()),
|
|
110
|
+
fontItalic: optional(primitive()),
|
|
111
|
+
fontSize: optional(primitive()),
|
|
112
|
+
fontStrikethrough: optional(primitive()),
|
|
113
|
+
fontUnderline: optional(primitive()),
|
|
114
|
+
hideFromView: primitive(),
|
|
115
|
+
hPivotSortFunction: optional(primitive()),
|
|
116
|
+
kind: primitive(),
|
|
117
|
+
linkLabelParameter: optional(primitive()),
|
|
118
|
+
maxWidth: optional(primitive()),
|
|
119
|
+
minWidth: optional(primitive()),
|
|
120
|
+
name: primitive(),
|
|
121
|
+
negativeBackgroundColor: optional(primitive()),
|
|
122
|
+
negativeForegroundColor: optional(primitive()),
|
|
123
|
+
normalBackgroundColor: optional(primitive()),
|
|
124
|
+
normalForegroundColor: optional(primitive()),
|
|
125
|
+
negativeNumberInParens: primitive(),
|
|
126
|
+
numberScale: optional(primitive()),
|
|
127
|
+
pinned: optional(primitive()),
|
|
128
|
+
textAlign: optional(primitive()),
|
|
129
|
+
type: primitive(),
|
|
130
|
+
zeroBackgroundColor: optional(primitive()),
|
|
131
|
+
zeroForegroundColor: optional(primitive()),
|
|
132
|
+
}),
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export class DataCubeConfiguration {
|
|
137
|
+
description?: string | undefined;
|
|
138
|
+
columns: DataCubeColumnConfiguration[] = [];
|
|
139
|
+
|
|
140
|
+
showTreeLines = false;
|
|
141
|
+
showHorizontalGridLines = false;
|
|
142
|
+
showVerticalGridLines = true;
|
|
143
|
+
gridLineColor = DEFAULT_GRID_LINE_COLOR;
|
|
144
|
+
|
|
145
|
+
fontFamily = DEFAULT_FONT_FAMILY;
|
|
146
|
+
fontSize = DEFAULT_FONT_SIZE;
|
|
147
|
+
fontBold = DEFAULT_FONT_BOLD;
|
|
148
|
+
fontItalic = DEFAULT_FONT_ITALIC;
|
|
149
|
+
fontUnderline?: DataCubeFontFormatUnderlineVariant | undefined =
|
|
150
|
+
DEFAULT_FONT_UNDERLINED;
|
|
151
|
+
fontStrikethrough = DEFAULT_FONT_STRIKETHROUGH;
|
|
152
|
+
fontCase?: DataCubeFontCase | undefined = DEFAULT_FONT_CASE;
|
|
153
|
+
textAlign = DEFAULT_TEXT_ALIGN;
|
|
154
|
+
normalForegroundColor = DEFAULT_FOREGROUND_COLOR;
|
|
155
|
+
negativeForegroundColor = DEFAULT_NEGATIVE_FOREGROUND_COLOR;
|
|
156
|
+
zeroForegroundColor = DEFAULT_ZERO_FOREGROUND_COLOR;
|
|
157
|
+
errorForegroundColor = DEFAULT_ERROR_FOREGROUND_COLOR;
|
|
158
|
+
normalBackgroundColor = DEFAULT_BACKGROUND_COLOR;
|
|
159
|
+
negativeBackgroundColor = DEFAULT_BACKGROUND_COLOR;
|
|
160
|
+
zeroBackgroundColor = DEFAULT_BACKGROUND_COLOR;
|
|
161
|
+
errorBackgroundColor = DEFAULT_BACKGROUND_COLOR;
|
|
162
|
+
|
|
163
|
+
alternateRows = false;
|
|
164
|
+
alternateRowsStandardMode = true;
|
|
165
|
+
alternateRowsColor = DEFAULT_ROW_HIGHLIGHT_BACKGROUND_COLOR;
|
|
166
|
+
alternateRowsCount = 1;
|
|
167
|
+
|
|
168
|
+
// aggregation
|
|
169
|
+
initialExpandLevel?: number | undefined;
|
|
170
|
+
showRootAggregation = false;
|
|
171
|
+
showLeafCount = false;
|
|
172
|
+
addPivotTotalColumn = true;
|
|
173
|
+
addPivotTotalColumnOnLeft = true;
|
|
174
|
+
treeGroupSortFunction?: string | undefined;
|
|
175
|
+
|
|
176
|
+
// misc
|
|
177
|
+
selectionStats: DataCubeSelectionStat[] = [];
|
|
178
|
+
showWarningForTruncatedResult = true;
|
|
179
|
+
|
|
180
|
+
static readonly serialization = new SerializationFactory(
|
|
181
|
+
createModelSchema(DataCubeConfiguration, {
|
|
182
|
+
addPivotTotalColumn: primitive(),
|
|
183
|
+
addPivotTotalColumnOnLeft: primitive(),
|
|
184
|
+
alternateRows: primitive(),
|
|
185
|
+
alternateRowsColor: primitive(),
|
|
186
|
+
alternateRowsCount: primitive(),
|
|
187
|
+
alternateRowsStandardMode: primitive(),
|
|
188
|
+
columns: list(
|
|
189
|
+
usingModelSchema(DataCubeColumnConfiguration.serialization.schema),
|
|
190
|
+
),
|
|
191
|
+
errorBackgroundColor: primitive(),
|
|
192
|
+
errorForegroundColor: primitive(),
|
|
193
|
+
description: optional(primitive()),
|
|
194
|
+
fontBold: primitive(),
|
|
195
|
+
fontCase: optional(primitive()),
|
|
196
|
+
fontFamily: primitive(),
|
|
197
|
+
fontItalic: primitive(),
|
|
198
|
+
fontSize: primitive(),
|
|
199
|
+
fontStrikethrough: primitive(),
|
|
200
|
+
fontUnderline: optional(primitive()),
|
|
201
|
+
gridLineColor: primitive(),
|
|
202
|
+
initialExpandLevel: optional(primitive()),
|
|
203
|
+
negativeBackgroundColor: primitive(),
|
|
204
|
+
negativeForegroundColor: primitive(),
|
|
205
|
+
normalBackgroundColor: primitive(),
|
|
206
|
+
normalForegroundColor: primitive(),
|
|
207
|
+
selectionStats: list(primitive()),
|
|
208
|
+
showHorizontalGridLines: primitive(),
|
|
209
|
+
showLeafCount: primitive(),
|
|
210
|
+
showRootAggregation: primitive(),
|
|
211
|
+
showTreeLines: primitive(),
|
|
212
|
+
showVerticalGridLines: primitive(),
|
|
213
|
+
showWarningForTruncatedResult: primitive(),
|
|
214
|
+
textAlign: primitive(),
|
|
215
|
+
treeGroupSortFunction: optional(primitive()),
|
|
216
|
+
zeroBackgroundColor: primitive(),
|
|
217
|
+
zeroForegroundColor: primitive(),
|
|
218
|
+
}),
|
|
219
|
+
);
|
|
220
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { PRIMITIVE_TYPE } from '@finos/legend-graph';
|
|
18
|
+
import {
|
|
19
|
+
DataCubeColumnConfiguration,
|
|
20
|
+
DataCubeConfiguration,
|
|
21
|
+
} from './DataCubeConfiguration.js';
|
|
22
|
+
import {
|
|
23
|
+
DataCubeColumnKind,
|
|
24
|
+
DataCubeFontTextAlignment,
|
|
25
|
+
} from './DataCubeQueryEngine.js';
|
|
26
|
+
|
|
27
|
+
export function buildDefaultColumnConfiguration(column: {
|
|
28
|
+
name: string;
|
|
29
|
+
type: string;
|
|
30
|
+
}): DataCubeColumnConfiguration {
|
|
31
|
+
const { name, type } = column;
|
|
32
|
+
const config = new DataCubeColumnConfiguration(name, type);
|
|
33
|
+
switch (type) {
|
|
34
|
+
case PRIMITIVE_TYPE.NUMBER:
|
|
35
|
+
case PRIMITIVE_TYPE.INTEGER:
|
|
36
|
+
case PRIMITIVE_TYPE.DECIMAL:
|
|
37
|
+
case PRIMITIVE_TYPE.FLOAT: {
|
|
38
|
+
config.kind = DataCubeColumnKind.MEASURE;
|
|
39
|
+
config.decimals = type === PRIMITIVE_TYPE.INTEGER ? 0 : 2;
|
|
40
|
+
config.displayCommas = true;
|
|
41
|
+
config.negativeNumberInParens = true;
|
|
42
|
+
config.textAlign = DataCubeFontTextAlignment.RIGHT; // always align number to the right
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
default: {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return config;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function buildDefaultConfiguration(
|
|
53
|
+
columns: { name: string; type: string }[],
|
|
54
|
+
): DataCubeConfiguration {
|
|
55
|
+
const configuration = new DataCubeConfiguration();
|
|
56
|
+
configuration.columns = columns.map((column) =>
|
|
57
|
+
buildDefaultColumnConfiguration(column),
|
|
58
|
+
);
|
|
59
|
+
return configuration;
|
|
60
|
+
}
|
|
@@ -18,13 +18,13 @@ import { action, makeObservable, observable } from 'mobx';
|
|
|
18
18
|
import type { DataCubeState } from '../DataCubeState.js';
|
|
19
19
|
import { DataCubeQuerySnapshotSubscriber } from './DataCubeQuerySnapshotSubscriber.js';
|
|
20
20
|
import type { DataCubeQuerySnapshot } from './DataCubeQuerySnapshot.js';
|
|
21
|
-
import { DATA_CUBE_DEFAULT_REPORT_NAME } from '../DataCubeDefaultConfig.js';
|
|
22
21
|
import type { DataCubeQuery } from '../../../server/models/DataCubeQuery.js';
|
|
23
22
|
import { formatDate } from '@finos/legend-shared';
|
|
23
|
+
import { DEFAULT_REPORT_NAME } from './DataCubeQueryEngine.js';
|
|
24
24
|
|
|
25
25
|
export class DataCubeCoreState extends DataCubeQuerySnapshotSubscriber {
|
|
26
26
|
baseQuery!: DataCubeQuery;
|
|
27
|
-
name =
|
|
27
|
+
name = DEFAULT_REPORT_NAME;
|
|
28
28
|
private startTime?: number | undefined;
|
|
29
29
|
|
|
30
30
|
constructor(dataCube: DataCubeState) {
|
|
@@ -40,14 +40,17 @@ export class DataCubeCoreState extends DataCubeQuerySnapshotSubscriber {
|
|
|
40
40
|
this.name = val;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
override async applySnapshot(
|
|
43
|
+
override async applySnapshot(
|
|
44
|
+
snapshot: DataCubeQuerySnapshot,
|
|
45
|
+
previousSnapshot: DataCubeQuerySnapshot | undefined,
|
|
46
|
+
): Promise<void> {
|
|
44
47
|
const data = snapshot.data;
|
|
45
48
|
this.setName(data.name);
|
|
46
49
|
if (!this.startTime) {
|
|
47
50
|
this.startTime = snapshot.timestamp;
|
|
48
51
|
}
|
|
49
52
|
this.application.layoutService.setWindowTitle(
|
|
50
|
-
`\
|
|
53
|
+
`\u229E ${data.name}${this.startTime ? ` - ${formatDate(new Date(this.startTime), 'HH:mm:ss EEE MMM dd yyyy')}` : ''}`,
|
|
51
54
|
);
|
|
52
55
|
}
|
|
53
56
|
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
type DataCubeQuerySnapshotFilterCondition,
|
|
52
52
|
type DataCubeQuerySnapshotFilter,
|
|
53
53
|
type DataCubeQuerySnapshot,
|
|
54
|
-
|
|
54
|
+
DataCubeQuerySnapshotSortOperation,
|
|
55
55
|
DataCubeQuerySnapshotFilterOperation,
|
|
56
56
|
DataCubeQueryFilterGroupOperation,
|
|
57
57
|
_findCol,
|
|
@@ -332,6 +332,17 @@ export function buildExecutableQuery(
|
|
|
332
332
|
funcMap[funcMapKey] = func;
|
|
333
333
|
};
|
|
334
334
|
|
|
335
|
+
// --------------------------------- FILTER ---------------------------------
|
|
336
|
+
|
|
337
|
+
if (data.filter) {
|
|
338
|
+
_process(
|
|
339
|
+
'filter',
|
|
340
|
+
_function(_name(DataCubeFunction.FILTER), [
|
|
341
|
+
_lambda([_var()], [_filter(data.filter)]),
|
|
342
|
+
]),
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
|
|
335
346
|
// --------------------------------- LEAF EXTEND ---------------------------------
|
|
336
347
|
|
|
337
348
|
if (data.leafExtendedColumns.length) {
|
|
@@ -347,13 +358,13 @@ export function buildExecutableQuery(
|
|
|
347
358
|
);
|
|
348
359
|
}
|
|
349
360
|
|
|
350
|
-
// ---------------------------------
|
|
361
|
+
// --------------------------------- SELECT ---------------------------------
|
|
351
362
|
|
|
352
|
-
if (data.
|
|
363
|
+
if (data.selectColumns.length) {
|
|
353
364
|
_process(
|
|
354
|
-
'
|
|
355
|
-
_function(_name(DataCubeFunction.
|
|
356
|
-
|
|
365
|
+
'select',
|
|
366
|
+
_function(_name(DataCubeFunction.SELECT), [
|
|
367
|
+
_cols(data.selectColumns.map((col) => _colSpec(col.name))),
|
|
357
368
|
]),
|
|
358
369
|
);
|
|
359
370
|
}
|
|
@@ -398,17 +409,6 @@ export function buildExecutableQuery(
|
|
|
398
409
|
);
|
|
399
410
|
}
|
|
400
411
|
|
|
401
|
-
// --------------------------------- SELECT ---------------------------------
|
|
402
|
-
|
|
403
|
-
if (data.selectColumns.length) {
|
|
404
|
-
_process(
|
|
405
|
-
'select',
|
|
406
|
-
_function(_name(DataCubeFunction.SELECT), [
|
|
407
|
-
_cols(data.selectColumns.map((col) => _colSpec(col.name))),
|
|
408
|
-
]),
|
|
409
|
-
);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
412
|
// --------------------------------- SORT ---------------------------------
|
|
413
413
|
|
|
414
414
|
if (data.sortColumns.length) {
|
|
@@ -419,7 +419,7 @@ export function buildExecutableQuery(
|
|
|
419
419
|
data.sortColumns.map((col) =>
|
|
420
420
|
_function(
|
|
421
421
|
_name(
|
|
422
|
-
col.
|
|
422
|
+
col.operation === DataCubeQuerySnapshotSortOperation.ASCENDING
|
|
423
423
|
? DataCubeFunction.ASC
|
|
424
424
|
: DataCubeFunction.DESC,
|
|
425
425
|
),
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import
|
|
17
|
+
import { TailwindCSSPalette } from '@finos/legend-art';
|
|
18
|
+
import { PRIMITIVE_TYPE, type V1_AppliedFunction } from '@finos/legend-graph';
|
|
18
19
|
|
|
19
20
|
export enum DataCubeFunction {
|
|
20
21
|
// relation
|
|
@@ -62,11 +63,15 @@ export enum DataCubeFunction {
|
|
|
62
63
|
MAX = 'meta::pure::functions::collection::max',
|
|
63
64
|
MIN = 'meta::pure::functions::collection::min',
|
|
64
65
|
SUM = 'meta::pure::functions::math::sum',
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
STDDEV_POP = 'meta::pure::functions::math::stdDevPopulation',
|
|
67
|
+
STDDEV_SAMP = 'meta::pure::functions::math::stdDevSample',
|
|
68
|
+
VAR_POP = 'meta::pure::functions::math::variancePopulation',
|
|
69
|
+
VAR_SAMP = 'meta::pure::functions::math::varianceSample',
|
|
70
|
+
// UNIQUE_VALUE_ONLY = 'meta::pure::functions::collection::uniqueValueOnly',
|
|
71
|
+
// PERCENTILE = 'meta::pure::functions::math::percentile',
|
|
68
72
|
}
|
|
69
73
|
|
|
74
|
+
export const DEFAULT_REPORT_NAME = 'New Report';
|
|
70
75
|
export const DEFAULT_LAMBDA_VARIABLE_NAME = 'x';
|
|
71
76
|
export const PIVOT_COLUMN_NAME_VALUE_SEPARATOR = '__|__';
|
|
72
77
|
|
|
@@ -74,6 +79,7 @@ export const PIVOT_COLUMN_NAME_VALUE_SEPARATOR = '__|__';
|
|
|
74
79
|
// when no aggregate is specified in groupBy() or pivot()
|
|
75
80
|
export const INTERNAL__FILLER_COUNT_AGG_COLUMN_NAME =
|
|
76
81
|
'INTERNAL__filler_count_agg_column';
|
|
82
|
+
export const DEFAULT_ROW_BUFFER = 20;
|
|
77
83
|
|
|
78
84
|
export type DataCubeQueryFunctionMap = {
|
|
79
85
|
leafExtend?: V1_AppliedFunction | undefined;
|
|
@@ -88,3 +94,150 @@ export type DataCubeQueryFunctionMap = {
|
|
|
88
94
|
sort?: V1_AppliedFunction | undefined;
|
|
89
95
|
limit?: V1_AppliedFunction | undefined;
|
|
90
96
|
};
|
|
97
|
+
|
|
98
|
+
export enum DataCubeNumberScale {
|
|
99
|
+
BASIS_POINT = 'Basis Points (bp)',
|
|
100
|
+
PERCENT = 'Percent (%)',
|
|
101
|
+
THOUSANDS = 'Thousands (k)',
|
|
102
|
+
MILLIONS = 'Millions (m)',
|
|
103
|
+
BILLIONS = 'Billions (b)',
|
|
104
|
+
TRILLIONS = 'Trillions (t)',
|
|
105
|
+
AUTO = 'Auto (k/m/b/t)',
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export enum DataCubeSelectionStat {
|
|
109
|
+
COUNT = 'Count',
|
|
110
|
+
SUM = 'Sum',
|
|
111
|
+
MIN = 'Min',
|
|
112
|
+
MAX = 'Max',
|
|
113
|
+
AVERAGE = 'Average',
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export enum DataCubeFont {
|
|
117
|
+
// sans-serif
|
|
118
|
+
ARIAL = 'Arial',
|
|
119
|
+
ROBOTO = 'Roboto',
|
|
120
|
+
ROBOTO_CONDENSED = 'Roboto Condensed',
|
|
121
|
+
|
|
122
|
+
// serif
|
|
123
|
+
TIMES_NEW_ROMAN = 'Times New Roman',
|
|
124
|
+
GEORGIA = 'Georgia',
|
|
125
|
+
ROBOTO_SERIF = 'Roboto Serif',
|
|
126
|
+
|
|
127
|
+
// monospace
|
|
128
|
+
JERBRAINS_MONO = 'Jetbrains Mono',
|
|
129
|
+
ROBOTO_MONO = 'Roboto Mono',
|
|
130
|
+
UBUNTU_MONO = 'Ubuntu Mono',
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export enum DataCubeFontTextAlignment {
|
|
134
|
+
CENTER = 'center',
|
|
135
|
+
LEFT = 'left',
|
|
136
|
+
RIGHT = 'right',
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export enum DataCubeFontCase {
|
|
140
|
+
LOWERCASE = 'lowercase',
|
|
141
|
+
UPPERCASE = 'uppercase',
|
|
142
|
+
CAPITALIZE = 'capitalize',
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export enum DataCubeFontFormatUnderlineVariant {
|
|
146
|
+
SOLID = 'solid',
|
|
147
|
+
DASHED = 'dashed',
|
|
148
|
+
DOTTED = 'dotted',
|
|
149
|
+
DOUBLE = 'double',
|
|
150
|
+
WAVY = 'wavy',
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export enum DataCubeColumnKind {
|
|
154
|
+
MEASURE = 'Measure',
|
|
155
|
+
DIMENSION = 'Dimension',
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export enum DataCubeAggregateFunction {
|
|
159
|
+
SUM = 'sum',
|
|
160
|
+
AVERAGE = 'avg',
|
|
161
|
+
COUNT = 'count',
|
|
162
|
+
MIN = 'min',
|
|
163
|
+
MAX = 'max',
|
|
164
|
+
// UNIQUE = 'uniq',
|
|
165
|
+
FIRST = 'first',
|
|
166
|
+
LAST = 'last',
|
|
167
|
+
MEDIAN = 'median',
|
|
168
|
+
VAR_POP = 'var_samp',
|
|
169
|
+
VAR_SAMP = 'var_pop',
|
|
170
|
+
STDDEV_POP = 'stddev_pop',
|
|
171
|
+
STDDEV_SAMP = 'stddev_samp',
|
|
172
|
+
// STANDARD_ERROR = 'stderr',
|
|
173
|
+
// NULL = 'null',
|
|
174
|
+
// ssq
|
|
175
|
+
// countvalid
|
|
176
|
+
// countnull
|
|
177
|
+
// uniqunstrict
|
|
178
|
+
// minmagnitude
|
|
179
|
+
// maxmagnitude
|
|
180
|
+
// commonprefix
|
|
181
|
+
// commonprefixunstrict
|
|
182
|
+
// strjoin
|
|
183
|
+
// strjoinuniq
|
|
184
|
+
// splitjoin
|
|
185
|
+
// daterange
|
|
186
|
+
// wavg
|
|
187
|
+
// wstderr
|
|
188
|
+
// wsum
|
|
189
|
+
// custom
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export enum DataCubeColumnPinPlacement {
|
|
193
|
+
LEFT = 'Left',
|
|
194
|
+
RIGHT = 'Right',
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export enum DataCubeColumnDataType {
|
|
198
|
+
NUMBER = 'number',
|
|
199
|
+
DATE = 'date',
|
|
200
|
+
TEXT = 'text',
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export function getDataType(type: string): DataCubeColumnDataType {
|
|
204
|
+
switch (type) {
|
|
205
|
+
case PRIMITIVE_TYPE.NUMBER:
|
|
206
|
+
case PRIMITIVE_TYPE.INTEGER:
|
|
207
|
+
case PRIMITIVE_TYPE.DECIMAL:
|
|
208
|
+
case PRIMITIVE_TYPE.FLOAT:
|
|
209
|
+
return DataCubeColumnDataType.NUMBER;
|
|
210
|
+
case PRIMITIVE_TYPE.DATE:
|
|
211
|
+
case PRIMITIVE_TYPE.DATETIME:
|
|
212
|
+
case PRIMITIVE_TYPE.STRICTDATE:
|
|
213
|
+
return DataCubeColumnDataType.DATE;
|
|
214
|
+
case PRIMITIVE_TYPE.STRING:
|
|
215
|
+
default:
|
|
216
|
+
return DataCubeColumnDataType.TEXT;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export const DEFAULT_URL_LABEL_QUERY_PARAM = 'dataCube.linkLabel';
|
|
221
|
+
|
|
222
|
+
export const DEFAULT_GRID_LINE_COLOR = TailwindCSSPalette.neutral[200];
|
|
223
|
+
export const DEFAULT_ROW_HIGHLIGHT_BACKGROUND_COLOR =
|
|
224
|
+
TailwindCSSPalette.sky[100];
|
|
225
|
+
|
|
226
|
+
export const DEFAULT_COLUMN_WIDTH = 300;
|
|
227
|
+
export const DEFAULT_COLUMN_MIN_WIDTH = 50;
|
|
228
|
+
export const DEFAULT_COLUMN_MAX_WIDTH = undefined;
|
|
229
|
+
|
|
230
|
+
export const DEFAULT_FONT_FAMILY = DataCubeFont.ROBOTO;
|
|
231
|
+
export const DEFAULT_FONT_SIZE = 12;
|
|
232
|
+
export const DEFAULT_FONT_BOLD = false;
|
|
233
|
+
export const DEFAULT_FONT_ITALIC = false;
|
|
234
|
+
export const DEFAULT_FONT_CASE = undefined;
|
|
235
|
+
export const DEFAULT_FONT_UNDERLINED = undefined;
|
|
236
|
+
export const DEFAULT_FONT_STRIKETHROUGH = false;
|
|
237
|
+
export const DEFAULT_TEXT_ALIGN = DataCubeFontTextAlignment.LEFT;
|
|
238
|
+
export const DEFAULT_FOREGROUND_COLOR = TailwindCSSPalette.black;
|
|
239
|
+
export const DEFAULT_BACKGROUND_COLOR = TailwindCSSPalette.transparent;
|
|
240
|
+
export const DEFAULT_ROW_BACKGROUND_COLOR = TailwindCSSPalette.white;
|
|
241
|
+
export const DEFAULT_NEGATIVE_FOREGROUND_COLOR = TailwindCSSPalette.red[500];
|
|
242
|
+
export const DEFAULT_ZERO_FOREGROUND_COLOR = TailwindCSSPalette.neutral[400];
|
|
243
|
+
export const DEFAULT_ERROR_FOREGROUND_COLOR = TailwindCSSPalette.blue[600];
|