@datagrok-libraries/bio 5.42.0 → 5.42.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/CHANGELOG.md +8 -0
- package/package.json +3 -3
- package/src/helm/helm-helper.d.ts +2 -3
- package/src/helm/helm-helper.d.ts.map +1 -1
- package/src/helm/helm-helper.js.map +1 -1
- package/src/helm/types.d.ts +3 -3
- package/src/helm/types.d.ts.map +1 -1
- package/src/utils/cell-renderer.d.ts +28 -22
- package/src/utils/cell-renderer.d.ts.map +1 -1
- package/src/utils/cell-renderer.js +59 -49
- package/src/utils/cell-renderer.js.map +1 -1
- package/src/package.d.ts +0 -1
- package/src/package.d.ts.map +0 -1
- package/src/package.js +0 -2
- package/src/package.js.map +0 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
10
|
"friendlyName": "Datagrok bio library",
|
|
11
|
-
"version": "5.42.
|
|
11
|
+
"version": "5.42.2",
|
|
12
12
|
"description": "Bio utilities, types supporting Macromolecule, Molecule3D data",
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@datagrok-libraries/gridext": "^1.3.71",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"wu": "latest"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@datagrok-libraries/helm-web-editor": "^1.1.
|
|
30
|
-
"@datagrok-libraries/js-draw-lite": "^0.0.
|
|
29
|
+
"@datagrok-libraries/helm-web-editor": "^1.1.5",
|
|
30
|
+
"@datagrok-libraries/js-draw-lite": "^0.0.3",
|
|
31
31
|
"@types/signals": "1.0.1",
|
|
32
32
|
"@types/three": "^0.159.0",
|
|
33
33
|
"@types/uuid": "^9.0.1",
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { App } from '@datagrok-libraries/helm-web-editor/helm/App';
|
|
2
|
-
import {
|
|
2
|
+
import { IHelmWebEditor } from './types';
|
|
3
3
|
import { IMonomerLib } from '../types/index';
|
|
4
|
-
|
|
5
|
-
export type GetMonomerFunc = (a: Atom<HelmType> | HelmType, name?: string) => GetMonomerResType;
|
|
4
|
+
import { GetMonomerFunc } from '../helm/types';
|
|
6
5
|
export interface IHelmHelper {
|
|
7
6
|
createHelmWebEditor(): IHelmWebEditor;
|
|
8
7
|
createWebEditorApp(host: HTMLDivElement, helm?: string): App;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helm-helper.d.ts","sourceRoot":"","sources":["helm-helper.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,8CAA8C,CAAC;AACtE,OAAO,
|
|
1
|
+
{"version":3,"file":"helm-helper.d.ts","sourceRoot":"","sources":["helm-helper.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,8CAA8C,CAAC;AACtE,OAAO,EAAiB,cAAc,EAAoB,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAG7C,MAAM,WAAW,WAAW;IAC1B,mBAAmB,IAAI,cAAc,CAAC;IAEtC,kBAAkB,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAE7D,IAAI,kBAAkB,IAAI,cAAc,GAAG,IAAI,CAAC;IAEhD,sBAAsB,CAAC,UAAU,EAAE,WAAW,GAAG,cAAc,CAAC;IAChE,kBAAkB,CAAC,cAAc,EAAE,cAAc,GAAG,cAAc,CAAC;IACnE,wBAAwB,IAAI,cAAc,CAAC;CAC5C;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC,CAO1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helm-helper.js","sourceRoot":"","sources":["helm-helper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"helm-helper.js","sourceRoot":"","sources":["helm-helper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAqBtC,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,WAAW,GAAG,MAAM,CAAC;IAC3B,MAAM,QAAQ,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,EAAC,CAAC,CAAC;IAC7E,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,YAAY,WAAW,qCAAqC,CAAC,CAAC;IAChF,MAAM,GAAG,GAAG,CAAC,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,mBAAmB,EAAiB,CAAC;IACtF,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/src/helm/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { HelmType, PolymerType, MonomerType, IWebEditorMonomer, WebEditorRGroups } from '@datagrok-libraries/js-draw-lite/src/types/org';
|
|
1
|
+
import type { HelmType, PolymerType, MonomerType, IWebEditorMonomer, WebEditorRGroups, IMonomerColors } from '@datagrok-libraries/js-draw-lite/src/types/org';
|
|
2
2
|
import type { Atom } from '@datagrok-libraries/js-draw-lite/src/Atom';
|
|
3
3
|
import type { IJsAtom } from '@datagrok-libraries/js-draw-lite/src/types/jsdraw2';
|
|
4
4
|
import type { Bond } from '@datagrok-libraries/js-draw-lite/src/Bond';
|
|
5
5
|
import type { Mol } from '@datagrok-libraries/js-draw-lite/src/Mol';
|
|
6
6
|
import type { Editor } from '@datagrok-libraries/js-draw-lite/src/JSDraw.Editor';
|
|
7
7
|
import type { App } from '@datagrok-libraries/helm-web-editor/helm/App';
|
|
8
|
-
import type { IOrgHelmWebEditor, IOrgHelmMonomers } from '@datagrok-libraries/helm-web-editor/src/types/org-helm';
|
|
8
|
+
import type { IOrgHelmWebEditor, IOrgHelmMonomers, GetMonomerFunc, GetMonomerResType } from '@datagrok-libraries/helm-web-editor/src/types/org-helm';
|
|
9
9
|
import type { HweWindow } from '@datagrok-libraries/helm-web-editor/src/types';
|
|
10
10
|
import type { JSDraw2ModuleType, ScilModuleType } from '@datagrok-libraries/js-draw-lite/src/types';
|
|
11
11
|
import type { OrgType } from '@datagrok-libraries/helm-web-editor/src/types/org-helm';
|
|
@@ -13,7 +13,7 @@ import type { Monomers } from '@datagrok-libraries/helm-web-editor/helm/Monomers
|
|
|
13
13
|
import type { DojoType, DojoxType } from '@datagrok-libraries/js-draw-lite/src/types/dojo';
|
|
14
14
|
export { HelmType, PolymerType, MonomerType, WebEditorRGroups };
|
|
15
15
|
export { Atom, IJsAtom, Bond, Mol, Editor };
|
|
16
|
-
export { IWebEditorMonomer, IOrgHelmWebEditor, IOrgHelmMonomers, App, Monomers };
|
|
16
|
+
export { IWebEditorMonomer, IMonomerColors, IOrgHelmWebEditor, IOrgHelmMonomers, App, Monomers, GetMonomerFunc, GetMonomerResType };
|
|
17
17
|
export { DojoType, DojoxType };
|
|
18
18
|
export { HweWindow, ScilModuleType, JSDraw2ModuleType, OrgType };
|
|
19
19
|
export interface IHelmWebEditor {
|
package/src/helm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EA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c;IAC7B,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/B,IAAI,IAAI,IAAI,cAAc,CAAC;IAE3B,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACnD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as DG from 'datagrok-api/dg';
|
|
2
|
+
import { ILogger } from './logger';
|
|
2
3
|
export declare enum TAGS {
|
|
3
4
|
maxMonomerLength = ".mm.cellRenderer.maxMonomerLength"
|
|
4
5
|
}
|
|
@@ -6,28 +7,33 @@ export declare enum DrawStyle {
|
|
|
6
7
|
MSA = "MSA",
|
|
7
8
|
classic = "classic"
|
|
8
9
|
}
|
|
10
|
+
export declare const PrintOptionsDefaults: {
|
|
11
|
+
/** Color of text to print */ color: string;
|
|
12
|
+
/** */ pivot: number;
|
|
13
|
+
/** Is left aligned */ left: boolean;
|
|
14
|
+
/** Transparency rate where 1.0 is fully transparent */ transparencyRate: number;
|
|
15
|
+
/** Monomer's separator, if specified */ separator: string;
|
|
16
|
+
/** Is checker if element last or not */ last: boolean;
|
|
17
|
+
/** MSA - for aligned, classic - for other seq */ drawStyle: DrawStyle;
|
|
18
|
+
/** Max word lengths per position (index of list) */ maxWord: number[];
|
|
19
|
+
/** Word index we currently draw */ wordIdx: number;
|
|
20
|
+
/** */ gridCell: DG.GridCell | null;
|
|
21
|
+
/** Reference sequence for diff mode */ referenceSequence: string[] | null;
|
|
22
|
+
/** Max length of a monomer */ maxLengthOfMonomer: number | null;
|
|
23
|
+
/** Map of monomers' text sizes */ monomerTextSizeMap: {
|
|
24
|
+
[key: string]: TextMetrics;
|
|
25
|
+
};
|
|
26
|
+
/** */ logger?: ILogger | undefined;
|
|
27
|
+
};
|
|
28
|
+
export type PrintOptions = typeof PrintOptionsDefaults;
|
|
9
29
|
/** A function that prints a string aligned to left or centered.
|
|
10
|
-
* @param {
|
|
11
|
-
* @param {
|
|
12
|
-
* @param {number}
|
|
13
|
-
* @param {number}
|
|
14
|
-
* @param {
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {number}pivot Pirvot.
|
|
18
|
-
* @param {boolean}left Is left aligned.
|
|
19
|
-
* @param {number}transparencyRate Transparency rate where 1.0 is fully transparent
|
|
20
|
-
* @param {string}separator Is separator for sequence.
|
|
21
|
-
* @param {boolean}last Is checker if element last or not.
|
|
22
|
-
* @param {DrawStyle}drawStyle Is draw style. MSA - for multicharSeq, classic - for other seq.
|
|
23
|
-
* @param {number[]}maxWord {{[pos: number]: number}} Max word lengths per position.
|
|
24
|
-
* @param {number}wordIdx Is index of word we currently draw.
|
|
25
|
-
* @param {DG.GridCell}gridCell Is grid cell.
|
|
26
|
-
* @param {string[]}referenceSequence Is reference sequence for diff mode.
|
|
27
|
-
* @param {number}maxLengthOfMonomer Is max length of monomer.
|
|
28
|
-
* @param {{[key: string]: TextMetrics}}monomerTextSizeMap Is map of monomer text sizes.
|
|
30
|
+
* @param {CanvasRenderingContext2D} g Canvas rendering context
|
|
31
|
+
* @param {string} s Text to print
|
|
32
|
+
* @param {number} x x coordinate
|
|
33
|
+
* @param {number} y y coordinate
|
|
34
|
+
* @param {number} w Width
|
|
35
|
+
* @param {number} h Height
|
|
36
|
+
* @param {PrintOptions} options
|
|
29
37
|
* @return {number} x coordinate to start printing at.*/
|
|
30
|
-
export declare function printLeftOrCentered(
|
|
31
|
-
[key: string]: TextMetrics;
|
|
32
|
-
}): number;
|
|
38
|
+
export declare function printLeftOrCentered(g: CanvasRenderingContext2D, s: string, x: number, y: number, w: number, h: number, options: Partial<PrintOptions>): number;
|
|
33
39
|
//# sourceMappingURL=cell-renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-renderer.d.ts","sourceRoot":"","sources":["cell-renderer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"cell-renderer.d.ts","sourceRoot":"","sources":["cell-renderer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGtC,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAOjC,oBAAY,IAAI;IACd,gBAAgB,sCAAsC;CACvD;AAED,oBAAY,SAAS;IACnB,GAAG,QAAQ;IACX,OAAO,YAAY;CACpB;AAED,eAAO,MAAM,oBAAoB;IAC/B,6BAA6B,QAAQ,MAAM;IAC3C,MAAM,QAAQ,MAAM;IACpB,sBAAsB,OAAO,OAAO;IACpC,uDAAuD,mBAAmB,MAAM;IAChF,wCAAwC,YAAY,MAAM;IAC1D,wCAAwC,OAAO,OAAO;IACtD,iDAAiD,YAAY,SAAS;IACtE,oDAAoD,UAAU,MAAM,EAAE;IACtE,mCAAmC,UAAU,MAAM;IACnD,OAAO,WAAW,GAAG,QAAQ,GAAG,IAAI;IACpC,uCAAuC,oBAAoB,MAAM,EAAE,GAAG,IAAI;IAC1E,8BAA8B,qBAAqB,MAAM,GAAG,IAAI;IAChE,kCAAkC;;;IAClC,MAAM;CACL,CAAC;AAEJ,MAAM,MAAM,YAAY,GAAG,OAAO,oBAAoB,CAAC;AAEvD;;;;;;;;wDAQwD;AACxD,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,wBAAwB,EAC7D,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,GACpF,MAAM,CAkER"}
|
|
@@ -12,78 +12,88 @@ export var DrawStyle;
|
|
|
12
12
|
DrawStyle["MSA"] = "MSA";
|
|
13
13
|
DrawStyle["classic"] = "classic";
|
|
14
14
|
})(DrawStyle || (DrawStyle = {}));
|
|
15
|
+
export const PrintOptionsDefaults = new class {
|
|
16
|
+
constructor() {
|
|
17
|
+
/** Color of text to print */ this.color = undefinedColor;
|
|
18
|
+
/** */ this.pivot = 0;
|
|
19
|
+
/** Is left aligned */ this.left = false;
|
|
20
|
+
/** Transparency rate where 1.0 is fully transparent */ this.transparencyRate = 1.0;
|
|
21
|
+
/** Monomer's separator, if specified */ this.separator = '';
|
|
22
|
+
/** Is checker if element last or not */ this.last = false;
|
|
23
|
+
/** MSA - for aligned, classic - for other seq */ this.drawStyle = DrawStyle.classic;
|
|
24
|
+
/** Max word lengths per position (index of list) */ this.maxWord = [];
|
|
25
|
+
/** Word index we currently draw */ this.wordIdx = 0;
|
|
26
|
+
/** */ this.gridCell = null;
|
|
27
|
+
/** Reference sequence for diff mode */ this.referenceSequence = null;
|
|
28
|
+
/** Max length of a monomer */ this.maxLengthOfMonomer = null;
|
|
29
|
+
/** Map of monomers' text sizes */ this.monomerTextSizeMap = {};
|
|
30
|
+
/** */ this.logger = undefined;
|
|
31
|
+
}
|
|
32
|
+
}();
|
|
15
33
|
/** A function that prints a string aligned to left or centered.
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {number}
|
|
19
|
-
* @param {number}
|
|
20
|
-
* @param {
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {
|
|
23
|
-
* @param {number}pivot Pirvot.
|
|
24
|
-
* @param {boolean}left Is left aligned.
|
|
25
|
-
* @param {number}transparencyRate Transparency rate where 1.0 is fully transparent
|
|
26
|
-
* @param {string}separator Is separator for sequence.
|
|
27
|
-
* @param {boolean}last Is checker if element last or not.
|
|
28
|
-
* @param {DrawStyle}drawStyle Is draw style. MSA - for multicharSeq, classic - for other seq.
|
|
29
|
-
* @param {number[]}maxWord {{[pos: number]: number}} Max word lengths per position.
|
|
30
|
-
* @param {number}wordIdx Is index of word we currently draw.
|
|
31
|
-
* @param {DG.GridCell}gridCell Is grid cell.
|
|
32
|
-
* @param {string[]}referenceSequence Is reference sequence for diff mode.
|
|
33
|
-
* @param {number}maxLengthOfMonomer Is max length of monomer.
|
|
34
|
-
* @param {{[key: string]: TextMetrics}}monomerTextSizeMap Is map of monomer text sizes.
|
|
34
|
+
* @param {CanvasRenderingContext2D} g Canvas rendering context
|
|
35
|
+
* @param {string} s Text to print
|
|
36
|
+
* @param {number} x x coordinate
|
|
37
|
+
* @param {number} y y coordinate
|
|
38
|
+
* @param {number} w Width
|
|
39
|
+
* @param {number} h Height
|
|
40
|
+
* @param {PrintOptions} options
|
|
35
41
|
* @return {number} x coordinate to start printing at.*/
|
|
36
|
-
export function printLeftOrCentered(
|
|
42
|
+
export function printLeftOrCentered(g, s, x, y, w, h, options) {
|
|
43
|
+
var _a, _b, _c;
|
|
44
|
+
const opts = Object.assign(Object.assign({}, PrintOptionsDefaults), options);
|
|
45
|
+
const logPrefix = `Bio: printLeftOrCentered()`;
|
|
46
|
+
options.logger?.debug(`${logPrefix}, start`);
|
|
37
47
|
g.textAlign = 'start';
|
|
38
48
|
let colorPart = s.substring(0);
|
|
39
|
-
let grayPart = last ? '' : separator;
|
|
40
|
-
if (drawStyle === DrawStyle.MSA)
|
|
49
|
+
let grayPart = opts.last ? '' : opts.separator;
|
|
50
|
+
if (opts.drawStyle === DrawStyle.MSA)
|
|
41
51
|
grayPart = '';
|
|
42
52
|
let colorCode = true;
|
|
43
53
|
let compareWithCurrent = true;
|
|
44
54
|
let highlightDifference = 'difference';
|
|
45
|
-
if ((gridCell != null) && (gridCell.cell.column != null)) {
|
|
46
|
-
colorCode = gridCell.cell.column.temp['color-code'] ?? true;
|
|
47
|
-
compareWithCurrent = gridCell.cell.column.temp['compare-with-current'] ?? true;
|
|
48
|
-
highlightDifference = gridCell.cell.column.temp['highlight-difference'] ?? 'difference';
|
|
55
|
+
if ((opts.gridCell != null) && (opts.gridCell.cell.column != null)) {
|
|
56
|
+
colorCode = opts.gridCell.cell.column.temp['color-code'] ?? true;
|
|
57
|
+
compareWithCurrent = opts.gridCell.cell.column.temp['compare-with-current'] ?? true;
|
|
58
|
+
highlightDifference = opts.gridCell.cell.column.temp['highlight-difference'] ?? 'difference';
|
|
49
59
|
}
|
|
50
|
-
if (referenceSequence) {
|
|
51
|
-
const currentMonomerCanonical = referenceSequence[wordIdx];
|
|
52
|
-
if (compareWithCurrent && (referenceSequence.length > 0) && (highlightDifference === 'difference'))
|
|
53
|
-
transparencyRate = (colorPart == currentMonomerCanonical) ? 0.3 : transparencyRate;
|
|
54
|
-
if (compareWithCurrent && (referenceSequence.length > 0) && (highlightDifference === 'equal'))
|
|
55
|
-
transparencyRate = (colorPart != currentMonomerCanonical) ? 0.3 : transparencyRate;
|
|
60
|
+
if (opts.referenceSequence) {
|
|
61
|
+
const currentMonomerCanonical = opts.referenceSequence[opts.wordIdx];
|
|
62
|
+
if (compareWithCurrent && (opts.referenceSequence.length > 0) && (highlightDifference === 'difference'))
|
|
63
|
+
opts.transparencyRate = (colorPart == currentMonomerCanonical) ? 0.3 : opts.transparencyRate;
|
|
64
|
+
if (compareWithCurrent && (opts.referenceSequence.length > 0) && (highlightDifference === 'equal'))
|
|
65
|
+
opts.transparencyRate = (colorPart != currentMonomerCanonical) ? 0.3 : opts.transparencyRate;
|
|
56
66
|
}
|
|
57
|
-
if (maxLengthOfMonomer != null)
|
|
58
|
-
colorPart = monomerToShortFunction(colorPart, maxLengthOfMonomer);
|
|
67
|
+
if (opts.maxLengthOfMonomer != null)
|
|
68
|
+
colorPart = monomerToShortFunction(colorPart, opts.maxLengthOfMonomer);
|
|
59
69
|
const fullText = colorPart + grayPart;
|
|
60
|
-
monomerTextSizeMap[fullText] ?? (
|
|
61
|
-
let textSize = monomerTextSizeMap[fullText];
|
|
62
|
-
monomerTextSizeMap[colorPart] ?? (
|
|
63
|
-
let maxColorTextSize = monomerTextSizeMap[colorPart].width;
|
|
64
|
-
monomerTextSizeMap[grayPart] ?? (monomerTextSizeMap[grayPart] = g.measureText(grayPart));
|
|
65
|
-
const grayPartSize = monomerTextSizeMap[grayPart].width;
|
|
70
|
+
(_a = opts.monomerTextSizeMap)[fullText] ?? (_a[fullText] = g.measureText(fullText));
|
|
71
|
+
let textSize = opts.monomerTextSizeMap[fullText];
|
|
72
|
+
(_b = opts.monomerTextSizeMap)[colorPart] ?? (_b[colorPart] = g.measureText(colorPart));
|
|
73
|
+
let maxColorTextSize = opts.monomerTextSizeMap[colorPart].width;
|
|
66
74
|
const dy = h / 2 - (textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent) / 2 + 1;
|
|
75
|
+
(_c = opts.monomerTextSizeMap)[grayPart] ?? (_c[grayPart] = g.measureText(grayPart));
|
|
76
|
+
const grayPartSize = opts.monomerTextSizeMap[grayPart].width;
|
|
67
77
|
textSize = textSize.width;
|
|
68
|
-
if (drawStyle === DrawStyle.MSA) {
|
|
69
|
-
maxColorTextSize = maxWord[wordIdx];
|
|
70
|
-
textSize = maxWord[wordIdx];
|
|
78
|
+
if (opts.drawStyle === DrawStyle.MSA) {
|
|
79
|
+
maxColorTextSize = opts.maxWord[opts.wordIdx];
|
|
80
|
+
textSize = opts.maxWord[opts.wordIdx];
|
|
71
81
|
}
|
|
72
82
|
/** Draw color part at {@link dx1}, and gray part at {@link dx2}. */
|
|
73
83
|
function draw(dx1, dx2) {
|
|
74
|
-
const drawColor = colorCode ? color : blackColor;
|
|
84
|
+
const drawColor = colorCode ? opts.color : blackColor;
|
|
75
85
|
g.fillStyle = drawColor;
|
|
76
|
-
g.globalAlpha = transparencyRate;
|
|
77
|
-
if (drawStyle === DrawStyle.classic) {
|
|
86
|
+
g.globalAlpha = opts.transparencyRate;
|
|
87
|
+
if (opts.drawStyle === DrawStyle.classic) {
|
|
78
88
|
g.fillText(colorPart, x + dx1, y + dy);
|
|
79
89
|
g.fillStyle = grayColor;
|
|
80
90
|
g.fillText(grayPart, x + dx2, y + dy);
|
|
81
91
|
}
|
|
82
|
-
if (drawStyle === DrawStyle.MSA)
|
|
92
|
+
if (opts.drawStyle === DrawStyle.MSA)
|
|
83
93
|
g.fillText(colorPart, x + dx1, y + dy);
|
|
84
94
|
}
|
|
85
|
-
const placeX = (maxWord[wordIdx] ?? 0) - (maxWord[0] ?? 0);
|
|
86
|
-
if (left || textSize > w) {
|
|
95
|
+
const placeX = (opts.maxWord[opts.wordIdx] ?? 0) - (opts.maxWord[0] ?? 0);
|
|
96
|
+
if (opts.left || textSize > w) {
|
|
87
97
|
draw(placeX, placeX + maxColorTextSize);
|
|
88
98
|
return x + placeX + maxColorTextSize + grayPartSize;
|
|
89
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-renderer.js","sourceRoot":"","sources":["cell-renderer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAGrD,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAC1C,MAAM,SAAS,GAAG,SAAS,CAAC;AAC5B,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,sBAAsB,GAA0D,cAAc,CAAC;AAErG,MAAM,CAAN,IAAY,IAEX;AAFD,WAAY,IAAI;IACd,8DAAsD,CAAA;AACxD,CAAC,EAFW,IAAI,KAAJ,IAAI,QAEf;AAED,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,gCAAmB,CAAA;AACrB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED
|
|
1
|
+
{"version":3,"file":"cell-renderer.js","sourceRoot":"","sources":["cell-renderer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAGrD,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAC1C,MAAM,SAAS,GAAG,SAAS,CAAC;AAC5B,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,sBAAsB,GAA0D,cAAc,CAAC;AAErG,MAAM,CAAN,IAAY,IAEX;AAFD,WAAY,IAAI;IACd,8DAAsD,CAAA;AACxD,CAAC,EAFW,IAAI,KAAJ,IAAI,QAEf;AAED,MAAM,CAAN,IA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AM,GAAG,gBAAgB,GAAG,YAAY,CAAC;KACrD;SAAM;QACL,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,gBAAgB,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,MAAM,GAAG,EAAE,GAAG,gBAAgB,CAAC;KAC3C;AACH,CAAC"}
|
package/src/package.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=package.d.ts.map
|
package/src/package.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["package.ts"],"names":[],"mappings":""}
|
package/src/package.js
DELETED
package/src/package.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","sourceRoot":"","sources":["package.ts"],"names":[],"mappings":""}
|