@datagrok/helm 2.0.3 → 2.0.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/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@datagrok/helm",
3
3
  "friendlyName": "Helm",
4
- "version": "2.0.3",
4
+ "version": "2.0.6",
5
5
  "author": {
6
6
  "name": "Oleksandra Serhiienko",
7
7
  "email": "oserhiienko@datagrok.ai"
8
8
  },
9
9
  "description": "",
10
10
  "dependencies": {
11
- "datagrok-api": "^1.6.0",
11
+ "@datagrok-libraries/utils": "^1.11.1",
12
+ "@datagrok-libraries/bio": "^5.5.0",
12
13
  "cash-dom": "^8.1.1",
14
+ "datagrok-api": "^1.7.2",
13
15
  "dayjs": "^1.10.6",
14
- "@datagrok-libraries/utils": "^1.6.2",
15
- "@datagrok-libraries/bio": "^3.1.1"
16
-
16
+ "rxjs": "^6.5.5"
17
17
  },
18
18
  "sources": [
19
19
  "css/helm.css",
@@ -42,19 +42,20 @@ it('TEST', async () => {
42
42
  let r = await page.evaluate((targetPackage):Promise<object> => {
43
43
  return new Promise<object>((resolve, reject) => {
44
44
  (<any>window).grok.functions.eval(targetPackage + ':test()').then((df: any) => {
45
- let cStatus = df.columns.byName('success');
46
- let cMessage = df.columns.byName('result');
47
- let cCat = df.columns.byName('category');
48
- let cName = df.columns.byName('name');
45
+ const cStatus = df.columns.byName('success');
46
+ const cMessage = df.columns.byName('result');
47
+ const cCat = df.columns.byName('category');
48
+ const cName = df.columns.byName('name');
49
+ const cTime = df.columns.byName('ms');
49
50
  let failed = false;
50
51
  let passReport = '';
51
52
  let failReport = '';
52
53
  for (let i = 0; i < df.rowCount; i++) {
53
54
  if (cStatus.get(i)) {
54
- passReport += `Test result : Success : ${targetPackage}.${cCat.get(i)}.${cName.get(i)} : ${cMessage.get(i)}\n`;
55
+ passReport += `Test result : Success : ${cTime.get(i)} : ${targetPackage}.${cCat.get(i)}.${cName.get(i)} : ${cMessage.get(i)}\n`;
55
56
  } else {
56
57
  failed = true;
57
- failReport += `Test result : Failed : ${targetPackage}.${cCat.get(i)}.${cName.get(i)} : ${cMessage.get(i)}\n`;
58
+ failReport += `Test result : Failed : ${cTime.get(i)} : ${targetPackage}.${cCat.get(i)}.${cName.get(i)} : ${cMessage.get(i)}\n`;
58
59
  }
59
60
  }
60
61
  resolve({failReport, passReport, failed});
@@ -74,7 +74,7 @@ export async function getBrowserPage(puppeteer: any): Promise<{browser: any, pag
74
74
  }, token);
75
75
  await page.goto(url);
76
76
  try {
77
- await page.waitForSelector('.grok-preloader', { timeout: 1800000 });
77
+ // await page.waitForSelector('.grok-preloader', { timeout: 1800000 });
78
78
  await page.waitForFunction(() => document.querySelector('.grok-preloader') == null, {timeout: 3600000});
79
79
  } catch (error) {
80
80
  throw error;
@@ -0,0 +1,45 @@
1
+ import * as grok from 'datagrok-api/grok';
2
+ import * as ui from 'datagrok-api/ui';
3
+ import * as DG from 'datagrok-api/dg';
4
+
5
+ export class HelmWebEditor {
6
+ editorView: any;
7
+ webEditor: any;
8
+ host: any;
9
+ editor: any;
10
+ w = 200;
11
+ h = 100;
12
+ constructor() {
13
+ this.editorView = ui.div();
14
+ org.helm.webeditor.MolViewer.molscale = 0.8;
15
+ this.webEditor = new scil.helm.App(this.editorView, {
16
+ showabout: false,
17
+ mexfontsize: '90%',
18
+ mexrnapinontab: true,
19
+ topmargin: 20,
20
+ mexmonomerstab: true,
21
+ sequenceviewonly: false,
22
+ mexfavoritefirst: true,
23
+ mexfilter: true
24
+ });
25
+ const sizes = this.webEditor.calculateSizes();
26
+ this.webEditor.canvas.resize(sizes.rightwidth - 100, sizes.topheight - 210);
27
+ let s = {width: sizes.rightwidth - 100 + 'px', height: sizes.bottomheight + 'px'};
28
+ //@ts-ignore
29
+ scil.apply(this.webEditor.sequence.style, s);
30
+ //@ts-ignore
31
+ scil.apply(this.webEditor.notation.style, s);
32
+ s = {width: sizes.rightwidth + 'px', height: (sizes.bottomheight + this.webEditor.toolbarheight) + 'px'};
33
+ //@ts-ignore
34
+ scil.apply(this.webEditor.properties.parent.style, s);
35
+ this.webEditor.structureview.resize(sizes.rightwidth, sizes.bottomheight + this.webEditor.toolbarheight);
36
+ this.webEditor.mex.resize(sizes.topheight - 80);
37
+ this.host = ui.div([], {style: {width: `${this.w}px`, height: `${this.h}px`}});
38
+ this.editor = new JSDraw2.Editor(this.host, {width: this.w, height: this.h, viewonly: true});
39
+ }
40
+
41
+ resizeEditor(w: number, h: number) {
42
+ this.editor.setSize(w, h);
43
+ }
44
+ }
45
+
@@ -1,6 +1,6 @@
1
1
  import * as DG from 'datagrok-api/dg';
2
2
  import * as grok from 'datagrok-api/grok';
3
- import {runTests, tests} from '@datagrok-libraries/utils/src/test';
3
+ import {runTests, tests, TestContext} from '@datagrok-libraries/utils/src/test';
4
4
  import './tests/helm-tests.ts';
5
5
 
6
6
  export const _package = new DG.Package();
@@ -10,8 +10,9 @@ export {tests};
10
10
  //name: test
11
11
  //input: string category {optional: true}
12
12
  //input: string test {optional: true}
13
+ //input: object testContext {optional: true}
13
14
  //output: dataframe result
14
- export async function test(category: string, test: string): Promise<DG.DataFrame> {
15
- const data = await runTests({category, test});
15
+ export async function test(category: string, test: string, testContext: TestContext): Promise<DG.DataFrame> {
16
+ const data = await runTests({category, test, testContext});
16
17
  return DG.DataFrame.fromObjects(data)!;
17
18
  }