@datagrok/bio 2.10.15 → 2.10.16
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 +4 -0
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +2 -2
- package/src/viewers/vd-regions-viewer.ts +33 -14
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Leonid Stolbov",
|
|
6
6
|
"email": "lstolbov@datagrok.ai"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.10.
|
|
8
|
+
"version": "2.10.16",
|
|
9
9
|
"description": "Bioinformatics support (import/export of sequences, conversion, visualization, analysis). [See more](https://github.com/datagrok-ai/public/blob/master/packages/Bio/README.md) for details.",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@biowasm/aioli": "^3.1.0",
|
|
37
|
-
"@datagrok-libraries/bio": "^5.38.
|
|
37
|
+
"@datagrok-libraries/bio": "^5.38.8",
|
|
38
38
|
"@datagrok-libraries/chem-meta": "^1.0.1",
|
|
39
39
|
"@datagrok-libraries/ml": "^6.3.43",
|
|
40
40
|
"@datagrok-libraries/tutorials": "^1.3.6",
|
|
@@ -60,6 +60,9 @@ export enum PROPS {
|
|
|
60
60
|
fitWidth = 'fitWidth',
|
|
61
61
|
positionWidth = 'positionWidth',
|
|
62
62
|
positionHeight = 'positionHeight',
|
|
63
|
+
|
|
64
|
+
// -- Behavior --
|
|
65
|
+
filterSource = 'filterSource',
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
const defaults: VdRegionsProps = VdRegionsPropsDefault;
|
|
@@ -88,6 +91,8 @@ export class VdRegionsViewer extends DG.JsViewer implements IVdRegionsViewer {
|
|
|
88
91
|
public positionWidth: number;
|
|
89
92
|
public positionHeight: PositionHeight;
|
|
90
93
|
|
|
94
|
+
public filterSource: FilterSources;
|
|
95
|
+
|
|
91
96
|
constructor() {
|
|
92
97
|
super();
|
|
93
98
|
|
|
@@ -111,6 +116,10 @@ export class VdRegionsViewer extends DG.JsViewer implements IVdRegionsViewer {
|
|
|
111
116
|
});
|
|
112
117
|
this.positionHeight = this.string(PROPS.positionHeight, defaults.positionHeight,
|
|
113
118
|
{category: PROPS_CATS.LAYOUT, choices: Object.keys(PositionHeight)}) as PositionHeight;
|
|
119
|
+
|
|
120
|
+
// -- Behavior --
|
|
121
|
+
this.filterSource = this.string(PROPS.filterSource, defaults.filterSource,
|
|
122
|
+
{category: PROPS_CATS.BEHAVIOR, choices: Object.values(FilterSources)}) as FilterSources;
|
|
114
123
|
}
|
|
115
124
|
|
|
116
125
|
public async init() {
|
|
@@ -197,6 +206,10 @@ export class VdRegionsViewer extends DG.JsViewer implements IVdRegionsViewer {
|
|
|
197
206
|
this.calcSize();
|
|
198
207
|
break;
|
|
199
208
|
|
|
209
|
+
case PROPS.filterSource:
|
|
210
|
+
this.filterSourceInput.value = this.filterSource;
|
|
211
|
+
break;
|
|
212
|
+
|
|
200
213
|
default:
|
|
201
214
|
this.setData(this.dataFrame, this.regions); // onPropertyChanged
|
|
202
215
|
break;
|
|
@@ -244,7 +257,7 @@ export class VdRegionsViewer extends DG.JsViewer implements IVdRegionsViewer {
|
|
|
244
257
|
private setDataInProgress: boolean = false;
|
|
245
258
|
|
|
246
259
|
private host: HTMLElement | null = null;
|
|
247
|
-
private filterSourceInput
|
|
260
|
+
private filterSourceInput!: DG.InputBase<FilterSources | null>;
|
|
248
261
|
private mainLayout: HTMLTableElement | null = null;
|
|
249
262
|
private logos: { [chain: string]: WebLogoViewer }[] = [];
|
|
250
263
|
|
|
@@ -350,12 +363,13 @@ export class VdRegionsViewer extends DG.JsViewer implements IVdRegionsViewer {
|
|
|
350
363
|
// this.mainLayout.style.height = '100%';
|
|
351
364
|
// this.mainLayout.style.border = '1px solid black';
|
|
352
365
|
|
|
353
|
-
this.filterSourceInput = ui.
|
|
366
|
+
this.filterSourceInput = ui.choiceInput<FilterSources>('Data source', defaults.filterSource,
|
|
367
|
+
Object.values(FilterSources), this.filterSourceInputOnValueChanged.bind(this));
|
|
354
368
|
this.filterSourceInput.root.style.position = 'absolute';
|
|
355
|
-
this.filterSourceInput.root.style.
|
|
356
|
-
this.filterSourceInput.root.style.top = '-
|
|
369
|
+
this.filterSourceInput.root.style.right = '9px';
|
|
370
|
+
this.filterSourceInput.root.style.top = '-4px';
|
|
357
371
|
//this.filterSourceInput.setTooltip('Check to filter sequences for selected VRs'); // TODO: GROK-13614
|
|
358
|
-
ui.tooltip.bind(this.filterSourceInput.input, 'Check to filter sequences for selected VRs');
|
|
372
|
+
//ui.tooltip.bind(this.filterSourceInput.input, 'Check to filter sequences for selected VRs');
|
|
359
373
|
|
|
360
374
|
const _color: string = `#ffbb${Math.ceil(Math.random() * 255).toString(16)}`;
|
|
361
375
|
this.host = ui.div([this.mainLayout, this.filterSourceInput!.root],
|
|
@@ -440,15 +454,20 @@ export class VdRegionsViewer extends DG.JsViewer implements IVdRegionsViewer {
|
|
|
440
454
|
}
|
|
441
455
|
|
|
442
456
|
private filterSourceInputOnValueChanged(): void {
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
457
|
+
const filterSourceValue = this.filterSourceInput.value;
|
|
458
|
+
// Using promise to prevent 'Bad state: Cannot fire new event. Controller is already firing an event'
|
|
459
|
+
this.viewPromise = this.viewPromise.then(() => {
|
|
460
|
+
if (this.filterSource !== filterSourceValue) {
|
|
461
|
+
this.props.getProperty(PROPS.filterSource).set(this, filterSourceValue); // to update value in property panel
|
|
462
|
+
|
|
463
|
+
for (let orderI = 0; orderI < this.logos.length; orderI++) {
|
|
464
|
+
for (let chainI = 0; chainI < this.chains.length; chainI++) {
|
|
465
|
+
const chain: string = this.chains[chainI];
|
|
466
|
+
const wl: DG.JsViewer = this.logos[orderI][chain];
|
|
467
|
+
wl.setOptions({[wlPROPS.filterSource]: this.filterSource});
|
|
468
|
+
}
|
|
469
|
+
}
|
|
451
470
|
}
|
|
452
|
-
}
|
|
471
|
+
});
|
|
453
472
|
}
|
|
454
473
|
}
|