@datagrok/bio 2.18.0 → 2.18.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 +10 -0
- package/dist/284.js +1 -1
- package/dist/284.js.map +1 -1
- package/dist/455.js +1 -1
- package/dist/455.js.map +1 -1
- package/dist/682.js +1 -1
- package/dist/682.js.map +1 -1
- package/dist/705.js +1 -1
- package/dist/705.js.map +1 -1
- package/dist/980.js +1 -1
- package/dist/980.js.map +1 -1
- package/dist/package-test.js +3 -3
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +2 -2
- package/dist/package.js.map +1 -1
- package/package.json +2 -3
- package/src/package.ts +7 -0
- package/src/tests/activity-cliffs-tests.ts +11 -6
- package/src/tests/renderers-test.ts +1 -1
- package/src/tests/substructure-filters-tests.ts +113 -104
- package/src/tests/to-atomic-level-ui-tests.ts +11 -6
- package/src/utils/monomer-cell-renderer.ts +0 -2
- package/src/utils/monomer-lib/monomer-lib-base.ts +10 -5
- package/src/widgets/bio-substructure-filter-helm.ts +4 -3
- package/src/widgets/bio-substructure-filter.ts +10 -8
- package/test-console-output-1.log +7389 -0
- package/test-record-1.mp4 +0 -0
- package/src/widgets/bio-substructure-filter-types.ts +0 -105
|
Binary file
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import * as ui from 'datagrok-api/ui';
|
|
2
|
-
import * as DG from 'datagrok-api/dg';
|
|
3
|
-
import * as grok from 'datagrok-api/grok';
|
|
4
|
-
|
|
5
|
-
import {Observable, Subject, Unsubscribable} from 'rxjs';
|
|
6
|
-
import {_package} from '../package';
|
|
7
|
-
|
|
8
|
-
export interface IFilterProps {
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/** Fasta and Helm */
|
|
12
|
-
export class BioFilterProps implements IFilterProps {
|
|
13
|
-
constructor(
|
|
14
|
-
public readonly substructure: string,
|
|
15
|
-
/** Pass false from an inheritors constructor, at the end set true. */ protected readOnly: boolean = true,
|
|
16
|
-
) {
|
|
17
|
-
return new Proxy(this, {
|
|
18
|
-
set: (target: any, key: string | symbol, value: any) => {
|
|
19
|
-
_package.logger.debug(`BioFilterProps.set ${key.toString()}( '${value}' )`);
|
|
20
|
-
if (this.readOnly)
|
|
21
|
-
throw new Error('Properties are immutable.');
|
|
22
|
-
target[key] = value;
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface IBioFilter {
|
|
30
|
-
get type(): string;
|
|
31
|
-
|
|
32
|
-
get props(): IFilterProps;
|
|
33
|
-
set props(value: IFilterProps);
|
|
34
|
-
|
|
35
|
-
applyProps(props: IFilterProps): void;
|
|
36
|
-
saveProps(): IFilterProps;
|
|
37
|
-
|
|
38
|
-
get onChanged(): Observable<void>;
|
|
39
|
-
get filterPanel(): HTMLElement;
|
|
40
|
-
get filterSummary(): string;
|
|
41
|
-
get isFiltering(): boolean;
|
|
42
|
-
|
|
43
|
-
attach(): Promise<void>;
|
|
44
|
-
detach(): Promise<void>;
|
|
45
|
-
resetFilter(): void;
|
|
46
|
-
substructureSearch(col: DG.Column): Promise<DG.BitSet | null>;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** Encapsulates input controls handling */
|
|
50
|
-
export abstract class BioFilterBase<TProps extends BioFilterProps> implements IBioFilter {
|
|
51
|
-
abstract get filterPanel(): HTMLElement;
|
|
52
|
-
|
|
53
|
-
abstract get emptyProps(): TProps;
|
|
54
|
-
|
|
55
|
-
onChanged: Subject<void> = new Subject<void>();
|
|
56
|
-
|
|
57
|
-
private _props: TProps;
|
|
58
|
-
protected _propsChanging: boolean = false;
|
|
59
|
-
|
|
60
|
-
abstract get type(): string;
|
|
61
|
-
|
|
62
|
-
get props(): TProps {
|
|
63
|
-
if (!this._props) this._props = this.emptyProps;
|
|
64
|
-
return this._props;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
set props(value: TProps) {
|
|
68
|
-
this._propsChanging = true;
|
|
69
|
-
try {
|
|
70
|
-
this._props = value;
|
|
71
|
-
this.applyProps();
|
|
72
|
-
this.onChanged.next();
|
|
73
|
-
} finally {
|
|
74
|
-
this._propsChanging = false;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
saveProps(): IFilterProps {
|
|
79
|
-
const propsObj = {};
|
|
80
|
-
for (const [key, value] of Object.entries(this.props)) {
|
|
81
|
-
if (key !== '_onChanged') {
|
|
82
|
-
// @ts-ignore
|
|
83
|
-
propsObj[key] = this.props[key];
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return propsObj;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
abstract applyProps(): void;
|
|
90
|
-
|
|
91
|
-
abstract attach(): Promise<void>;
|
|
92
|
-
|
|
93
|
-
async detach(): Promise<void> { }
|
|
94
|
-
|
|
95
|
-
get filterSummary(): string { return this.props.substructure; };
|
|
96
|
-
|
|
97
|
-
get isFiltering(): boolean { return this.props.substructure !== ''; }
|
|
98
|
-
|
|
99
|
-
abstract substructureSearch(_column: DG.Column): Promise<DG.BitSet | null>;
|
|
100
|
-
|
|
101
|
-
resetFilter(): void {
|
|
102
|
-
this.props = this.emptyProps;
|
|
103
|
-
this.onChanged.next();
|
|
104
|
-
}
|
|
105
|
-
}
|