drugflow-molstar 0.2.1 → 0.2.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/LICENSE +201 -201
- package/README.md +15 -15
- package/build/{drugflow-molstar-component-0.2.1.js → drugflow-molstar-component-0.2.2.js} +4 -4
- package/build/drugflow-molstar-light.css +1 -1
- package/build/{drugflow-molstar-plugin-0.2.1.js → drugflow-molstar-plugin-0.2.2.js} +2 -2
- package/lib/alphafold-transparency.d.ts +6 -6
- package/lib/alphafold-transparency.js +153 -153
- package/lib/app/molstar/lib/apps/docking-viewer/index.html +37 -0
- package/lib/app/molstar/lib/apps/viewer/embedded.html +44 -0
- package/lib/app/molstar/lib/apps/viewer/favicon.ico +0 -0
- package/lib/app/molstar/lib/apps/viewer/index.html +110 -0
- package/lib/app/molstar/lib/examples/alpha-orbitals/index.html +73 -0
- package/lib/app/molstar/lib/examples/basic-wrapper/index.html +138 -0
- package/lib/app/molstar/lib/examples/lighting/index.html +89 -0
- package/lib/app/molstar/lib/examples/proteopedia-wrapper/index.html +237 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/base.scss +33 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/controls-base.scss +334 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/controls.scss +419 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/help.scss +27 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/line-graph.scss +68 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/log.scss +100 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/misc.scss +644 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/sequence.scss +126 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/slider.scss +166 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/tasks.scss +99 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/toast.scss +84 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/transformer.scss +164 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/components/viewport.scss +128 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/common.scss +72 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/controls-landscape.scss +90 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/controls-outside.scss +99 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout/controls-portrait.scss +109 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/layout.scss +41 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/logo.scss +13 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/normalize.scss +210 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/ui.scss +41 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/base/variables.scss +86 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/blue.scss +2 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/colors/blue.scss +24 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/colors/dark.scss +24 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/colors/light.scss +30 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/dark.scss +2 -0
- package/lib/app/molstar/lib/mol-plugin-ui/skin/light.scss +2 -0
- package/lib/custom-events.d.ts +4 -4
- package/lib/custom-events.js +56 -56
- package/lib/domain-annotations/behavior.d.ts +5 -5
- package/lib/domain-annotations/behavior.js +49 -49
- package/lib/domain-annotations/color.d.ts +10 -10
- package/lib/domain-annotations/color.js +78 -78
- package/lib/domain-annotations/prop.d.ts +35 -35
- package/lib/domain-annotations/prop.js +160 -160
- package/lib/drugflow-molstar-component-build-0.1.2.js +4268 -0
- package/lib/drugflow-molstar-component-build-0.1.2.js.LICENSE.txt +24 -0
- package/lib/drugflow-molstar-component-build-0.1.2.js.map +1 -0
- package/lib/drugflow-molstar-component-build-0.1.3.js +2 -0
- package/lib/drugflow-molstar-component-build-0.1.3.js.LICENSE.txt +24 -0
- package/lib/drugflow-molstar-component-build-0.1.4.js +2 -0
- package/lib/drugflow-molstar-component-build-0.1.4.js.LICENSE.txt +24 -0
- package/lib/drugflow-molstar-component-build-0.1.6.js +2 -0
- package/lib/drugflow-molstar-component-build-0.1.6.js.LICENSE.txt +24 -0
- package/lib/drugflow-molstar-component-build-0.2.2.js +2 -0
- package/lib/drugflow-molstar-component-build-0.2.2.js.LICENSE.txt +24 -0
- package/lib/helpers.d.ts +82 -81
- package/lib/helpers.js +278 -278
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1274 -1239
- package/lib/labels.d.ts +2 -2
- package/lib/labels.js +42 -42
- package/lib/loci-details.d.ts +27 -27
- package/lib/loci-details.js +128 -128
- package/lib/pdbe-molstar-component-build-3.1.2.js +2 -0
- package/lib/pdbe-molstar-component-build-3.1.2.js.LICENSE.txt +24 -0
- package/lib/sifts-mapping.d.ts +16 -16
- package/lib/sifts-mapping.js +83 -83
- package/lib/sifts-mappings-behaviour.d.ts +5 -5
- package/lib/sifts-mappings-behaviour.js +64 -64
- package/lib/spec.d.ts +76 -76
- package/lib/spec.js +105 -105
- package/lib/subscribe-events.d.ts +1 -1
- package/lib/subscribe-events.js +194 -194
- package/lib/superposition-export.d.ts +4 -4
- package/lib/superposition-export.js +152 -152
- package/lib/superposition-focus-representation.d.ts +16 -16
- package/lib/superposition-focus-representation.js +153 -153
- package/lib/superposition-sifts-mapping.d.ts +22 -22
- package/lib/superposition-sifts-mapping.js +159 -159
- package/lib/superposition.d.ts +18 -18
- package/lib/superposition.js +794 -794
- package/lib/ui/alphafold-superposition.d.ts +56 -56
- package/lib/ui/alphafold-superposition.js +178 -178
- package/lib/ui/alphafold-tranparency.d.ts +22 -22
- package/lib/ui/alphafold-tranparency.js +65 -65
- package/lib/ui/annotation-controls.d.ts +24 -24
- package/lib/ui/annotation-controls.js +166 -166
- package/lib/ui/export-superposition.d.ts +6 -6
- package/lib/ui/export-superposition.js +71 -71
- package/lib/ui/pdbe-left-panel.d.ts +18 -18
- package/lib/ui/pdbe-left-panel.js +167 -167
- package/lib/ui/pdbe-screenshot-controls.d.ts +20 -20
- package/lib/ui/pdbe-screenshot-controls.js +101 -101
- package/lib/ui/pdbe-structure-controls.d.ts +17 -17
- package/lib/ui/pdbe-structure-controls.js +70 -70
- package/lib/ui/pdbe-viewport-controls.d.ts +6 -6
- package/lib/ui/pdbe-viewport-controls.js +56 -56
- package/lib/ui/segment-tree.d.ts +18 -18
- package/lib/ui/segment-tree.js +804 -804
- package/lib/ui/superposition-components.d.ts +10 -10
- package/lib/ui/superposition-components.js +435 -435
- package/lib/ui/superposition-viewport.d.ts +5 -5
- package/lib/ui/superposition-viewport.js +23 -23
- package/package.json +79 -79
- /package/build/{drugflow-molstar-0.2.1.css → drugflow-molstar-0.2.2.css} +0 -0
- /package/build/{drugflow-molstar-plugin-0.2.1.js.LICENSE.txt → drugflow-molstar-plugin-0.2.2.js.LICENSE.txt} +0 -0
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SuperpositionModelExportUI = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var react_1 = require("react");
|
|
7
|
-
var base_1 = require("Molstar/mol-plugin-ui/base");
|
|
8
|
-
var common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
9
|
-
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
10
|
-
var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
|
|
11
|
-
var use_behavior_1 = require("Molstar/mol-plugin-ui/hooks/use-behavior");
|
|
12
|
-
var param_definition_1 = require("Molstar/mol-util/param-definition");
|
|
13
|
-
var superposition_export_1 = require("../superposition-export");
|
|
14
|
-
var SuperpositionModelExportUI = /** @class */ (function (_super) {
|
|
15
|
-
tslib_1.__extends(SuperpositionModelExportUI, _super);
|
|
16
|
-
function SuperpositionModelExportUI() {
|
|
17
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
18
|
-
}
|
|
19
|
-
SuperpositionModelExportUI.prototype.defaultState = function () {
|
|
20
|
-
return {
|
|
21
|
-
header: 'Export Models',
|
|
22
|
-
isCollapsed: true,
|
|
23
|
-
brand: { accent: 'cyan', svg: icons_1.GetAppSvg }
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
SuperpositionModelExportUI.prototype.renderControls = function () {
|
|
27
|
-
return (0, jsx_runtime_1.jsx)(SuperpositionExportControls, { plugin: this.plugin });
|
|
28
|
-
};
|
|
29
|
-
return SuperpositionModelExportUI;
|
|
30
|
-
}(base_1.CollapsableControls));
|
|
31
|
-
exports.SuperpositionModelExportUI = SuperpositionModelExportUI;
|
|
32
|
-
var Params = {
|
|
33
|
-
format: param_definition_1.ParamDefinition.Select('cif', [['cif', 'mmCIF'], ['bcif', 'Binary mmCIF']])
|
|
34
|
-
};
|
|
35
|
-
var DefaultParams = param_definition_1.ParamDefinition.getDefaultValues(Params);
|
|
36
|
-
function SuperpositionExportControls(_a) {
|
|
37
|
-
var _this = this;
|
|
38
|
-
var plugin = _a.plugin;
|
|
39
|
-
var _b = (0, react_1.useState)(DefaultParams), params = _b[0], setParams = _b[1];
|
|
40
|
-
var _c = (0, react_1.useState)(false), exporting = _c[0], setExporting = _c[1];
|
|
41
|
-
(0, use_behavior_1.useBehavior)(plugin.managers.structure.hierarchy.behaviors.selection); // triggers UI update
|
|
42
|
-
var isBusy = (0, use_behavior_1.useBehavior)(plugin.behaviors.state.isBusy);
|
|
43
|
-
var hierarchy = plugin.managers.structure.hierarchy.current;
|
|
44
|
-
var label = 'Nothing to Export';
|
|
45
|
-
if (hierarchy.structures.length === 1) {
|
|
46
|
-
label = 'Export';
|
|
47
|
-
}
|
|
48
|
-
if (hierarchy.structures.length > 1) {
|
|
49
|
-
label = 'Export (as ZIP)';
|
|
50
|
-
}
|
|
51
|
-
var onExport = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
52
|
-
return tslib_1.__generator(this, function (_a) {
|
|
53
|
-
switch (_a.label) {
|
|
54
|
-
case 0:
|
|
55
|
-
setExporting(true);
|
|
56
|
-
_a.label = 1;
|
|
57
|
-
case 1:
|
|
58
|
-
_a.trys.push([1, , 3, 4]);
|
|
59
|
-
return [4 /*yield*/, (0, superposition_export_1.superpositionExportHierarchy)(plugin, { format: params.format })];
|
|
60
|
-
case 2:
|
|
61
|
-
_a.sent();
|
|
62
|
-
return [3 /*break*/, 4];
|
|
63
|
-
case 3:
|
|
64
|
-
setExporting(false);
|
|
65
|
-
return [7 /*endfinally*/];
|
|
66
|
-
case 4: return [2 /*return*/];
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}); };
|
|
70
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: Params, values: params, onChangeValues: setParams, isDisabled: isBusy || exporting }), (0, jsx_runtime_1.jsx)(common_1.Button, tslib_1.__assign({ onClick: onExport, style: { marginTop: 1 }, disabled: isBusy || hierarchy.structures.length === 0 || exporting, commit: hierarchy.structures.length ? 'on' : 'off' }, { children: label }))] });
|
|
71
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SuperpositionModelExportUI = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("react");
|
|
7
|
+
var base_1 = require("Molstar/mol-plugin-ui/base");
|
|
8
|
+
var common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
9
|
+
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
10
|
+
var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
|
|
11
|
+
var use_behavior_1 = require("Molstar/mol-plugin-ui/hooks/use-behavior");
|
|
12
|
+
var param_definition_1 = require("Molstar/mol-util/param-definition");
|
|
13
|
+
var superposition_export_1 = require("../superposition-export");
|
|
14
|
+
var SuperpositionModelExportUI = /** @class */ (function (_super) {
|
|
15
|
+
tslib_1.__extends(SuperpositionModelExportUI, _super);
|
|
16
|
+
function SuperpositionModelExportUI() {
|
|
17
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
18
|
+
}
|
|
19
|
+
SuperpositionModelExportUI.prototype.defaultState = function () {
|
|
20
|
+
return {
|
|
21
|
+
header: 'Export Models',
|
|
22
|
+
isCollapsed: true,
|
|
23
|
+
brand: { accent: 'cyan', svg: icons_1.GetAppSvg }
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
SuperpositionModelExportUI.prototype.renderControls = function () {
|
|
27
|
+
return (0, jsx_runtime_1.jsx)(SuperpositionExportControls, { plugin: this.plugin });
|
|
28
|
+
};
|
|
29
|
+
return SuperpositionModelExportUI;
|
|
30
|
+
}(base_1.CollapsableControls));
|
|
31
|
+
exports.SuperpositionModelExportUI = SuperpositionModelExportUI;
|
|
32
|
+
var Params = {
|
|
33
|
+
format: param_definition_1.ParamDefinition.Select('cif', [['cif', 'mmCIF'], ['bcif', 'Binary mmCIF']])
|
|
34
|
+
};
|
|
35
|
+
var DefaultParams = param_definition_1.ParamDefinition.getDefaultValues(Params);
|
|
36
|
+
function SuperpositionExportControls(_a) {
|
|
37
|
+
var _this = this;
|
|
38
|
+
var plugin = _a.plugin;
|
|
39
|
+
var _b = (0, react_1.useState)(DefaultParams), params = _b[0], setParams = _b[1];
|
|
40
|
+
var _c = (0, react_1.useState)(false), exporting = _c[0], setExporting = _c[1];
|
|
41
|
+
(0, use_behavior_1.useBehavior)(plugin.managers.structure.hierarchy.behaviors.selection); // triggers UI update
|
|
42
|
+
var isBusy = (0, use_behavior_1.useBehavior)(plugin.behaviors.state.isBusy);
|
|
43
|
+
var hierarchy = plugin.managers.structure.hierarchy.current;
|
|
44
|
+
var label = 'Nothing to Export';
|
|
45
|
+
if (hierarchy.structures.length === 1) {
|
|
46
|
+
label = 'Export';
|
|
47
|
+
}
|
|
48
|
+
if (hierarchy.structures.length > 1) {
|
|
49
|
+
label = 'Export (as ZIP)';
|
|
50
|
+
}
|
|
51
|
+
var onExport = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
52
|
+
return tslib_1.__generator(this, function (_a) {
|
|
53
|
+
switch (_a.label) {
|
|
54
|
+
case 0:
|
|
55
|
+
setExporting(true);
|
|
56
|
+
_a.label = 1;
|
|
57
|
+
case 1:
|
|
58
|
+
_a.trys.push([1, , 3, 4]);
|
|
59
|
+
return [4 /*yield*/, (0, superposition_export_1.superpositionExportHierarchy)(plugin, { format: params.format })];
|
|
60
|
+
case 2:
|
|
61
|
+
_a.sent();
|
|
62
|
+
return [3 /*break*/, 4];
|
|
63
|
+
case 3:
|
|
64
|
+
setExporting(false);
|
|
65
|
+
return [7 /*endfinally*/];
|
|
66
|
+
case 4: return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}); };
|
|
70
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: Params, values: params, onChangeValues: setParams, isDisabled: isBusy || exporting }), (0, jsx_runtime_1.jsx)(common_1.Button, tslib_1.__assign({ onClick: onExport, style: { marginTop: 1 }, disabled: isBusy || hierarchy.structures.length === 0 || exporting, commit: hierarchy.structures.length ? 'on' : 'off' }, { children: label }))] });
|
|
71
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { PluginUIComponent } from 'Molstar/mol-plugin-ui/base';
|
|
3
|
-
export declare function WavesIconSvg(): JSX.Element;
|
|
4
|
-
declare type LeftPanelTabName = 'none' | 'root' | 'data' | 'states' | 'settings' | 'help' | 'segments';
|
|
5
|
-
export declare class LeftPanelControls extends PluginUIComponent<{}, {
|
|
6
|
-
tab: LeftPanelTabName;
|
|
7
|
-
}> {
|
|
8
|
-
state: {
|
|
9
|
-
tab: LeftPanelTabName;
|
|
10
|
-
};
|
|
11
|
-
componentDidMount(): void;
|
|
12
|
-
set: (tab: LeftPanelTabName) => void;
|
|
13
|
-
tabs: {
|
|
14
|
-
[K in LeftPanelTabName]: JSX.Element;
|
|
15
|
-
};
|
|
16
|
-
render(): JSX.Element;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PluginUIComponent } from 'Molstar/mol-plugin-ui/base';
|
|
3
|
+
export declare function WavesIconSvg(): JSX.Element;
|
|
4
|
+
declare type LeftPanelTabName = 'none' | 'root' | 'data' | 'states' | 'settings' | 'help' | 'segments';
|
|
5
|
+
export declare class LeftPanelControls extends PluginUIComponent<{}, {
|
|
6
|
+
tab: LeftPanelTabName;
|
|
7
|
+
}> {
|
|
8
|
+
state: {
|
|
9
|
+
tab: LeftPanelTabName;
|
|
10
|
+
};
|
|
11
|
+
componentDidMount(): void;
|
|
12
|
+
set: (tab: LeftPanelTabName) => void;
|
|
13
|
+
tabs: {
|
|
14
|
+
[K in LeftPanelTabName]: JSX.Element;
|
|
15
|
+
};
|
|
16
|
+
render(): JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -1,167 +1,167 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LeftPanelControls = exports.WavesIconSvg = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var canvas3d_1 = require("Molstar/mol-canvas3d/canvas3d");
|
|
7
|
-
var commands_1 = require("Molstar/mol-plugin/commands");
|
|
8
|
-
var mol_state_1 = require("Molstar/mol-state");
|
|
9
|
-
var base_1 = require("Molstar/mol-plugin-ui/base");
|
|
10
|
-
var common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
11
|
-
var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
|
|
12
|
-
var actions_1 = require("Molstar/mol-plugin-ui/state/actions");
|
|
13
|
-
var snapshots_1 = require("Molstar/mol-plugin-ui/state/snapshots");
|
|
14
|
-
var tree_1 = require("Molstar/mol-plugin-ui/state/tree");
|
|
15
|
-
var help_1 = require("Molstar/mol-plugin-ui/viewport/help");
|
|
16
|
-
var segment_tree_1 = require("./segment-tree");
|
|
17
|
-
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
18
|
-
var help_2 = require("Molstar/mol-plugin-ui/viewport/help");
|
|
19
|
-
var _WavesIcon = (0, jsx_runtime_1.jsx)("svg", tslib_1.__assign({ width: '24px', height: '24px', viewBox: '0 0 24 24' }, { children: (0, jsx_runtime_1.jsx)("path", { d: "M17 16.99c-1.35 0-2.2.42-2.95.8-.65.33-1.18.6-2.05.6-.9 0-1.4-.25-2.05-.6-.75-.38-1.57-.8-2.95-.8s-2.2.42-2.95.8c-.65.33-1.17.6-2.05.6v1.95c1.35 0 2.2-.42 2.95-.8.65-.33 1.17-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.42 2.95-.8c.65-.33 1.18-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8v-1.95c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8zm0-4.45c-1.35 0-2.2.43-2.95.8-.65.32-1.18.6-2.05.6-.9 0-1.4-.25-2.05-.6-.75-.38-1.57-.8-2.95-.8s-2.2.43-2.95.8c-.65.32-1.17.6-2.05.6v1.95c1.35 0 2.2-.43 2.95-.8.65-.35 1.15-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.43 2.95-.8c.65-.35 1.15-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.58.8 2.95.8v-1.95c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8zm2.95-8.08c-.75-.38-1.58-.8-2.95-.8s-2.2.42-2.95.8c-.65.32-1.18.6-2.05.6-.9 0-1.4-.25-2.05-.6-.75-.37-1.57-.8-2.95-.8s-2.2.42-2.95.8c-.65.33-1.17.6-2.05.6v1.93c1.35 0 2.2-.43 2.95-.8.65-.33 1.17-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.43 2.95-.8c.65-.32 1.18-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8V5.04c-.9 0-1.4-.25-2.05-.58zM17 8.09c-1.35 0-2.2.43-2.95.8-.65.35-1.15.6-2.05.6s-1.4-.25-2.05-.6c-.75-.38-1.57-.8-2.95-.8s-2.2.43-2.95.8c-.65.35-1.15.6-2.05.6v1.95c1.35 0 2.2-.43 2.95-.8.65-.32 1.18-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.43 2.95-.8c.65-.32 1.18-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8V9.49c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8z" }) }));
|
|
20
|
-
function WavesIconSvg() { return _WavesIcon; }
|
|
21
|
-
exports.WavesIconSvg = WavesIconSvg;
|
|
22
|
-
var LeftPanelControls = /** @class */ (function (_super) {
|
|
23
|
-
tslib_1.__extends(LeftPanelControls, _super);
|
|
24
|
-
function LeftPanelControls() {
|
|
25
|
-
var _this = this;
|
|
26
|
-
var _a;
|
|
27
|
-
_this = _super.apply(this, arguments) || this;
|
|
28
|
-
_this.state = { tab: _this.plugin.behaviors.layout.leftPanelTabName.value };
|
|
29
|
-
_this.set = function (tab) {
|
|
30
|
-
if (_this.state.tab === tab) {
|
|
31
|
-
_this.setState({ tab: 'none' }, function () { return _this.plugin.behaviors.layout.leftPanelTabName.next('none'); });
|
|
32
|
-
commands_1.PluginCommands.Layout.Update(_this.plugin, { state: { regionState: tslib_1.__assign(tslib_1.__assign({}, _this.plugin.layout.state.regionState), { left: 'collapsed' }) } });
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
_this.setState({ tab: tab }, function () { return _this.plugin.behaviors.layout.leftPanelTabName.next(tab); });
|
|
36
|
-
if (_this.plugin.layout.state.regionState.left !== 'full') {
|
|
37
|
-
commands_1.PluginCommands.Layout.Update(_this.plugin, { state: { regionState: tslib_1.__assign(tslib_1.__assign({}, _this.plugin.layout.state.regionState), { left: 'full' }) } });
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
_this.tabs = {
|
|
41
|
-
'none': (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}),
|
|
42
|
-
'root': (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.SectionHeader, { icon: icons_1.HomeOutlinedSvg, title: 'Home' }), (0, jsx_runtime_1.jsx)(actions_1.StateObjectActions, { state: _this.plugin.state.data, nodeRef: mol_state_1.StateTransform.RootRef, hideHeader: true, initiallyCollapsed: true, alwaysExpandFirst: true }), ((_a = _this.plugin.spec.components) === null || _a === void 0 ? void 0 : _a.remoteState) !== 'none' && (0, jsx_runtime_1.jsx)(snapshots_1.RemoteStateSnapshots, { listOnly: true })] }),
|
|
43
|
-
'data': (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.SectionHeader, { icon: icons_1.AccountTreeOutlinedSvg, title: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(RemoveAllButton, {}), " State Tree"] }) }), (0, jsx_runtime_1.jsx)(tree_1.StateTree, { state: _this.plugin.state.data })] }),
|
|
44
|
-
'segments': (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(segment_tree_1.SegmentTree, {}) }),
|
|
45
|
-
'states': (0, jsx_runtime_1.jsx)(snapshots_1.StateSnapshots, {}),
|
|
46
|
-
'settings': (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.SectionHeader, { icon: icons_1.TuneSvg, title: 'Plugin Settings' }), (0, jsx_runtime_1.jsx)(FullSettings, {})] }),
|
|
47
|
-
'help': (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.SectionHeader, { icon: icons_1.HelpOutlineSvg, title: 'Help' }), (0, jsx_runtime_1.jsx)(help_1.HelpContent, {}), (0, jsx_runtime_1.jsx)(SuperpositionHelpContent, {})] })
|
|
48
|
-
};
|
|
49
|
-
return _this;
|
|
50
|
-
}
|
|
51
|
-
LeftPanelControls.prototype.componentDidMount = function () {
|
|
52
|
-
var _this = this;
|
|
53
|
-
this.subscribe(this.plugin.behaviors.layout.leftPanelTabName, function (tab) {
|
|
54
|
-
if (_this.state.tab !== tab)
|
|
55
|
-
_this.setState({ tab: tab });
|
|
56
|
-
if (tab === 'none' && _this.plugin.layout.state.regionState.left !== 'collapsed') {
|
|
57
|
-
commands_1.PluginCommands.Layout.Update(_this.plugin, { state: { regionState: tslib_1.__assign(tslib_1.__assign({}, _this.plugin.layout.state.regionState), { left: 'collapsed' }) } });
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
this.subscribe(this.plugin.state.data.events.changed, function (_a) {
|
|
61
|
-
var state = _a.state;
|
|
62
|
-
if (_this.state.tab !== 'data')
|
|
63
|
-
return;
|
|
64
|
-
if (state.cells.size === 1)
|
|
65
|
-
_this.set('root');
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
LeftPanelControls.prototype.render = function () {
|
|
69
|
-
var _this = this;
|
|
70
|
-
var tab = this.state.tab;
|
|
71
|
-
var customState = this.plugin.customState;
|
|
72
|
-
return (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-left-panel-controls' }, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-left-panel-controls-buttons' }, { children: [(0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.HelpOutlineSvg, toggleState: tab === 'help', transparent: true, onClick: function () { return _this.set('help'); }, title: 'Help' }), customState && customState.initParams && customState.initParams.superposition && (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: WavesIconSvg, toggleState: tab === 'segments', transparent: true, onClick: function () { return _this.set('segments'); }, title: 'Superpose segments' }), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-left-panel-controls-buttons-bottom' }, { children: (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.TuneSvg, toggleState: tab === 'settings', transparent: true, onClick: function () { return _this.set('settings'); }, title: 'Settings' }) }))] })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-scrollable-container' }, { children: this.tabs[tab] }))] }));
|
|
73
|
-
};
|
|
74
|
-
return LeftPanelControls;
|
|
75
|
-
}(base_1.PluginUIComponent));
|
|
76
|
-
exports.LeftPanelControls = LeftPanelControls;
|
|
77
|
-
// class DataIcon extends PluginUIComponent<{ set: (tab: LeftPanelTabName) => void }, { changed: boolean }> {
|
|
78
|
-
// state = { changed: false };
|
|
79
|
-
// get tab() {
|
|
80
|
-
// return this.plugin.behaviors.layout.leftPanelTabName.value;
|
|
81
|
-
// }
|
|
82
|
-
// componentDidMount() {
|
|
83
|
-
// this.subscribe(this.plugin.behaviors.layout.leftPanelTabName, tab => {
|
|
84
|
-
// if (this.tab === 'data') this.setState({ changed: false });
|
|
85
|
-
// else this.forceUpdate();
|
|
86
|
-
// });
|
|
87
|
-
// this.subscribe(this.plugin.state.data.events.changed, state => {
|
|
88
|
-
// if (this.tab !== 'data') this.setState({ changed: true });
|
|
89
|
-
// });
|
|
90
|
-
// }
|
|
91
|
-
// render() {
|
|
92
|
-
// return <IconButton
|
|
93
|
-
// svg={AccountTreeOutlinedSvg} toggleState={this.tab === 'data'} transparent onClick={() => this.props.set('data')} title='State Tree'
|
|
94
|
-
// style={{ position: 'relative' }} extraContent={this.state.changed ? <div className='msp-left-panel-controls-button-data-dirty' /> : void 0} />;
|
|
95
|
-
// }
|
|
96
|
-
// }
|
|
97
|
-
var FullSettings = /** @class */ (function (_super) {
|
|
98
|
-
tslib_1.__extends(FullSettings, _super);
|
|
99
|
-
function FullSettings() {
|
|
100
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
101
|
-
_this.setSettings = function (p) {
|
|
102
|
-
var _a;
|
|
103
|
-
commands_1.PluginCommands.Canvas3D.SetSettings(_this.plugin, { settings: (_a = {}, _a[p.name] = p.value, _a) });
|
|
104
|
-
};
|
|
105
|
-
return _this;
|
|
106
|
-
}
|
|
107
|
-
FullSettings.prototype.componentDidMount = function () {
|
|
108
|
-
var _this = this;
|
|
109
|
-
this.subscribe(this.plugin.events.canvas3d.settingsUpdated, function () { return _this.forceUpdate(); });
|
|
110
|
-
this.subscribe(this.plugin.layout.events.updated, function () { return _this.forceUpdate(); });
|
|
111
|
-
this.subscribe(this.plugin.canvas3d.camera.stateChanged, function (state) {
|
|
112
|
-
if (state.radiusMax !== undefined || state.radius !== undefined) {
|
|
113
|
-
_this.forceUpdate();
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
FullSettings.prototype.render = function () {
|
|
118
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: this.plugin.canvas3d && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.SectionHeader, { title: 'Viewport' }), (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: canvas3d_1.Canvas3DParams, values: this.plugin.canvas3d.props, onChange: this.setSettings })] }) });
|
|
119
|
-
};
|
|
120
|
-
return FullSettings;
|
|
121
|
-
}(base_1.PluginUIComponent));
|
|
122
|
-
var RemoveAllButton = /** @class */ (function (_super) {
|
|
123
|
-
tslib_1.__extends(RemoveAllButton, _super);
|
|
124
|
-
function RemoveAllButton() {
|
|
125
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
126
|
-
_this.remove = function (e) {
|
|
127
|
-
e.preventDefault();
|
|
128
|
-
commands_1.PluginCommands.State.RemoveObject(_this.plugin, { state: _this.plugin.state.data, ref: mol_state_1.StateTransform.RootRef });
|
|
129
|
-
};
|
|
130
|
-
return _this;
|
|
131
|
-
}
|
|
132
|
-
RemoveAllButton.prototype.componentDidMount = function () {
|
|
133
|
-
var _this = this;
|
|
134
|
-
this.subscribe(this.plugin.state.events.cell.created, function (e) {
|
|
135
|
-
if (e.cell.transform.parent === mol_state_1.StateTransform.RootRef)
|
|
136
|
-
_this.forceUpdate();
|
|
137
|
-
});
|
|
138
|
-
this.subscribe(this.plugin.state.events.cell.removed, function (e) {
|
|
139
|
-
if (e.parent === mol_state_1.StateTransform.RootRef)
|
|
140
|
-
_this.forceUpdate();
|
|
141
|
-
});
|
|
142
|
-
};
|
|
143
|
-
RemoveAllButton.prototype.render = function () {
|
|
144
|
-
var count = this.plugin.state.data.tree.children.get(mol_state_1.StateTransform.RootRef).size;
|
|
145
|
-
if (count === 0)
|
|
146
|
-
return null;
|
|
147
|
-
return (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.DeleteOutlinedSvg, onClick: this.remove, title: 'Remove All', style: { display: 'inline-block' }, small: true, className: 'msp-no-hover-outline', transparent: true });
|
|
148
|
-
};
|
|
149
|
-
return RemoveAllButton;
|
|
150
|
-
}(base_1.PluginUIComponent));
|
|
151
|
-
function HelpSection(props) {
|
|
152
|
-
return (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-simple-help-section' }, { children: props.header }));
|
|
153
|
-
}
|
|
154
|
-
var SuperpositionHelpContent = /** @class */ (function (_super) {
|
|
155
|
-
tslib_1.__extends(SuperpositionHelpContent, _super);
|
|
156
|
-
function SuperpositionHelpContent() {
|
|
157
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
158
|
-
}
|
|
159
|
-
SuperpositionHelpContent.prototype.componentDidMount = function () {
|
|
160
|
-
var _this = this;
|
|
161
|
-
this.subscribe(this.plugin.events.canvas3d.settingsUpdated, function () { return _this.forceUpdate(); });
|
|
162
|
-
};
|
|
163
|
-
SuperpositionHelpContent.prototype.render = function () {
|
|
164
|
-
return (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(HelpSection, { header: 'Superposition' }), (0, jsx_runtime_1.jsx)(help_2.HelpGroup, tslib_1.__assign({ header: 'Segment' }, { children: (0, jsx_runtime_1.jsx)(help_2.HelpText, { children: (0, jsx_runtime_1.jsx)("p", { children: "Discrete UniProt sequence range mapped to the structure" }) }) })), (0, jsx_runtime_1.jsx)(help_2.HelpGroup, tslib_1.__assign({ header: 'Cluster' }, { children: (0, jsx_runtime_1.jsx)(help_2.HelpText, { children: (0, jsx_runtime_1.jsx)("p", { children: "Structural chains that possess significantly close superposition Q-score" }) }) })), (0, jsx_runtime_1.jsx)(help_2.HelpGroup, tslib_1.__assign({ header: 'Representative chain' }, { children: (0, jsx_runtime_1.jsx)(help_2.HelpText, { children: (0, jsx_runtime_1.jsx)("p", { children: "The best-ranked chain within a cluster chosen based on the model quality, resolution, observed residues ratio and UniProt sequence coverage" }) }) }))] });
|
|
165
|
-
};
|
|
166
|
-
return SuperpositionHelpContent;
|
|
167
|
-
}(base_1.PluginUIComponent));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LeftPanelControls = exports.WavesIconSvg = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var canvas3d_1 = require("Molstar/mol-canvas3d/canvas3d");
|
|
7
|
+
var commands_1 = require("Molstar/mol-plugin/commands");
|
|
8
|
+
var mol_state_1 = require("Molstar/mol-state");
|
|
9
|
+
var base_1 = require("Molstar/mol-plugin-ui/base");
|
|
10
|
+
var common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
11
|
+
var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
|
|
12
|
+
var actions_1 = require("Molstar/mol-plugin-ui/state/actions");
|
|
13
|
+
var snapshots_1 = require("Molstar/mol-plugin-ui/state/snapshots");
|
|
14
|
+
var tree_1 = require("Molstar/mol-plugin-ui/state/tree");
|
|
15
|
+
var help_1 = require("Molstar/mol-plugin-ui/viewport/help");
|
|
16
|
+
var segment_tree_1 = require("./segment-tree");
|
|
17
|
+
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
18
|
+
var help_2 = require("Molstar/mol-plugin-ui/viewport/help");
|
|
19
|
+
var _WavesIcon = (0, jsx_runtime_1.jsx)("svg", tslib_1.__assign({ width: '24px', height: '24px', viewBox: '0 0 24 24' }, { children: (0, jsx_runtime_1.jsx)("path", { d: "M17 16.99c-1.35 0-2.2.42-2.95.8-.65.33-1.18.6-2.05.6-.9 0-1.4-.25-2.05-.6-.75-.38-1.57-.8-2.95-.8s-2.2.42-2.95.8c-.65.33-1.17.6-2.05.6v1.95c1.35 0 2.2-.42 2.95-.8.65-.33 1.17-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.42 2.95-.8c.65-.33 1.18-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8v-1.95c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8zm0-4.45c-1.35 0-2.2.43-2.95.8-.65.32-1.18.6-2.05.6-.9 0-1.4-.25-2.05-.6-.75-.38-1.57-.8-2.95-.8s-2.2.43-2.95.8c-.65.32-1.17.6-2.05.6v1.95c1.35 0 2.2-.43 2.95-.8.65-.35 1.15-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.43 2.95-.8c.65-.35 1.15-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.58.8 2.95.8v-1.95c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8zm2.95-8.08c-.75-.38-1.58-.8-2.95-.8s-2.2.42-2.95.8c-.65.32-1.18.6-2.05.6-.9 0-1.4-.25-2.05-.6-.75-.37-1.57-.8-2.95-.8s-2.2.42-2.95.8c-.65.33-1.17.6-2.05.6v1.93c1.35 0 2.2-.43 2.95-.8.65-.33 1.17-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.43 2.95-.8c.65-.32 1.18-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8V5.04c-.9 0-1.4-.25-2.05-.58zM17 8.09c-1.35 0-2.2.43-2.95.8-.65.35-1.15.6-2.05.6s-1.4-.25-2.05-.6c-.75-.38-1.57-.8-2.95-.8s-2.2.43-2.95.8c-.65.35-1.15.6-2.05.6v1.95c1.35 0 2.2-.43 2.95-.8.65-.32 1.18-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.43 2.95-.8c.65-.32 1.18-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8V9.49c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8z" }) }));
|
|
20
|
+
function WavesIconSvg() { return _WavesIcon; }
|
|
21
|
+
exports.WavesIconSvg = WavesIconSvg;
|
|
22
|
+
var LeftPanelControls = /** @class */ (function (_super) {
|
|
23
|
+
tslib_1.__extends(LeftPanelControls, _super);
|
|
24
|
+
function LeftPanelControls() {
|
|
25
|
+
var _this = this;
|
|
26
|
+
var _a;
|
|
27
|
+
_this = _super.apply(this, arguments) || this;
|
|
28
|
+
_this.state = { tab: _this.plugin.behaviors.layout.leftPanelTabName.value };
|
|
29
|
+
_this.set = function (tab) {
|
|
30
|
+
if (_this.state.tab === tab) {
|
|
31
|
+
_this.setState({ tab: 'none' }, function () { return _this.plugin.behaviors.layout.leftPanelTabName.next('none'); });
|
|
32
|
+
commands_1.PluginCommands.Layout.Update(_this.plugin, { state: { regionState: tslib_1.__assign(tslib_1.__assign({}, _this.plugin.layout.state.regionState), { left: 'collapsed' }) } });
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
_this.setState({ tab: tab }, function () { return _this.plugin.behaviors.layout.leftPanelTabName.next(tab); });
|
|
36
|
+
if (_this.plugin.layout.state.regionState.left !== 'full') {
|
|
37
|
+
commands_1.PluginCommands.Layout.Update(_this.plugin, { state: { regionState: tslib_1.__assign(tslib_1.__assign({}, _this.plugin.layout.state.regionState), { left: 'full' }) } });
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
_this.tabs = {
|
|
41
|
+
'none': (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}),
|
|
42
|
+
'root': (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.SectionHeader, { icon: icons_1.HomeOutlinedSvg, title: 'Home' }), (0, jsx_runtime_1.jsx)(actions_1.StateObjectActions, { state: _this.plugin.state.data, nodeRef: mol_state_1.StateTransform.RootRef, hideHeader: true, initiallyCollapsed: true, alwaysExpandFirst: true }), ((_a = _this.plugin.spec.components) === null || _a === void 0 ? void 0 : _a.remoteState) !== 'none' && (0, jsx_runtime_1.jsx)(snapshots_1.RemoteStateSnapshots, { listOnly: true })] }),
|
|
43
|
+
'data': (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.SectionHeader, { icon: icons_1.AccountTreeOutlinedSvg, title: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(RemoveAllButton, {}), " State Tree"] }) }), (0, jsx_runtime_1.jsx)(tree_1.StateTree, { state: _this.plugin.state.data })] }),
|
|
44
|
+
'segments': (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(segment_tree_1.SegmentTree, {}) }),
|
|
45
|
+
'states': (0, jsx_runtime_1.jsx)(snapshots_1.StateSnapshots, {}),
|
|
46
|
+
'settings': (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.SectionHeader, { icon: icons_1.TuneSvg, title: 'Plugin Settings' }), (0, jsx_runtime_1.jsx)(FullSettings, {})] }),
|
|
47
|
+
'help': (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.SectionHeader, { icon: icons_1.HelpOutlineSvg, title: 'Help' }), (0, jsx_runtime_1.jsx)(help_1.HelpContent, {}), (0, jsx_runtime_1.jsx)(SuperpositionHelpContent, {})] })
|
|
48
|
+
};
|
|
49
|
+
return _this;
|
|
50
|
+
}
|
|
51
|
+
LeftPanelControls.prototype.componentDidMount = function () {
|
|
52
|
+
var _this = this;
|
|
53
|
+
this.subscribe(this.plugin.behaviors.layout.leftPanelTabName, function (tab) {
|
|
54
|
+
if (_this.state.tab !== tab)
|
|
55
|
+
_this.setState({ tab: tab });
|
|
56
|
+
if (tab === 'none' && _this.plugin.layout.state.regionState.left !== 'collapsed') {
|
|
57
|
+
commands_1.PluginCommands.Layout.Update(_this.plugin, { state: { regionState: tslib_1.__assign(tslib_1.__assign({}, _this.plugin.layout.state.regionState), { left: 'collapsed' }) } });
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
this.subscribe(this.plugin.state.data.events.changed, function (_a) {
|
|
61
|
+
var state = _a.state;
|
|
62
|
+
if (_this.state.tab !== 'data')
|
|
63
|
+
return;
|
|
64
|
+
if (state.cells.size === 1)
|
|
65
|
+
_this.set('root');
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
LeftPanelControls.prototype.render = function () {
|
|
69
|
+
var _this = this;
|
|
70
|
+
var tab = this.state.tab;
|
|
71
|
+
var customState = this.plugin.customState;
|
|
72
|
+
return (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-left-panel-controls' }, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-left-panel-controls-buttons' }, { children: [(0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.HelpOutlineSvg, toggleState: tab === 'help', transparent: true, onClick: function () { return _this.set('help'); }, title: 'Help' }), customState && customState.initParams && customState.initParams.superposition && (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: WavesIconSvg, toggleState: tab === 'segments', transparent: true, onClick: function () { return _this.set('segments'); }, title: 'Superpose segments' }), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-left-panel-controls-buttons-bottom' }, { children: (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.TuneSvg, toggleState: tab === 'settings', transparent: true, onClick: function () { return _this.set('settings'); }, title: 'Settings' }) }))] })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-scrollable-container' }, { children: this.tabs[tab] }))] }));
|
|
73
|
+
};
|
|
74
|
+
return LeftPanelControls;
|
|
75
|
+
}(base_1.PluginUIComponent));
|
|
76
|
+
exports.LeftPanelControls = LeftPanelControls;
|
|
77
|
+
// class DataIcon extends PluginUIComponent<{ set: (tab: LeftPanelTabName) => void }, { changed: boolean }> {
|
|
78
|
+
// state = { changed: false };
|
|
79
|
+
// get tab() {
|
|
80
|
+
// return this.plugin.behaviors.layout.leftPanelTabName.value;
|
|
81
|
+
// }
|
|
82
|
+
// componentDidMount() {
|
|
83
|
+
// this.subscribe(this.plugin.behaviors.layout.leftPanelTabName, tab => {
|
|
84
|
+
// if (this.tab === 'data') this.setState({ changed: false });
|
|
85
|
+
// else this.forceUpdate();
|
|
86
|
+
// });
|
|
87
|
+
// this.subscribe(this.plugin.state.data.events.changed, state => {
|
|
88
|
+
// if (this.tab !== 'data') this.setState({ changed: true });
|
|
89
|
+
// });
|
|
90
|
+
// }
|
|
91
|
+
// render() {
|
|
92
|
+
// return <IconButton
|
|
93
|
+
// svg={AccountTreeOutlinedSvg} toggleState={this.tab === 'data'} transparent onClick={() => this.props.set('data')} title='State Tree'
|
|
94
|
+
// style={{ position: 'relative' }} extraContent={this.state.changed ? <div className='msp-left-panel-controls-button-data-dirty' /> : void 0} />;
|
|
95
|
+
// }
|
|
96
|
+
// }
|
|
97
|
+
var FullSettings = /** @class */ (function (_super) {
|
|
98
|
+
tslib_1.__extends(FullSettings, _super);
|
|
99
|
+
function FullSettings() {
|
|
100
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
101
|
+
_this.setSettings = function (p) {
|
|
102
|
+
var _a;
|
|
103
|
+
commands_1.PluginCommands.Canvas3D.SetSettings(_this.plugin, { settings: (_a = {}, _a[p.name] = p.value, _a) });
|
|
104
|
+
};
|
|
105
|
+
return _this;
|
|
106
|
+
}
|
|
107
|
+
FullSettings.prototype.componentDidMount = function () {
|
|
108
|
+
var _this = this;
|
|
109
|
+
this.subscribe(this.plugin.events.canvas3d.settingsUpdated, function () { return _this.forceUpdate(); });
|
|
110
|
+
this.subscribe(this.plugin.layout.events.updated, function () { return _this.forceUpdate(); });
|
|
111
|
+
this.subscribe(this.plugin.canvas3d.camera.stateChanged, function (state) {
|
|
112
|
+
if (state.radiusMax !== undefined || state.radius !== undefined) {
|
|
113
|
+
_this.forceUpdate();
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
FullSettings.prototype.render = function () {
|
|
118
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: this.plugin.canvas3d && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.SectionHeader, { title: 'Viewport' }), (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: canvas3d_1.Canvas3DParams, values: this.plugin.canvas3d.props, onChange: this.setSettings })] }) });
|
|
119
|
+
};
|
|
120
|
+
return FullSettings;
|
|
121
|
+
}(base_1.PluginUIComponent));
|
|
122
|
+
var RemoveAllButton = /** @class */ (function (_super) {
|
|
123
|
+
tslib_1.__extends(RemoveAllButton, _super);
|
|
124
|
+
function RemoveAllButton() {
|
|
125
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
126
|
+
_this.remove = function (e) {
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
commands_1.PluginCommands.State.RemoveObject(_this.plugin, { state: _this.plugin.state.data, ref: mol_state_1.StateTransform.RootRef });
|
|
129
|
+
};
|
|
130
|
+
return _this;
|
|
131
|
+
}
|
|
132
|
+
RemoveAllButton.prototype.componentDidMount = function () {
|
|
133
|
+
var _this = this;
|
|
134
|
+
this.subscribe(this.plugin.state.events.cell.created, function (e) {
|
|
135
|
+
if (e.cell.transform.parent === mol_state_1.StateTransform.RootRef)
|
|
136
|
+
_this.forceUpdate();
|
|
137
|
+
});
|
|
138
|
+
this.subscribe(this.plugin.state.events.cell.removed, function (e) {
|
|
139
|
+
if (e.parent === mol_state_1.StateTransform.RootRef)
|
|
140
|
+
_this.forceUpdate();
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
RemoveAllButton.prototype.render = function () {
|
|
144
|
+
var count = this.plugin.state.data.tree.children.get(mol_state_1.StateTransform.RootRef).size;
|
|
145
|
+
if (count === 0)
|
|
146
|
+
return null;
|
|
147
|
+
return (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.DeleteOutlinedSvg, onClick: this.remove, title: 'Remove All', style: { display: 'inline-block' }, small: true, className: 'msp-no-hover-outline', transparent: true });
|
|
148
|
+
};
|
|
149
|
+
return RemoveAllButton;
|
|
150
|
+
}(base_1.PluginUIComponent));
|
|
151
|
+
function HelpSection(props) {
|
|
152
|
+
return (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-simple-help-section' }, { children: props.header }));
|
|
153
|
+
}
|
|
154
|
+
var SuperpositionHelpContent = /** @class */ (function (_super) {
|
|
155
|
+
tslib_1.__extends(SuperpositionHelpContent, _super);
|
|
156
|
+
function SuperpositionHelpContent() {
|
|
157
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
158
|
+
}
|
|
159
|
+
SuperpositionHelpContent.prototype.componentDidMount = function () {
|
|
160
|
+
var _this = this;
|
|
161
|
+
this.subscribe(this.plugin.events.canvas3d.settingsUpdated, function () { return _this.forceUpdate(); });
|
|
162
|
+
};
|
|
163
|
+
SuperpositionHelpContent.prototype.render = function () {
|
|
164
|
+
return (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(HelpSection, { header: 'Superposition' }), (0, jsx_runtime_1.jsx)(help_2.HelpGroup, tslib_1.__assign({ header: 'Segment' }, { children: (0, jsx_runtime_1.jsx)(help_2.HelpText, { children: (0, jsx_runtime_1.jsx)("p", { children: "Discrete UniProt sequence range mapped to the structure" }) }) })), (0, jsx_runtime_1.jsx)(help_2.HelpGroup, tslib_1.__assign({ header: 'Cluster' }, { children: (0, jsx_runtime_1.jsx)(help_2.HelpText, { children: (0, jsx_runtime_1.jsx)("p", { children: "Structural chains that possess significantly close superposition Q-score" }) }) })), (0, jsx_runtime_1.jsx)(help_2.HelpGroup, tslib_1.__assign({ header: 'Representative chain' }, { children: (0, jsx_runtime_1.jsx)(help_2.HelpText, { children: (0, jsx_runtime_1.jsx)("p", { children: "The best-ranked chain within a cluster chosen based on the model quality, resolution, observed residues ratio and UniProt sequence coverage" }) }) }))] });
|
|
165
|
+
};
|
|
166
|
+
return SuperpositionHelpContent;
|
|
167
|
+
}(base_1.PluginUIComponent));
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { PluginUIComponent } from 'Molstar/mol-plugin-ui/base';
|
|
3
|
-
interface ImageControlsState {
|
|
4
|
-
showPreview: boolean;
|
|
5
|
-
isDisabled: boolean;
|
|
6
|
-
imageData?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class DownloadScreenshotControls extends PluginUIComponent<{
|
|
9
|
-
close: () => void;
|
|
10
|
-
}, ImageControlsState> {
|
|
11
|
-
state: ImageControlsState;
|
|
12
|
-
private download;
|
|
13
|
-
private copy;
|
|
14
|
-
private copyImg;
|
|
15
|
-
componentDidMount(): void;
|
|
16
|
-
componentWillUnmount(): void;
|
|
17
|
-
open: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
-
render(): JSX.Element;
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PluginUIComponent } from 'Molstar/mol-plugin-ui/base';
|
|
3
|
+
interface ImageControlsState {
|
|
4
|
+
showPreview: boolean;
|
|
5
|
+
isDisabled: boolean;
|
|
6
|
+
imageData?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class DownloadScreenshotControls extends PluginUIComponent<{
|
|
9
|
+
close: () => void;
|
|
10
|
+
}, ImageControlsState> {
|
|
11
|
+
state: ImageControlsState;
|
|
12
|
+
private download;
|
|
13
|
+
private copy;
|
|
14
|
+
private copyImg;
|
|
15
|
+
componentDidMount(): void;
|
|
16
|
+
componentWillUnmount(): void;
|
|
17
|
+
open: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
+
render(): JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export {};
|