@datagrok/helm 2.1.7 → 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.7",
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();