@finos/legend-application-data-cube 0.1.0

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.
Files changed (108) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/lib/application/Core_LegendDataCubeApplicationPlugin.d.ts +23 -0
  4. package/lib/application/Core_LegendDataCubeApplicationPlugin.d.ts.map +1 -0
  5. package/lib/application/Core_LegendDataCubeApplicationPlugin.js +35 -0
  6. package/lib/application/Core_LegendDataCubeApplicationPlugin.js.map +1 -0
  7. package/lib/application/Core_LegendDataCube_LegendApplicationPlugin.d.ts +19 -0
  8. package/lib/application/Core_LegendDataCube_LegendApplicationPlugin.d.ts.map +1 -0
  9. package/lib/application/Core_LegendDataCube_LegendApplicationPlugin.js +19 -0
  10. package/lib/application/Core_LegendDataCube_LegendApplicationPlugin.js.map +1 -0
  11. package/lib/application/LegendDataCube.d.ts +26 -0
  12. package/lib/application/LegendDataCube.d.ts.map +1 -0
  13. package/lib/application/LegendDataCube.js +41 -0
  14. package/lib/application/LegendDataCube.js.map +1 -0
  15. package/lib/application/LegendDataCubeApplicationConfig.d.ts +33 -0
  16. package/lib/application/LegendDataCubeApplicationConfig.d.ts.map +1 -0
  17. package/lib/application/LegendDataCubeApplicationConfig.js +36 -0
  18. package/lib/application/LegendDataCubeApplicationConfig.js.map +1 -0
  19. package/lib/application/LegendDataCubeApplicationPlugin.d.ts +26 -0
  20. package/lib/application/LegendDataCubeApplicationPlugin.d.ts.map +1 -0
  21. package/lib/application/LegendDataCubeApplicationPlugin.js +28 -0
  22. package/lib/application/LegendDataCubeApplicationPlugin.js.map +1 -0
  23. package/lib/application/LegendDataCubePluginManager.d.ts +32 -0
  24. package/lib/application/LegendDataCubePluginManager.d.ts.map +1 -0
  25. package/lib/application/LegendDataCubePluginManager.js +47 -0
  26. package/lib/application/LegendDataCubePluginManager.js.map +1 -0
  27. package/lib/components/DataCubeEditor.d.ts +19 -0
  28. package/lib/components/DataCubeEditor.d.ts.map +1 -0
  29. package/lib/components/DataCubeEditor.js +31 -0
  30. package/lib/components/DataCubeEditor.js.map +1 -0
  31. package/lib/components/LegendDataCubeFrameworkProvider.d.ts +25 -0
  32. package/lib/components/LegendDataCubeFrameworkProvider.d.ts.map +1 -0
  33. package/lib/components/LegendDataCubeFrameworkProvider.js +31 -0
  34. package/lib/components/LegendDataCubeFrameworkProvider.js.map +1 -0
  35. package/lib/components/LegendDataCubeWebApplication.d.ts +21 -0
  36. package/lib/components/LegendDataCubeWebApplication.d.ts.map +1 -0
  37. package/lib/components/LegendDataCubeWebApplication.js +29 -0
  38. package/lib/components/LegendDataCubeWebApplication.js.map +1 -0
  39. package/lib/components/source/DataCubeSourceEditor.d.ts +22 -0
  40. package/lib/components/source/DataCubeSourceEditor.d.ts.map +1 -0
  41. package/lib/components/source/DataCubeSourceEditor.js +43 -0
  42. package/lib/components/source/DataCubeSourceEditor.js.map +1 -0
  43. package/lib/components/source/SavedQuerySourceEditor.d.ts +22 -0
  44. package/lib/components/source/SavedQuerySourceEditor.d.ts.map +1 -0
  45. package/lib/components/source/SavedQuerySourceEditor.js +25 -0
  46. package/lib/components/source/SavedQuerySourceEditor.js.map +1 -0
  47. package/lib/index.css +17 -0
  48. package/lib/index.css.map +1 -0
  49. package/lib/index.d.ts +19 -0
  50. package/lib/index.d.ts.map +1 -0
  51. package/lib/index.js +19 -0
  52. package/lib/index.js.map +1 -0
  53. package/lib/package.json +81 -0
  54. package/lib/stores/LegendDataCubeEditorStore.d.ts +44 -0
  55. package/lib/stores/LegendDataCubeEditorStore.d.ts.map +1 -0
  56. package/lib/stores/LegendDataCubeEditorStore.js +91 -0
  57. package/lib/stores/LegendDataCubeEditorStore.js.map +1 -0
  58. package/lib/stores/engine/LegendExecutionDataCubeEngine.d.ts +46 -0
  59. package/lib/stores/engine/LegendExecutionDataCubeEngine.d.ts.map +1 -0
  60. package/lib/stores/engine/LegendExecutionDataCubeEngine.js +145 -0
  61. package/lib/stores/engine/LegendExecutionDataCubeEngine.js.map +1 -0
  62. package/lib/stores/source/CubeInputSource.d.ts +38 -0
  63. package/lib/stores/source/CubeInputSource.d.ts.map +1 -0
  64. package/lib/stores/source/CubeInputSource.js +40 -0
  65. package/lib/stores/source/CubeInputSource.js.map +1 -0
  66. package/lib/stores/source/CubeInputSourceLoader.d.ts +37 -0
  67. package/lib/stores/source/CubeInputSourceLoader.d.ts.map +1 -0
  68. package/lib/stores/source/CubeInputSourceLoader.js +40 -0
  69. package/lib/stores/source/CubeInputSourceLoader.js.map +1 -0
  70. package/lib/stores/source/LegendCubeViewer.d.ts +23 -0
  71. package/lib/stores/source/LegendCubeViewer.d.ts.map +1 -0
  72. package/lib/stores/source/LegendCubeViewer.js +24 -0
  73. package/lib/stores/source/LegendCubeViewer.js.map +1 -0
  74. package/lib/stores/source/LegendDataCubeSourceBuilder.d.ts +34 -0
  75. package/lib/stores/source/LegendDataCubeSourceBuilder.d.ts.map +1 -0
  76. package/lib/stores/source/LegendDataCubeSourceBuilder.js +70 -0
  77. package/lib/stores/source/LegendDataCubeSourceBuilder.js.map +1 -0
  78. package/lib/stores/source/SavedDepotInputSourceState.d.ts +47 -0
  79. package/lib/stores/source/SavedDepotInputSourceState.d.ts.map +1 -0
  80. package/lib/stores/source/SavedDepotInputSourceState.js +77 -0
  81. package/lib/stores/source/SavedDepotInputSourceState.js.map +1 -0
  82. package/lib/stores/source/SavedQueryInputSourceState.d.ts +35 -0
  83. package/lib/stores/source/SavedQueryInputSourceState.d.ts.map +1 -0
  84. package/lib/stores/source/SavedQueryInputSourceState.js +81 -0
  85. package/lib/stores/source/SavedQueryInputSourceState.js.map +1 -0
  86. package/package.json +81 -0
  87. package/src/application/Core_LegendDataCubeApplicationPlugin.ts +38 -0
  88. package/src/application/Core_LegendDataCube_LegendApplicationPlugin.ts +19 -0
  89. package/src/application/LegendDataCube.tsx +70 -0
  90. package/src/application/LegendDataCubeApplicationConfig.ts +74 -0
  91. package/src/application/LegendDataCubeApplicationPlugin.ts +30 -0
  92. package/src/application/LegendDataCubePluginManager.ts +66 -0
  93. package/src/components/DataCubeEditor.tsx +93 -0
  94. package/src/components/LegendDataCubeFrameworkProvider.tsx +70 -0
  95. package/src/components/LegendDataCubeWebApplication.tsx +45 -0
  96. package/src/components/source/DataCubeSourceEditor.tsx +133 -0
  97. package/src/components/source/SavedQuerySourceEditor.tsx +62 -0
  98. package/src/index.ts +19 -0
  99. package/src/stores/LegendDataCubeEditorStore.ts +120 -0
  100. package/src/stores/engine/LegendExecutionDataCubeEngine.ts +257 -0
  101. package/src/stores/source/CubeInputSource.ts +47 -0
  102. package/src/stores/source/CubeInputSourceLoader.ts +56 -0
  103. package/src/stores/source/LegendCubeViewer.ts +28 -0
  104. package/src/stores/source/LegendDataCubeSourceBuilder.ts +98 -0
  105. package/src/stores/source/SavedDepotInputSourceState.ts +103 -0
  106. package/src/stores/source/SavedQueryInputSourceState.ts +144 -0
  107. package/tsconfig.json +82 -0
  108. package/tsconfig.package.json +54 -0
