drugflow-molstar 0.3.77 → 0.4.1
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/build/drugflow-molstar-0.4.1.css +1 -0
- package/build/drugflow-molstar-component-0.4.1.js +25 -0
- package/build/drugflow-molstar-plugin-0.4.1.js +2 -0
- package/build/drugflow-molstar-plugin-0.4.1.js.LICENSE.txt +64 -0
- package/lib/alphafold-transparency.js +58 -125
- package/lib/contact.d.ts +15 -6
- package/lib/contact.js +71 -66
- package/lib/custom-events.js +16 -16
- package/lib/domain-annotations/behavior.js +20 -24
- package/lib/domain-annotations/color.d.ts +1 -1
- package/lib/domain-annotations/color.js +23 -22
- package/lib/domain-annotations/prop.d.ts +3 -3
- package/lib/domain-annotations/prop.js +54 -76
- package/lib/drugflow-molstar-component-build-0.3.78.js +2 -0
- package/lib/drugflow-molstar-component-build-0.4.1.js +2 -0
- package/lib/helpers.d.ts +4 -4
- package/lib/helpers.js +94 -99
- package/lib/index.js +1785 -2608
- package/lib/labels.d.ts +1 -1
- package/lib/labels.js +20 -23
- package/lib/loci-details.d.ts +2 -2
- package/lib/loci-details.js +26 -29
- package/lib/sifts-mapping.js +30 -34
- package/lib/sifts-mappings-behaviour.js +26 -30
- package/lib/spec.d.ts +1 -1
- package/lib/spec.js +50 -38
- package/lib/structure_contact3d.d.ts +13 -4
- package/lib/structure_contact3d.js +25 -46
- package/lib/subscribe-events.js +17 -17
- package/lib/superposition-export.js +100 -144
- package/lib/superposition-focus-representation.d.ts +1 -1
- package/lib/superposition-focus-representation.js +74 -112
- package/lib/superposition-sifts-mapping.d.ts +1 -1
- package/lib/superposition-sifts-mapping.js +56 -62
- package/lib/superposition.d.ts +2 -2
- package/lib/superposition.js +490 -726
- package/lib/ui/alphafold-superposition.d.ts +8 -9
- package/lib/ui/alphafold-superposition.js +96 -120
- package/lib/ui/alphafold-tranparency.d.ts +1 -2
- package/lib/ui/alphafold-tranparency.js +27 -43
- package/lib/ui/annotation-controls.d.ts +2 -3
- package/lib/ui/annotation-controls.js +81 -87
- package/lib/ui/export-superposition.js +33 -51
- package/lib/ui/pdbe-left-panel.d.ts +3 -3
- package/lib/ui/pdbe-left-panel.js +82 -106
- package/lib/ui/pdbe-screenshot-controls.d.ts +1 -1
- package/lib/ui/pdbe-screenshot-controls.js +54 -83
- package/lib/ui/pdbe-structure-controls.d.ts +4 -5
- package/lib/ui/pdbe-structure-controls.js +34 -57
- package/lib/ui/pdbe-viewport-controls.d.ts +1 -2
- package/lib/ui/pdbe-viewport-controls.js +23 -29
- package/lib/ui/segment-tree.d.ts +1 -2
- package/lib/ui/segment-tree.js +438 -590
- package/lib/ui/superposition-components.d.ts +1 -2
- package/lib/ui/superposition-components.js +196 -266
- package/lib/ui/superposition-viewport.d.ts +1 -2
- package/lib/ui/superposition-viewport.js +11 -18
- package/package.json +7 -4
- package/build/drugflow-molstar-0.3.62.css +0 -1
- package/build/drugflow-molstar-0.3.77.css +0 -1
- package/build/drugflow-molstar-component-0.3.62.js +0 -25
- package/build/drugflow-molstar-component-0.3.77.js +0 -25
- package/build/drugflow-molstar-light.css +0 -1
- package/build/drugflow-molstar-plugin-0.3.62.js +0 -2
- package/build/drugflow-molstar-plugin-0.3.62.js.LICENSE.txt +0 -39
- package/build/drugflow-molstar-plugin-0.3.77.js +0 -2
- package/build/drugflow-molstar-plugin-0.3.77.js.LICENSE.txt +0 -39
- package/lib/drugflow-molstar-component-build-0.1.2.js +0 -4268
- package/lib/drugflow-molstar-component-build-0.1.2.js.map +0 -1
- package/lib/drugflow-molstar-component-build-0.1.3.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.4.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.4.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.1.5.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.5.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.1.6.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.6.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.10.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.10.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.2.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.2.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.3.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.3.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.4.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.4.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.5.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.5.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.6.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.6.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.7.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.7.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.9.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.9.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.1.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.1.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.10.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.10.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.11.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.11.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.12.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.12.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.13.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.13.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.14.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.14.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.15.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.15.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.16.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.16.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.17.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.17.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.18.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.18.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.19.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.19.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.2.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.2.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.20.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.20.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.21.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.21.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.22.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.22.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.23.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.23.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.24.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.24.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.25.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.25.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.26.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.26.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.27.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.27.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.28.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.28.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.29.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.29.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.3.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.3.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.30.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.30.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.31.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.31.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.32.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.32.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.33.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.33.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.34.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.34.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.35.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.35.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.36.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.36.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.37.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.37.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.38.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.38.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.39.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.39.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.4.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.4.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.40.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.40.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.41.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.41.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.42.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.42.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.43.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.43.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.44.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.44.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.46.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.46.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.47.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.47.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.48.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.48.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.49.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.49.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.5.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.5.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.50.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.50.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.51.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.51.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.52.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.52.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.53.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.53.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.54.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.54.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.55.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.55.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.56.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.56.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.57.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.57.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.58.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.58.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.59.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.59.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.6.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.6.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.60.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.60.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.61.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.61.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.62.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.62.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.63.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.63.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.64.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.64.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.65.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.65.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.66.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.66.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.67.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.67.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.68.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.68.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.69.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.69.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.7.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.7.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.70.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.70.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.71.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.71.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.72.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.72.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.73.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.73.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.74.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.74.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.75.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.75.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.76.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.76.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.77.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.77.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.8.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.8.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.9.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.9.js.LICENSE.txt +0 -24
- package/lib/index2.d.ts +0 -1
- package/lib/index2.js +0 -1369
- package/lib/pdbe-molstar-component-build-3.1.2.js +0 -2
- package/lib/pdbe-molstar-component-build-3.1.2.js.LICENSE.txt +0 -24
- /package/lib/{drugflow-molstar-component-build-0.1.2.js.LICENSE.txt → drugflow-molstar-component-build-0.3.78.js.LICENSE.txt} +0 -0
- /package/lib/{drugflow-molstar-component-build-0.1.3.js.LICENSE.txt → drugflow-molstar-component-build-0.4.1.js.LICENSE.txt} +0 -0
|
@@ -1,42 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SuperpositionComponentControls = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
tslib_1.__extends(SuperpositionComponentControls, _super);
|
|
17
|
-
function SuperpositionComponentControls() {
|
|
18
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
19
|
-
}
|
|
20
|
-
SuperpositionComponentControls.prototype.defaultState = function () {
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const commands_1 = require("Molstar/mol-plugin/commands");
|
|
6
|
+
const mol_state_1 = require("Molstar/mol-state");
|
|
7
|
+
const param_definition_1 = require("Molstar/mol-util/param-definition");
|
|
8
|
+
const base_1 = require("Molstar/mol-plugin-ui/base");
|
|
9
|
+
const common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
10
|
+
const icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
11
|
+
const parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
|
|
12
|
+
const operators_1 = require("rxjs/operators");
|
|
13
|
+
const rxjs_1 = require("rxjs");
|
|
14
|
+
class SuperpositionComponentControls extends base_1.CollapsableControls {
|
|
15
|
+
defaultState() {
|
|
21
16
|
return {
|
|
22
17
|
header: 'Components',
|
|
23
18
|
isCollapsed: false,
|
|
24
19
|
isDisabled: false,
|
|
25
20
|
brand: { accent: 'blue', svg: icons_1.CubeOutlineSvg }
|
|
26
21
|
};
|
|
27
|
-
}
|
|
28
|
-
|
|
22
|
+
}
|
|
23
|
+
renderControls() {
|
|
29
24
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(ComponentListControls, {}) });
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
}(base_1.CollapsableControls));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
33
27
|
exports.SuperpositionComponentControls = SuperpositionComponentControls;
|
|
34
28
|
;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
_this.state = {
|
|
29
|
+
class ComponentListControls extends base_1.PurePluginUIComponent {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.state = {
|
|
40
33
|
segmentWatch: false,
|
|
41
34
|
ligSearchText: '',
|
|
42
35
|
carbSearchText: '',
|
|
@@ -47,144 +40,108 @@ var ComponentListControls = /** @class */ (function (_super) {
|
|
|
47
40
|
isCarbCollapsed: false,
|
|
48
41
|
isBusy: false
|
|
49
42
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
this.ligInputStream = new rxjs_1.Subject();
|
|
44
|
+
this.handleLigInputStream = (inputStr) => {
|
|
45
|
+
this.setState({ ligSearchText: inputStr });
|
|
46
|
+
const filteredRes = this.state.componentGroups.ligGroups.filter((g) => {
|
|
47
|
+
const gKeys = g[0].key.split(',');
|
|
48
|
+
const cId1Arr = gKeys[0].split('-');
|
|
56
49
|
return cId1Arr[2].toLowerCase().indexOf(inputStr.toLowerCase()) >= 0;
|
|
57
50
|
});
|
|
58
|
-
|
|
51
|
+
this.setState({ ligGroups: filteredRes });
|
|
59
52
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
this.carbInputStream = new rxjs_1.Subject();
|
|
54
|
+
this.handleCarbInputStream = (inputStr) => {
|
|
55
|
+
this.setState({ carbSearchText: inputStr });
|
|
56
|
+
const filteredRes = this.state.componentGroups.carbGroups.filter((g) => {
|
|
57
|
+
const gKeys = g[0].key.split(',');
|
|
58
|
+
const cId1Arr = gKeys[0].split('-');
|
|
66
59
|
cId1Arr.splice(0, 2);
|
|
67
60
|
cId1Arr.pop();
|
|
68
61
|
return cId1Arr.join('-').toLowerCase().indexOf(inputStr.toLowerCase()) >= 0;
|
|
69
62
|
});
|
|
70
|
-
|
|
63
|
+
this.setState({ carbGroups: filteredRes });
|
|
71
64
|
};
|
|
72
|
-
|
|
65
|
+
this.toggleVisible = (e, action, type) => {
|
|
73
66
|
e.preventDefault();
|
|
74
67
|
e.currentTarget.blur();
|
|
75
|
-
|
|
68
|
+
const customState = this.plugin.customState;
|
|
76
69
|
customState.events.isBusy.next(true);
|
|
77
|
-
|
|
78
|
-
setTimeout(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
visualEntites_1 = tslib_1.__asyncValues(visualEntites);
|
|
86
|
-
_b.label = 1;
|
|
87
|
-
case 1: return [4 /*yield*/, visualEntites_1.next()];
|
|
88
|
-
case 2:
|
|
89
|
-
if (!(visualEntites_1_1 = _b.sent(), !visualEntites_1_1.done)) return [3 /*break*/, 4];
|
|
90
|
-
visualEntity = visualEntites_1_1.value;
|
|
91
|
-
this.plugin.managers.structure.hierarchy.toggleVisibility(visualEntity, action);
|
|
92
|
-
_b.label = 3;
|
|
93
|
-
case 3: return [3 /*break*/, 1];
|
|
94
|
-
case 4: return [3 /*break*/, 11];
|
|
95
|
-
case 5:
|
|
96
|
-
e_1_1 = _b.sent();
|
|
97
|
-
e_1 = { error: e_1_1 };
|
|
98
|
-
return [3 /*break*/, 11];
|
|
99
|
-
case 6:
|
|
100
|
-
_b.trys.push([6, , 9, 10]);
|
|
101
|
-
if (!(visualEntites_1_1 && !visualEntites_1_1.done && (_a = visualEntites_1.return))) return [3 /*break*/, 8];
|
|
102
|
-
return [4 /*yield*/, _a.call(visualEntites_1)];
|
|
103
|
-
case 7:
|
|
104
|
-
_b.sent();
|
|
105
|
-
_b.label = 8;
|
|
106
|
-
case 8: return [3 /*break*/, 10];
|
|
107
|
-
case 9:
|
|
108
|
-
if (e_1) throw e_1.error;
|
|
109
|
-
return [7 /*endfinally*/];
|
|
110
|
-
case 10: return [7 /*endfinally*/];
|
|
111
|
-
case 11:
|
|
112
|
-
;
|
|
113
|
-
customState.events.isBusy.next(false);
|
|
114
|
-
return [2 /*return*/];
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}); });
|
|
70
|
+
const visualEntites = (type === 'ligands') ? this.state.ligGroups : this.state.carbGroups;
|
|
71
|
+
setTimeout(async () => {
|
|
72
|
+
for await (const visualEntity of visualEntites) {
|
|
73
|
+
this.plugin.managers.structure.hierarchy.toggleVisibility(visualEntity, action);
|
|
74
|
+
}
|
|
75
|
+
;
|
|
76
|
+
customState.events.isBusy.next(false);
|
|
77
|
+
});
|
|
118
78
|
};
|
|
119
|
-
|
|
120
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.Button,
|
|
79
|
+
this.showHideAllControls = (type) => {
|
|
80
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CheckSvg, flex: true, onClick: (e) => this.toggleVisible(e, 'show', type), style: { flex: '0 0 50px', textAlign: 'center', fontSize: '80%', color: '#9cacc3', padding: 0 }, title: `Show all ${type}`, disabled: false, children: "All" }), (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CloseSvg, flex: true, onClick: (e) => this.toggleVisible(e, 'hide', type), style: { flex: '0 0 50px', textAlign: 'center', fontSize: '80%', color: '#9cacc3', padding: 0 }, title: `Hide all ${type}`, disabled: false, children: "None" })] });
|
|
121
81
|
};
|
|
122
|
-
|
|
82
|
+
this.clearLigSearch = (e) => {
|
|
123
83
|
e.preventDefault();
|
|
124
|
-
|
|
125
|
-
|
|
84
|
+
this.setState({ ligSearchText: '' });
|
|
85
|
+
this.ligInputStream.next('');
|
|
126
86
|
e.currentTarget.blur();
|
|
127
87
|
};
|
|
128
|
-
|
|
88
|
+
this.clearCarbSearch = (e) => {
|
|
129
89
|
e.preventDefault();
|
|
130
|
-
|
|
131
|
-
|
|
90
|
+
this.setState({ carbSearchText: '' });
|
|
91
|
+
this.carbInputStream.next('');
|
|
132
92
|
e.currentTarget.blur();
|
|
133
93
|
};
|
|
134
|
-
|
|
94
|
+
this.collapseSection = (e, type) => {
|
|
135
95
|
e.preventDefault();
|
|
136
96
|
e.currentTarget.blur();
|
|
137
97
|
if (type === 'ligands') {
|
|
138
|
-
|
|
98
|
+
this.setState({ isLigCollapsed: !this.state.isLigCollapsed });
|
|
139
99
|
}
|
|
140
100
|
else {
|
|
141
|
-
|
|
101
|
+
this.setState({ isCarbCollapsed: !this.state.isCarbCollapsed });
|
|
142
102
|
}
|
|
143
103
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
104
|
+
this.sectionHeader = (type) => {
|
|
105
|
+
const showHideAllControls = (type === 'ligands') ? this.showHideAllControls('ligands') : this.showHideAllControls('carbohydrates');
|
|
106
|
+
const title = (type === 'ligands') ? 'Ligand' : 'Carbohydrates';
|
|
107
|
+
const visibleVisuals = (type === 'ligands') ? this.state.ligGroups.length : this.state.carbGroups.length;
|
|
108
|
+
const totalVisuals = (type === 'ligands') ? this.state.componentGroups.ligGroups.length : this.state.componentGroups.carbGroups.length;
|
|
109
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', style: { marginTop: '6px' }, children: [(0, jsx_runtime_1.jsxs)("button", { className: 'msp-form-control msp-control-button-label msp-transform-header-brand-gray', style: { textAlign: 'left' }, onClick: (e) => this.collapseSection(e, type), children: [(0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)("strong", { children: title }) }), (0, jsx_runtime_1.jsxs)("small", { style: { color: '#7d91b0' }, children: [" ( ", visibleVisuals, visibleVisuals < totalVisuals ? ` / ${totalVisuals}` : '', " )"] })] }), visibleVisuals > 1 && showHideAllControls] });
|
|
150
110
|
};
|
|
151
|
-
return _this;
|
|
152
111
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
_this.forceUpdate();
|
|
112
|
+
componentDidMount() {
|
|
113
|
+
this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, () => {
|
|
114
|
+
this.categoriseGroups();
|
|
115
|
+
this.forceUpdate();
|
|
158
116
|
});
|
|
159
|
-
this.subscribe(this.plugin.behaviors.state.isBusy,
|
|
160
|
-
|
|
117
|
+
this.subscribe(this.plugin.behaviors.state.isBusy, v => {
|
|
118
|
+
this.setState({ isBusy: v });
|
|
161
119
|
});
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
var customState = this.plugin.customState;
|
|
120
|
+
}
|
|
121
|
+
componentDidUpdate() {
|
|
122
|
+
const customState = this.plugin.customState;
|
|
166
123
|
if (customState.events && !this.state.segmentWatch) {
|
|
167
124
|
this.setState({ segmentWatch: true });
|
|
168
|
-
this.subscribe(customState.events.segmentUpdate,
|
|
169
|
-
|
|
170
|
-
|
|
125
|
+
this.subscribe(customState.events.segmentUpdate, () => {
|
|
126
|
+
this.categoriseGroups();
|
|
127
|
+
this.forceUpdate();
|
|
171
128
|
});
|
|
172
129
|
}
|
|
173
|
-
this.subscribe(this.ligInputStream.pipe((0, operators_1.debounceTime)(1000 / 24)),
|
|
174
|
-
this.subscribe(this.carbInputStream.pipe((0, operators_1.debounceTime)(1000 / 24)),
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
componentGroups.forEach(
|
|
181
|
-
|
|
130
|
+
this.subscribe(this.ligInputStream.pipe((0, operators_1.debounceTime)(1000 / 24)), (e) => this.handleLigInputStream(e));
|
|
131
|
+
this.subscribe(this.carbInputStream.pipe((0, operators_1.debounceTime)(1000 / 24)), (e) => this.handleCarbInputStream(e));
|
|
132
|
+
}
|
|
133
|
+
categoriseGroups() {
|
|
134
|
+
let componentGroupsVal = { nonLigGroups: [], ligGroups: [], carbGroups: [], alphafold: [] };
|
|
135
|
+
const componentGroups = this.plugin.managers.structure.hierarchy.currentComponentGroups;
|
|
136
|
+
const customState = this.plugin.customState;
|
|
137
|
+
componentGroups.forEach((g) => {
|
|
138
|
+
let isLigandView = false;
|
|
182
139
|
if (customState.initParams && customState.initParams.superpositionParams && customState.initParams.superpositionParams.ligandView) {
|
|
183
140
|
isLigandView = true;
|
|
184
141
|
}
|
|
185
142
|
if (isLigandView) {
|
|
186
|
-
|
|
187
|
-
|
|
143
|
+
const gKeys = g[0].key.split(',');
|
|
144
|
+
const cId1Arr = gKeys[0].split('-');
|
|
188
145
|
if (gKeys.indexOf('superposition-focus-surr-sel') === -1) {
|
|
189
146
|
if (cId1Arr[cId1Arr.length - 1] !== (customState.superpositionState.activeSegment - 1) + '')
|
|
190
147
|
return;
|
|
@@ -206,8 +163,8 @@ var ComponentListControls = /** @class */ (function (_super) {
|
|
|
206
163
|
}
|
|
207
164
|
}
|
|
208
165
|
else {
|
|
209
|
-
|
|
210
|
-
if (gKeys.indexOf('superposition-focus-surr-sel') >= 0 || gKeys.indexOf(
|
|
166
|
+
const gKeys = g[0].key.split(',');
|
|
167
|
+
if (gKeys.indexOf('superposition-focus-surr-sel') >= 0 || gKeys.indexOf(`Chain-${customState.superpositionState.activeSegment - 1}`) >= 0) {
|
|
211
168
|
componentGroupsVal.nonLigGroups.push(g);
|
|
212
169
|
}
|
|
213
170
|
else if (gKeys.indexOf('alphafold-chain') >= 0) {
|
|
@@ -216,220 +173,193 @@ var ComponentListControls = /** @class */ (function (_super) {
|
|
|
216
173
|
}
|
|
217
174
|
});
|
|
218
175
|
this.setState({ componentGroups: componentGroupsVal, ligGroups: componentGroupsVal.ligGroups, carbGroups: componentGroupsVal.carbGroups, ligSearchText: '', carbSearchText: '' });
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
function StructureComponentGroup() {
|
|
233
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
234
|
-
_this.state = {
|
|
176
|
+
}
|
|
177
|
+
render() {
|
|
178
|
+
const ligSearchControls = (0, jsx_runtime_1.jsxs)("div", { className: 'msp-mapped-parameter-group', style: { fontSize: '90%' }, children: [(0, jsx_runtime_1.jsxs)("div", { className: 'msp-control-row msp-transform-header-brand-gray', style: { height: '33px' }, children: [(0, jsx_runtime_1.jsx)("span", { className: 'msp-control-row-label', children: "Search Ligand" }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-row-ctrl', children: (0, jsx_runtime_1.jsx)("input", { type: 'text', placeholder: 'Enter HET code', disabled: this.state.isBusy, onChange: e => this.ligInputStream.next(e.target.value), value: this.state.ligSearchText, maxLength: 3 }) })] }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.CloseSvg, flex: true, onClick: this.clearLigSearch, style: { flex: '0 0 24px', padding: 0 }, disabled: this.state.ligSearchText === '' || this.state.isBusy, toggleState: this.state.ligSearchText !== '', title: 'Clear search input' })] });
|
|
179
|
+
const carbSearchControls = (0, jsx_runtime_1.jsxs)("div", { className: 'msp-mapped-parameter-group', style: { fontSize: '90%' }, children: [(0, jsx_runtime_1.jsxs)("div", { className: 'msp-control-row msp-transform-header-brand-gray', style: { height: '33px' }, children: [(0, jsx_runtime_1.jsx)("span", { className: 'msp-control-row-label', children: "Search Carbohydrate" }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-row-ctrl', children: (0, jsx_runtime_1.jsx)("input", { type: 'text', placeholder: 'Enter HET code', disabled: this.state.isBusy, onChange: e => this.carbInputStream.next(e.target.value), value: this.state.carbSearchText, maxLength: 3 }) })] }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.CloseSvg, flex: true, onClick: this.clearCarbSearch, style: { flex: '0 0 24px', padding: 0 }, disabled: this.state.carbSearchText === '' || this.state.isBusy, toggleState: this.state.carbSearchText !== '', title: 'Clear search input' })] });
|
|
180
|
+
const ligSectionHeader = this.sectionHeader('ligands');
|
|
181
|
+
const carbSectionHeader = this.sectionHeader('carbohydrates');
|
|
182
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(this.state.componentGroups.nonLigGroups.length > 0) && (0, jsx_runtime_1.jsx)("div", { children: this.state.componentGroups.nonLigGroups.map((g) => (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: true }, g[0].cell.transform.ref)) }), (this.state.componentGroups.alphafold.length > 0) && (0, jsx_runtime_1.jsx)("div", { children: this.state.componentGroups.alphafold.map((g) => (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: true, type: 'alphafold' }, g[0].cell.transform.ref)) }), (this.state.componentGroups.ligGroups.length > 0) && ligSectionHeader, (!this.state.isLigCollapsed && this.state.componentGroups.ligGroups.length > 5) && ligSearchControls, (this.state.componentGroups.ligGroups.length > 0) && (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-offset', style: { maxHeight: '800px', overflowY: 'auto' }, children: !this.state.isLigCollapsed && this.state.ligGroups.map((g) => (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: false }, g[0].cell.transform.ref)) }), (this.state.componentGroups.carbGroups.length > 0) && carbSectionHeader, (!this.state.isCarbCollapsed && this.state.componentGroups.carbGroups.length > 5) && carbSearchControls, (this.state.componentGroups.carbGroups.length > 0) && (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-offset', style: { maxHeight: '800px', overflowY: 'auto' }, children: !this.state.isCarbCollapsed && this.state.carbGroups.map((g) => (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: false }, g[0].cell.transform.ref)) })] });
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
class StructureComponentGroup extends base_1.PurePluginUIComponent {
|
|
186
|
+
constructor() {
|
|
187
|
+
super(...arguments);
|
|
188
|
+
this.state = {
|
|
235
189
|
action: void 0,
|
|
236
190
|
isHidden: false,
|
|
237
191
|
isBusy: false
|
|
238
192
|
};
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
if (!c.cell.state.isHidden) {
|
|
246
|
-
allHidden = false;
|
|
247
|
-
break;
|
|
248
|
-
}
|
|
193
|
+
this.checkAllHidden = async () => {
|
|
194
|
+
let allHidden = true;
|
|
195
|
+
for (const c of this.props.group) {
|
|
196
|
+
if (!c.cell.state.isHidden) {
|
|
197
|
+
allHidden = false;
|
|
198
|
+
break;
|
|
249
199
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
_this.toggleVisible = function (e) {
|
|
200
|
+
}
|
|
201
|
+
if (allHidden)
|
|
202
|
+
this.setState({ isHidden: true });
|
|
203
|
+
};
|
|
204
|
+
this.toggleVisible = (e) => {
|
|
256
205
|
e.preventDefault();
|
|
257
206
|
e.currentTarget.blur();
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
if (
|
|
261
|
-
|
|
262
|
-
spState.alphafold.visibility[spState.activeSegment - 1] =
|
|
207
|
+
this.plugin.managers.structure.component.toggleVisibility(this.props.group);
|
|
208
|
+
this.setState({ isHidden: !this.state.isHidden });
|
|
209
|
+
if (this.props.type === 'alphafold') {
|
|
210
|
+
const spState = this.plugin.customState.superpositionState;
|
|
211
|
+
spState.alphafold.visibility[spState.activeSegment - 1] = this.state.isHidden;
|
|
263
212
|
}
|
|
264
213
|
};
|
|
265
|
-
|
|
266
|
-
|
|
214
|
+
this.toggleAction = () => this.setState({ action: this.state.action === 'action' ? void 0 : 'action' });
|
|
215
|
+
this.highlight = (e) => {
|
|
267
216
|
e.preventDefault();
|
|
268
|
-
if (!
|
|
217
|
+
if (!this.props.group[0].cell.parent)
|
|
269
218
|
return;
|
|
270
|
-
commands_1.PluginCommands.Interactivity.Object.Highlight(
|
|
219
|
+
commands_1.PluginCommands.Interactivity.Object.Highlight(this.plugin, { state: this.props.group[0].cell.parent, ref: this.props.group.map(c => c.cell.transform.ref) });
|
|
271
220
|
};
|
|
272
|
-
|
|
221
|
+
this.clearHighlight = (e) => {
|
|
273
222
|
e.preventDefault();
|
|
274
|
-
commands_1.PluginCommands.Interactivity.ClearHighlights(
|
|
223
|
+
commands_1.PluginCommands.Interactivity.ClearHighlights(this.plugin);
|
|
275
224
|
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
for (
|
|
279
|
-
var c = _a[_i];
|
|
225
|
+
this.focus = () => {
|
|
226
|
+
let allHidden = true;
|
|
227
|
+
for (const c of this.props.group) {
|
|
280
228
|
if (!c.cell.state.isHidden) {
|
|
281
229
|
allHidden = false;
|
|
282
230
|
break;
|
|
283
231
|
}
|
|
284
232
|
}
|
|
285
233
|
if (allHidden) {
|
|
286
|
-
|
|
234
|
+
this.plugin.managers.structure.hierarchy.toggleVisibility(this.props.group, 'show');
|
|
287
235
|
}
|
|
288
|
-
|
|
289
|
-
var _a;
|
|
236
|
+
this.plugin.managers.camera.focusSpheres(this.props.group, e => {
|
|
290
237
|
if (e.cell.state.isHidden)
|
|
291
238
|
return;
|
|
292
|
-
return
|
|
239
|
+
return e.cell.obj?.data.boundary.sphere;
|
|
293
240
|
});
|
|
294
241
|
};
|
|
295
|
-
return _this;
|
|
296
242
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
enumerable: false,
|
|
302
|
-
configurable: true
|
|
303
|
-
});
|
|
304
|
-
StructureComponentGroup.prototype.componentDidMount = function () {
|
|
305
|
-
var _this = this;
|
|
243
|
+
get pivot() {
|
|
244
|
+
return this.props.group[0];
|
|
245
|
+
}
|
|
246
|
+
componentDidMount() {
|
|
306
247
|
this.checkAllHidden();
|
|
307
|
-
this.subscribe(this.plugin.state.events.cell.stateUpdated,
|
|
308
|
-
var _a, _b;
|
|
248
|
+
this.subscribe(this.plugin.state.events.cell.stateUpdated, e => {
|
|
309
249
|
// if (State.ObjectEvent.isCell(e, this.pivot.cell)) this.forceUpdate();
|
|
310
|
-
if (
|
|
250
|
+
if (this.pivot.cell.obj?.label === e.cell.obj?.label) {
|
|
311
251
|
if (!e.cell.state.isHidden) {
|
|
312
|
-
|
|
252
|
+
this.setState({ isHidden: false });
|
|
313
253
|
}
|
|
314
254
|
else {
|
|
315
|
-
|
|
255
|
+
this.checkAllHidden();
|
|
316
256
|
}
|
|
317
257
|
}
|
|
318
258
|
});
|
|
319
|
-
this.subscribe(this.plugin.behaviors.state.isBusy,
|
|
320
|
-
|
|
259
|
+
this.subscribe(this.plugin.behaviors.state.isBusy, v => {
|
|
260
|
+
this.setState({ isBusy: v });
|
|
321
261
|
});
|
|
322
|
-
this.subscribe(this.plugin.customState.events.isBusy,
|
|
323
|
-
|
|
262
|
+
this.subscribe(this.plugin.customState.events.isBusy, (e) => {
|
|
263
|
+
this.setState({ isBusy: e });
|
|
324
264
|
});
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
tslib_1.__extends(StructureRepresentationEntry, _super);
|
|
339
|
-
function StructureRepresentationEntry() {
|
|
340
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
341
|
-
_this.state = {
|
|
265
|
+
}
|
|
266
|
+
render() {
|
|
267
|
+
const component = this.pivot;
|
|
268
|
+
const cell = component.cell;
|
|
269
|
+
const label = cell.obj?.label;
|
|
270
|
+
const labelEle = this.props.boldHeader ? (0, jsx_runtime_1.jsx)("strong", { children: label }) : label;
|
|
271
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [(0, jsx_runtime_1.jsx)(common_1.Button, { noOverflow: true, className: 'msp-control-button-label', title: `${label} - Click to focus.`, onClick: this.focus, style: { textAlign: 'left' }, disabled: this.state.isBusy, children: labelEle }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { disabled: this.state.isBusy, svg: this.state.isHidden ? icons_1.VisibilityOffOutlinedSvg : icons_1.VisibilityOutlinedSvg, toggleState: false, onClick: this.toggleVisible, title: `${this.state.isHidden ? 'Show' : 'Hide'} component`, small: true, className: 'msp-form-control', flex: true }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { disabled: this.state.isBusy, svg: icons_1.MoreHorizSvg, onClick: this.toggleAction, title: 'Actions', toggleState: this.state.action === 'action', className: 'msp-form-control', flex: true })] }), this.state.action === 'action' && (0, jsx_runtime_1.jsx)("div", { className: 'msp-accent-offset', children: (0, jsx_runtime_1.jsx)("div", { style: { marginBottom: '6px' }, children: component.representations.map(r => (0, jsx_runtime_1.jsx)(StructureRepresentationEntry, { group: this.props.group, representation: r }, r.cell.transform.ref)) }) })] });
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
class StructureRepresentationEntry extends base_1.PurePluginUIComponent {
|
|
275
|
+
constructor() {
|
|
276
|
+
super(...arguments);
|
|
277
|
+
this.state = {
|
|
342
278
|
isBusy: false,
|
|
343
279
|
clusterVal: { cluster: 'All' }
|
|
344
280
|
};
|
|
345
|
-
|
|
346
|
-
|
|
281
|
+
this.remove = () => this.plugin.managers.structure.component.removeRepresentations(this.props.group, this.props.representation);
|
|
282
|
+
this.toggleVisible = (e) => {
|
|
347
283
|
e.preventDefault();
|
|
348
284
|
e.currentTarget.blur();
|
|
349
|
-
|
|
285
|
+
this.plugin.managers.structure.component.toggleVisibility(this.props.group, this.props.representation);
|
|
350
286
|
};
|
|
351
|
-
|
|
352
|
-
return
|
|
287
|
+
this.update = (params) => {
|
|
288
|
+
return this.updateRepresentations(this.props.group, this.props.representation, params);
|
|
353
289
|
};
|
|
354
|
-
|
|
355
|
-
|
|
290
|
+
this.selectCluster = (params) => {
|
|
291
|
+
this.setState({ clusterVal: { cluster: params.cluster } });
|
|
356
292
|
};
|
|
357
|
-
return _this;
|
|
358
293
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
_this.forceUpdate();
|
|
294
|
+
componentDidMount() {
|
|
295
|
+
this.subscribe(this.plugin.state.events.cell.stateUpdated, e => {
|
|
296
|
+
if (mol_state_1.State.ObjectEvent.isCell(e, this.props.representation.cell))
|
|
297
|
+
this.forceUpdate();
|
|
364
298
|
});
|
|
365
|
-
this.subscribe(this.plugin.behaviors.state.isBusy,
|
|
366
|
-
|
|
299
|
+
this.subscribe(this.plugin.behaviors.state.isBusy, v => {
|
|
300
|
+
this.setState({ isBusy: v });
|
|
367
301
|
});
|
|
368
|
-
this.subscribe(this.plugin.customState.events.isBusy,
|
|
369
|
-
|
|
302
|
+
this.subscribe(this.plugin.customState.events.isBusy, (e) => {
|
|
303
|
+
this.setState({ isBusy: e });
|
|
370
304
|
});
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
var _a, _b, _c;
|
|
305
|
+
}
|
|
306
|
+
updateRepresentations(components, pivot, params) {
|
|
374
307
|
if (components.length === 0)
|
|
375
308
|
return Promise.resolve();
|
|
376
|
-
|
|
309
|
+
const index = components[0].representations.indexOf(pivot);
|
|
377
310
|
if (index < 0)
|
|
378
311
|
return Promise.resolve();
|
|
379
|
-
|
|
380
|
-
|
|
312
|
+
const superpositionState = this.plugin.customState.superpositionState;
|
|
313
|
+
let filteredComps = [];
|
|
381
314
|
if (this.state.clusterVal.cluster !== 'All') {
|
|
382
|
-
|
|
383
|
-
filteredComps = clusterData.map(
|
|
384
|
-
return
|
|
315
|
+
const clusterData = superpositionState.segmentData[superpositionState.activeSegment - 1].clusters[parseInt(this.state.clusterVal.cluster) - 1];
|
|
316
|
+
filteredComps = clusterData.map((s) => {
|
|
317
|
+
return `${s.pdb_id}_${s.struct_asym_id}`;
|
|
385
318
|
});
|
|
386
319
|
if (filteredComps.length === 0)
|
|
387
320
|
return;
|
|
388
321
|
}
|
|
389
|
-
|
|
390
|
-
for (
|
|
391
|
-
var c = components_1[_i];
|
|
322
|
+
const update = this.plugin.state.data.build();
|
|
323
|
+
for (const c of components) {
|
|
392
324
|
// TODO: is it ok to use just the index here? Could possible lead to ugly edge cases, but perhaps not worth the trouble to "fix".
|
|
393
|
-
|
|
325
|
+
const repr = c.representations[index];
|
|
394
326
|
if (!repr)
|
|
395
327
|
continue;
|
|
396
328
|
if (repr.cell.transform.transformer !== pivot.cell.transform.transformer)
|
|
397
329
|
continue;
|
|
398
330
|
if (this.state.clusterVal.cluster !== 'All') {
|
|
399
|
-
|
|
331
|
+
const rmIndex = filteredComps.indexOf(superpositionState.refMaps[repr.cell.transform.parent]);
|
|
400
332
|
if (rmIndex === -1)
|
|
401
333
|
continue;
|
|
402
334
|
}
|
|
403
|
-
|
|
404
|
-
type: params.type ? params.type :
|
|
405
|
-
colorTheme: params.colorTheme ? params.colorTheme :
|
|
406
|
-
sizeTheme: params.sizeTheme ? params.sizeTheme :
|
|
335
|
+
const updatedParams = {
|
|
336
|
+
type: params.type ? params.type : repr.cell.params?.values.type,
|
|
337
|
+
colorTheme: params.colorTheme ? params.colorTheme : repr.cell.params?.values.colorTheme,
|
|
338
|
+
sizeTheme: params.sizeTheme ? params.sizeTheme : repr.cell.params?.values.sizeTheme
|
|
407
339
|
};
|
|
408
340
|
update.to(repr.cell).update(updatedParams);
|
|
409
341
|
}
|
|
410
342
|
return update.commit({ canUndo: 'Update Representation' });
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
superpositionState.segmentData[superpositionState.activeSegment - 1].clusters.forEach(function (c, i) {
|
|
343
|
+
}
|
|
344
|
+
render() {
|
|
345
|
+
const repr = this.props.representation.cell;
|
|
346
|
+
const superpositionState = this.plugin.customState.superpositionState;
|
|
347
|
+
let clusterSelectArr = [['All', 'All']];
|
|
348
|
+
superpositionState.segmentData[superpositionState.activeSegment - 1].clusters.forEach((c, i) => {
|
|
418
349
|
clusterSelectArr.push([(i + 1) + '', (i + 1) + '']);
|
|
419
350
|
});
|
|
420
|
-
|
|
351
|
+
const clusterOptions = {
|
|
421
352
|
cluster: param_definition_1.ParamDefinition.Select('All', clusterSelectArr, { label: 'Select Cluster' })
|
|
422
353
|
};
|
|
423
|
-
|
|
424
|
-
|
|
354
|
+
let isSurrVisual = false;
|
|
355
|
+
let isAlphafold = false;
|
|
425
356
|
if (repr && repr.obj) {
|
|
426
|
-
|
|
357
|
+
const reprObj = repr.obj;
|
|
427
358
|
if (reprObj.tags && reprObj.tags.indexOf('superposition-focus-surr-repr') >= 0)
|
|
428
359
|
isSurrVisual = true;
|
|
429
360
|
if (reprObj.tags && reprObj.tags.indexOf('af-superposition-visual') >= 0)
|
|
430
361
|
isAlphafold = true;
|
|
431
362
|
}
|
|
432
|
-
return (0, jsx_runtime_1.jsx)("div",
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
}(base_1.PurePluginUIComponent));
|
|
363
|
+
return (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: repr.parent && (0, jsx_runtime_1.jsxs)("div", { children: [(clusterSelectArr.length > 2 && !isSurrVisual && !isAlphafold) && (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: clusterOptions, values: this.state.clusterVal, onChangeValues: this.selectCluster, isDisabled: this.state.isBusy }) }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: { type: repr.params?.definition.type }, values: { type: repr.params?.values.type }, onChangeValues: this.update, isDisabled: this.state.isBusy }) }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: { colorTheme: repr.params?.definition.colorTheme }, values: { colorTheme: repr.params?.values.colorTheme }, onChangeValues: this.update, isDisabled: this.state.isBusy }) }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: { sizeTheme: repr.params?.definition.sizeTheme }, values: { sizeTheme: repr.params?.values.sizeTheme }, onChangeValues: this.update, isDisabled: this.state.isBusy }) })] }) });
|
|
364
|
+
}
|
|
365
|
+
}
|