@datagrok/compute 0.7.2 → 0.7.3

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/package.json CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "name": "@datagrok/compute",
3
3
  "friendlyName": "Compute",
4
- "version": "0.7.2",
4
+ "version": "0.7.3",
5
5
  "description": "",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/datagrok-ai/public.git",
9
+ "directory": "packages/Compute"
10
+ },
6
11
  "dependencies": {
7
- "@datagrok-libraries/utils": "^0.2.4",
12
+ "@datagrok-libraries/utils": "^0.4.0",
8
13
  "cash-dom": "latest",
9
14
  "codemirror": "^5.64.0",
10
- "datagrok-api": "^0.148.1",
15
+ "datagrok-api": "^0.151.0",
11
16
  "dayjs": "latest",
12
17
  "exceljs": "^4.3.0",
13
18
  "file-saver": "^2.0.5",
@@ -33,8 +38,8 @@
33
38
  "link-api": "npm link datagrok-api",
34
39
  "link-utils": "npm link @datagrok-libraries/utils",
35
40
  "link-all": "npm link datagrok-api @datagrok-libraries/utils",
36
- "debug-compute": "webpack & grok publish dev --release",
37
- "release-compute": "grok publish --rebuild --release",
41
+ "debug-compute": "webpack & grok publish localhost --release",
42
+ "release-compute": "webpack && grok publish localhost --release",
38
43
  "build-compute": "webpack",
39
44
  "build": "webpack",
40
45
  "build-compute-local": "npm --prefix ./../../js-api run build && npm --prefix ./../../libraries/utils run build && npm run build",
@@ -15,13 +15,18 @@ export class ModelCatalogView extends DG.CustomCardView {
15
15
  this.name = 'Models';
16
16
  this.permanentFilter = '#model';
17
17
 
18
- this.objectType = 'Script';
19
- this.categoryFilters = {
20
- 'language': 'Language',
18
+ this.objectType = 'Func';
19
+ this.categoryFilters = {
20
+ 'options.direction': 'Direction',
21
21
  'tag': 'Tags',
22
22
  'createdOn': 'Created',
23
23
  'author.id': 'Author'
24
24
  };
25
+ this.hierarchy = [
26
+ 'options.direction',
27
+ 'options.domain'
28
+ ];
29
+ this.showTree = true;
25
30
  this.initRibbon();
26
31
  this.initMenu();
27
32
  }
@@ -33,15 +33,15 @@ export class ModelHandler extends DG.ObjectHandler {
33
33
  }
34
34
 
35
35
  renderIcon(x: DG.Func, context: any = null): HTMLElement {
36
- return x instanceof DG.Script ? this.getLanguageIcon(x.language) : ui.iconFA('lightning');
36
+ return x instanceof DG.Script ? this.getLanguageIcon(x.language) : ui.iconImage(x.package.name, x.package.getIconUrl());
37
37
  }
38
38
 
39
39
  renderMarkup(x: DG.Func): HTMLElement {
40
- return ui.span([this.renderIcon(x), ui.label(x.friendlyName, {style: {marginLeft: '4px'}})], {style: {display: 'inline-flex'}});
40
+ return ui.span([this.renderIcon(x), ui.label(x.friendlyName)]);
41
41
  }
42
42
 
43
43
  renderProperties(x: DG.Func) {
44
- const a = ui.accordion();
44
+ const a = ui.accordion('ComputeModel');
45
45
  a.context = x;
46
46
  a.addTitle(ui.span([this.renderIcon(x), ui.label(x.friendlyName), ui.contextActions(x), ui.star(x.id)]));
47
47
  a.addPane('Details', () => {
@@ -63,11 +63,13 @@ export class ModelHandler extends DG.ObjectHandler {
63
63
  }
64
64
 
65
65
  renderCard(x: DG.Func, context?: any): HTMLElement {
66
+ let h = this.renderMarkup(x);
67
+ h.classList.add('d4-link-label');
66
68
  let card = ui.bind(x, ui.divV([
67
- ui.h2(this.renderMarkup(x)),
69
+ ui.h2(h),
68
70
  ui.divText(x.description, 'ui-description'),
69
71
  this.renderDetails(x),
70
- ], 'd4-gallery-item'), {contextMenu: false});
72
+ ]));
71
73
  let c = grok.functions.getCurrentCall();
72
74
  card.ondblclick = (e) => {
73
75
  ModelHandler.openModel(x, c);
@@ -7,6 +7,7 @@ import $ from 'cash-dom';
7
7
  import {FunctionView} from "@datagrok-libraries/utils/src/function-view";
8
8
  const api = <any>window;
9
9
 
10
+ /*
10
11
 
11
12
  export class ModelsWidget extends DG.Widget {
12
13
  caption: string;
@@ -116,4 +117,4 @@ export class ModelsWidget extends DG.Widget {
116
117
  }
117
118
  }
118
119
 
119
- }
120
+ } */
package/src/package.ts CHANGED
@@ -7,11 +7,10 @@ import {_functionParametersGrid} from './function-views/function-parameters-grid
7
7
  import {ModelCatalogView} from './model-catalog-view';
8
8
  import wu from 'wu';
9
9
  import {OutliersSelectionViewer} from './outliers-selection/outliers-selection-viewer';
10
- import {ModelsWidget} from './models-widget'
10
+ //import {ModelsWidget} from './models-widget'
11
11
  import {FunctionView} from "@datagrok-libraries/utils/src/function-view";
12
12
  import {delay} from "@datagrok-libraries/utils/src/test";
13
13
  import {ComputationView} from "@datagrok-libraries/utils/src/computation-view";
14
- import {ComputeView} from "./function-views/compute-view";
15
14
 
16
15
  let initCompleted: boolean = false;
17
16
  export const _package = new DG.Package();
@@ -25,11 +24,11 @@ export function OutliersSelection() {
25
24
  }
26
25
 
27
26
 
28
- //output: widget result
27
+ /*//output: widget result
29
28
  //tags: dashboard
30
29
  export function modelsWidget(): DG.Widget {
31
30
  return new ModelsWidget();
32
- }
31
+ }*/
33
32
 
34
33
  /* eslint-disable */
35
34
 
@@ -39,10 +38,13 @@ export function modelsWidget(): DG.Widget {
39
38
  //output: view result
40
39
  export function functionParametersGrid(f: DG.Func): DG.View {
41
40
  return _functionParametersGrid(f);
41
+ document.getElementById('root')?.appendChild(ui.h1('Hello World'));
42
42
  }
43
43
 
44
44
  //name: hof
45
+ //tags: model
45
46
  export function hof() {
47
+ grok.shell.info('blablabla');
46
48
  let f: DG.Func = DG.Func.byName('Sin');
47
49
  let v: DG.View = functionParametersGrid(f);
48
50
  grok.shell.addView(v);
@@ -129,8 +131,8 @@ export function init() {
129
131
  }).root;
130
132
  });
131
133
 
132
- grok.events.onViewAdding.subscribe((v: DG.ViewBase) => {
133
- if (v.type == 'function' && (v as FunctionView).func?.hasTag("model")) {
134
+ /* grok.events.onViewAdding.subscribe((v: DG.ViewBase) => {
135
+ if (v instanceof ComputationView && (v as ComputationView).func?.hasTag("model")) {
134
136
  let modelsView = wu(grok.shell.views).find((v) => v.parentCall?.func.name == 'modelCatalog');
135
137
  if (modelsView != undefined) {
136
138
  v.parentCall = modelsView!.parentCall;
@@ -138,22 +140,18 @@ export function init() {
138
140
  v.toolbox = modelsList;
139
141
  }
140
142
  }
141
- });
143
+ });*/
142
144
 
143
145
  initCompleted = true;
144
146
  }
145
147
 
146
148
  //name: Model Catalog
147
- // export function modelCatalog() {
148
- // /* let view = new DG.MultiView({
149
- // viewFactories: {
150
- // 'Models': {factory: () => new ModelCatalogView(), allowClose: false}
151
- // }
152
- // });*/
153
- // let view = new ModelCatalogView();
154
- // view.name = 'Models';
155
- // grok.shell.addView(view);
156
- // }
149
+ //tags: app
150
+ export function modelCatalog() {
151
+ let view = new ModelCatalogView();
152
+ view.name = 'Models';
153
+ grok.shell.addView(view);
154
+ }
157
155
 
158
156
 
159
157
  //name: computationTest
@@ -170,5 +168,5 @@ export async function computationTest(delayMs: number, error: string): Promise<D
170
168
  //name: testComputationView();
171
169
  export function testComputationView() {
172
170
  let f = DG.Func.find({name: 'computationTest'})[0];
173
- grok.shell.addView(new ComputeView(f));
174
- }
171
+ //grok.shell.addView(new ComputationView(f));
172
+ }