@@ -0,0 +1,24 @@
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
+ export class LegendCubeViewer {
17
+ source;
18
+ engine;
19
+ constructor(source, engine) {
20
+ this.source = source;
21
+ this.engine = engine;
22
+ }
23
+ }
24
+ //# sourceMappingURL=LegendCubeViewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendCubeViewer.js","sourceRoot":"","sources":["../../../src/stores/source/LegendCubeViewer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,OAAO,gBAAgB;IAC3B,MAAM,CAAkB;IACxB,MAAM,CAAiB;IAEvB,YAAY,MAAuB,EAAE,MAAsB;QACzD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF"}
@@ -0,0 +1,34 @@
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
+ import { DataCubeSourceType, type CubeInputSourceState } from './CubeInputSourceLoader.js';
17
+ import type { LegendDataCubeStoreContext } from '../LegendDataCubeEditorStore.js';
18
+ import { type GeneratorFn } from '@finos/legend-shared';
19
+ import type { CubeInputSource } from './CubeInputSource.js';
20
+ import type { DataCubeEngine } from '@finos/legend-data-cube';
21
+ export declare class LegendDataCubeSourceBuilder {
22
+ readonly context: LegendDataCubeStoreContext;
23
+ open: boolean;
24
+ sourceState: CubeInputSourceState;
25
+ constructor(context: LegendDataCubeStoreContext);
26
+ get options(): DataCubeSourceType[];
27
+ get currentOption(): DataCubeSourceType;
28
+ openModal(): void;
29
+ close(): void;
30
+ changeSource(source: DataCubeSourceType): void;
31
+ buildSource(source: DataCubeSourceType): CubeInputSourceState;
32
+ inputSource(callback: (source: CubeInputSource, engine: DataCubeEngine) => void): GeneratorFn<void>;
33
+ }
34
+ //# sourceMappingURL=LegendDataCubeSourceBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendDataCubeSourceBuilder.d.ts","sourceRoot":"","sources":["../../../src/stores/source/LegendDataCubeSourceBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,kBAAkB,EAClB,KAAK,oBAAoB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,qBAAa,2BAA2B;IACtC,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;IAC7C,IAAI,UAAS;IACb,WAAW,EAAE,oBAAoB,CAAC;gBAEtB,OAAO,EAAE,0BAA0B;IAU/C,IAAI,OAAO,IAAI,kBAAkB,EAAE,CAElC;IAED,IAAI,aAAa,IAAI,kBAAkB,CAEtC;IAED,SAAS,IAAI,IAAI;IAIjB,KAAK,IAAI,IAAI;IAIb,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI;IAM9C,WAAW,CAAC,MAAM,EAAE,kBAAkB,GAAG,oBAAoB;IAO5D,WAAW,CACV,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,KAAK,IAAI,GAClE,WAAW,CAAC,IAAI,CAAC;CAkBrB"}
@@ -0,0 +1,70 @@
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
+ import { flow, makeObservable, observable } from 'mobx';
17
+ import { DataCubeSourceType, } from './CubeInputSourceLoader.js';
18
+ import { SavedQueryInputSourceState } from './SavedQueryInputSourceState.js';
19
+ import { UnsupportedOperationError, assertErrorThrown, assertTrue, guaranteeNonNullable, } from '@finos/legend-shared';
20
+ export class LegendDataCubeSourceBuilder {
21
+ context;
22
+ open = false;
23
+ sourceState;
24
+ constructor(context) {
25
+ makeObservable(this, {
26
+ open: observable,
27
+ sourceState: observable,
28
+ inputSource: flow,
29
+ });
30
+ this.context = context;
31
+ this.sourceState = this.buildSource(guaranteeNonNullable(this.options[0]));
32
+ }
33
+ get options() {
34
+ return Object.values(DataCubeSourceType);
35
+ }
36
+ get currentOption() {
37
+ throw new UnsupportedOperationError('');
38
+ }
39
+ openModal() {
40
+ this.open = true;
41
+ }
42
+ close() {
43
+ this.open = false;
44
+ }
45
+ changeSource(source) {
46
+ if (this.sourceState.label !== source) {
47
+ this.sourceState = this.buildSource(source);
48
+ }
49
+ }
50
+ buildSource(source) {
51
+ if (source === DataCubeSourceType.LEGEND_QUERY) {
52
+ return SavedQueryInputSourceState.builder(this.context);
53
+ }
54
+ throw new UnsupportedOperationError('Not supported');
55
+ }
56
+ *inputSource(callback) {
57
+ try {
58
+ assertTrue(this.sourceState.isValid, 'Source State is in a valid state to input');
59
+ const engine = (yield this.sourceState.buildCubeEngine());
60
+ const source = this.sourceState.process();
61
+ callback(source, engine);
62
+ this.close();
63
+ }
64
+ catch (error) {
65
+ assertErrorThrown(error);
66
+ this.context.applicationStore.notificationService.notifyError(`Unable to import: ${this.sourceState.label}: ${error.message}`);
67
+ }
68
+ }
69
+ }
70
+ //# sourceMappingURL=LegendDataCubeSourceBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendDataCubeSourceBuilder.js","sourceRoot":"","sources":["../../../src/stores/source/LegendDataCubeSourceBuilder.ts"],"names":[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AAI,MAAM,KAAK,kBAAkB,CAAC,YAAY,EAAE,CAAC;YAC/C,OAAO,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1D,CAAC;QACD,MAAM,IAAI,yBAAyB,CAAC,eAAe,CAAC,CAAC;IACvD,CAAC;IAED,CAAC,WAAW,CACV,QAAmE;QAEnE,IAAI,CAAC;YACH,UAAU,CACR,IAAI,CAAC,WAAW,CAAC,OAAO,EACxB,2CAA2C,CAC5C,CAAC;YACF,MAAM,MAAM,GACV,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,CAAmB,CAAC;YAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;YAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACzB,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAC3D,qBAAqB,IAAI,CAAC,WAAW,CAAC,KAAK,KAAK,KAAK,CAAC,OAAO,EAAE,CAChE,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,47 @@
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
+ import { type GeneratorFn } from '@finos/legend-shared';
17
+ import { type CubeInputSource } from './CubeInputSource.js';
18
+ import type { VersionedProjectData } from '@finos/legend-server-depot';
19
+ import type { DataCubeEngine } from '@finos/legend-data-cube';
20
+ import { CubeInputSourceState, DataCubeSourceType } from './CubeInputSourceLoader.js';
21
+ import type { LegendDataCubeStoreContext } from '../LegendDataCubeEditorStore.js';
22
+ export declare enum SAVED_DEPOT_TYPE {
23
+ SERVICE = "SERVICE",
24
+ FUNCTION = "FUNCTION",
25
+ TABLE = "TABLE"
26
+ }
27
+ export declare abstract class SavedDepotSourceState {
28
+ abstract get label(): SAVED_DEPOT_TYPE;
29
+ }
30
+ export declare class ServiceDepotSourceState extends SavedDepotSourceState {
31
+ get label(): SAVED_DEPOT_TYPE;
32
+ }
33
+ export declare class SavedDepotInputSourceState extends CubeInputSourceState {
34
+ project: VersionedProjectData | undefined;
35
+ selectedSource: SavedDepotSourceState;
36
+ constructor(context: LegendDataCubeStoreContext);
37
+ get options(): SAVED_DEPOT_TYPE[];
38
+ process(): CubeInputSource;
39
+ fectchAssociatedProjectsAndVersions(): GeneratorFn<void>;
40
+ static builder(context: LegendDataCubeStoreContext): CubeInputSourceState;
41
+ build(source: SAVED_DEPOT_TYPE): SavedDepotSourceState;
42
+ get label(): DataCubeSourceType;
43
+ setup(): Promise<void>;
44
+ buildCubeEngine(): Promise<DataCubeEngine | undefined>;
45
+ get isValid(): boolean;
46
+ }
47
+ //# sourceMappingURL=SavedDepotInputSourceState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SavedDepotInputSourceState.d.ts","sourceRoot":"","sources":["../../../src/stores/source/SavedDepotInputSourceState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAGlF,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,KAAK,UAAU;CAChB;AAED,8BAAsB,qBAAqB;IACzC,QAAQ,KAAK,KAAK,IAAI,gBAAgB,CAAC;CACxC;AAED,qBAAa,uBAAwB,SAAQ,qBAAqB;IAChE,IAAa,KAAK,IAAI,gBAAgB,CAErC;CACF;AAED,qBAAa,0BAA2B,SAAQ,oBAAoB;IAClE,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAC1C,cAAc,EAAE,qBAAqB,CAAC;gBAE1B,OAAO,EAAE,0BAA0B;IAU/C,IAAI,OAAO,IAAI,gBAAgB,EAAE,CAEhC;IACQ,OAAO,IAAI,eAAe;IAQlC,mCAAmC,IAAI,WAAW,CAAC,IAAI,CAAC;WAIzC,OAAO,CACrB,OAAO,EAAE,0BAA0B,GAClC,oBAAoB;IAIvB,KAAK,CAAC,MAAM,EAAE,gBAAgB,GAAG,qBAAqB;IAOtD,IAAa,KAAK,IAAI,kBAAkB,CAEvC;IACQ,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAGzB,eAAe,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAI5D,IAAa,OAAO,IAAI,OAAO,CAE9B;CACF"}
@@ -0,0 +1,77 @@
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
+ import { UnsupportedOperationError, guaranteeNonNullable, } from '@finos/legend-shared';
17
+ import {} from './CubeInputSource.js';
18
+ import { CubeInputSourceState, DataCubeSourceType, } from './CubeInputSourceLoader.js';
19
+ import { makeObservable, observable } from 'mobx';
20
+ export var SAVED_DEPOT_TYPE;
21
+ (function (SAVED_DEPOT_TYPE) {
22
+ SAVED_DEPOT_TYPE["SERVICE"] = "SERVICE";
23
+ SAVED_DEPOT_TYPE["FUNCTION"] = "FUNCTION";
24
+ SAVED_DEPOT_TYPE["TABLE"] = "TABLE";
25
+ })(SAVED_DEPOT_TYPE || (SAVED_DEPOT_TYPE = {}));
26
+ export class SavedDepotSourceState {
27
+ }
28
+ export class ServiceDepotSourceState extends SavedDepotSourceState {
29
+ get label() {
30
+ return SAVED_DEPOT_TYPE.SERVICE;
31
+ }
32
+ }
33
+ export class SavedDepotInputSourceState extends CubeInputSourceState {
34
+ project;
35
+ selectedSource;
36
+ constructor(context) {
37
+ super(context);
38
+ makeObservable(this, {
39
+ project: observable,
40
+ selectedSource: observable,
41
+ });
42
+ this.selectedSource = this.build(guaranteeNonNullable(this.options[0]));
43
+ }
44
+ get options() {
45
+ return Object.values(SAVED_DEPOT_TYPE);
46
+ }
47
+ process() {
48
+ // assertTrue(this.isValid);
49
+ // if (this.element instanceof Service) {
50
+ // }
51
+ throw new UnsupportedOperationError('');
52
+ }
53
+ *fectchAssociatedProjectsAndVersions() {
54
+ throw new UnsupportedOperationError('not supported yet');
55
+ }
56
+ static builder(context) {
57
+ return new SavedDepotInputSourceState(context);
58
+ }
59
+ build(source) {
60
+ // if (source === SAVED_DEPOT_TYPE.SERVICE) {
61
+ // }
62
+ throw new UnsupportedOperationError('');
63
+ }
64
+ get label() {
65
+ return DataCubeSourceType.DEPOT_QUERY;
66
+ }
67
+ setup() {
68
+ throw new Error('Method not implemented.');
69
+ }
70
+ async buildCubeEngine() {
71
+ throw new Error('Method not implemented.');
72
+ }
73
+ get isValid() {
74
+ throw new Error('Method not implemented.');
75
+ }
76
+ }
77
+ //# sourceMappingURL=SavedDepotInputSourceState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SavedDepotInputSourceState.js","sourceRoot":"","sources":["../../../src/stores/source/SavedDepotInputSourceState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GAErB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAwB,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElD,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,mCAAe,CAAA;AACjB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,MAAM,OAAgB,qBAAqB;CAE1C;AAED,MAAM,OAAO,uBAAwB,SAAQ,qBAAqB;IAChE,IAAa,KAAK;QAChB,OAAO,gBAAgB,CAAC,OAAO,CAAC;IAClC,CAAC;CACF;AAED,MAAM,OAAO,0BAA2B,SAAQ,oBAAoB;IAClE,OAAO,CAAmC;IAC1C,cAAc,CAAwB;IAEtC,YAAY,OAAmC;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,cAAc,CAAC,IAAI,EAAE;YACnB,OAAO,EAAE,UAAU;YACnB,cAAc,EAAE,UAAU;SAC3B,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,IAAI,OAAO;QACT,OAAO,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACzC,CAAC;IACQ,OAAO;QACd,4BAA4B;QAC5B,yCAAyC;QACzC,IAAI;QAEJ,MAAM,IAAI,yBAAyB,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,CAAC,mCAAmC;QAClC,MAAM,IAAI,yBAAyB,CAAC,mBAAmB,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,CAAU,OAAO,CACrB,OAAmC;QAEnC,OAAO,IAAI,0BAA0B,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,MAAwB;QAC5B,6CAA6C;QAC7C,IAAI;QAEJ,MAAM,IAAI,yBAAyB,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,IAAa,KAAK;QAChB,OAAO,kBAAkB,CAAC,WAAW,CAAC;IACxC,CAAC;IACQ,KAAK;QACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,KAAK,CAAC,eAAe;QACnB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,IAAa,OAAO;QAClB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF"}
@@ -0,0 +1,35 @@
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
+ import { type CubeInputSource } from './CubeInputSource.js';
17
+ import { CubeInputSourceState, DataCubeSourceType } from './CubeInputSourceLoader.js';
18
+ import type { DataCubeEngine } from '@finos/legend-data-cube';
19
+ import { type LightQuery } from '@finos/legend-graph';
20
+ import type { LegendDataCubeStoreContext } from '../LegendDataCubeEditorStore.js';
21
+ import { QueryLoaderState } from '@finos/legend-query-builder';
22
+ export declare class SavedQueryInputSourceState extends CubeInputSourceState {
23
+ query: LightQuery | undefined;
24
+ queryLoaderState: QueryLoaderState;
25
+ constructor(context: LegendDataCubeStoreContext);
26
+ setQuery(query: LightQuery): void;
27
+ process(): CubeInputSource;
28
+ get openActionable(): boolean;
29
+ static builder(context: LegendDataCubeStoreContext): CubeInputSourceState;
30
+ get label(): DataCubeSourceType;
31
+ setup(): Promise<void>;
32
+ buildCubeEngine(): Promise<DataCubeEngine | undefined>;
33
+ get isValid(): boolean;
34
+ }
35
+ //# sourceMappingURL=SavedQueryInputSourceState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SavedQueryInputSourceState.d.ts","sourceRoot":"","sources":["../../../src/stores/source/SavedQueryInputSourceState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAEL,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAGrC,qBAAa,0BAA2B,SAAQ,oBAAoB;IAClE,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC;IAC9B,gBAAgB,EAAE,gBAAgB,CAAC;gBAEvB,OAAO,EAAE,0BAA0B;IA2B/C,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAIxB,OAAO,IAAI,eAAe;IAKnC,IAAa,cAAc,IAAI,OAAO,CAErC;WAEe,OAAO,CACrB,OAAO,EAAE,0BAA0B,GAClC,oBAAoB;IAGvB,IAAa,KAAK,IAAI,kBAAkB,CAEvC;IACQ,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,eAAe,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAuC5D,IAAa,OAAO,IAAI,OAAO,CAE9B;CACF"}
@@ -0,0 +1,81 @@
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
+ import { assertTrue, guaranteeNonNullable, isNonNullable, } from '@finos/legend-shared';
17
+ import { LegendSavedQuerySource, } from './CubeInputSource.js';
18
+ import { CubeInputSourceState, DataCubeSourceType, } from './CubeInputSourceLoader.js';
19
+ import { LegendSDLC, QuerySearchSpecification, } from '@finos/legend-graph';
20
+ import { resolveVersion } from '@finos/legend-server-depot';
21
+ import { LegendExecutionDataCubeEngine } from '../engine/LegendExecutionDataCubeEngine.js';
22
+ import { QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT, QueryLoaderState, } from '@finos/legend-query-builder';
23
+ import { action, makeObservable, observable } from 'mobx';
24
+ export class SavedQueryInputSourceState extends CubeInputSourceState {
25
+ query;
26
+ queryLoaderState;
27
+ constructor(context) {
28
+ super(context);
29
+ makeObservable(this, {
30
+ query: observable,
31
+ buildCubeEngineState: observable,
32
+ setQuery: action,
33
+ });
34
+ this.queryLoaderState = new QueryLoaderState(this.context.applicationStore, this.context.graphManagerState, {
35
+ loadQuery: (query) => {
36
+ this.setQuery(query);
37
+ },
38
+ decorateSearchSpecification: (val) => val,
39
+ fetchDefaultQueries: async () => {
40
+ const searchSpecification = new QuerySearchSpecification();
41
+ searchSpecification.limit = QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT;
42
+ return this.context.graphManagerState.graphManager.searchQueries(QuerySearchSpecification.createDefault(undefined));
43
+ },
44
+ isReadOnly: true,
45
+ });
46
+ }
47
+ setQuery(query) {
48
+ this.query = query;
49
+ }
50
+ process() {
51
+ assertTrue(this.isValid);
52
+ return new LegendSavedQuerySource(guaranteeNonNullable(this.query).id);
53
+ }
54
+ get openActionable() {
55
+ return false;
56
+ }
57
+ static builder(context) {
58
+ return new SavedQueryInputSourceState(context);
59
+ }
60
+ get label() {
61
+ return DataCubeSourceType.LEGEND_QUERY;
62
+ }
63
+ setup() {
64
+ throw new Error('Method not implemented.');
65
+ }
66
+ async buildCubeEngine() {
67
+ this.buildCubeEngineState.inProgress();
68
+ const queryInfo = await this.context.graphManagerState.graphManager.getQueryInfo(guaranteeNonNullable(this.query).id);
69
+ const execConext = (await this.context.graphManagerState.graphManager.resolveQueryInfoExecutionContext(queryInfo, () => this.context.depotServerClient.getVersionEntities(queryInfo.groupId, queryInfo.artifactId, queryInfo.versionId)));
70
+ const lambda = (await this.context.graphManagerState.graphManager.pureCodeToLambda(queryInfo.content));
71
+ this.context.graphManagerState.graph.setOrigin(new LegendSDLC(queryInfo.groupId, queryInfo.artifactId, resolveVersion(queryInfo.versionId)));
72
+ // TODO: we should be able to call engine and convert lambda to relation if not one.
73
+ const engine = new LegendExecutionDataCubeEngine(lambda, undefined, execConext.mapping, execConext.runtime, this.context.graphManagerState);
74
+ this.buildCubeEngineState.complete();
75
+ return engine;
76
+ }
77
+ get isValid() {
78
+ return isNonNullable(this.query);
79
+ }
80
+ }
81
+ //# sourceMappingURL=SavedQueryInputSourceState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SavedQueryInput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O,EACjB,SAAS,CAAC,UAAU,EACpB,SAAS,CAAC,SAAS,CACpB,CACJ,CAAqD,CAAC;QACzD,MAAM,MAAM,GACV,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,gBAAgB,CACjE,SAAS,CAAC,OAAO,CAClB,CAAyB,CAAC;QAC7B,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,SAAS,CAC5C,IAAI,UAAU,CACZ,SAAS,CAAC,OAAO,EACjB,SAAS,CAAC,UAAU,EACpB,cAAc,CAAC,SAAS,CAAC,SAAS,CAAC,CACpC,CACF,CAAC;QACF,oFAAoF;QACpF,MAAM,MAAM,GAAG,IAAI,6BAA6B,CAC9C,MAAM,EACN,SAAS,EACT,UAAU,CAAC,OAAO,EAClB,UAAU,CAAC,OAAO,EAClB,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAC/B,CAAC;QACF,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,CAAC;QACrC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAa,OAAO;QAClB,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@finos/legend-application-data-cube",
3
+ "version": "0.1.0",
4
+ "description": "Legend Data Cube application core",
5
+ "keywords": [
6
+ "legend",
7
+ "legend-application",
8
+ "legend-data-cube"
9
+ ],
10
+ "homepage": "https://github.com/finos/legend-studio/tree/master/packages/legend-application-data-cube",
11
+ "bugs": {
12
+ "url": "https://github.com/finos/legend-studio/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/finos/legend-studio.git",
17
+ "directory": "packages/legend-application-data-cube"
18
+ },
19
+ "license": "Apache-2.0",
20
+ "sideEffects": false,
21
+ "type": "module",
22
+ "exports": {
23
+ ".": "./lib/index.js",
24
+ "./lib/index.css": "./lib/index.css"
25
+ },
26
+ "module": "lib/index.js",
27
+ "types": "lib/index.d.ts",
28
+ "scripts": {
29
+ "build": "yarn clean && yarn build:sass && yarn build:ts",
30
+ "build:sass": "cross-env INIT_CWD=$INIT_CWD node ../../scripts/workflow/buildSass.js",
31
+ "build:ts": "tsc --project ./tsconfig.build.json",
32
+ "clean": "npm-run-all clean:cache clean:lib",
33
+ "clean:cache": "rimraf \"build\"",
34
+ "clean:lib": "rimraf \"lib\"",
35
+ "dev": "npm-run-all --parallel dev:sass dev:ts",
36
+ "dev:sass": "sass style:lib --watch --load-path=../../node_modules/@finos/legend-art/scss",
37
+ "dev:ts": "tsc --watch --preserveWatchOutput",
38
+ "lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location ./build/.eslintcache --report-unused-disable-directives --parser-options=project:\"./tsconfig.json\" \"./src/**/*.{js,ts,tsx}\"",
39
+ "publish:prepare": "node ../../scripts/release/preparePublishContent.js",
40
+ "publish:snapshot": "node ../../scripts/release/publishDevSnapshot.js",
41
+ "test": "jest",
42
+ "test:watch": "jest --watch"
43
+ },
44
+ "dependencies": {
45
+ "@finos/legend-application": "16.0.12",
46
+ "@finos/legend-art": "7.1.69",
47
+ "@finos/legend-code-editor": "2.0.25",
48
+ "@finos/legend-data-cube": "0.0.30",
49
+ "@finos/legend-graph": "31.10.59",
50
+ "@finos/legend-query-builder": "4.15.28",
51
+ "@finos/legend-server-depot": "6.0.71",
52
+ "@finos/legend-shared": "10.0.62",
53
+ "@finos/legend-storage": "3.0.113",
54
+ "@types/react": "18.3.12",
55
+ "@types/react-dom": "18.3.1",
56
+ "mobx": "6.13.5",
57
+ "mobx-react-lite": "4.0.7",
58
+ "react": "18.3.1",
59
+ "react-dom": "18.3.1"
60
+ },
61
+ "devDependencies": {
62
+ "@finos/legend-dev-utils": "2.1.31",
63
+ "@jest/globals": "29.7.0",
64
+ "cross-env": "7.0.3",
65
+ "eslint": "9.15.0",
66
+ "jest": "29.7.0",
67
+ "npm-run-all": "4.1.5",
68
+ "rimraf": "6.0.1",
69
+ "sass": "1.81.0",
70
+ "typescript": "5.6.3"
71
+ },
72
+ "peerDependencies": {
73
+ "react": "^18.0.0"
74
+ },
75
+ "publishConfig": {
76
+ "directory": "build/publishContent"
77
+ },
78
+ "extensions": {
79
+ "applicationDataCubePlugin": "@finos/legend-application-data-cube-plugin-core"
80
+ }
81
+ }
@@ -0,0 +1,38 @@
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 packageJson from '../../package.json' with { type: 'json' };
18
+ import { configureCodeEditorComponent } from '@finos/legend-lego/code-editor';
19
+ import { LegendDataCubeApplicationPlugin } from './LegendDataCubeApplicationPlugin.js';
20
+ import { setupPureLanguageService } from '@finos/legend-code-editor';
21
+ import { type LegendApplicationSetup } from '@finos/legend-application';
22
+
23
+ export class Core_LegendDataCubeApplicationPlugin extends LegendDataCubeApplicationPlugin {
24
+ static NAME = packageJson.extensions.applicationDataCubePlugin;
25
+
26
+ constructor() {
27
+ super(Core_LegendDataCubeApplicationPlugin.NAME, packageJson.version);
28
+ }
29
+
30
+ override getExtraApplicationSetups(): LegendApplicationSetup[] {
31
+ return [
32
+ async (applicationStore) => {
33
+ await configureCodeEditorComponent(applicationStore);
34
+ setupPureLanguageService({});
35
+ },
36
+ ];
37
+ }
38
+ }
@@ -0,0 +1,19 @@
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 { Core_LegendApplicationPlugin } from '@finos/legend-application';
18
+
19
+ export class Core_LegendDataCube_LegendApplicationPlugin extends Core_LegendApplicationPlugin {}
@@ -0,0 +1,70 @@
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
+ LegendApplication,
19
+ type LegendApplicationConfig,
20
+ type LegendApplicationConfigurationInput,
21
+ type ApplicationStore,
22
+ type LegendApplicationPlugin,
23
+ type LegendApplicationPluginManager,
24
+ getApplicationRootElement,
25
+ ApplicationStoreProvider,
26
+ } from '@finos/legend-application';
27
+ import {
28
+ LegendDataCubeApplicationConfig,
29
+ type LegendDataCubeApplicationConfigurationData,
30
+ } from './LegendDataCubeApplicationConfig.js';
31
+ import { LegendDataCubePluginManager } from './LegendDataCubePluginManager.js';
32
+ import { Core_LegendDataCube_LegendApplicationPlugin } from './Core_LegendDataCube_LegendApplicationPlugin.js';
33
+ import { Core_LegendDataCubeApplicationPlugin } from './Core_LegendDataCubeApplicationPlugin.js';
34
+ import { LegendDataCubeWebApplication } from '../components/LegendDataCubeWebApplication.js';
35
+ import { createRoot } from 'react-dom/client';
36
+
37
+ export class LegendDataCube extends LegendApplication {
38
+ declare config: LegendDataCubeApplicationConfig;
39
+ declare pluginManager: LegendDataCubePluginManager;
40
+
41
+ static create(): LegendDataCube {
42
+ const application = new LegendDataCube(
43
+ LegendDataCubePluginManager.create(),
44
+ );
45
+ application.withBasePresets([]);
46
+ application.withBasePlugins([
47
+ new Core_LegendDataCube_LegendApplicationPlugin(),
48
+ new Core_LegendDataCubeApplicationPlugin(),
49
+ ]);
50
+ return application;
51
+ }
52
+
53
+ async configureApplication(
54
+ input: LegendApplicationConfigurationInput<LegendDataCubeApplicationConfigurationData>,
55
+ ): Promise<LegendApplicationConfig> {
56
+ return new LegendDataCubeApplicationConfig(input);
57
+ }
58
+ async loadApplication(
59
+ applicationStore: ApplicationStore<
60
+ LegendApplicationConfig,
61
+ LegendApplicationPluginManager<LegendApplicationPlugin>
62
+ >,
63
+ ): Promise<void> {
64
+ createRoot(getApplicationRootElement()).render(
65
+ <ApplicationStoreProvider store={applicationStore}>
66
+ <LegendDataCubeWebApplication baseUrl={this.baseAddress} />
67
+ </ApplicationStoreProvider>,
68
+ );
69
+ }
70
+ }