@datagrok/helm 2.7.1 → 2.7.2

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.7.1",
4
+ "version": "2.7.2",
5
5
  "author": {
6
6
  "name": "Maria Dolotova",
7
7
  "email": "mdolotova@datagrok.ai"
@@ -16,7 +16,7 @@
16
16
  "css/helm.css"
17
17
  ],
18
18
  "dependencies": {
19
- "@datagrok-libraries/bio": "^5.45.11",
19
+ "@datagrok-libraries/bio": "^5.48.2",
20
20
  "@datagrok-libraries/chem-meta": "^1.2.7",
21
21
  "cash-dom": "^8.1.1",
22
22
  "@datagrok-libraries/utils": "^4.4.0",
@@ -23,7 +23,7 @@ import {getHoveredMonomerFromEditorMol, getSeqMonomerFromHelmAtom} from './get-h
23
23
  import {_package, getHelmService} from '../package';
24
24
 
25
25
  export class HelmGridCellRendererBack extends CellRendererBackAsyncBase<HelmProps, HelmAux> {
26
- private _auxList: (HelmAux | null)[];
26
+ private _auxList: Map<string, HelmAux | null>;
27
27
 
28
28
  private sysMonomerLib: IMonomerLibBase | null = null;
29
29
  private helmHelper: IHelmHelper | null = null;
@@ -70,7 +70,7 @@ export class HelmGridCellRendererBack extends CellRendererBackAsyncBase<HelmProp
70
70
  const logPrefix = `${this.toLog()}.reset()`;
71
71
  this.logger.debug(`${logPrefix}, start`);
72
72
  super.reset();
73
- this._auxList = new Array<HelmAux | null>(this.tableCol.length).fill(null);
73
+ this._auxList = new Map<string, HelmAux | null>();
74
74
  this.invalidateGrid();
75
75
  this.logger.debug(`${logPrefix}, end`);
76
76
  }
@@ -89,8 +89,8 @@ export class HelmGridCellRendererBack extends CellRendererBackAsyncBase<HelmProp
89
89
  protected override storeAux(gridCell: DG.GridCell, aux: HelmAux): void {
90
90
  const logPrefix = `${this.toLog()}.storeAux()`;
91
91
  this.logger.debug(`${logPrefix}, start`);
92
- if (gridCell.tableRowIndex !== null)
93
- this._auxList[gridCell.tableRowIndex] = aux;
92
+ if (!!gridCell.cell?.value)
93
+ this._auxList.set(gridCell.cell.value, aux);
94
94
  }
95
95
 
96
96
  /** Renders cell from image data (cache), returns true to update the cell by service.
@@ -104,9 +104,11 @@ export class HelmGridCellRendererBack extends CellRendererBackAsyncBase<HelmProp
104
104
 
105
105
  const gcb = gridCellBounds;
106
106
  const dpr = window.devicePixelRatio;
107
- if (gridCell.tableRowIndex === null) return false;
108
- const aux = this._auxList[gridCell.tableRowIndex];
109
- if (!aux) return true;
107
+ if (!gridCell.cell?.value)
108
+ return false;
109
+ const aux = this._auxList.get(gridCell.cell.value);
110
+ if (!aux)
111
+ return true;
110
112
 
111
113
  const [cellWidth, cellHeight] = [gcb.width * dpr - 2, gcb.height * dpr - 2];
112
114
  const cellDScale = Math.min(0.95 * cellWidth / aux.dBox.width, 0.95 * cellHeight / aux.dBox.height);
@@ -158,8 +160,8 @@ export class HelmGridCellRendererBack extends CellRendererBackAsyncBase<HelmProp
158
160
  }
159
161
 
160
162
  onMouseMove(gridCell: DG.GridCell, e: MouseEvent): void {
161
- if (gridCell.tableRowIndex === null || !this._auxList) return;
162
- const aux = this._auxList[gridCell.tableRowIndex];
163
+ if (!gridCell.cell?.value || !this._auxList || !!e.buttons) return;
164
+ const aux = this._auxList.get(gridCell.cell.value);
163
165
  if (!aux) return;
164
166
 
165
167
  const logPrefix = `${this.toLog()}.onMouseMove()`;
@@ -192,8 +194,11 @@ export class HelmGridCellRendererBack extends CellRendererBackAsyncBase<HelmProp
192
194
  // Tooltip for missing monomers
193
195
  ui.tooltip.hide();
194
196
  }
195
-
196
197
  execMonomerHoverLinks(gridCell, seqMonomer);
198
+
199
+ e.preventDefault();
200
+ e.stopPropagation();
201
+
197
202
  }
198
203
 
199
204
  onMouseLeave(gridCell: DG.GridCell, e: MouseEvent): void {
@@ -237,9 +242,6 @@ export class HelmGridCellRenderer extends DG.GridCellRenderer {
237
242
  } catch (err: any) {
238
243
  const [errMsg, errStack] = errInfo(err);
239
244
  _package.logger.error(errMsg, undefined, errStack);
240
- } finally {
241
- e.preventDefault();
242
- e.stopPropagation();
243
245
  }
244
246
  }
245
247