drugflow-molstar 0.1.0
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 -0
- package/README.md +15 -0
- package/build/pdbe-molstar-3.1.2.css +1 -0
- package/build/pdbe-molstar-component-3.1.2.js +25 -0
- package/build/pdbe-molstar-plugin-3.1.2.js +2 -0
- package/build/pdbe-molstar-plugin-3.1.2.js.LICENSE.txt +39 -0
- package/lib/alphafold-transparency.d.ts +6 -0
- package/lib/alphafold-transparency.js +153 -0
- package/lib/custom-events.d.ts +4 -0
- package/lib/custom-events.js +56 -0
- package/lib/domain-annotations/behavior.d.ts +5 -0
- package/lib/domain-annotations/behavior.js +49 -0
- package/lib/domain-annotations/color.d.ts +10 -0
- package/lib/domain-annotations/color.js +78 -0
- package/lib/domain-annotations/prop.d.ts +35 -0
- package/lib/domain-annotations/prop.js +160 -0
- package/lib/helpers.d.ts +80 -0
- package/lib/helpers.js +278 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +901 -0
- package/lib/labels.d.ts +2 -0
- package/lib/labels.js +42 -0
- package/lib/loci-details.d.ts +27 -0
- package/lib/loci-details.js +128 -0
- 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 -0
- package/lib/sifts-mapping.js +83 -0
- package/lib/sifts-mappings-behaviour.d.ts +5 -0
- package/lib/sifts-mappings-behaviour.js +64 -0
- package/lib/spec.d.ts +75 -0
- package/lib/spec.js +105 -0
- package/lib/subscribe-events.d.ts +1 -0
- package/lib/subscribe-events.js +194 -0
- package/lib/superposition-export.d.ts +4 -0
- package/lib/superposition-export.js +152 -0
- package/lib/superposition-focus-representation.d.ts +16 -0
- package/lib/superposition-focus-representation.js +153 -0
- package/lib/superposition-sifts-mapping.d.ts +22 -0
- package/lib/superposition-sifts-mapping.js +159 -0
- package/lib/superposition.d.ts +18 -0
- package/lib/superposition.js +794 -0
- package/lib/ui/alphafold-superposition.d.ts +56 -0
- package/lib/ui/alphafold-superposition.js +178 -0
- package/lib/ui/alphafold-tranparency.d.ts +22 -0
- package/lib/ui/alphafold-tranparency.js +65 -0
- package/lib/ui/annotation-controls.d.ts +24 -0
- package/lib/ui/annotation-controls.js +166 -0
- package/lib/ui/export-superposition.d.ts +6 -0
- package/lib/ui/export-superposition.js +71 -0
- package/lib/ui/pdbe-left-panel.d.ts +18 -0
- package/lib/ui/pdbe-left-panel.js +167 -0
- package/lib/ui/pdbe-screenshot-controls.d.ts +20 -0
- package/lib/ui/pdbe-screenshot-controls.js +101 -0
- package/lib/ui/pdbe-structure-controls.d.ts +17 -0
- package/lib/ui/pdbe-structure-controls.js +70 -0
- package/lib/ui/pdbe-viewport-controls.d.ts +6 -0
- package/lib/ui/pdbe-viewport-controls.js +56 -0
- package/lib/ui/segment-tree.d.ts +18 -0
- package/lib/ui/segment-tree.js +804 -0
- package/lib/ui/superposition-components.d.ts +10 -0
- package/lib/ui/superposition-components.js +435 -0
- package/lib/ui/superposition-viewport.d.ts +5 -0
- package/lib/ui/superposition-viewport.js +23 -0
- package/package.json +79 -0
|
@@ -0,0 +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));
|
|
@@ -0,0 +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 {};
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +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
|
+
}
|