@datagrok/compute 1.39.3 → 1.39.6
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/CHANGELOG.md +10 -0
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +9 -9
- package/src/global.d.ts +13 -0
- package/src/package.ts +75 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/compute",
|
|
3
3
|
"friendlyName": "Compute",
|
|
4
|
-
"version": "1.39.
|
|
4
|
+
"version": "1.39.6",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Aufar Zakiev",
|
|
7
7
|
"email": "aufar.zakiev@softwarecountry.com"
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@datagrok-libraries/utils": "^4.3.0",
|
|
17
|
-
"@datagrok-libraries/compute-utils": "^1.39.
|
|
18
|
-
"cash-dom": "
|
|
19
|
-
"datagrok-api": "^1.
|
|
17
|
+
"@datagrok-libraries/compute-utils": "^1.39.5",
|
|
18
|
+
"cash-dom": "^8.1.5",
|
|
19
|
+
"datagrok-api": "^1.22.1",
|
|
20
20
|
"rxjs": "^6.6.7",
|
|
21
21
|
"source-map-loader": "^4.0.1",
|
|
22
|
-
"ts-loader": "
|
|
23
|
-
"typescript": "
|
|
22
|
+
"ts-loader": "^9.5.1",
|
|
23
|
+
"typescript": "^5.6.3",
|
|
24
24
|
"exceljs": "^4.3.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"eslint": "^8.0.1",
|
|
32
32
|
"eslint-config-google": "^0.14.0",
|
|
33
33
|
"style-loader": "^3.3.1",
|
|
34
|
-
"webpack": "
|
|
35
|
-
"webpack-cli": "
|
|
34
|
+
"webpack": "^5.95.0",
|
|
35
|
+
"webpack-cli": "^5.1.4"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"link-api": "npm link datagrok-api",
|
|
@@ -63,4 +63,4 @@
|
|
|
63
63
|
"meta": {
|
|
64
64
|
"dartium": false
|
|
65
65
|
}
|
|
66
|
-
}
|
|
66
|
+
}
|
package/src/global.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as grokNamespace from 'datagrok-api/grok';
|
|
2
|
+
import * as uiNamespace from 'datagrok-api/ui';
|
|
3
|
+
import * as DGNamespace from 'datagrok-api/dg';
|
|
4
|
+
import * as rxjsNamespace from 'rxjs';
|
|
5
|
+
import $Namespace from 'cash-dom';
|
|
6
|
+
|
|
7
|
+
declare global {
|
|
8
|
+
const grok: typeof grokNamespace;
|
|
9
|
+
const ui: typeof uiNamespace;
|
|
10
|
+
const DG: typeof DGNamespace;
|
|
11
|
+
const rjxs: typeof rxjsNamespace;
|
|
12
|
+
const $: typeof $Namespace;
|
|
13
|
+
}
|
package/src/package.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as grok from 'datagrok-api/grok';
|
|
3
3
|
import * as ui from 'datagrok-api/ui';
|
|
4
4
|
import * as DG from 'datagrok-api/dg';
|
|
5
|
-
import {filter} from 'rxjs/operators';
|
|
5
|
+
import {filter, take} from 'rxjs/operators';
|
|
6
6
|
import {OutliersSelectionViewer} from './outliers-selection/outliers-selection-viewer';
|
|
7
7
|
import {
|
|
8
8
|
ComputationView as ComputationViewInst,
|
|
@@ -338,6 +338,80 @@ export function ObjectCoolingSelector(params: any) {
|
|
|
338
338
|
);
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
+
//input: dynamic treeNode
|
|
342
|
+
//input: view browseView
|
|
343
|
+
export async function modelCatalogTreeBrowser(treeNode: DG.TreeViewGroup, browseView: DG.BrowseView) {
|
|
344
|
+
const NO_CATEGORY = 'Uncategorized' as const;
|
|
345
|
+
|
|
346
|
+
const modelSource = grok.dapi.functions.filter('(#model)');
|
|
347
|
+
const modelList = await modelSource.list();
|
|
348
|
+
const departments = modelList.reduce((acc, model) => {
|
|
349
|
+
if (model.options.department)
|
|
350
|
+
acc.add(model.options.department)
|
|
351
|
+
else
|
|
352
|
+
acc.add(NO_CATEGORY)
|
|
353
|
+
return acc;
|
|
354
|
+
}, new Set([] as string[]));
|
|
355
|
+
|
|
356
|
+
const hlProcesses = modelList.reduce((acc, model) => {
|
|
357
|
+
if (model.options.HL_process)
|
|
358
|
+
acc.add(model.options.HL_process)
|
|
359
|
+
else
|
|
360
|
+
acc.add(NO_CATEGORY)
|
|
361
|
+
return acc;
|
|
362
|
+
}, new Set([] as string[]));
|
|
363
|
+
|
|
364
|
+
const processes = modelList.reduce((acc, model) => {
|
|
365
|
+
if (model.options.process)
|
|
366
|
+
acc.add(model.options.process)
|
|
367
|
+
else
|
|
368
|
+
acc.add(NO_CATEGORY)
|
|
369
|
+
return acc;
|
|
370
|
+
}, new Set([] as string[]));
|
|
371
|
+
|
|
372
|
+
for (const department of departments) {
|
|
373
|
+
const serverDep = (department !== NO_CATEGORY ? department: undefined);
|
|
374
|
+
const hasModelsDep = modelList.find((model) =>
|
|
375
|
+
model.options.department === serverDep
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
if (!hasModelsDep) continue;
|
|
379
|
+
|
|
380
|
+
const depNode = treeNode.getOrCreateGroup(department, null, false)
|
|
381
|
+
for (const hlProcess of hlProcesses) {
|
|
382
|
+
const serverHlProcess = (hlProcess !== NO_CATEGORY ? hlProcess: undefined);
|
|
383
|
+
const hasModelsHl = modelList.find((model) =>
|
|
384
|
+
model.options.department === serverDep &&
|
|
385
|
+
model.options.HL_process === serverHlProcess
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
if (!hasModelsHl) continue;
|
|
389
|
+
|
|
390
|
+
const hlNode = hlProcess !== NO_CATEGORY ? depNode.getOrCreateGroup(hlProcess, null, false): depNode;
|
|
391
|
+
for (const process of processes) {
|
|
392
|
+
const serverProcess = (process !== NO_CATEGORY ? process: undefined);
|
|
393
|
+
const hasModels = modelList.find((model) =>
|
|
394
|
+
model.options.department === serverDep &&
|
|
395
|
+
model.options.HL_process === serverHlProcess &&
|
|
396
|
+
model.options.process === serverProcess
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
if (!hasModels) continue;
|
|
400
|
+
|
|
401
|
+
const processNode = process !== NO_CATEGORY ? hlNode.getOrCreateGroup(process, null, false): hlNode;
|
|
402
|
+
processNode.onNodeExpanding.pipe(take(1)).subscribe(() => {
|
|
403
|
+
const modelRule = `(#model)`;
|
|
404
|
+
const depRules = department === NO_CATEGORY ? `(options.department = null)`: `(options.department in ("${department}"))`;
|
|
405
|
+
const hlProcessRules = hlProcess === NO_CATEGORY ? `(options.HL_process = null)`: `(options.HL_process in ("${hlProcess}"))`;
|
|
406
|
+
const processRules = process === NO_CATEGORY ? `(options.process = null)`: `(options.process in ("${process}"))`;
|
|
407
|
+
const filteringRules = `(${[modelRule, depRules, hlProcessRules, processRules].join(' and ')})`
|
|
408
|
+
processNode.loadSources(grok.dapi.functions.filter(filteringRules));
|
|
409
|
+
})
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
341
415
|
//// Compute-utils API section
|
|
342
416
|
|
|
343
417
|
export const testPipeline = testPipelineInst;
|