@datagrok/helm 2.2.0 → 2.3.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.
- package/CHANGELOG.md +28 -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 +15 -16
- package/src/cell-renderer.ts +13 -36
- package/src/constants.ts +0 -11
- package/src/helm-helper.ts +67 -17
- package/src/helm-monomer-placer.ts +8 -26
- package/src/helm-web-editor.ts +33 -3
- package/src/package-test.ts +12 -4
- package/src/package-utils.ts +160 -0
- package/src/package.ts +123 -197
- package/src/tests/findMonomers-tests.ts +2 -0
- package/src/tests/get-all-parts-tests.ts +5 -0
- package/src/tests/{get-molfiles.ts → get-molfiles-tests.ts} +3 -1
- package/src/tests/get-monomer-tests.ts +279 -0
- package/src/tests/helm-service-tests.ts +4 -0
- package/src/tests/helm-tests.ts +8 -1
- package/src/tests/helm-web-editor-tests.ts +55 -0
- package/src/tests/parse-helm-tests.ts +98 -0
- package/src/tests/properties-widget-tests.ts +33 -4
- package/src/tests/renderers-tests.ts +3 -1
- package/src/tests/utils.ts +6 -0
- package/src/types/index.ts +5 -0
- package/src/utils/get-hovered.ts +9 -21
- package/src/utils/get-monomer-dummy.ts +149 -0
- package/src/utils/get-monomer-of-library.ts +90 -0
- package/src/utils/get-monomer.ts +113 -0
- package/src/utils/helm-grid-cell-renderer.ts +12 -7
- package/src/utils/helm-service.ts +19 -45
- package/src/utils/index.ts +11 -17
- package/src/widgets/properties-widget.ts +29 -9
- package/tsconfig.json +1 -1
- package/vendor/helm-web-editor.development.js +39640 -0
- package/vendor/helm-web-editor.production.js +2 -0
- package/vendor/helm-web-editor.production.js.map +1 -0
- package/webpack.config.js +14 -11
- package/helm/JSDraw/Pistoia.HELM-uncompressed.js +0 -9694
- package/helm/JSDraw/Pistoia.HELM.js +0 -27
- package/helm/JSDraw/ReadMe.txt +0 -8
- package/helm/JSDraw/Scilligence.JSDraw2.Lite-uncompressed.js +0 -31126
- package/helm/JSDraw/Scilligence.JSDraw2.Lite.js +0 -12
- package/helm/JSDraw/Scilligence.JSDraw2.Resources.js +0 -762
- package/helm/JSDraw/dojo.js +0 -250
- package/helm/JSDraw/test.html +0 -24
- package/src/utils/dummy-monomer.ts +0 -69
|
@@ -1,69 +0,0 @@
|
|
|
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
|
-
import {_package} from '../package';
|
|
5
|
-
|
|
6
|
-
/* eslint-disable camelcase */
|
|
7
|
-
export class DummyWebEditorMonomer {
|
|
8
|
-
public readonly backgroundcolor: string = '#FF4444';
|
|
9
|
-
public readonly linecolor: string = '#800000';
|
|
10
|
-
public readonly textcolor: string = '#FFFFFF';
|
|
11
|
-
|
|
12
|
-
// no effect
|
|
13
|
-
// public readonly na: string = 'NA';
|
|
14
|
-
// public readonly nature: string = 'NA';
|
|
15
|
-
|
|
16
|
-
/** R-Group index os single digit only is allowed in Pistoia code */
|
|
17
|
-
public readonly at: { [rg: string]: string } = {
|
|
18
|
-
R1: 'H', R2: 'H', R3: 'H', R4: 'H', R5: 'H', R6: 'H', R7: 'H', R8: 'H', R9: 'H'
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
constructor(
|
|
22
|
-
public readonly biotype: string,
|
|
23
|
-
/** symbol, elem */ public readonly id: string,
|
|
24
|
-
/** name */ public readonly n: string = 'missing',
|
|
25
|
-
/** molfile*/ public readonly m?: string,
|
|
26
|
-
) {
|
|
27
|
-
if (!this.id)
|
|
28
|
-
throw new Error('Not supported undefined [id].');
|
|
29
|
-
|
|
30
|
-
return new Proxy(this, {
|
|
31
|
-
get: (target: any, prop: string | symbol, _receiver: any) => {
|
|
32
|
-
const logPrefix = `${this.toLog()}.proxy.get( '${String(prop)}' )`;
|
|
33
|
-
switch (prop) {
|
|
34
|
-
case 'id':
|
|
35
|
-
case 'at':
|
|
36
|
-
case 'na':
|
|
37
|
-
case 'nature':
|
|
38
|
-
case 'backgroundcolor':
|
|
39
|
-
case 'linecolor':
|
|
40
|
-
case 'textcolor': {
|
|
41
|
-
// these attributes are known and handled
|
|
42
|
-
return target[prop];
|
|
43
|
-
}
|
|
44
|
-
case 'rs': {
|
|
45
|
-
/* R-Group count (?), 2 is default for monomer "?" */
|
|
46
|
-
throw new Error('Not supported get "rs" attribute.');
|
|
47
|
-
}
|
|
48
|
-
default:
|
|
49
|
-
// Unexpected attribute requested
|
|
50
|
-
_package.logger.warning(`${logPrefix}`);
|
|
51
|
-
return target[prop];
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
set: (target, prop, value: any, _receiver: any): boolean => {
|
|
55
|
-
throw new Error(`Not supported set '${String(prop)}' attribute, any.`);
|
|
56
|
-
},
|
|
57
|
-
apply: (target: any, thisArg: any, argArray: any[]): any | undefined => {
|
|
58
|
-
throw new Error(`Not supported call (apply) '${thisArg.toString()}' method, any.`);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
private static objCounter: number = -1;
|
|
64
|
-
private readonly objId: number = ++DummyWebEditorMonomer.objCounter;
|
|
65
|
-
|
|
66
|
-
protected toLog(): string {
|
|
67
|
-
return `Helm: DummyWebEditorMonomer<${this.objId}>`;
|
|
68
|
-
}
|
|
69
|
-
}
|