@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@datagrok/helm",
3
3
  "friendlyName": "Helm",
4
- "version": "2.1.6",
4
+ "version": "2.1.8",
5
5
  "author": {
6
6
  "name": "Oleksandra Serhiienko",
7
7
  "email": "oserhiienko@datagrok.ai"
@@ -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
- if (monomers.size > 0) {
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
- // "sourceMap": true, /* Generates corresponding '.map' file. */
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. */
package/webpack.config.js CHANGED
@@ -28,7 +28,7 @@ module.exports = {
28
28
  },
29
29
  ],
30
30
  },
31
- devtool: 'inline-source-map',
31
+ devtool: 'source-map',
32
32
  externals: {
33
33
  'datagrok-api/dg': 'DG',
34
34
  'datagrok-api/grok': 'grok',