drugflow-molstar 0.2.0 → 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.2.js +25 -0
- package/build/drugflow-molstar-light.css +1 -1
- package/build/{drugflow-molstar-plugin-0.2.0.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.0.css → drugflow-molstar-0.2.2.css} +0 -0
- /package/build/{drugflow-molstar-plugin-0.2.0.js.LICENSE.txt → drugflow-molstar-plugin-0.2.2.js.LICENSE.txt} +0 -0
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DownloadScreenshotControls = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
|
|
7
|
-
var base_1 = require("Molstar/mol-plugin-ui/base");
|
|
8
|
-
var screenshot_1 = require("Molstar/mol-plugin-ui/controls/screenshot");
|
|
9
|
-
var common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
10
|
-
var commands_1 = require("Molstar/mol-plugin/commands");
|
|
11
|
-
var use_behavior_1 = require("Molstar/mol-plugin-ui/hooks/use-behavior");
|
|
12
|
-
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
13
|
-
var DownloadScreenshotControls = /** @class */ (function (_super) {
|
|
14
|
-
tslib_1.__extends(DownloadScreenshotControls, _super);
|
|
15
|
-
function DownloadScreenshotControls() {
|
|
16
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
17
|
-
_this.state = {
|
|
18
|
-
showPreview: true,
|
|
19
|
-
isDisabled: false
|
|
20
|
-
};
|
|
21
|
-
_this.download = function () {
|
|
22
|
-
var _a;
|
|
23
|
-
(_a = _this.plugin.helpers.viewportScreenshot) === null || _a === void 0 ? void 0 : _a.download();
|
|
24
|
-
_this.props.close();
|
|
25
|
-
};
|
|
26
|
-
_this.copy = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
27
|
-
var _a;
|
|
28
|
-
var _b;
|
|
29
|
-
return tslib_1.__generator(this, function (_c) {
|
|
30
|
-
switch (_c.label) {
|
|
31
|
-
case 0:
|
|
32
|
-
_c.trys.push([0, 2, , 3]);
|
|
33
|
-
return [4 /*yield*/, ((_b = this.plugin.helpers.viewportScreenshot) === null || _b === void 0 ? void 0 : _b.copyToClipboard())];
|
|
34
|
-
case 1:
|
|
35
|
-
_c.sent();
|
|
36
|
-
commands_1.PluginCommands.Toast.Show(this.plugin, {
|
|
37
|
-
message: 'Copied to clipboard.',
|
|
38
|
-
title: 'Screenshot',
|
|
39
|
-
timeoutMs: 1500
|
|
40
|
-
});
|
|
41
|
-
return [3 /*break*/, 3];
|
|
42
|
-
case 2:
|
|
43
|
-
_a = _c.sent();
|
|
44
|
-
return [2 /*return*/, this.copyImg()];
|
|
45
|
-
case 3: return [2 /*return*/];
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}); };
|
|
49
|
-
_this.copyImg = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
50
|
-
var src;
|
|
51
|
-
var _a;
|
|
52
|
-
return tslib_1.__generator(this, function (_b) {
|
|
53
|
-
switch (_b.label) {
|
|
54
|
-
case 0: return [4 /*yield*/, ((_a = this.plugin.helpers.viewportScreenshot) === null || _a === void 0 ? void 0 : _a.getImageDataUri())];
|
|
55
|
-
case 1:
|
|
56
|
-
src = _b.sent();
|
|
57
|
-
this.setState({ imageData: src });
|
|
58
|
-
return [2 /*return*/];
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}); };
|
|
62
|
-
_this.open = function (e) {
|
|
63
|
-
if (!e.target.files || !e.target.files[0])
|
|
64
|
-
return;
|
|
65
|
-
commands_1.PluginCommands.State.Snapshots.OpenFile(_this.plugin, { file: e.target.files[0] });
|
|
66
|
-
};
|
|
67
|
-
return _this;
|
|
68
|
-
}
|
|
69
|
-
DownloadScreenshotControls.prototype.componentDidMount = function () {
|
|
70
|
-
var _this = this;
|
|
71
|
-
this.subscribe(this.plugin.state.data.behaviors.isUpdating, function (v) {
|
|
72
|
-
_this.setState({ isDisabled: v });
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
DownloadScreenshotControls.prototype.componentWillUnmount = function () {
|
|
76
|
-
this.setState({ imageData: void 0 });
|
|
77
|
-
};
|
|
78
|
-
DownloadScreenshotControls.prototype.render = function () {
|
|
79
|
-
var _this = this;
|
|
80
|
-
var _a;
|
|
81
|
-
var hasClipboardApi = !!((_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.write);
|
|
82
|
-
return (0, jsx_runtime_1.jsxs)("div", { children: [this.state.showPreview && (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-image-preview' }, { children: [(0, jsx_runtime_1.jsx)(screenshot_1.ScreenshotPreview, { plugin: this.plugin }), (0, jsx_runtime_1.jsx)(CropControls, { plugin: this.plugin })] })), (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-flex-row' }, { children: [!this.state.imageData && (0, jsx_runtime_1.jsx)(common_1.Button, tslib_1.__assign({ icon: icons_1.CopySvg, onClick: hasClipboardApi ? this.copy : this.copyImg, disabled: this.state.isDisabled }, { children: "Copy" })), this.state.imageData && (0, jsx_runtime_1.jsx)(common_1.Button, tslib_1.__assign({ onClick: function () { return _this.setState({ imageData: void 0 }); }, disabled: this.state.isDisabled }, { children: "Clear" })), (0, jsx_runtime_1.jsx)(common_1.Button, tslib_1.__assign({ icon: icons_1.GetAppSvg, onClick: this.download, disabled: this.state.isDisabled }, { children: "Download" }))] })), this.state.imageData && (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-row msp-copy-image-wrapper' }, { children: [(0, jsx_runtime_1.jsx)("div", { children: "Right click below + Copy Image" }), (0, jsx_runtime_1.jsx)("img", { src: this.state.imageData, style: { width: '100%', height: 32, display: 'block' } })] })), (0, jsx_runtime_1.jsx)(ScreenshotParams, { plugin: this.plugin, isDisabled: this.state.isDisabled })] });
|
|
83
|
-
};
|
|
84
|
-
return DownloadScreenshotControls;
|
|
85
|
-
}(base_1.PluginUIComponent));
|
|
86
|
-
exports.DownloadScreenshotControls = DownloadScreenshotControls;
|
|
87
|
-
function ScreenshotParams(_a) {
|
|
88
|
-
var plugin = _a.plugin, isDisabled = _a.isDisabled;
|
|
89
|
-
var helper = plugin.helpers.viewportScreenshot;
|
|
90
|
-
var values = (0, use_behavior_1.useBehavior)(helper.behaviors.values);
|
|
91
|
-
return (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: helper.params, values: values, onChangeValues: function (v) { return helper.behaviors.values.next(v); }, isDisabled: isDisabled });
|
|
92
|
-
}
|
|
93
|
-
function CropControls(_a) {
|
|
94
|
-
var plugin = _a.plugin;
|
|
95
|
-
var helper = plugin.helpers.viewportScreenshot;
|
|
96
|
-
var cropParams = (0, use_behavior_1.useBehavior)(helper === null || helper === void 0 ? void 0 : helper.behaviors.cropParams);
|
|
97
|
-
(0, use_behavior_1.useBehavior)(helper === null || helper === void 0 ? void 0 : helper.behaviors.relativeCrop);
|
|
98
|
-
if (!helper)
|
|
99
|
-
return null;
|
|
100
|
-
return (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ style: { width: '100%', height: '24px', marginTop: '8px' } }, { children: [(0, jsx_runtime_1.jsx)(common_1.ToggleButton, { icon: icons_1.CropOrginalSvg, title: 'Auto-crop', inline: true, isSelected: cropParams.auto, style: { background: 'transparent', float: 'left', width: 'auto', height: '24px', lineHeight: '24px' }, toggle: function () { return helper.toggleAutocrop(); }, label: 'Auto-crop ' + (cropParams.auto ? 'On' : 'Off') }), !cropParams.auto && (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CropSvg, title: 'Crop', style: { background: 'transparent', float: 'right', height: '24px', lineHeight: '24px', width: '24px', padding: '0' }, onClick: function () { return helper.autocrop(); } }), !cropParams.auto && !helper.isFullFrame && (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CropFreeSvg, title: 'Reset Crop', style: { background: 'transparent', float: 'right', height: '24px', lineHeight: '24px', width: '24px', padding: '0' }, onClick: function () { return helper.resetCrop(); } })] }));
|
|
101
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DownloadScreenshotControls = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
|
|
7
|
+
var base_1 = require("Molstar/mol-plugin-ui/base");
|
|
8
|
+
var screenshot_1 = require("Molstar/mol-plugin-ui/controls/screenshot");
|
|
9
|
+
var common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
10
|
+
var commands_1 = require("Molstar/mol-plugin/commands");
|
|
11
|
+
var use_behavior_1 = require("Molstar/mol-plugin-ui/hooks/use-behavior");
|
|
12
|
+
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
13
|
+
var DownloadScreenshotControls = /** @class */ (function (_super) {
|
|
14
|
+
tslib_1.__extends(DownloadScreenshotControls, _super);
|
|
15
|
+
function DownloadScreenshotControls() {
|
|
16
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
17
|
+
_this.state = {
|
|
18
|
+
showPreview: true,
|
|
19
|
+
isDisabled: false
|
|
20
|
+
};
|
|
21
|
+
_this.download = function () {
|
|
22
|
+
var _a;
|
|
23
|
+
(_a = _this.plugin.helpers.viewportScreenshot) === null || _a === void 0 ? void 0 : _a.download();
|
|
24
|
+
_this.props.close();
|
|
25
|
+
};
|
|
26
|
+
_this.copy = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
27
|
+
var _a;
|
|
28
|
+
var _b;
|
|
29
|
+
return tslib_1.__generator(this, function (_c) {
|
|
30
|
+
switch (_c.label) {
|
|
31
|
+
case 0:
|
|
32
|
+
_c.trys.push([0, 2, , 3]);
|
|
33
|
+
return [4 /*yield*/, ((_b = this.plugin.helpers.viewportScreenshot) === null || _b === void 0 ? void 0 : _b.copyToClipboard())];
|
|
34
|
+
case 1:
|
|
35
|
+
_c.sent();
|
|
36
|
+
commands_1.PluginCommands.Toast.Show(this.plugin, {
|
|
37
|
+
message: 'Copied to clipboard.',
|
|
38
|
+
title: 'Screenshot',
|
|
39
|
+
timeoutMs: 1500
|
|
40
|
+
});
|
|
41
|
+
return [3 /*break*/, 3];
|
|
42
|
+
case 2:
|
|
43
|
+
_a = _c.sent();
|
|
44
|
+
return [2 /*return*/, this.copyImg()];
|
|
45
|
+
case 3: return [2 /*return*/];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}); };
|
|
49
|
+
_this.copyImg = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
50
|
+
var src;
|
|
51
|
+
var _a;
|
|
52
|
+
return tslib_1.__generator(this, function (_b) {
|
|
53
|
+
switch (_b.label) {
|
|
54
|
+
case 0: return [4 /*yield*/, ((_a = this.plugin.helpers.viewportScreenshot) === null || _a === void 0 ? void 0 : _a.getImageDataUri())];
|
|
55
|
+
case 1:
|
|
56
|
+
src = _b.sent();
|
|
57
|
+
this.setState({ imageData: src });
|
|
58
|
+
return [2 /*return*/];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}); };
|
|
62
|
+
_this.open = function (e) {
|
|
63
|
+
if (!e.target.files || !e.target.files[0])
|
|
64
|
+
return;
|
|
65
|
+
commands_1.PluginCommands.State.Snapshots.OpenFile(_this.plugin, { file: e.target.files[0] });
|
|
66
|
+
};
|
|
67
|
+
return _this;
|
|
68
|
+
}
|
|
69
|
+
DownloadScreenshotControls.prototype.componentDidMount = function () {
|
|
70
|
+
var _this = this;
|
|
71
|
+
this.subscribe(this.plugin.state.data.behaviors.isUpdating, function (v) {
|
|
72
|
+
_this.setState({ isDisabled: v });
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
DownloadScreenshotControls.prototype.componentWillUnmount = function () {
|
|
76
|
+
this.setState({ imageData: void 0 });
|
|
77
|
+
};
|
|
78
|
+
DownloadScreenshotControls.prototype.render = function () {
|
|
79
|
+
var _this = this;
|
|
80
|
+
var _a;
|
|
81
|
+
var hasClipboardApi = !!((_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.write);
|
|
82
|
+
return (0, jsx_runtime_1.jsxs)("div", { children: [this.state.showPreview && (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-image-preview' }, { children: [(0, jsx_runtime_1.jsx)(screenshot_1.ScreenshotPreview, { plugin: this.plugin }), (0, jsx_runtime_1.jsx)(CropControls, { plugin: this.plugin })] })), (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-flex-row' }, { children: [!this.state.imageData && (0, jsx_runtime_1.jsx)(common_1.Button, tslib_1.__assign({ icon: icons_1.CopySvg, onClick: hasClipboardApi ? this.copy : this.copyImg, disabled: this.state.isDisabled }, { children: "Copy" })), this.state.imageData && (0, jsx_runtime_1.jsx)(common_1.Button, tslib_1.__assign({ onClick: function () { return _this.setState({ imageData: void 0 }); }, disabled: this.state.isDisabled }, { children: "Clear" })), (0, jsx_runtime_1.jsx)(common_1.Button, tslib_1.__assign({ icon: icons_1.GetAppSvg, onClick: this.download, disabled: this.state.isDisabled }, { children: "Download" }))] })), this.state.imageData && (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-row msp-copy-image-wrapper' }, { children: [(0, jsx_runtime_1.jsx)("div", { children: "Right click below + Copy Image" }), (0, jsx_runtime_1.jsx)("img", { src: this.state.imageData, style: { width: '100%', height: 32, display: 'block' } })] })), (0, jsx_runtime_1.jsx)(ScreenshotParams, { plugin: this.plugin, isDisabled: this.state.isDisabled })] });
|
|
83
|
+
};
|
|
84
|
+
return DownloadScreenshotControls;
|
|
85
|
+
}(base_1.PluginUIComponent));
|
|
86
|
+
exports.DownloadScreenshotControls = DownloadScreenshotControls;
|
|
87
|
+
function ScreenshotParams(_a) {
|
|
88
|
+
var plugin = _a.plugin, isDisabled = _a.isDisabled;
|
|
89
|
+
var helper = plugin.helpers.viewportScreenshot;
|
|
90
|
+
var values = (0, use_behavior_1.useBehavior)(helper.behaviors.values);
|
|
91
|
+
return (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: helper.params, values: values, onChangeValues: function (v) { return helper.behaviors.values.next(v); }, isDisabled: isDisabled });
|
|
92
|
+
}
|
|
93
|
+
function CropControls(_a) {
|
|
94
|
+
var plugin = _a.plugin;
|
|
95
|
+
var helper = plugin.helpers.viewportScreenshot;
|
|
96
|
+
var cropParams = (0, use_behavior_1.useBehavior)(helper === null || helper === void 0 ? void 0 : helper.behaviors.cropParams);
|
|
97
|
+
(0, use_behavior_1.useBehavior)(helper === null || helper === void 0 ? void 0 : helper.behaviors.relativeCrop);
|
|
98
|
+
if (!helper)
|
|
99
|
+
return null;
|
|
100
|
+
return (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ style: { width: '100%', height: '24px', marginTop: '8px' } }, { children: [(0, jsx_runtime_1.jsx)(common_1.ToggleButton, { icon: icons_1.CropOrginalSvg, title: 'Auto-crop', inline: true, isSelected: cropParams.auto, style: { background: 'transparent', float: 'left', width: 'auto', height: '24px', lineHeight: '24px' }, toggle: function () { return helper.toggleAutocrop(); }, label: 'Auto-crop ' + (cropParams.auto ? 'On' : 'Off') }), !cropParams.auto && (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CropSvg, title: 'Crop', style: { background: 'transparent', float: 'right', height: '24px', lineHeight: '24px', width: '24px', padding: '0' }, onClick: function () { return helper.autocrop(); } }), !cropParams.auto && !helper.isFullFrame && (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CropFreeSvg, title: 'Reset Crop', style: { background: 'transparent', float: 'right', height: '24px', lineHeight: '24px', width: '24px', padding: '0' }, onClick: function () { return helper.resetCrop(); } })] }));
|
|
101
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { PluginUIComponent } from 'Molstar/mol-plugin-ui/base';
|
|
3
|
-
export declare class PDBeStructureTools extends PluginUIComponent {
|
|
4
|
-
render(): JSX.Element;
|
|
5
|
-
}
|
|
6
|
-
export declare class CustomStructureControls extends PluginUIComponent<{
|
|
7
|
-
initiallyCollapsed?: boolean;
|
|
8
|
-
}> {
|
|
9
|
-
componentDidMount(): void;
|
|
10
|
-
render(): JSX.Element | null;
|
|
11
|
-
}
|
|
12
|
-
export declare class PDBeLigandViewStructureTools extends PluginUIComponent {
|
|
13
|
-
render(): JSX.Element;
|
|
14
|
-
}
|
|
15
|
-
export declare class PDBeSuperpositionStructureTools extends PluginUIComponent {
|
|
16
|
-
render(): JSX.Element;
|
|
17
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PluginUIComponent } from 'Molstar/mol-plugin-ui/base';
|
|
3
|
+
export declare class PDBeStructureTools extends PluginUIComponent {
|
|
4
|
+
render(): JSX.Element;
|
|
5
|
+
}
|
|
6
|
+
export declare class CustomStructureControls extends PluginUIComponent<{
|
|
7
|
+
initiallyCollapsed?: boolean;
|
|
8
|
+
}> {
|
|
9
|
+
componentDidMount(): void;
|
|
10
|
+
render(): JSX.Element | null;
|
|
11
|
+
}
|
|
12
|
+
export declare class PDBeLigandViewStructureTools extends PluginUIComponent {
|
|
13
|
+
render(): JSX.Element;
|
|
14
|
+
}
|
|
15
|
+
export declare class PDBeSuperpositionStructureTools extends PluginUIComponent {
|
|
16
|
+
render(): JSX.Element;
|
|
17
|
+
}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PDBeSuperpositionStructureTools = exports.PDBeLigandViewStructureTools = exports.CustomStructureControls = exports.PDBeStructureTools = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var base_1 = require("Molstar/mol-plugin-ui/base");
|
|
7
|
-
var components_1 = require("Molstar/mol-plugin-ui/structure/components");
|
|
8
|
-
var measurements_1 = require("Molstar/mol-plugin-ui/structure/measurements");
|
|
9
|
-
var source_1 = require("Molstar/mol-plugin-ui/structure/source");
|
|
10
|
-
var volume_1 = require("Molstar/mol-plugin-ui/structure/volume");
|
|
11
|
-
var annotation_controls_1 = require("./annotation-controls");
|
|
12
|
-
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
13
|
-
var superposition_components_1 = require("./superposition-components");
|
|
14
|
-
var quick_styles_1 = require("Molstar/mol-plugin-ui/structure/quick-styles");
|
|
15
|
-
var alphafold_superposition_1 = require("./alphafold-superposition");
|
|
16
|
-
var export_superposition_1 = require("./export-superposition");
|
|
17
|
-
var alphafold_tranparency_1 = require("./alphafold-tranparency");
|
|
18
|
-
var PDBeStructureTools = /** @class */ (function (_super) {
|
|
19
|
-
tslib_1.__extends(PDBeStructureTools, _super);
|
|
20
|
-
function PDBeStructureTools() {
|
|
21
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
-
}
|
|
23
|
-
PDBeStructureTools.prototype.render = function () {
|
|
24
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-section-header' }, { children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: icons_1.BuildSvg }), "Structure Tools"] })), (0, jsx_runtime_1.jsx)(source_1.StructureSourceControls, {}), (0, jsx_runtime_1.jsx)(annotation_controls_1.AnnotationsComponentControls, {}), (0, jsx_runtime_1.jsx)(quick_styles_1.StructureQuickStylesControls, {}), (0, jsx_runtime_1.jsx)(components_1.StructureComponentControls, {}), (0, jsx_runtime_1.jsx)(volume_1.VolumeStreamingControls, {}), (0, jsx_runtime_1.jsx)(volume_1.VolumeSourceControls, {}), (0, jsx_runtime_1.jsx)(measurements_1.StructureMeasurementsControls, {}), (0, jsx_runtime_1.jsx)(CustomStructureControls, {})] });
|
|
25
|
-
};
|
|
26
|
-
return PDBeStructureTools;
|
|
27
|
-
}(base_1.PluginUIComponent));
|
|
28
|
-
exports.PDBeStructureTools = PDBeStructureTools;
|
|
29
|
-
var CustomStructureControls = /** @class */ (function (_super) {
|
|
30
|
-
tslib_1.__extends(CustomStructureControls, _super);
|
|
31
|
-
function CustomStructureControls() {
|
|
32
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
33
|
-
}
|
|
34
|
-
CustomStructureControls.prototype.componentDidMount = function () {
|
|
35
|
-
var _this = this;
|
|
36
|
-
this.subscribe(this.plugin.state.behaviors.events.changed, function () { return _this.forceUpdate(); });
|
|
37
|
-
};
|
|
38
|
-
CustomStructureControls.prototype.render = function () {
|
|
39
|
-
var _this = this;
|
|
40
|
-
var controls = [];
|
|
41
|
-
this.plugin.customStructureControls.forEach(function (Controls, key) {
|
|
42
|
-
controls.push((0, jsx_runtime_1.jsx)(Controls, { initiallyCollapsed: _this.props.initiallyCollapsed }, key));
|
|
43
|
-
});
|
|
44
|
-
return controls.length > 0 ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: controls }) : null;
|
|
45
|
-
};
|
|
46
|
-
return CustomStructureControls;
|
|
47
|
-
}(base_1.PluginUIComponent));
|
|
48
|
-
exports.CustomStructureControls = CustomStructureControls;
|
|
49
|
-
var PDBeLigandViewStructureTools = /** @class */ (function (_super) {
|
|
50
|
-
tslib_1.__extends(PDBeLigandViewStructureTools, _super);
|
|
51
|
-
function PDBeLigandViewStructureTools() {
|
|
52
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
53
|
-
}
|
|
54
|
-
PDBeLigandViewStructureTools.prototype.render = function () {
|
|
55
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-section-header' }, { children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: icons_1.BuildSvg }), "Structure Tools"] })), (0, jsx_runtime_1.jsx)(components_1.StructureComponentControls, {}), (0, jsx_runtime_1.jsx)(volume_1.VolumeStreamingControls, {}), (0, jsx_runtime_1.jsx)(measurements_1.StructureMeasurementsControls, {}), (0, jsx_runtime_1.jsx)(CustomStructureControls, {})] });
|
|
56
|
-
};
|
|
57
|
-
return PDBeLigandViewStructureTools;
|
|
58
|
-
}(base_1.PluginUIComponent));
|
|
59
|
-
exports.PDBeLigandViewStructureTools = PDBeLigandViewStructureTools;
|
|
60
|
-
var PDBeSuperpositionStructureTools = /** @class */ (function (_super) {
|
|
61
|
-
tslib_1.__extends(PDBeSuperpositionStructureTools, _super);
|
|
62
|
-
function PDBeSuperpositionStructureTools() {
|
|
63
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
64
|
-
}
|
|
65
|
-
PDBeSuperpositionStructureTools.prototype.render = function () {
|
|
66
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-section-header' }, { children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: icons_1.BuildSvg }), "Structure Tools"] })), (0, jsx_runtime_1.jsx)(superposition_components_1.SuperpositionComponentControls, {}), (0, jsx_runtime_1.jsx)(alphafold_tranparency_1.AlphafoldTransparencyControls, {}), (0, jsx_runtime_1.jsx)(alphafold_superposition_1.AlphafoldPaeControls, {}), (0, jsx_runtime_1.jsx)(alphafold_superposition_1.AlphafoldSuperpositionControls, {}), (0, jsx_runtime_1.jsx)(measurements_1.StructureMeasurementsControls, {}), (0, jsx_runtime_1.jsx)(export_superposition_1.SuperpositionModelExportUI, {}), (0, jsx_runtime_1.jsx)(CustomStructureControls, {})] });
|
|
67
|
-
};
|
|
68
|
-
return PDBeSuperpositionStructureTools;
|
|
69
|
-
}(base_1.PluginUIComponent));
|
|
70
|
-
exports.PDBeSuperpositionStructureTools = PDBeSuperpositionStructureTools;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PDBeSuperpositionStructureTools = exports.PDBeLigandViewStructureTools = exports.CustomStructureControls = exports.PDBeStructureTools = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var base_1 = require("Molstar/mol-plugin-ui/base");
|
|
7
|
+
var components_1 = require("Molstar/mol-plugin-ui/structure/components");
|
|
8
|
+
var measurements_1 = require("Molstar/mol-plugin-ui/structure/measurements");
|
|
9
|
+
var source_1 = require("Molstar/mol-plugin-ui/structure/source");
|
|
10
|
+
var volume_1 = require("Molstar/mol-plugin-ui/structure/volume");
|
|
11
|
+
var annotation_controls_1 = require("./annotation-controls");
|
|
12
|
+
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
13
|
+
var superposition_components_1 = require("./superposition-components");
|
|
14
|
+
var quick_styles_1 = require("Molstar/mol-plugin-ui/structure/quick-styles");
|
|
15
|
+
var alphafold_superposition_1 = require("./alphafold-superposition");
|
|
16
|
+
var export_superposition_1 = require("./export-superposition");
|
|
17
|
+
var alphafold_tranparency_1 = require("./alphafold-tranparency");
|
|
18
|
+
var PDBeStructureTools = /** @class */ (function (_super) {
|
|
19
|
+
tslib_1.__extends(PDBeStructureTools, _super);
|
|
20
|
+
function PDBeStructureTools() {
|
|
21
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
+
}
|
|
23
|
+
PDBeStructureTools.prototype.render = function () {
|
|
24
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-section-header' }, { children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: icons_1.BuildSvg }), "Structure Tools"] })), (0, jsx_runtime_1.jsx)(source_1.StructureSourceControls, {}), (0, jsx_runtime_1.jsx)(annotation_controls_1.AnnotationsComponentControls, {}), (0, jsx_runtime_1.jsx)(quick_styles_1.StructureQuickStylesControls, {}), (0, jsx_runtime_1.jsx)(components_1.StructureComponentControls, {}), (0, jsx_runtime_1.jsx)(volume_1.VolumeStreamingControls, {}), (0, jsx_runtime_1.jsx)(volume_1.VolumeSourceControls, {}), (0, jsx_runtime_1.jsx)(measurements_1.StructureMeasurementsControls, {}), (0, jsx_runtime_1.jsx)(CustomStructureControls, {})] });
|
|
25
|
+
};
|
|
26
|
+
return PDBeStructureTools;
|
|
27
|
+
}(base_1.PluginUIComponent));
|
|
28
|
+
exports.PDBeStructureTools = PDBeStructureTools;
|
|
29
|
+
var CustomStructureControls = /** @class */ (function (_super) {
|
|
30
|
+
tslib_1.__extends(CustomStructureControls, _super);
|
|
31
|
+
function CustomStructureControls() {
|
|
32
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
33
|
+
}
|
|
34
|
+
CustomStructureControls.prototype.componentDidMount = function () {
|
|
35
|
+
var _this = this;
|
|
36
|
+
this.subscribe(this.plugin.state.behaviors.events.changed, function () { return _this.forceUpdate(); });
|
|
37
|
+
};
|
|
38
|
+
CustomStructureControls.prototype.render = function () {
|
|
39
|
+
var _this = this;
|
|
40
|
+
var controls = [];
|
|
41
|
+
this.plugin.customStructureControls.forEach(function (Controls, key) {
|
|
42
|
+
controls.push((0, jsx_runtime_1.jsx)(Controls, { initiallyCollapsed: _this.props.initiallyCollapsed }, key));
|
|
43
|
+
});
|
|
44
|
+
return controls.length > 0 ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: controls }) : null;
|
|
45
|
+
};
|
|
46
|
+
return CustomStructureControls;
|
|
47
|
+
}(base_1.PluginUIComponent));
|
|
48
|
+
exports.CustomStructureControls = CustomStructureControls;
|
|
49
|
+
var PDBeLigandViewStructureTools = /** @class */ (function (_super) {
|
|
50
|
+
tslib_1.__extends(PDBeLigandViewStructureTools, _super);
|
|
51
|
+
function PDBeLigandViewStructureTools() {
|
|
52
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
53
|
+
}
|
|
54
|
+
PDBeLigandViewStructureTools.prototype.render = function () {
|
|
55
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-section-header' }, { children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: icons_1.BuildSvg }), "Structure Tools"] })), (0, jsx_runtime_1.jsx)(components_1.StructureComponentControls, {}), (0, jsx_runtime_1.jsx)(volume_1.VolumeStreamingControls, {}), (0, jsx_runtime_1.jsx)(measurements_1.StructureMeasurementsControls, {}), (0, jsx_runtime_1.jsx)(CustomStructureControls, {})] });
|
|
56
|
+
};
|
|
57
|
+
return PDBeLigandViewStructureTools;
|
|
58
|
+
}(base_1.PluginUIComponent));
|
|
59
|
+
exports.PDBeLigandViewStructureTools = PDBeLigandViewStructureTools;
|
|
60
|
+
var PDBeSuperpositionStructureTools = /** @class */ (function (_super) {
|
|
61
|
+
tslib_1.__extends(PDBeSuperpositionStructureTools, _super);
|
|
62
|
+
function PDBeSuperpositionStructureTools() {
|
|
63
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
64
|
+
}
|
|
65
|
+
PDBeSuperpositionStructureTools.prototype.render = function () {
|
|
66
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-section-header' }, { children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: icons_1.BuildSvg }), "Structure Tools"] })), (0, jsx_runtime_1.jsx)(superposition_components_1.SuperpositionComponentControls, {}), (0, jsx_runtime_1.jsx)(alphafold_tranparency_1.AlphafoldTransparencyControls, {}), (0, jsx_runtime_1.jsx)(alphafold_superposition_1.AlphafoldPaeControls, {}), (0, jsx_runtime_1.jsx)(alphafold_superposition_1.AlphafoldSuperpositionControls, {}), (0, jsx_runtime_1.jsx)(measurements_1.StructureMeasurementsControls, {}), (0, jsx_runtime_1.jsx)(export_superposition_1.SuperpositionModelExportUI, {}), (0, jsx_runtime_1.jsx)(CustomStructureControls, {})] });
|
|
67
|
+
};
|
|
68
|
+
return PDBeSuperpositionStructureTools;
|
|
69
|
+
}(base_1.PluginUIComponent));
|
|
70
|
+
exports.PDBeSuperpositionStructureTools = PDBeSuperpositionStructureTools;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ViewportControls } from 'Molstar/mol-plugin-ui/viewport';
|
|
3
|
-
export declare class PDBeViewportControls extends ViewportControls {
|
|
4
|
-
isBlack(customeState: any): boolean;
|
|
5
|
-
render(): JSX.Element;
|
|
6
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ViewportControls } from 'Molstar/mol-plugin-ui/viewport';
|
|
3
|
+
export declare class PDBeViewportControls extends ViewportControls {
|
|
4
|
+
isBlack(customeState: any): boolean;
|
|
5
|
+
render(): JSX.Element;
|
|
6
|
+
}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PDBeViewportControls = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
var config_1 = require("Molstar/mol-plugin/config");
|
|
7
|
-
var common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
8
|
-
var selection_1 = require("Molstar/mol-plugin-ui/structure/selection");
|
|
9
|
-
var pdbe_screenshot_controls_1 = require("./pdbe-screenshot-controls");
|
|
10
|
-
var simple_settings_1 = require("Molstar/mol-plugin-ui/viewport/simple-settings");
|
|
11
|
-
var viewport_1 = require("Molstar/mol-plugin-ui/viewport");
|
|
12
|
-
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
13
|
-
var PDBeViewportControls = /** @class */ (function (_super) {
|
|
14
|
-
tslib_1.__extends(PDBeViewportControls, _super);
|
|
15
|
-
function PDBeViewportControls() {
|
|
16
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
17
|
-
}
|
|
18
|
-
PDBeViewportControls.prototype.isBlack = function (customeState) {
|
|
19
|
-
if (customeState && customeState.initParams && customeState.initParams.bgColor) {
|
|
20
|
-
var color = customeState.initParams.bgColor;
|
|
21
|
-
if (color.r === 0 && color.g === 0 && color.b === 0)
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
return false;
|
|
25
|
-
};
|
|
26
|
-
PDBeViewportControls.prototype.render = function () {
|
|
27
|
-
var customeState = this.plugin.customState;
|
|
28
|
-
var showPDBeLink = false;
|
|
29
|
-
var showControlToggle = true;
|
|
30
|
-
var showControlInfo = true;
|
|
31
|
-
if (customeState && customeState.initParams && customeState.initParams.moleculeId && customeState.initParams.pdbeLink)
|
|
32
|
-
showPDBeLink = true;
|
|
33
|
-
if (customeState && customeState.initParams && customeState.initParams.superposition)
|
|
34
|
-
showPDBeLink = false;
|
|
35
|
-
if (customeState && customeState.initParams && customeState.initParams.hideCanvasControls && customeState.initParams.hideCanvasControls.indexOf('controlToggle') > -1)
|
|
36
|
-
showControlToggle = false;
|
|
37
|
-
if (customeState && customeState.initParams && customeState.initParams.hideCanvasControls && customeState.initParams.hideCanvasControls.indexOf('controlInfo') > -1)
|
|
38
|
-
showControlInfo = false;
|
|
39
|
-
var bgColor = this.isBlack(customeState) ? '#fff' : '#555';
|
|
40
|
-
var pdbeLink = {
|
|
41
|
-
parentStyle: { width: 'auto' },
|
|
42
|
-
bgStyle: { position: 'absolute', height: '27px', width: '54px', marginLeft: '-33px' },
|
|
43
|
-
containerStyle: { position: 'absolute', right: '10px', top: '10px', padding: '3px 3px 3px 18px' },
|
|
44
|
-
style: { display: 'inline-block', fontSize: '14px', color: bgColor, borderBottom: 'none', cursor: 'pointer', textDecoration: 'none', position: 'absolute', right: '5px' },
|
|
45
|
-
pdbeImg: {
|
|
46
|
-
src: 'https://www.ebi.ac.uk/pdbe/entry/static/images/logos/PDBe/logo_T_64.png',
|
|
47
|
-
alt: 'PDBe logo',
|
|
48
|
-
style: { height: '12px', width: '12px', border: 0, position: 'absolute', margin: '4px 0 0 -13px' }
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
var vwpBtnsTopMargin = { marginTop: '30px' };
|
|
52
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showPDBeLink && (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-viewport-controls-buttons', style: pdbeLink.containerStyle }, { children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-semi-transparent-background', style: pdbeLink.bgStyle }), (0, jsx_runtime_1.jsxs)("a", tslib_1.__assign({ className: 'msp-pdbe-link', style: pdbeLink.style, target: "_blank", href: "https://pdbe.org/".concat(customeState.initParams.moleculeId) }, { children: [(0, jsx_runtime_1.jsx)("img", { src: pdbeLink.pdbeImg.src, alt: pdbeLink.pdbeImg.alt, style: pdbeLink.pdbeImg.style }), customeState.initParams.moleculeId] }))] })), (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-viewport-controls', onMouseMove: this.onMouseMove, style: showPDBeLink ? vwpBtnsTopMargin : void 0 }, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-viewport-controls-buttons' }, { children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-semi-transparent-background' }), this.icon(icons_1.AutorenewSvg, this.resetCamera, 'Reset Camera')] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-semi-transparent-background' }), this.icon(icons_1.CameraOutlinedSvg, this.toggleScreenshotExpanded, 'Screenshot / State Snapshot', this.state.isScreenshotExpanded)] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-semi-transparent-background' }), showControlToggle && this.icon(icons_1.BuildOutlinedSvg, this.toggleControls, 'Toggle Controls Panel', this.plugin.layout.state.showControls), this.plugin.config.get(config_1.PluginConfig.Viewport.ShowExpand) && this.icon(icons_1.FullscreenSvg, this.toggleExpanded, 'Toggle Expanded Viewport', this.plugin.layout.state.isExpanded), showControlInfo && this.icon(icons_1.TuneSvg, this.toggleSettingsExpanded, 'Settings / Controls Info', this.state.isSettingsExpanded)] }), this.plugin.config.get(config_1.PluginConfig.Viewport.ShowSelectionMode) && (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-semi-transparent-background' }), (0, jsx_runtime_1.jsx)(selection_1.ToggleSelectionModeButton, {})] })] })), this.state.isScreenshotExpanded && (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-viewport-controls-panel' }, { children: (0, jsx_runtime_1.jsx)(common_1.ControlGroup, tslib_1.__assign({ header: 'Screenshot / State', title: 'Click to close.', initialExpanded: true, hideExpander: true, hideOffset: true, onHeaderClick: this.toggleScreenshotExpanded, topRightIcon: icons_1.CloseSvg, noTopMargin: true, childrenClassName: 'msp-viewport-controls-panel-controls' }, { children: (0, jsx_runtime_1.jsx)(pdbe_screenshot_controls_1.DownloadScreenshotControls, { close: this.toggleScreenshotExpanded }) })) })), this.state.isSettingsExpanded && (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-viewport-controls-panel' }, { children: (0, jsx_runtime_1.jsx)(common_1.ControlGroup, tslib_1.__assign({ header: 'Settings / Controls Info', title: 'Click to close.', initialExpanded: true, hideExpander: true, hideOffset: true, onHeaderClick: this.toggleSettingsExpanded, topRightIcon: icons_1.CloseSvg, noTopMargin: true, childrenClassName: 'msp-viewport-controls-panel-controls' }, { children: (0, jsx_runtime_1.jsx)(simple_settings_1.SimpleSettingsControl, {}) })) }))] }))] });
|
|
53
|
-
};
|
|
54
|
-
return PDBeViewportControls;
|
|
55
|
-
}(viewport_1.ViewportControls));
|
|
56
|
-
exports.PDBeViewportControls = PDBeViewportControls;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PDBeViewportControls = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var config_1 = require("Molstar/mol-plugin/config");
|
|
7
|
+
var common_1 = require("Molstar/mol-plugin-ui/controls/common");
|
|
8
|
+
var selection_1 = require("Molstar/mol-plugin-ui/structure/selection");
|
|
9
|
+
var pdbe_screenshot_controls_1 = require("./pdbe-screenshot-controls");
|
|
10
|
+
var simple_settings_1 = require("Molstar/mol-plugin-ui/viewport/simple-settings");
|
|
11
|
+
var viewport_1 = require("Molstar/mol-plugin-ui/viewport");
|
|
12
|
+
var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
|
|
13
|
+
var PDBeViewportControls = /** @class */ (function (_super) {
|
|
14
|
+
tslib_1.__extends(PDBeViewportControls, _super);
|
|
15
|
+
function PDBeViewportControls() {
|
|
16
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
17
|
+
}
|
|
18
|
+
PDBeViewportControls.prototype.isBlack = function (customeState) {
|
|
19
|
+
if (customeState && customeState.initParams && customeState.initParams.bgColor) {
|
|
20
|
+
var color = customeState.initParams.bgColor;
|
|
21
|
+
if (color.r === 0 && color.g === 0 && color.b === 0)
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
};
|
|
26
|
+
PDBeViewportControls.prototype.render = function () {
|
|
27
|
+
var customeState = this.plugin.customState;
|
|
28
|
+
var showPDBeLink = false;
|
|
29
|
+
var showControlToggle = true;
|
|
30
|
+
var showControlInfo = true;
|
|
31
|
+
if (customeState && customeState.initParams && customeState.initParams.moleculeId && customeState.initParams.pdbeLink)
|
|
32
|
+
showPDBeLink = true;
|
|
33
|
+
if (customeState && customeState.initParams && customeState.initParams.superposition)
|
|
34
|
+
showPDBeLink = false;
|
|
35
|
+
if (customeState && customeState.initParams && customeState.initParams.hideCanvasControls && customeState.initParams.hideCanvasControls.indexOf('controlToggle') > -1)
|
|
36
|
+
showControlToggle = false;
|
|
37
|
+
if (customeState && customeState.initParams && customeState.initParams.hideCanvasControls && customeState.initParams.hideCanvasControls.indexOf('controlInfo') > -1)
|
|
38
|
+
showControlInfo = false;
|
|
39
|
+
var bgColor = this.isBlack(customeState) ? '#fff' : '#555';
|
|
40
|
+
var pdbeLink = {
|
|
41
|
+
parentStyle: { width: 'auto' },
|
|
42
|
+
bgStyle: { position: 'absolute', height: '27px', width: '54px', marginLeft: '-33px' },
|
|
43
|
+
containerStyle: { position: 'absolute', right: '10px', top: '10px', padding: '3px 3px 3px 18px' },
|
|
44
|
+
style: { display: 'inline-block', fontSize: '14px', color: bgColor, borderBottom: 'none', cursor: 'pointer', textDecoration: 'none', position: 'absolute', right: '5px' },
|
|
45
|
+
pdbeImg: {
|
|
46
|
+
src: 'https://www.ebi.ac.uk/pdbe/entry/static/images/logos/PDBe/logo_T_64.png',
|
|
47
|
+
alt: 'PDBe logo',
|
|
48
|
+
style: { height: '12px', width: '12px', border: 0, position: 'absolute', margin: '4px 0 0 -13px' }
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var vwpBtnsTopMargin = { marginTop: '30px' };
|
|
52
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showPDBeLink && (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-viewport-controls-buttons', style: pdbeLink.containerStyle }, { children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-semi-transparent-background', style: pdbeLink.bgStyle }), (0, jsx_runtime_1.jsxs)("a", tslib_1.__assign({ className: 'msp-pdbe-link', style: pdbeLink.style, target: "_blank", href: "https://pdbe.org/".concat(customeState.initParams.moleculeId) }, { children: [(0, jsx_runtime_1.jsx)("img", { src: pdbeLink.pdbeImg.src, alt: pdbeLink.pdbeImg.alt, style: pdbeLink.pdbeImg.style }), customeState.initParams.moleculeId] }))] })), (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-viewport-controls', onMouseMove: this.onMouseMove, style: showPDBeLink ? vwpBtnsTopMargin : void 0 }, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-viewport-controls-buttons' }, { children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-semi-transparent-background' }), this.icon(icons_1.AutorenewSvg, this.resetCamera, 'Reset Camera')] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-semi-transparent-background' }), this.icon(icons_1.CameraOutlinedSvg, this.toggleScreenshotExpanded, 'Screenshot / State Snapshot', this.state.isScreenshotExpanded)] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-semi-transparent-background' }), showControlToggle && this.icon(icons_1.BuildOutlinedSvg, this.toggleControls, 'Toggle Controls Panel', this.plugin.layout.state.showControls), this.plugin.config.get(config_1.PluginConfig.Viewport.ShowExpand) && this.icon(icons_1.FullscreenSvg, this.toggleExpanded, 'Toggle Expanded Viewport', this.plugin.layout.state.isExpanded), showControlInfo && this.icon(icons_1.TuneSvg, this.toggleSettingsExpanded, 'Settings / Controls Info', this.state.isSettingsExpanded)] }), this.plugin.config.get(config_1.PluginConfig.Viewport.ShowSelectionMode) && (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-semi-transparent-background' }), (0, jsx_runtime_1.jsx)(selection_1.ToggleSelectionModeButton, {})] })] })), this.state.isScreenshotExpanded && (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-viewport-controls-panel' }, { children: (0, jsx_runtime_1.jsx)(common_1.ControlGroup, tslib_1.__assign({ header: 'Screenshot / State', title: 'Click to close.', initialExpanded: true, hideExpander: true, hideOffset: true, onHeaderClick: this.toggleScreenshotExpanded, topRightIcon: icons_1.CloseSvg, noTopMargin: true, childrenClassName: 'msp-viewport-controls-panel-controls' }, { children: (0, jsx_runtime_1.jsx)(pdbe_screenshot_controls_1.DownloadScreenshotControls, { close: this.toggleScreenshotExpanded }) })) })), this.state.isSettingsExpanded && (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-viewport-controls-panel' }, { children: (0, jsx_runtime_1.jsx)(common_1.ControlGroup, tslib_1.__assign({ header: 'Settings / Controls Info', title: 'Click to close.', initialExpanded: true, hideExpander: true, hideOffset: true, onHeaderClick: this.toggleSettingsExpanded, topRightIcon: icons_1.CloseSvg, noTopMargin: true, childrenClassName: 'msp-viewport-controls-panel-controls' }, { children: (0, jsx_runtime_1.jsx)(simple_settings_1.SimpleSettingsControl, {}) })) }))] }))] });
|
|
53
|
+
};
|
|
54
|
+
return PDBeViewportControls;
|
|
55
|
+
}(viewport_1.ViewportControls));
|
|
56
|
+
exports.PDBeViewportControls = PDBeViewportControls;
|
package/lib/ui/segment-tree.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { PurePluginUIComponent } from 'Molstar/mol-plugin-ui/base';
|
|
3
|
-
import { StateObjectRef } from 'Molstar/mol-state';
|
|
4
|
-
import { PluginStateObject } from 'Molstar/mol-plugin-state/objects';
|
|
5
|
-
import { Mat4 } from 'Molstar/mol-math/linear-algebra';
|
|
6
|
-
export declare class SegmentTree extends PurePluginUIComponent<{}, {
|
|
7
|
-
segment?: any;
|
|
8
|
-
isBusy: boolean;
|
|
9
|
-
}> {
|
|
10
|
-
componentDidMount(): void;
|
|
11
|
-
get customState(): any;
|
|
12
|
-
getSegmentParams: () => void;
|
|
13
|
-
updateSegment: (val: any) => Promise<false | undefined>;
|
|
14
|
-
hideStructures: (segmentIndex: number) => void;
|
|
15
|
-
displayStructures: (segmentIndex: number) => Promise<void>;
|
|
16
|
-
transform(s: StateObjectRef<PluginStateObject.Molecule.Structure>, matrix: Mat4): Promise<void>;
|
|
17
|
-
render(): JSX.Element;
|
|
18
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PurePluginUIComponent } from 'Molstar/mol-plugin-ui/base';
|
|
3
|
+
import { StateObjectRef } from 'Molstar/mol-state';
|
|
4
|
+
import { PluginStateObject } from 'Molstar/mol-plugin-state/objects';
|
|
5
|
+
import { Mat4 } from 'Molstar/mol-math/linear-algebra';
|
|
6
|
+
export declare class SegmentTree extends PurePluginUIComponent<{}, {
|
|
7
|
+
segment?: any;
|
|
8
|
+
isBusy: boolean;
|
|
9
|
+
}> {
|
|
10
|
+
componentDidMount(): void;
|
|
11
|
+
get customState(): any;
|
|
12
|
+
getSegmentParams: () => void;
|
|
13
|
+
updateSegment: (val: any) => Promise<false | undefined>;
|
|
14
|
+
hideStructures: (segmentIndex: number) => void;
|
|
15
|
+
displayStructures: (segmentIndex: number) => Promise<void>;
|
|
16
|
+
transform(s: StateObjectRef<PluginStateObject.Molecule.Structure>, matrix: Mat4): Promise<void>;
|
|
17
|
+
render(): JSX.Element;
|
|
18
|
+
}
|