@datagrok/helm 2.1.6 → 2.1.8
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/README.md +13 -10
- package/dist/package-test.js +2 -735
- package/dist/package-test.js.map +1 -0
- package/dist/package.js +2 -2465
- package/dist/package.js.map +1 -0
- package/package.json +1 -1
- package/src/cell-renderer.ts +8 -3
- package/src/package.ts +5 -1
- package/tsconfig.json +1 -1
- package/webpack.config.js +1 -1
package/package.json
CHANGED
package/src/cell-renderer.ts
CHANGED
|
@@ -73,7 +73,7 @@ export class HelmCellRenderer extends DG.GridCellRenderer {
|
|
|
73
73
|
const monomers = findMonomers(gridCell.cell.value);
|
|
74
74
|
let s: string = gridCell.cell.value ?? '';
|
|
75
75
|
let subParts: string[] = parseHelm(s);
|
|
76
|
-
if (monomers.size == 0) {
|
|
76
|
+
if (monomers.size == 0 && grid) {
|
|
77
77
|
const host = ui.div([], {style: {width: `${w}px`, height: `${h}px`}});
|
|
78
78
|
host.setAttribute('dataformat', 'helm');
|
|
79
79
|
host.setAttribute('data', gridCell.cell.value);
|
|
@@ -81,8 +81,13 @@ export class HelmCellRenderer extends DG.GridCellRenderer {
|
|
|
81
81
|
//@ts-ignore
|
|
82
82
|
const canvas = new JSDraw2.Editor(host, {width: w, height: h, skin: 'w8', viewonly: true});
|
|
83
83
|
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
84
|
+
} else {
|
|
85
|
+
if (!grid) {
|
|
86
|
+
const r = window.devicePixelRatio;
|
|
87
|
+
h = 28;
|
|
88
|
+
g.canvas.height = h*r;
|
|
89
|
+
g.canvas.style.height = `${h}px`;
|
|
90
|
+
}
|
|
86
91
|
w = grid ? Math.min(grid.canvas.width - x, w) : g.canvas.width - x;
|
|
87
92
|
g.save();
|
|
88
93
|
g.beginPath();
|
package/src/package.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {IMonomerLib, Monomer} from '@datagrok-libraries/bio/src/types';
|
|
|
10
10
|
import {NotationConverter} from '@datagrok-libraries/bio/src/utils/notation-converter';
|
|
11
11
|
import {findMonomers} from './utils';
|
|
12
12
|
import {errorToConsole} from '@datagrok-libraries/utils/src/to-console';
|
|
13
|
+
import { NOTATION } from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
13
14
|
|
|
14
15
|
export const _package = new DG.Package();
|
|
15
16
|
let monomerLib: IMonomerLib | null = null;
|
|
@@ -119,8 +120,11 @@ export function editMoleculeCell(cell: DG.GridCell): void {
|
|
|
119
120
|
export function openEditor(mol: string): void {
|
|
120
121
|
let df = grok.shell.tv.grid.dataFrame;
|
|
121
122
|
let col = df.columns.bySemType('Macromolecule');
|
|
123
|
+
const colUnits = col.getTag(DG.TAGS.UNITS);
|
|
124
|
+
if (colUnits === NOTATION.HELM)
|
|
125
|
+
checkMonomersAndOpenWebEditor(df.currentCell, undefined, undefined);
|
|
122
126
|
let converter = new NotationConverter(col);
|
|
123
|
-
const resStr = converter.convertStringToHelm(mol, '/');
|
|
127
|
+
const resStr = converter.convertStringToHelm(mol, '/');
|
|
124
128
|
checkMonomersAndOpenWebEditor(df.currentCell, resStr, col.getTag(DG.TAGS.UNITS));
|
|
125
129
|
}
|
|
126
130
|
|
package/tsconfig.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
|
|
13
13
|
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
14
14
|
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
15
|
-
|
|
15
|
+
"sourceMap": true, /* Generates corresponding '.map' file. */
|
|
16
16
|
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
17
17
|
// "outDir": "./", /* Redirect output structure to the directory. */
|
|
18
18
|
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|