pdbe-molstar 3.4.0 → 3.6.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/build/pdbe-molstar-component.js +2 -2
- package/build/pdbe-molstar-light.css +2 -2
- package/build/pdbe-molstar-plugin.js +2 -2
- package/build/pdbe-molstar-plugin.js.LICENSE.txt +26 -1
- package/build/pdbe-molstar.css +2 -2
- package/lib/alphafold-transparency.js +5 -6
- package/lib/custom-events.js +1 -1
- package/lib/domain-annotations/behavior.d.ts +1 -1
- package/lib/domain-annotations/color.js +2 -2
- package/lib/domain-annotations/prop.js +1 -2
- package/lib/extensions/complexes/coloring.d.ts +40 -0
- package/lib/extensions/complexes/coloring.js +118 -0
- package/lib/extensions/complexes/index.d.ts +55 -0
- package/lib/extensions/complexes/index.js +123 -0
- package/lib/extensions/complexes/superpose-by-biggest-chain.d.ts +17 -0
- package/lib/extensions/complexes/superpose-by-biggest-chain.js +135 -0
- package/lib/extensions/foldseek/index.d.ts +1 -1
- package/lib/extensions/foldseek/index.js +7 -7
- package/lib/extensions/interactions/index.d.ts +36 -0
- package/lib/extensions/interactions/index.js +112 -0
- package/lib/extensions/state-gallery/behavior.d.ts +1 -1
- package/lib/extensions/state-gallery/config.js +2 -2
- package/lib/extensions/state-gallery/manager.js +5 -4
- package/lib/extensions/state-gallery/ui.js +12 -12
- package/lib/helpers.d.ts +8 -0
- package/lib/helpers.js +175 -81
- package/lib/labels.d.ts +1 -1
- package/lib/loci-details.js +4 -5
- package/lib/plugin-custom-state.js +2 -2
- package/lib/sifts-mapping.js +1 -2
- package/lib/sifts-mappings-behaviour.d.ts +1 -1
- package/lib/spec-from-html.js +1 -2
- package/lib/spec.d.ts +1 -1
- package/lib/spec.js +3 -3
- package/lib/styles/pdbe-molstar/_index.scss +7 -7
- package/lib/styles/pdbe-molstar-dark.scss +2 -2
- package/lib/styles/pdbe-molstar-light.scss +2 -2
- package/lib/subscribe-events.js +1 -2
- package/lib/superposition-export.js +1 -2
- package/lib/superposition-focus-representation.d.ts +2 -2
- package/lib/superposition-focus-representation.js +1 -1
- package/lib/superposition-sifts-mapping.js +1 -2
- package/lib/superposition.d.ts +1 -1
- package/lib/superposition.js +34 -39
- package/lib/ui/alphafold-superposition.js +6 -6
- package/lib/ui/annotation-controls.d.ts +1 -1
- package/lib/ui/annotation-controls.js +2 -2
- package/lib/ui/annotation-row-controls.js +3 -3
- package/lib/ui/custom-controls.js +1 -1
- package/lib/ui/export-superposition.d.ts +0 -1
- package/lib/ui/export-superposition.js +1 -1
- package/lib/ui/icons.js +1 -1
- package/lib/ui/left-panel/core.d.ts +0 -1
- package/lib/ui/left-panel/core.js +5 -6
- package/lib/ui/left-panel/pdbe-left-panel.d.ts +0 -1
- package/lib/ui/left-panel/tabs.d.ts +1 -1
- package/lib/ui/left-panel/tabs.js +2 -2
- package/lib/ui/overlay.js +3 -4
- package/lib/ui/pdbe-screenshot-controls.js +4 -4
- package/lib/ui/pdbe-structure-controls.js +3 -3
- package/lib/ui/pdbe-viewport-controls.js +3 -4
- package/lib/ui/pdbe-viewport.d.ts +5 -2
- package/lib/ui/pdbe-viewport.js +24 -3
- package/lib/ui/segment-tree.js +40 -45
- package/lib/ui/split-ui/components.d.ts +1 -2
- package/lib/ui/split-ui/components.js +2 -2
- package/lib/ui/split-ui/split-ui.js +6 -7
- package/lib/ui/superposition-components.js +16 -21
- package/lib/ui/symmetry-annotation-controls.d.ts +4 -4
- package/lib/ui/symmetry-annotation-controls.js +18 -25
- package/lib/viewer.d.ts +31 -3
- package/lib/viewer.js +54 -40
- package/package.json +4 -4
package/lib/sifts-mapping.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PluginBehavior } from 'molstar/lib/mol-plugin/behavior';
|
|
2
|
-
export declare const PDBeSIFTSMapping: import("molstar/lib/mol-state
|
|
2
|
+
export declare const PDBeSIFTSMapping: import("molstar/lib/mol-state").StateTransformer<PluginBehavior.Category, PluginBehavior.Behavior, {
|
|
3
3
|
autoAttach: boolean;
|
|
4
4
|
showTooltip: boolean;
|
|
5
5
|
}>;
|
package/lib/spec-from-html.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initParamsFromHtmlAttributes =
|
|
3
|
+
exports.initParamsFromHtmlAttributes = initParamsFromHtmlAttributes;
|
|
4
4
|
const spec_1 = require("./spec");
|
|
5
5
|
/** Extract InitParams from attributes of an HTML element */
|
|
6
6
|
function initParamsFromHtmlAttributes(element) {
|
|
@@ -10,7 +10,6 @@ function initParamsFromHtmlAttributes(element) {
|
|
|
10
10
|
console.error('Invalid PDBeMolstarPlugin options:', params);
|
|
11
11
|
return params;
|
|
12
12
|
}
|
|
13
|
-
exports.initParamsFromHtmlAttributes = initParamsFromHtmlAttributes;
|
|
14
13
|
/** Actions for loading individual HTML attributes into InitParams object */
|
|
15
14
|
const InitParamsLoadingActions = {
|
|
16
15
|
// DATA
|
package/lib/spec.d.ts
CHANGED
|
@@ -123,7 +123,7 @@ export interface InitParams {
|
|
|
123
123
|
/** Hide all control panels by default (can be shown by the Toggle Controls Panel button (wrench icon)) */
|
|
124
124
|
hideControls: boolean;
|
|
125
125
|
/** Hide individual icon buttons in the top-right corner of the canvas */
|
|
126
|
-
hideCanvasControls: ('expand' | 'controlToggle' | 'controlInfo' | 'selection' | 'animation' | 'trajectory')[];
|
|
126
|
+
hideCanvasControls: ('screenshot' | 'expand' | 'controlToggle' | 'controlInfo' | 'selection' | 'animation' | 'trajectory')[];
|
|
127
127
|
/** Display Sequence panel */
|
|
128
128
|
sequencePanel: boolean;
|
|
129
129
|
/** Display Left control panel */
|
package/lib/spec.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DefaultParams = exports.Encoding = exports.VisualStyle = exports.ComponentType = exports.Lighting = exports.Preset = exports.DefaultPluginUISpec = exports.DefaultPluginSpec = void 0;
|
|
4
|
+
exports.resolveVisualStyleSpec = resolveVisualStyleSpec;
|
|
5
|
+
exports.validateInitParams = validateInitParams;
|
|
4
6
|
const actions_1 = require("molstar/lib/mol-plugin-state/actions");
|
|
5
7
|
const volume_1 = require("molstar/lib/mol-plugin-ui/custom/volume");
|
|
6
8
|
const behavior_1 = require("molstar/lib/mol-plugin/behavior");
|
|
@@ -56,7 +58,6 @@ function resolveVisualStyleSpec(spec) {
|
|
|
56
58
|
}
|
|
57
59
|
return Object.fromEntries(Object.entries(spec).map(([type, compSpec]) => [type, resolveComponentVisualStyleSpec(compSpec)]));
|
|
58
60
|
}
|
|
59
|
-
exports.resolveVisualStyleSpec = resolveVisualStyleSpec;
|
|
60
61
|
function resolveComponentVisualStyleSpec(spec) {
|
|
61
62
|
if (spec === undefined)
|
|
62
63
|
return undefined;
|
|
@@ -125,4 +126,3 @@ function validateInitParams(params) {
|
|
|
125
126
|
}
|
|
126
127
|
return undefined;
|
|
127
128
|
}
|
|
128
|
-
exports.validateInitParams = validateInitParams;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// Color constants must be imported before importing this file
|
|
4
4
|
// (from molstar/lib/mol-plugin-ui/skin/*.scss or molstar/lib/mol-plugin-ui/skin/colors/*.scss)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
@import 'molstar/lib/mol-plugin-ui/skin/base/variables.scss';
|
|
6
|
+
@use 'molstar/lib/mol-plugin-ui/skin/base/_vars.scss' as vars;
|
|
8
7
|
|
|
8
|
+
.msp-plugin {
|
|
9
9
|
::-webkit-scrollbar-thumb {
|
|
10
10
|
background-color: #80808080;
|
|
11
11
|
border-radius: 10px;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.msp-viewport-controls-panel .msp-viewport-controls-panel-controls {
|
|
25
|
-
max-height: calc(100cqh -
|
|
25
|
+
max-height: calc(100cqh - 46px - 24px - 10px); // 100cqh = viewport container, 46px = control buttons offset, 24px = header, 10px = space below
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// Avoid wraping headers in left panel help
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
float: left;
|
|
44
44
|
|
|
45
45
|
&:not(:empty) {
|
|
46
|
-
margin-right:
|
|
46
|
+
margin-right: vars.$control-spacing;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
align-items: center;
|
|
55
|
-
padding-inline: calc(54px + 2 *
|
|
55
|
+
padding-inline: calc(54px + 2 * vars.$control-spacing); // 54px = PDBe logo box
|
|
56
56
|
pointer-events: none;
|
|
57
57
|
|
|
58
58
|
>* {
|
|
59
|
-
margin-top:
|
|
59
|
+
margin-top: vars.$control-spacing;
|
|
60
60
|
pointer-events: auto;
|
|
61
61
|
max-width: 100%;
|
|
62
62
|
}
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
.pdbemolstar-state-gallery-title-box {
|
|
146
146
|
width: 500px;
|
|
147
147
|
max-width: 100%;
|
|
148
|
-
background-color:
|
|
148
|
+
background-color: vars.$msp-form-control-background;
|
|
149
149
|
display: flex;
|
|
150
150
|
flex-direction: row;
|
|
151
151
|
justify-content: space-between;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@use 'molstar/lib/mol-plugin-ui/skin/dark';
|
|
2
|
+
@use './pdbe-molstar/_index';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@use 'molstar/lib/mol-plugin-ui/skin/light';
|
|
2
|
+
@use './pdbe-molstar/_index';
|
package/lib/subscribe-events.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.subscribeToComponentEvents =
|
|
3
|
+
exports.subscribeToComponentEvents = subscribeToComponentEvents;
|
|
4
4
|
function subscribeToComponentEvents(wrapperCtx) {
|
|
5
5
|
document.addEventListener('PDB.interactions.click', function (e) {
|
|
6
6
|
if (typeof e.detail !== 'undefined') {
|
|
@@ -191,4 +191,3 @@ function subscribeToComponentEvents(wrapperCtx) {
|
|
|
191
191
|
wrapperCtx.visual.clearHighlight();
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
exports.subscribeToComponentEvents = subscribeToComponentEvents;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.superpositionExportHierarchy =
|
|
3
|
+
exports.superpositionExportHierarchy = superpositionExportHierarchy;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const utf8_1 = require("molstar/lib/mol-io/common/utf8");
|
|
6
6
|
const structure_1 = require("molstar/lib/mol-model/structure");
|
|
@@ -21,7 +21,6 @@ function superpositionExportHierarchy(plugin, options) {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
exports.superpositionExportHierarchy = superpositionExportHierarchy;
|
|
25
24
|
function _superpositionExportHierarchy(plugin, options) {
|
|
26
25
|
return mol_task_1.Task.create('Export', (ctx) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
26
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -4,7 +4,7 @@ import { ParamDefinition as PD } from 'molstar/lib/mol-util/param-definition';
|
|
|
4
4
|
declare const SuperpositionFocusRepresentationParams: (plugin: PluginContext) => {
|
|
5
5
|
expandRadius: PD.Numeric;
|
|
6
6
|
surroundingsParams: PD.Group<PD.Normalize<{
|
|
7
|
-
[x: string]: any;
|
|
7
|
+
[x: string]: /*elided*/ any;
|
|
8
8
|
}>>;
|
|
9
9
|
};
|
|
10
10
|
type SuperpositionFocusRepresentationProps = PD.ValuesFor<ReturnType<typeof SuperpositionFocusRepresentationParams>>;
|
|
@@ -12,5 +12,5 @@ export declare enum SuperpositionFocusRepresentationTags {
|
|
|
12
12
|
SurrSel = "superposition-focus-surr-sel",
|
|
13
13
|
SurrRepr = "superposition-focus-surr-repr"
|
|
14
14
|
}
|
|
15
|
-
export declare const SuperpositionFocusRepresentation: import("molstar/lib/mol-state
|
|
15
|
+
export declare const SuperpositionFocusRepresentation: import("molstar/lib/mol-state").StateTransformer<PluginBehavior.Category, PluginBehavior.Behavior, SuperpositionFocusRepresentationProps>;
|
|
16
16
|
export {};
|
|
@@ -25,7 +25,7 @@ var SuperpositionFocusRepresentationTags;
|
|
|
25
25
|
(function (SuperpositionFocusRepresentationTags) {
|
|
26
26
|
SuperpositionFocusRepresentationTags["SurrSel"] = "superposition-focus-surr-sel";
|
|
27
27
|
SuperpositionFocusRepresentationTags["SurrRepr"] = "superposition-focus-surr-repr";
|
|
28
|
-
})(SuperpositionFocusRepresentationTags
|
|
28
|
+
})(SuperpositionFocusRepresentationTags || (exports.SuperpositionFocusRepresentationTags = SuperpositionFocusRepresentationTags = {}));
|
|
29
29
|
const TagSet = new Set([SuperpositionFocusRepresentationTags.SurrSel, SuperpositionFocusRepresentationTags.SurrRepr]);
|
|
30
30
|
class SuperpositionFocusRepresentationBehavior extends behavior_1.PluginBehavior.WithSubscribers {
|
|
31
31
|
get surrLabel() { return `[Focus] Surroundings (${this.params.expandRadius} Å)`; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.alignAndSuperposeWithSIFTSMapping =
|
|
3
|
+
exports.alignAndSuperposeWithSIFTSMapping = alignAndSuperposeWithSIFTSMapping;
|
|
4
4
|
const int_1 = require("molstar/lib/mol-data/int");
|
|
5
5
|
const minimize_rmsd_1 = require("molstar/lib/mol-math/linear-algebra/3d/minimize-rmsd");
|
|
6
6
|
const element_1 = require("molstar/lib/mol-model/structure/structure/element");
|
|
@@ -37,7 +37,6 @@ function alignAndSuperposeWithSIFTSMapping(structures, options) {
|
|
|
37
37
|
}
|
|
38
38
|
return { entries, zeroOverlapPairs, failedPairs };
|
|
39
39
|
}
|
|
40
|
-
exports.alignAndSuperposeWithSIFTSMapping = alignAndSuperposeWithSIFTSMapping;
|
|
41
40
|
function getPositionTables(index, pivot, other, N) {
|
|
42
41
|
const xs = minimize_rmsd_1.MinimizeRmsd.Positions.empty(N);
|
|
43
42
|
const ys = minimize_rmsd_1.MinimizeRmsd.Positions.empty(N);
|
package/lib/superposition.d.ts
CHANGED
|
@@ -12,4 +12,4 @@ export declare function loadAfStructure(plugin: PluginContext): Promise<string |
|
|
|
12
12
|
export declare function superposeAf(plugin: PluginContext, traceOnly: boolean, segmentIndex?: number): Promise<true | undefined>;
|
|
13
13
|
export declare function renderSuperposition(plugin: PluginContext, segmentIndex: number, entryList: ClusterMember[]): Promise<void>;
|
|
14
14
|
/** Apply tranformation to a structure. Only use once per structure, combining multiple transformations is not implemented. */
|
|
15
|
-
export declare function transform(plugin: PluginContext, s: StateObjectRef<PSO.Molecule.Structure>, matrix: Mat4): Promise<StateObjectSelector<PSO.Molecule.Structure, import("molstar/lib/mol-state
|
|
15
|
+
export declare function transform(plugin: PluginContext, s: StateObjectRef<PSO.Molecule.Structure>, matrix: Mat4): Promise<StateObjectSelector<PSO.Molecule.Structure, import("molstar/lib/mol-state").StateTransformer<import("molstar/lib/mol-state").StateObject<any, import("molstar/lib/mol-state").StateObject.Type<any>>, import("molstar/lib/mol-state").StateObject<any, import("molstar/lib/mol-state").StateObject.Type<any>>, any>>>;
|
package/lib/superposition.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SuperpositionColorPalette = void 0;
|
|
4
|
+
exports.getNextColor = getNextColor;
|
|
5
|
+
exports.initSuperposition = initSuperposition;
|
|
6
|
+
exports.loadAfStructure = loadAfStructure;
|
|
7
|
+
exports.superposeAf = superposeAf;
|
|
8
|
+
exports.renderSuperposition = renderSuperposition;
|
|
9
|
+
exports.transform = transform;
|
|
4
10
|
const tslib_1 = require("tslib");
|
|
5
11
|
const linear_algebra_1 = require("molstar/lib/mol-math/linear-algebra");
|
|
6
12
|
const structure_1 = require("molstar/lib/mol-model/structure");
|
|
@@ -28,10 +34,9 @@ function getNextColor(plugin, segmentIndex) {
|
|
|
28
34
|
spState.colorCounters[segmentIndex] = (spState.colorCounters[segmentIndex] + 1) % exports.SuperpositionColorPalette.length;
|
|
29
35
|
return nextColor;
|
|
30
36
|
}
|
|
31
|
-
exports.getNextColor = getNextColor;
|
|
32
37
|
function initSuperposition(plugin, completeSubject) {
|
|
33
|
-
var _a;
|
|
34
38
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a;
|
|
35
40
|
let success = false;
|
|
36
41
|
try {
|
|
37
42
|
yield plugin.clear();
|
|
@@ -114,7 +119,6 @@ function initSuperposition(plugin, completeSubject) {
|
|
|
114
119
|
}
|
|
115
120
|
});
|
|
116
121
|
}
|
|
117
|
-
exports.initSuperposition = initSuperposition;
|
|
118
122
|
function createCarbVisLabel(carbLigNamesAndCount) {
|
|
119
123
|
const compList = [];
|
|
120
124
|
for (const carbCompId in carbLigNamesAndCount) {
|
|
@@ -144,8 +148,8 @@ function getAfUrls(plugin, accession) {
|
|
|
144
148
|
});
|
|
145
149
|
}
|
|
146
150
|
function loadAfStructure(plugin) {
|
|
147
|
-
var _a, _b;
|
|
148
151
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
var _a, _b;
|
|
149
153
|
const customState = (0, plugin_custom_state_1.PluginCustomState)(plugin);
|
|
150
154
|
if (!customState.superpositionState)
|
|
151
155
|
throw new Error('customState.superpositionState has not been initialized');
|
|
@@ -169,7 +173,6 @@ function loadAfStructure(plugin) {
|
|
|
169
173
|
return false;
|
|
170
174
|
});
|
|
171
175
|
}
|
|
172
|
-
exports.loadAfStructure = loadAfStructure;
|
|
173
176
|
function superposeAf(plugin, traceOnly, segmentIndex) {
|
|
174
177
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
175
178
|
const customState = (0, plugin_custom_state_1.PluginCustomState)(plugin);
|
|
@@ -243,10 +246,9 @@ function superposeAf(plugin, traceOnly, segmentIndex) {
|
|
|
243
246
|
return true;
|
|
244
247
|
});
|
|
245
248
|
}
|
|
246
|
-
exports.superposeAf = superposeAf;
|
|
247
249
|
function renderSuperposition(plugin, segmentIndex, entryList) {
|
|
248
|
-
var _a;
|
|
249
250
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
251
|
+
var _a;
|
|
250
252
|
const customState = (0, plugin_custom_state_1.PluginCustomState)(plugin);
|
|
251
253
|
const superpositionParams = customState.initParams.superpositionParams;
|
|
252
254
|
let busyFlagOn = false;
|
|
@@ -256,8 +258,8 @@ function renderSuperposition(plugin, segmentIndex, entryList) {
|
|
|
256
258
|
}
|
|
257
259
|
// Load Coordinates and render respresentations
|
|
258
260
|
return plugin.dataTransaction(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
259
|
-
var
|
|
260
|
-
var
|
|
261
|
+
var _a, e_1, _b, _c;
|
|
262
|
+
var _d;
|
|
261
263
|
if (!customState.initParams)
|
|
262
264
|
throw new Error('customState.initParams has not been initialized');
|
|
263
265
|
if (!customState.superpositionState)
|
|
@@ -336,35 +338,30 @@ function renderSuperposition(plugin, segmentIndex, entryList) {
|
|
|
336
338
|
// const interactingHets = [];
|
|
337
339
|
if (hets && hets.length > 0) {
|
|
338
340
|
try {
|
|
339
|
-
for (var
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
// interactingHets.push(het);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
finally {
|
|
360
|
-
_f = true;
|
|
341
|
+
for (var _e = true, hets_1 = (e_1 = void 0, tslib_1.__asyncValues(hets)), hets_1_1; hets_1_1 = yield hets_1.next(), _a = hets_1_1.done, !_a; _e = true) {
|
|
342
|
+
_c = hets_1_1.value;
|
|
343
|
+
_e = false;
|
|
344
|
+
const het = _c;
|
|
345
|
+
const ligand = builder_1.MolScriptBuilder.struct.generator.atomGroups({
|
|
346
|
+
'chain-test': builder_1.MolScriptBuilder.core.rel.eq([builder_1.MolScriptBuilder.struct.atomProperty.macromolecular.auth_asym_id(), s.auth_asym_id]),
|
|
347
|
+
'residue-test': builder_1.MolScriptBuilder.core.rel.eq([builder_1.MolScriptBuilder.struct.atomProperty.macromolecular.label_comp_id(), het]),
|
|
348
|
+
'group-by': builder_1.MolScriptBuilder.core.str.concat([builder_1.MolScriptBuilder.struct.atomProperty.core.operatorName(), builder_1.MolScriptBuilder.struct.atomProperty.macromolecular.residueKey()]),
|
|
349
|
+
});
|
|
350
|
+
const labelTagParams = { label: `${het}`, tags: [`superposition-ligand-sel`] };
|
|
351
|
+
const hetColor = (0, helpers_1.normalizeColor)(superpositionParams.ligandColor, DefaultLigandColor);
|
|
352
|
+
const ligandExp = yield plugin.builders.structure.tryCreateComponentFromExpression(strInstance, ligand, `${het}-${segmentIndex}`, labelTagParams);
|
|
353
|
+
if (ligandExp) {
|
|
354
|
+
yield plugin.builders.structure.representation.addRepresentation(ligandExp, { type: 'ball-and-stick', color: 'uniform', colorParams: { value: hetColor } }, { tag: `superposition-ligand-visual` });
|
|
355
|
+
spState.refMaps[ligandExp.ref] = `${s.pdb_id}_${s.struct_asym_id}`;
|
|
356
|
+
invalidStruct = false;
|
|
357
|
+
// interactingHets.push(het);
|
|
361
358
|
}
|
|
362
359
|
}
|
|
363
360
|
}
|
|
364
361
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
365
362
|
finally {
|
|
366
363
|
try {
|
|
367
|
-
if (!
|
|
364
|
+
if (!_e && !_a && (_b = hets_1.return)) yield _b.call(hets_1);
|
|
368
365
|
}
|
|
369
366
|
finally { if (e_1) throw e_1.error; }
|
|
370
367
|
}
|
|
@@ -450,15 +447,14 @@ function renderSuperposition(plugin, segmentIndex, entryList) {
|
|
|
450
447
|
}
|
|
451
448
|
if (busyFlagOn) {
|
|
452
449
|
busyFlagOn = false;
|
|
453
|
-
(
|
|
450
|
+
(_d = customState.events) === null || _d === void 0 ? void 0 : _d.isBusy.next(false);
|
|
454
451
|
}
|
|
455
452
|
}));
|
|
456
453
|
});
|
|
457
454
|
}
|
|
458
|
-
exports.renderSuperposition = renderSuperposition;
|
|
459
455
|
function getLigandNamesFromModelData(plugin, state, modelRef) {
|
|
460
|
-
var _a;
|
|
461
456
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
457
|
+
var _a;
|
|
462
458
|
const cell = state.select(modelRef)[0];
|
|
463
459
|
if (!cell || !cell.obj)
|
|
464
460
|
return undefined;
|
|
@@ -502,7 +498,6 @@ function transform(plugin, s, matrix) {
|
|
|
502
498
|
.insert(transforms_1.StateTransforms.Model.TransformStructureConformation, { transform: { name: 'matrix', params: { data: matrix, transpose: false } } });
|
|
503
499
|
return plugin.runTask(plugin.state.data.updateTree(b));
|
|
504
500
|
}
|
|
505
|
-
exports.transform = transform;
|
|
506
501
|
function afTransform(plugin, s, matrix, coordinateSystem) {
|
|
507
502
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
508
503
|
const r = mol_state_1.StateObjectRef.resolveAndCheck(plugin.state.data, s);
|
|
@@ -526,8 +521,8 @@ function afTransform(plugin, s, matrix, coordinateSystem) {
|
|
|
526
521
|
});
|
|
527
522
|
}
|
|
528
523
|
function getMatrixData(plugin) {
|
|
529
|
-
var _a, _b, _c;
|
|
530
524
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
525
|
+
var _a, _b, _c;
|
|
531
526
|
const customState = (0, plugin_custom_state_1.PluginCustomState)(plugin);
|
|
532
527
|
if (!customState.initParams)
|
|
533
528
|
throw new Error('customState.initParams has not been initialized');
|
|
@@ -551,8 +546,8 @@ function getMatrixData(plugin) {
|
|
|
551
546
|
}
|
|
552
547
|
/** Download data about segment clustering and save in plugin custom state */
|
|
553
548
|
function getSegmentData(plugin) {
|
|
554
|
-
var _a;
|
|
555
549
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
550
|
+
var _a;
|
|
556
551
|
const customState = (0, plugin_custom_state_1.PluginCustomState)(plugin);
|
|
557
552
|
if (!customState.initParams)
|
|
558
553
|
throw new Error('customState.initParams has not been initialized');
|
|
@@ -69,7 +69,7 @@ class AlphafoldPaeControls extends base_1.CollapsableControls {
|
|
|
69
69
|
if (!superpositionState || !superpositionState.alphafold)
|
|
70
70
|
return null;
|
|
71
71
|
const errorScale = [0, 5, 10, 15, 20, 25, 30];
|
|
72
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
72
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', style: { height: 'auto', textAlign: 'center', justifyContent: 'center', padding: '15px 0', position: 'relative', fontSize: '12px' }, children: [(0, jsx_runtime_1.jsx)("div", { ref: this.axisBoxRef, className: 'pae-axis-box', style: { position: 'absolute', width: '100%', height: '100%' } }), (0, jsx_runtime_1.jsx)("span", { style: { transform: 'rotate(270deg)', position: 'absolute', transformOrigin: '0 0', left: '10px', top: '165px', fontWeight: 500 }, children: "Aligned residue" }), (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', style: { height: 'auto', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { width: '200px', height: '200px', border: '1px solid #6a635a', margin: '2px 0 25px 25px', position: 'relative' }, children: (0, jsx_runtime_1.jsx)("img", { style: { width: '100%', height: '100%', position: 'absolute', left: 0, top: 0 }, src: `${superpositionState.alphafold.apiData.pae}`, alt: "PAE" }) }), (0, jsx_runtime_1.jsx)("div", { style: { textAlign: 'center', paddingLeft: '30px', marginBottom: '20px', fontWeight: 500 }, children: "Scored residue" }), (0, jsx_runtime_1.jsx)("img", { style: { width: '200px', height: '10px', border: '1px solid #6a635a', margin: '2px 0 25px 25px', transform: 'rotate(180deg)' }, src: 'https://alphafold.ebi.ac.uk/assets/img/horizontal_colorbar.png', alt: "PAE Scale" }), (0, jsx_runtime_1.jsx)("ul", { style: { listStyleType: 'none', fontWeight: 500, margin: 0, display: 'inline-block', position: 'absolute', top: '292px', marginLeft: '24px' }, children: errorScale.map((errValue) => (0, jsx_runtime_1.jsx)("li", { style: { float: 'left', marginRight: '18px' }, children: errValue }, errValue)) }), (0, jsx_runtime_1.jsx)("div", { style: { textAlign: 'center', paddingLeft: '20px', fontWeight: 500 }, children: "Expected position error (\u00C5ngstr\u00F6ms)" })] })] });
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
exports.AlphafoldPaeControls = AlphafoldPaeControls;
|
|
@@ -96,10 +96,10 @@ class AlphafoldSuperpositionControls extends base_1.CollapsableControls {
|
|
|
96
96
|
throw new Error('customState.superpositionState has not been initialized');
|
|
97
97
|
const { activeSegment } = spData;
|
|
98
98
|
const { rmsds } = spData.alphafold;
|
|
99
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
99
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'msp-control-offset', children: [(rmsds.length === 0 || !rmsds[activeSegment - 1]) && (0, jsx_runtime_1.jsx)("div", { className: 'msp-flex-row', style: { padding: '5px 0 0 10px' }, children: (0, jsx_runtime_1.jsx)("strong", { children: "No overlap found!" }) }), rmsds[activeSegment - 1] && (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [(0, jsx_runtime_1.jsx)("div", { style: { width: '40%', borderRight: '1px solid rgb(213 206 196)', padding: '5px 0 0 5px' }, children: (0, jsx_runtime_1.jsx)("strong", { children: "Entry" }) }), (0, jsx_runtime_1.jsx)("div", { style: { padding: '5px 0 0 5px' }, children: (0, jsx_runtime_1.jsx)("strong", { children: "RMSD (\u212B)" }) })] }), rmsds[activeSegment - 1] && rmsds[activeSegment - 1].map((d) => {
|
|
100
100
|
const details = d.split(':');
|
|
101
|
-
return details[1] !== '-' ? (0, jsx_runtime_1.jsxs)("div",
|
|
102
|
-
})] })
|
|
101
|
+
return details[1] !== '-' ? (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-control-row-label', style: { width: '40%', borderRight: '1px solid rgb(213 206 196)', padding: '5px 0 0 5px' }, children: details[0] }), (0, jsx_runtime_1.jsx)("div", { style: { padding: '5px 0 0 5px' }, children: details[1] })] }, d) : null;
|
|
102
|
+
})] });
|
|
103
103
|
}
|
|
104
104
|
renderControls() {
|
|
105
105
|
const superpositionState = (0, plugin_custom_state_1.PluginCustomState)(this.plugin).superpositionState;
|
|
@@ -148,10 +148,10 @@ class AfSuperpositionControls extends base_1.PurePluginUIComponent {
|
|
|
148
148
|
return (0, plugin_custom_state_1.PluginCustomState)(this.plugin);
|
|
149
149
|
}
|
|
150
150
|
superposeByDbMapping() {
|
|
151
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(common_1.Button,
|
|
151
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.SuperposeChainsSvg, title: 'Superpose AlphaFold structure using intersection of residues from SIFTS UNIPROT mapping.', className: 'msp-btn msp-btn-block', onClick: this.superposeDb, style: { marginTop: '1px', textAlign: 'left' }, disabled: this.state.isBusy, children: "Load AlphaFold structure" }) });
|
|
152
152
|
}
|
|
153
153
|
render() {
|
|
154
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div",
|
|
154
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: { backgroundColor: '#dce54e', fontWeight: 500, padding: '5px 12px' }, children: "New Feature!" }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-help-text', style: { margin: '2px 0' }, children: (0, jsx_runtime_1.jsxs)("div", { className: 'msp-help-description', children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: icons_2.InfoIconSvg, inline: true }), "Load and superpose AlphaFold structure against representative chains."] }) }), (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [this.state.canUseDb && this.superposeByDbMapping(), (0, jsx_runtime_1.jsx)(common_1.ToggleButton, { icon: icons_1.TuneSvg, label: '', title: 'Options', toggle: this.toggleOptions, isSelected: this.state.action === 'options', disabled: this.state.isBusy, style: { flex: '0 0 40px', padding: 0 } })] }), this.state.action === 'options' && (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-offset', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: exports.AlphafoldSuperpositionParams, values: this.state.options, onChangeValues: this.setOptions, isDisabled: this.state.isBusy }) })] });
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
exports.AfSuperpositionControls = AfSuperpositionControls;
|
|
@@ -28,7 +28,7 @@ export declare class AnnotationsComponentControls extends PurePluginUIComponent<
|
|
|
28
28
|
initOptionParams: () => void;
|
|
29
29
|
getStructure: () => StateObject<Structure, StateObject.Type<any>> | undefined;
|
|
30
30
|
toggleCollapsed: () => void;
|
|
31
|
-
applyAnnotation: (type:
|
|
31
|
+
applyAnnotation: (type: "validation" | "domains", visibleState: boolean, params?: StructureQualityReportColorThemeProps | DomainAnnotationsColorThemeProps) => void;
|
|
32
32
|
toggleAnnotation: (type: AnnotationType) => void;
|
|
33
33
|
updateValidationParams: (values: StructureQualityReportColorThemeProps) => void;
|
|
34
34
|
updateDomainParams: (values?: DomainAnnotationsColorThemeProps) => void;
|
|
@@ -166,10 +166,10 @@ class AnnotationsComponentControls extends base_1.PurePluginUIComponent {
|
|
|
166
166
|
: 'msp-transform-wrapper';
|
|
167
167
|
const validationDataReady = (_a = this.getStructure()) === null || _a === void 0 ? void 0 : _a.data.model.customProperties.has(prop_1.StructureQualityReportProvider.descriptor);
|
|
168
168
|
const domainDataReady = (_b = this.getStructure()) === null || _b === void 0 ? void 0 : _b.data.model.customProperties.has(prop_2.DomainAnnotationsProvider.descriptor);
|
|
169
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
169
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: wrapClass, children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-transform-header', children: (0, jsx_runtime_1.jsxs)(common_1.Button, { icon: brand ? undefined : this.state.isCollapsed ? icons_1.ArrowRightSvg : icons_1.ArrowDropDownSvg, noOverflow: true, onClick: this.toggleCollapsed, className: brand ? `msp-transform-header-brand msp-transform-header-brand-${brand.accent}` : undefined, title: `Click to ${this.state.isCollapsed ? 'expand' : 'collapse'}`, children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: brand === null || brand === void 0 ? void 0 : brand.svg, inline: true }), "Annotations", (0, jsx_runtime_1.jsx)("small", { style: { margin: '0 6px' }, children: this.state.isCollapsed ? '' : this.state.description })] }) }), !this.state.isCollapsed && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [this.state.validationParams &&
|
|
170
170
|
(0, jsx_runtime_1.jsx)(annotation_row_controls_1.AnnotationRowControls, { title: 'Validation', params: this.state.validationParams.params, values: this.state.validationParams.values, onChangeValues: this.updateValidationParams, applied: this.state.validationApplied, onChangeApplied: () => this.toggleAnnotation('validation'), errorMessage: validationDataReady ? undefined : 'First activate annotation to show options' }), this.state.domainsParams &&
|
|
171
171
|
(0, jsx_runtime_1.jsx)(annotation_row_controls_1.AnnotationRowControls, { title: 'Domain Annotations', shortTitle: 'Domains', params: this.state.domainsParams.params, values: this.state.domainsParams.values, onChangeValues: this.updateDomainParams, applied: this.state.domainsApplied, onChangeApplied: () => this.toggleAnnotation('domains'), errorMessage: domainDataReady ? undefined : 'First activate annotation to show options' }), this.state.showSymmetryAnnotation &&
|
|
172
|
-
(0, jsx_runtime_1.jsx)(symmetry_annotation_controls_1.SymmetryAnnotationControls, {})] })] })
|
|
172
|
+
(0, jsx_runtime_1.jsx)(symmetry_annotation_controls_1.SymmetryAnnotationControls, {})] })] });
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
exports.AnnotationsComponentControls = AnnotationsComponentControls;
|
|
@@ -32,12 +32,12 @@ class AnnotationRowControls extends react_1.default.PureComponent {
|
|
|
32
32
|
var _a;
|
|
33
33
|
if (!this.props.params)
|
|
34
34
|
return null;
|
|
35
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div",
|
|
36
|
-
(0, jsx_runtime_1.jsx)("div",
|
|
35
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [(0, jsx_runtime_1.jsx)(common_1.Button, { noOverflow: true, className: 'msp-control-button-label', title: this.props.title, style: { textAlign: 'left' }, children: (_a = this.props.shortTitle) !== null && _a !== void 0 ? _a : this.props.title }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { onClick: () => this.toggleApplied(), toggleState: false, svg: !this.isApplied() ? icons_1.VisibilityOffOutlinedSvg : icons_1.VisibilityOutlinedSvg, title: `Click to ${this.isApplied() ? 'hide' : 'show'} ${this.props.title}`, small: true, className: 'msp-form-control', flex: true }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { onClick: () => this.toggleOptions(), svg: icons_1.MoreHorizSvg, title: 'Options', toggleState: this.state.optionsExpanded, className: 'msp-form-control', flex: true })] }), this.state.optionsExpanded &&
|
|
36
|
+
(0, jsx_runtime_1.jsx)("div", { style: { marginBottom: '6px' }, children: (0, jsx_runtime_1.jsx)("div", { className: 'msp-accent-offset', children: (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: this.renderOptions() }) }) })] });
|
|
37
37
|
}
|
|
38
38
|
renderOptions() {
|
|
39
39
|
if (this.props.errorMessage) {
|
|
40
|
-
return (0, jsx_runtime_1.jsx)("div",
|
|
40
|
+
return (0, jsx_runtime_1.jsx)("div", { className: 'msp-row-text', children: (0, jsx_runtime_1.jsx)("div", { children: this.props.errorMessage }) });
|
|
41
41
|
}
|
|
42
42
|
return (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: this.props.params, onChange: this.props.onChange, values: this.props.values, onChangeValues: this.props.onChangeValues, onEnter: this.props.onEnter });
|
|
43
43
|
}
|
|
@@ -11,7 +11,7 @@ class CustomControls extends base_1.PluginUIComponent {
|
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
13
|
const customControls = Array.from(plugin_custom_state_1.PluginCustomControls.get(this.plugin, this.props.region).entries());
|
|
14
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: customControls.map(([name, Control]) => (0, jsx_runtime_1.jsx)("div",
|
|
14
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: customControls.map(([name, Control]) => (0, jsx_runtime_1.jsx)("div", { className: `pdbemolstar-custom-control-${this.props.region}`, children: (0, jsx_runtime_1.jsx)(Control, {}) }, name)) });
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
exports.CustomControls = CustomControls;
|
|
@@ -50,5 +50,5 @@ function SuperpositionExportControls({ plugin }) {
|
|
|
50
50
|
setExporting(false);
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: Params, values: params, onChangeValues: setParams, isDisabled: isBusy || exporting }), (0, jsx_runtime_1.jsx)(common_1.Button,
|
|
53
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: Params, values: params, onChangeValues: setParams, isDisabled: isBusy || exporting }), (0, jsx_runtime_1.jsx)(common_1.Button, { onClick: onExport, style: { marginTop: 1 }, disabled: isBusy || hierarchy.structures.length === 0 || exporting, commit: hierarchy.structures.length > 0 ? 'on' : 'off', children: label })] });
|
|
54
54
|
}
|
package/lib/ui/icons.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.HourglassBottomSvg = exports.ChevronRightSvg = exports.ChevronLeftSvg = exports.TextsmsOutlinedSvg = exports.InfoIconSvg = exports.WavesIconSvg = exports.CollectionsOutlinedSvg = exports.EmptyIconSvg = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
function svgIcon(path) {
|
|
6
|
-
const svg = (0, jsx_runtime_1.jsx)("svg",
|
|
6
|
+
const svg = (0, jsx_runtime_1.jsx)("svg", { width: '24px', height: '24px', viewBox: '0 0 24 24', children: (0, jsx_runtime_1.jsx)("path", { d: path }) });
|
|
7
7
|
return function SvgIcon() { return svg; };
|
|
8
8
|
}
|
|
9
9
|
// Source: https://mui.com/material-ui/material-icons/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.VerticalTabbedPanel = VerticalTabbedPanel;
|
|
4
|
+
exports.LeftPanel = LeftPanel;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
7
|
const base_1 = require("molstar/lib/mol-plugin-ui/base");
|
|
@@ -10,7 +11,7 @@ const sleep_1 = require("molstar/lib/mol-util/sleep");
|
|
|
10
11
|
/** Convert `Icon` to a React functional element. `Icon` can be either React element (class or functional) or a string with icon path (in 24x24 viewBox) */
|
|
11
12
|
function resolveIcon(Icon) {
|
|
12
13
|
if (typeof Icon === 'string') {
|
|
13
|
-
return function _Icon() { return (0, jsx_runtime_1.jsx)("svg",
|
|
14
|
+
return function _Icon() { return (0, jsx_runtime_1.jsx)("svg", { width: '24px', height: '24px', viewBox: '0 0 24 24', children: (0, jsx_runtime_1.jsx)("path", { d: Icon }) }); };
|
|
14
15
|
}
|
|
15
16
|
else {
|
|
16
17
|
return function _Icon() { return (0, jsx_runtime_1.jsx)(Icon, {}); };
|
|
@@ -89,12 +90,11 @@ function VerticalTabbedPanel(options) {
|
|
|
89
90
|
return null;
|
|
90
91
|
return (0, jsx_runtime_1.jsx)(common_1.IconButton, { title: tab.title, svg: resolveIcon(tab.icon), toggleState: tab.id === currentTabId, onClick: () => this.toggleTab(tab.id), transparent: true, style: { position: 'relative' }, extraContent: this.state.dirtyTabs.includes(tab.id) ? (0, jsx_runtime_1.jsx)("div", { className: 'msp-left-panel-controls-button-data-dirty' }) : undefined }, tab.id);
|
|
91
92
|
};
|
|
92
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
93
|
-
(0, jsx_runtime_1.jsxs)("div",
|
|
93
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'msp-left-panel-controls', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'msp-left-panel-controls-buttons', children: [(_a = options.tabsTop) === null || _a === void 0 ? void 0 : _a.map(iconForTab), (0, jsx_runtime_1.jsx)("div", { className: 'msp-left-panel-controls-buttons-bottom', children: (_b = options.tabsBottom) === null || _b === void 0 ? void 0 : _b.map(iconForTab) })] }), currentTab &&
|
|
94
|
+
(0, jsx_runtime_1.jsxs)("div", { className: 'msp-scrollable-container', children: [CurrentTabHeader && (0, jsx_runtime_1.jsx)(CurrentTabHeader, {}) || (0, jsx_runtime_1.jsx)(common_1.SectionHeader, { icon: resolveIcon(currentTab.icon), title: currentTab.title }), CurrentTabBody && (0, jsx_runtime_1.jsx)(CurrentTabBody, {})] })] });
|
|
94
95
|
}
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
|
-
exports.VerticalTabbedPanel = VerticalTabbedPanel;
|
|
98
98
|
/** Set left panel state in Molstar layout to 'full' (if expanded) or 'collapsed' (if not expanded).
|
|
99
99
|
* Do not change the state if it is 'hidden'. */
|
|
100
100
|
function adjustLeftPanelState(plugin, expanded) {
|
|
@@ -117,4 +117,3 @@ function LeftPanel(options) {
|
|
|
117
117
|
(_c = options.onTabChange) === null || _c === void 0 ? void 0 : _c.call(options, plugin, tab);
|
|
118
118
|
} }));
|
|
119
119
|
}
|
|
120
|
-
exports.LeftPanel = LeftPanel;
|
|
@@ -48,7 +48,7 @@ export declare const CoreLeftPanelTabs: {
|
|
|
48
48
|
readonly header: typeof DataTabHeader;
|
|
49
49
|
readonly body: typeof DataTabBody;
|
|
50
50
|
readonly dirtyOn: (plugin: import("molstar/lib/mol-plugin/context").PluginContext) => import("rxjs").Subject<{
|
|
51
|
-
state: import("molstar/lib/mol-state
|
|
51
|
+
state: import("molstar/lib/mol-state").State;
|
|
52
52
|
inTransaction: boolean;
|
|
53
53
|
}>;
|
|
54
54
|
};
|