drugflow-molstar 0.3.77 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/drugflow-molstar-0.4.1.css +1 -0
- package/build/drugflow-molstar-component-0.4.1.js +25 -0
- package/build/drugflow-molstar-plugin-0.4.1.js +2 -0
- package/build/drugflow-molstar-plugin-0.4.1.js.LICENSE.txt +64 -0
- package/lib/alphafold-transparency.js +58 -125
- package/lib/contact.d.ts +15 -6
- package/lib/contact.js +71 -66
- package/lib/custom-events.js +16 -16
- package/lib/domain-annotations/behavior.js +20 -24
- package/lib/domain-annotations/color.d.ts +1 -1
- package/lib/domain-annotations/color.js +23 -22
- package/lib/domain-annotations/prop.d.ts +3 -3
- package/lib/domain-annotations/prop.js +54 -76
- package/lib/drugflow-molstar-component-build-0.3.78.js +2 -0
- package/lib/drugflow-molstar-component-build-0.4.1.js +2 -0
- package/lib/helpers.d.ts +4 -4
- package/lib/helpers.js +94 -99
- package/lib/index.js +1785 -2608
- package/lib/labels.d.ts +1 -1
- package/lib/labels.js +20 -23
- package/lib/loci-details.d.ts +2 -2
- package/lib/loci-details.js +26 -29
- package/lib/sifts-mapping.js +30 -34
- package/lib/sifts-mappings-behaviour.js +26 -30
- package/lib/spec.d.ts +1 -1
- package/lib/spec.js +50 -38
- package/lib/structure_contact3d.d.ts +13 -4
- package/lib/structure_contact3d.js +25 -46
- package/lib/subscribe-events.js +17 -17
- package/lib/superposition-export.js +100 -144
- package/lib/superposition-focus-representation.d.ts +1 -1
- package/lib/superposition-focus-representation.js +74 -112
- package/lib/superposition-sifts-mapping.d.ts +1 -1
- package/lib/superposition-sifts-mapping.js +56 -62
- package/lib/superposition.d.ts +2 -2
- package/lib/superposition.js +490 -726
- package/lib/ui/alphafold-superposition.d.ts +8 -9
- package/lib/ui/alphafold-superposition.js +96 -120
- package/lib/ui/alphafold-tranparency.d.ts +1 -2
- package/lib/ui/alphafold-tranparency.js +27 -43
- package/lib/ui/annotation-controls.d.ts +2 -3
- package/lib/ui/annotation-controls.js +81 -87
- package/lib/ui/export-superposition.js +33 -51
- package/lib/ui/pdbe-left-panel.d.ts +3 -3
- package/lib/ui/pdbe-left-panel.js +82 -106
- package/lib/ui/pdbe-screenshot-controls.d.ts +1 -1
- package/lib/ui/pdbe-screenshot-controls.js +54 -83
- package/lib/ui/pdbe-structure-controls.d.ts +4 -5
- package/lib/ui/pdbe-structure-controls.js +34 -57
- package/lib/ui/pdbe-viewport-controls.d.ts +1 -2
- package/lib/ui/pdbe-viewport-controls.js +23 -29
- package/lib/ui/segment-tree.d.ts +1 -2
- package/lib/ui/segment-tree.js +438 -590
- package/lib/ui/superposition-components.d.ts +1 -2
- package/lib/ui/superposition-components.js +196 -266
- package/lib/ui/superposition-viewport.d.ts +1 -2
- package/lib/ui/superposition-viewport.js +11 -18
- package/package.json +7 -4
- package/build/drugflow-molstar-0.3.62.css +0 -1
- package/build/drugflow-molstar-0.3.77.css +0 -1
- package/build/drugflow-molstar-component-0.3.62.js +0 -25
- package/build/drugflow-molstar-component-0.3.77.js +0 -25
- package/build/drugflow-molstar-light.css +0 -1
- package/build/drugflow-molstar-plugin-0.3.62.js +0 -2
- package/build/drugflow-molstar-plugin-0.3.62.js.LICENSE.txt +0 -39
- package/build/drugflow-molstar-plugin-0.3.77.js +0 -2
- package/build/drugflow-molstar-plugin-0.3.77.js.LICENSE.txt +0 -39
- package/lib/drugflow-molstar-component-build-0.1.2.js +0 -4268
- package/lib/drugflow-molstar-component-build-0.1.2.js.map +0 -1
- package/lib/drugflow-molstar-component-build-0.1.3.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.4.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.4.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.1.5.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.5.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.1.6.js +0 -2
- package/lib/drugflow-molstar-component-build-0.1.6.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.10.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.10.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.2.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.2.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.3.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.3.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.4.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.4.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.5.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.5.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.6.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.6.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.7.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.7.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.2.9.js +0 -2
- package/lib/drugflow-molstar-component-build-0.2.9.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.1.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.1.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.10.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.10.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.11.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.11.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.12.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.12.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.13.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.13.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.14.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.14.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.15.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.15.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.16.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.16.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.17.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.17.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.18.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.18.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.19.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.19.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.2.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.2.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.20.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.20.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.21.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.21.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.22.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.22.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.23.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.23.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.24.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.24.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.25.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.25.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.26.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.26.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.27.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.27.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.28.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.28.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.29.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.29.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.3.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.3.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.30.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.30.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.31.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.31.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.32.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.32.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.33.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.33.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.34.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.34.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.35.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.35.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.36.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.36.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.37.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.37.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.38.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.38.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.39.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.39.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.4.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.4.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.40.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.40.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.41.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.41.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.42.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.42.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.43.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.43.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.44.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.44.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.46.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.46.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.47.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.47.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.48.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.48.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.49.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.49.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.5.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.5.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.50.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.50.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.51.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.51.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.52.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.52.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.53.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.53.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.54.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.54.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.55.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.55.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.56.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.56.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.57.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.57.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.58.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.58.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.59.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.59.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.6.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.6.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.60.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.60.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.61.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.61.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.62.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.62.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.63.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.63.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.64.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.64.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.65.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.65.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.66.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.66.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.67.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.67.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.68.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.68.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.69.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.69.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.7.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.7.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.70.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.70.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.71.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.71.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.72.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.72.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.73.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.73.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.74.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.74.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.75.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.75.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.76.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.76.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.77.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.77.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.8.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.8.js.LICENSE.txt +0 -24
- package/lib/drugflow-molstar-component-build-0.3.9.js +0 -2
- package/lib/drugflow-molstar-component-build-0.3.9.js.LICENSE.txt +0 -24
- package/lib/index2.d.ts +0 -1
- package/lib/index2.js +0 -1369
- package/lib/pdbe-molstar-component-build-3.1.2.js +0 -2
- package/lib/pdbe-molstar-component-build-3.1.2.js.LICENSE.txt +0 -24
- /package/lib/{drugflow-molstar-component-build-0.1.2.js.LICENSE.txt → drugflow-molstar-component-build-0.3.78.js.LICENSE.txt} +0 -0
- /package/lib/{drugflow-molstar-component-build-0.1.3.js.LICENSE.txt → drugflow-molstar-component-build-0.4.1.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @license React
|
|
38
|
+
* react-jsx-runtime.production.min.js
|
|
39
|
+
*
|
|
40
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the MIT license found in the
|
|
43
|
+
* LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @license React
|
|
48
|
+
* react.production.min.js
|
|
49
|
+
*
|
|
50
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the MIT license found in the
|
|
53
|
+
* LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @license React
|
|
58
|
+
* scheduler.production.min.js
|
|
59
|
+
*
|
|
60
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the MIT license found in the
|
|
63
|
+
* LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.clearStructureTransparency = exports.setStructureTransparency = exports.applyAFTransparency = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var TransparencyManagerTag = 'transparency-controls';
|
|
4
|
+
const structure_1 = require("Molstar/mol-model/structure");
|
|
5
|
+
const transforms_1 = require("Molstar/mol-plugin-state/transforms");
|
|
6
|
+
const mol_state_1 = require("Molstar/mol-state");
|
|
7
|
+
const loci_1 = require("Molstar/mol-model/loci");
|
|
8
|
+
const transparency_1 = require("Molstar/mol-theme/transparency");
|
|
9
|
+
const builder_1 = require("Molstar/mol-script/language/builder");
|
|
10
|
+
const prop_1 = require("Molstar/extensions/model-archive/quality-assessment/prop");
|
|
11
|
+
const compiler_1 = require("Molstar/mol-script/runtime/query/compiler");
|
|
12
|
+
const structure_2 = require("Molstar/mol-model/structure");
|
|
13
|
+
const TransparencyManagerTag = 'transparency-controls';
|
|
15
14
|
function getLociByPLDDT(score, contextData) {
|
|
16
|
-
|
|
15
|
+
const queryExp = builder_1.MolScriptBuilder.struct.modifier.union([
|
|
17
16
|
builder_1.MolScriptBuilder.struct.modifier.wholeResidues([
|
|
18
17
|
builder_1.MolScriptBuilder.struct.modifier.union([
|
|
19
18
|
builder_1.MolScriptBuilder.struct.generator.atomGroups({
|
|
@@ -23,131 +22,65 @@ function getLociByPLDDT(score, contextData) {
|
|
|
23
22
|
])
|
|
24
23
|
])
|
|
25
24
|
]);
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const query = (0, compiler_1.compile)(queryExp);
|
|
26
|
+
const sel = query(new structure_2.QueryContext(contextData));
|
|
28
27
|
return structure_2.StructureSelection.toLociWithSourceUnits(sel);
|
|
29
28
|
}
|
|
30
|
-
function applyAFTransparency(plugin, structure, transparency, pLDDT) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return [2 /*return*/, plugin.dataTransaction(function (ctx) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
36
|
-
var loci;
|
|
37
|
-
var _a;
|
|
38
|
-
return tslib_1.__generator(this, function (_b) {
|
|
39
|
-
switch (_b.label) {
|
|
40
|
-
case 0:
|
|
41
|
-
loci = getLociByPLDDT(pLDDT, (_a = structure.cell.obj) === null || _a === void 0 ? void 0 : _a.data);
|
|
42
|
-
return [4 /*yield*/, setStructureTransparency(plugin, structure.components, transparency, loci)];
|
|
43
|
-
case 1:
|
|
44
|
-
_b.sent();
|
|
45
|
-
return [2 /*return*/];
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}); }, { canUndo: 'Apply Transparency' })];
|
|
49
|
-
});
|
|
50
|
-
});
|
|
29
|
+
async function applyAFTransparency(plugin, structure, transparency, pLDDT = 70) {
|
|
30
|
+
return plugin.dataTransaction(async (ctx) => {
|
|
31
|
+
const loci = getLociByPLDDT(pLDDT, structure.cell.obj?.data);
|
|
32
|
+
await setStructureTransparency(plugin, structure.components, transparency, loci);
|
|
33
|
+
}, { canUndo: 'Apply Transparency' });
|
|
51
34
|
}
|
|
52
35
|
exports.applyAFTransparency = applyAFTransparency;
|
|
53
|
-
function setStructureTransparency(plugin, components, value, loci, types) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
filtered = getFilteredBundle([layer], structure);
|
|
77
|
-
update.to(repr.transform.ref)
|
|
78
|
-
.apply(transforms_1.StateTransforms.Representation.TransparencyStructureRepresentation3DFromBundle, transparency_1.Transparency.toBundle(filtered), { tags: TransparencyManagerTag });
|
|
79
|
-
}
|
|
80
|
-
return [2 /*return*/];
|
|
81
|
-
});
|
|
82
|
-
}); })];
|
|
83
|
-
case 1:
|
|
84
|
-
_a.sent();
|
|
85
|
-
return [2 /*return*/];
|
|
86
|
-
}
|
|
87
|
-
});
|
|
36
|
+
async function setStructureTransparency(plugin, components, value, loci, types) {
|
|
37
|
+
await eachRepr(plugin, components, async (update, repr, transparencyCell) => {
|
|
38
|
+
if (types && types.length > 0 && !types.includes(repr.params.values.type.name))
|
|
39
|
+
return;
|
|
40
|
+
const structure = repr.obj.data.sourceData;
|
|
41
|
+
if (loci_1.Loci.isEmpty(loci) || (0, loci_1.isEmptyLoci)(loci))
|
|
42
|
+
return;
|
|
43
|
+
const layer = {
|
|
44
|
+
bundle: structure_1.StructureElement.Bundle.fromLoci(loci),
|
|
45
|
+
value,
|
|
46
|
+
};
|
|
47
|
+
if (transparencyCell) {
|
|
48
|
+
const bundleLayers = [...transparencyCell.params.values.layers, layer];
|
|
49
|
+
const filtered = getFilteredBundle(bundleLayers, structure);
|
|
50
|
+
update.to(transparencyCell).update(transparency_1.Transparency.toBundle(filtered));
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const filtered = getFilteredBundle([layer], structure);
|
|
54
|
+
update.to(repr.transform.ref)
|
|
55
|
+
.apply(transforms_1.StateTransforms.Representation.TransparencyStructureRepresentation3DFromBundle, transparency_1.Transparency.toBundle(filtered), { tags: TransparencyManagerTag });
|
|
56
|
+
}
|
|
88
57
|
});
|
|
89
58
|
}
|
|
90
59
|
exports.setStructureTransparency = setStructureTransparency;
|
|
91
|
-
function clearStructureTransparency(plugin, components, types) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (types && types.length > 0 && !types.includes(repr.params.values.type.name))
|
|
99
|
-
return [2 /*return*/];
|
|
100
|
-
if (transparencyCell) {
|
|
101
|
-
update.delete(transparencyCell.transform.ref);
|
|
102
|
-
}
|
|
103
|
-
return [2 /*return*/];
|
|
104
|
-
});
|
|
105
|
-
}); })];
|
|
106
|
-
case 1:
|
|
107
|
-
_a.sent();
|
|
108
|
-
return [2 /*return*/];
|
|
109
|
-
}
|
|
110
|
-
});
|
|
60
|
+
async function clearStructureTransparency(plugin, components, types) {
|
|
61
|
+
await eachRepr(plugin, components, async (update, repr, transparencyCell) => {
|
|
62
|
+
if (types && types.length > 0 && !types.includes(repr.params.values.type.name))
|
|
63
|
+
return;
|
|
64
|
+
if (transparencyCell) {
|
|
65
|
+
update.delete(transparencyCell.transform.ref);
|
|
66
|
+
}
|
|
111
67
|
});
|
|
112
68
|
}
|
|
113
69
|
exports.clearStructureTransparency = clearStructureTransparency;
|
|
114
|
-
function eachRepr(plugin, components, callback) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
case 1:
|
|
125
|
-
if (!(_i < components_1.length)) return [3 /*break*/, 6];
|
|
126
|
-
c = components_1[_i];
|
|
127
|
-
_a = 0, _b = c.representations;
|
|
128
|
-
_c.label = 2;
|
|
129
|
-
case 2:
|
|
130
|
-
if (!(_a < _b.length)) return [3 /*break*/, 5];
|
|
131
|
-
r = _b[_a];
|
|
132
|
-
transparency = state.select(mol_state_1.StateSelection.Generators.ofTransformer(transforms_1.StateTransforms.Representation.TransparencyStructureRepresentation3DFromBundle, r.cell.transform.ref).withTag(TransparencyManagerTag));
|
|
133
|
-
return [4 /*yield*/, callback(update, r.cell, transparency[0])];
|
|
134
|
-
case 3:
|
|
135
|
-
_c.sent();
|
|
136
|
-
_c.label = 4;
|
|
137
|
-
case 4:
|
|
138
|
-
_a++;
|
|
139
|
-
return [3 /*break*/, 2];
|
|
140
|
-
case 5:
|
|
141
|
-
_i++;
|
|
142
|
-
return [3 /*break*/, 1];
|
|
143
|
-
case 6: return [2 /*return*/, update.commit({ doNotUpdateCurrent: true })];
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
});
|
|
70
|
+
async function eachRepr(plugin, components, callback) {
|
|
71
|
+
const state = plugin.state.data;
|
|
72
|
+
const update = state.build();
|
|
73
|
+
for (const c of components) {
|
|
74
|
+
for (const r of c.representations) {
|
|
75
|
+
const transparency = state.select(mol_state_1.StateSelection.Generators.ofTransformer(transforms_1.StateTransforms.Representation.TransparencyStructureRepresentation3DFromBundle, r.cell.transform.ref).withTag(TransparencyManagerTag));
|
|
76
|
+
await callback(update, r.cell, transparency[0]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return update.commit({ doNotUpdateCurrent: true });
|
|
147
80
|
}
|
|
148
81
|
/** filter transparency layers for given structure */
|
|
149
82
|
function getFilteredBundle(layers, structure) {
|
|
150
|
-
|
|
151
|
-
|
|
83
|
+
const transparency = transparency_1.Transparency.ofBundle(layers, structure.root);
|
|
84
|
+
const merged = transparency_1.Transparency.merge(transparency);
|
|
152
85
|
return transparency_1.Transparency.filter(merged, structure);
|
|
153
86
|
}
|
package/lib/contact.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const ContactParams: {
|
|
|
24
24
|
tether: PD.BooleanParam;
|
|
25
25
|
tetherLength: PD.Numeric;
|
|
26
26
|
tetherBaseWidth: PD.Numeric;
|
|
27
|
-
attachment: PD.Select<"
|
|
27
|
+
attachment: PD.Select<"middle-center" | "bottom-left" | "bottom-center" | "bottom-right" | "middle-left" | "middle-right" | "top-left" | "top-center" | "top-right">;
|
|
28
28
|
fontFamily: PD.Select<import("molstar/lib/mol-geo/geometry/text/font-atlas").FontFamily>;
|
|
29
29
|
fontQuality: PD.Select<number>;
|
|
30
30
|
fontStyle: PD.Select<import("molstar/lib/mol-geo/geometry/text/font-atlas").FontStyle>;
|
|
@@ -45,9 +45,15 @@ export declare const ContactParams: {
|
|
|
45
45
|
position: any;
|
|
46
46
|
rotation: any;
|
|
47
47
|
scale: any;
|
|
48
|
+
transform: any;
|
|
48
49
|
}>[];
|
|
49
50
|
}>>;
|
|
51
|
+
emissive: PD.Numeric;
|
|
52
|
+
density: PD.Numeric;
|
|
50
53
|
instanceGranularity: PD.BooleanParam;
|
|
54
|
+
lod: PD.Vec3;
|
|
55
|
+
cellSize: PD.Numeric;
|
|
56
|
+
batchSize: PD.Numeric;
|
|
51
57
|
lineSizeAttenuation: PD.BooleanParam;
|
|
52
58
|
linesSize: PD.Numeric;
|
|
53
59
|
dashLength: PD.Numeric;
|
|
@@ -56,15 +62,18 @@ export declare const ContactParams: {
|
|
|
56
62
|
sizeAspectRatio: PD.Numeric;
|
|
57
63
|
doubleSided: PD.BooleanParam;
|
|
58
64
|
ignoreLight: PD.BooleanParam;
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
celShaded: PD.BooleanParam;
|
|
66
|
+
xrayShaded: PD.Select<boolean | "inverted">;
|
|
67
|
+
transparentBackfaces: PD.Select<"off" | "on" | "opaque">;
|
|
68
|
+
solidInterior: PD.BooleanParam;
|
|
61
69
|
bumpFrequency: PD.Numeric;
|
|
62
70
|
bumpAmplitude: PD.Numeric;
|
|
71
|
+
colorMode: PD.Select<"default" | "interpolate">;
|
|
63
72
|
};
|
|
64
|
-
export
|
|
65
|
-
export
|
|
73
|
+
export type ContactParams = typeof ContactParams;
|
|
74
|
+
export type ContactProps = PD.Values<ContactParams>;
|
|
66
75
|
export declare function contactLabel(pair: Loci.Bundle<2>, options?: Partial<LabelOptions & {
|
|
67
76
|
interactionType: string;
|
|
68
77
|
}>): string;
|
|
69
|
-
export
|
|
78
|
+
export type ContactRepresentation = Representation<ContactData, ContactParams>;
|
|
70
79
|
export declare function ContactRepresentation(ctx: RepresentationContext, getParams: RepresentationParamsGetter<ContactData, ContactParams>): ContactRepresentation;
|
package/lib/contact.js
CHANGED
|
@@ -1,49 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContactRepresentation = exports.contactLabel = exports.ContactParams = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
4
|
// contact.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
const loci_1 = require("molstar/lib/mol-model/loci");
|
|
6
|
+
const text_1 = require("molstar/lib/mol-geo/geometry/text/text");
|
|
7
|
+
const param_definition_1 = require("molstar/lib/mol-util/param-definition");
|
|
8
|
+
const names_1 = require("molstar/lib/mol-util/color/names");
|
|
9
|
+
const representation_1 = require("molstar/lib/mol-repr/shape/representation");
|
|
10
|
+
const representation_2 = require("molstar/lib/mol-repr/representation");
|
|
11
|
+
const shape_1 = require("molstar/lib/mol-model/shape");
|
|
12
|
+
const text_builder_1 = require("molstar/lib/mol-geo/geometry/text/text-builder");
|
|
13
|
+
const linear_algebra_1 = require("molstar/lib/mol-math/linear-algebra");
|
|
14
|
+
const marker_action_1 = require("molstar/lib/mol-util/marker-action");
|
|
15
|
+
const label_1 = require("molstar/lib/mol-theme/label");
|
|
16
|
+
const common_1 = require("molstar/lib/mol-repr/shape/loci/common");
|
|
17
|
+
const geometry_1 = require("molstar/lib/mol-math/geometry");
|
|
18
|
+
const cylinders_builder_1 = require("molstar/lib/mol-geo/geometry/cylinders/cylinders-builder");
|
|
19
|
+
const cylinders_1 = require("molstar/lib/mol-geo/geometry/cylinders/cylinders");
|
|
20
|
+
const label_2 = require("molstar/lib/mol-theme/label");
|
|
21
|
+
const SharedParams = {
|
|
23
22
|
unitLabel: param_definition_1.ParamDefinition.Text('\u212B', { isEssential: true }),
|
|
24
23
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
const CylinderParams = {
|
|
25
|
+
...cylinders_1.Cylinders.Params,
|
|
26
|
+
...SharedParams,
|
|
27
|
+
lineSizeAttenuation: param_definition_1.ParamDefinition.Boolean(true),
|
|
28
|
+
linesSize: param_definition_1.ParamDefinition.Numeric(0.075, { min: 0.01, max: 5, step: 0.01 }),
|
|
29
|
+
dashLength: param_definition_1.ParamDefinition.Numeric(0.12, { min: 0.01, max: 0.2, step: 0.01 }),
|
|
30
|
+
interactionType: param_definition_1.ParamDefinition.Text('', { isEssential: true }),
|
|
31
|
+
cylinderColor: param_definition_1.ParamDefinition.Color(names_1.ColorNames.lightgreen, { isEssential: true }),
|
|
32
|
+
};
|
|
33
|
+
const TextParams = {
|
|
34
|
+
...common_1.LociLabelTextParams,
|
|
35
|
+
...SharedParams,
|
|
36
|
+
};
|
|
37
|
+
const ContactVisuals = {
|
|
38
|
+
cylinder: (ctx, getParams) => (0, representation_1.ShapeRepresentation)(getCylindersShape, cylinders_1.Cylinders.Utils, {
|
|
39
|
+
modifyState: (s) => ({ ...s, markerActions: marker_action_1.MarkerActions.Highlighting }),
|
|
40
|
+
}),
|
|
41
|
+
text: (ctx, getParams) => (0, representation_1.ShapeRepresentation)(getTextShape, text_1.Text.Utils, {
|
|
42
|
+
modifyState: (s) => ({ ...s, markerActions: marker_action_1.MarkerAction.None }),
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
exports.ContactParams = {
|
|
46
|
+
...CylinderParams,
|
|
47
|
+
...TextParams,
|
|
48
|
+
visuals: param_definition_1.ParamDefinition.MultiSelect(['cylinder', 'text'], param_definition_1.ParamDefinition.objectToOptions(ContactVisuals)),
|
|
38
49
|
};
|
|
39
|
-
exports.ContactParams = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, CylinderParams), TextParams), { visuals: param_definition_1.ParamDefinition.MultiSelect(['cylinder', 'text'], param_definition_1.ParamDefinition.objectToOptions(ContactVisuals)) });
|
|
40
50
|
//
|
|
41
|
-
function contactLabel(pair, options) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var label = (0, label_2.bundleLabel)(pair, o);
|
|
46
|
-
return "".concat((_a = o === null || o === void 0 ? void 0 : o.interactionType) !== null && _a !== void 0 ? _a : 'Distance', "</br>").concat(label);
|
|
51
|
+
function contactLabel(pair, options = {}) {
|
|
52
|
+
const o = { ...label_2.DefaultLabelOptions, ...options };
|
|
53
|
+
const label = (0, label_2.bundleLabel)(pair, o);
|
|
54
|
+
return `${o?.interactionType ?? 'Distance'}</br>${label}`;
|
|
47
55
|
}
|
|
48
56
|
exports.contactLabel = contactLabel;
|
|
49
57
|
function getContactState() {
|
|
@@ -55,8 +63,8 @@ function getContactState() {
|
|
|
55
63
|
};
|
|
56
64
|
}
|
|
57
65
|
function setContactState(pair, state) {
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
const { sphereA, sphereB, center } = state;
|
|
67
|
+
const [lociA, lociB] = pair.loci;
|
|
60
68
|
loci_1.Loci.getBoundingSphere(lociA, sphereA);
|
|
61
69
|
loci_1.Loci.getBoundingSphere(lociB, sphereB);
|
|
62
70
|
linear_algebra_1.Vec3.add(center, sphereA.center, sphereB.center);
|
|
@@ -64,53 +72,50 @@ function setContactState(pair, state) {
|
|
|
64
72
|
state.distance = linear_algebra_1.Vec3.distance(sphereA.center, sphereB.center);
|
|
65
73
|
return state;
|
|
66
74
|
}
|
|
67
|
-
|
|
75
|
+
const tmpState = getContactState();
|
|
68
76
|
function getContactName(data, unitLabel) {
|
|
69
77
|
return data.pairs.length === 1
|
|
70
|
-
?
|
|
71
|
-
unitLabel
|
|
78
|
+
? `Contact ${(0, label_1.distanceLabel)(data.pairs[0], {
|
|
79
|
+
unitLabel,
|
|
72
80
|
measureOnly: true,
|
|
73
|
-
})
|
|
74
|
-
:
|
|
81
|
+
})}`
|
|
82
|
+
: `${data.pairs.length} Contacts`;
|
|
75
83
|
}
|
|
76
84
|
//
|
|
77
85
|
function buildCylinders(data, props, cylinders) {
|
|
78
|
-
|
|
79
|
-
for (
|
|
86
|
+
const builder = cylinders_builder_1.CylindersBuilder.create(128, 64, cylinders);
|
|
87
|
+
for (let i = 0, il = data.pairs.length; i < il; ++i) {
|
|
80
88
|
setContactState(data.pairs[i], tmpState);
|
|
81
89
|
// TODO: radiusScale: number, topCap: boolean, bottomCap: boolean
|
|
82
|
-
builder.addFixedLengthDashes(tmpState.sphereA.center, tmpState.sphereB.center, props.dashLength, 1, true, true,
|
|
90
|
+
builder.addFixedLengthDashes(tmpState.sphereA.center, tmpState.sphereB.center, props.dashLength, 1, true, true, false, // interpolate parameter
|
|
91
|
+
i);
|
|
83
92
|
}
|
|
84
93
|
return builder.getCylinders();
|
|
85
94
|
}
|
|
86
95
|
function getCylindersShape(ctx, data, props, shape) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
};
|
|
92
|
-
return shape_1.Shape.create(name, data, cylinders, function () { return props.cylinderColor; }, function () { return props.linesSize; }, getLabel);
|
|
96
|
+
const cylinders = buildCylinders(data, props, shape && shape.geometry);
|
|
97
|
+
const name = getContactName(data, props.unitLabel);
|
|
98
|
+
const getLabel = (groupId) => contactLabel(data.pairs[groupId], props);
|
|
99
|
+
return shape_1.Shape.create(name, data, cylinders, () => props.cylinderColor, () => props.linesSize, getLabel);
|
|
93
100
|
}
|
|
94
101
|
//
|
|
95
102
|
function buildText(data, props, text) {
|
|
96
|
-
|
|
97
|
-
for (
|
|
103
|
+
const builder = text_builder_1.TextBuilder.create(props, 128, 64, text);
|
|
104
|
+
for (let i = 0, il = data.pairs.length; i < il; ++i) {
|
|
98
105
|
setContactState(data.pairs[i], tmpState);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
106
|
+
const { center, distance, sphereA, sphereB } = tmpState;
|
|
107
|
+
const label = props.customText || `${distance.toFixed(2)} ${props.unitLabel}`;
|
|
108
|
+
const radius = Math.max(2, sphereA.radius, sphereB.radius);
|
|
109
|
+
const scale = radius / 2;
|
|
103
110
|
builder.add(label, center[0], center[1], center[2], 1, scale, i);
|
|
104
111
|
}
|
|
105
112
|
return builder.getText();
|
|
106
113
|
}
|
|
107
114
|
function getTextShape(ctx, data, props, shape) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
};
|
|
113
|
-
return shape_1.Shape.create(name, data, text, function () { return props.textColor; }, function () { return props.textSize; }, getLabel);
|
|
115
|
+
const text = buildText(data, props, shape && shape.geometry);
|
|
116
|
+
const name = getContactName(data, props.unitLabel);
|
|
117
|
+
const getLabel = (groupId) => (0, label_1.distanceLabel)(data.pairs[groupId], props);
|
|
118
|
+
return shape_1.Shape.create(name, data, text, () => props.textColor, () => props.textSize, getLabel);
|
|
114
119
|
}
|
|
115
120
|
function ContactRepresentation(ctx, getParams) {
|
|
116
121
|
return representation_2.Representation.createMulti('Contact', ctx, getParams, representation_2.Representation.StateBuilder, ContactVisuals);
|
package/lib/custom-events.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CustomEvents = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const loci_details_1 = require("./loci-details");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
6
|
var CustomEvents;
|
|
7
7
|
(function (CustomEvents) {
|
|
8
8
|
function create(eventTypeArr) {
|
|
9
|
-
|
|
10
|
-
for (
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
let eventObj = {};
|
|
10
|
+
for (let ei = 0, el = eventTypeArr.length; ei < el; ei++) {
|
|
11
|
+
let eventType = eventTypeArr[ei];
|
|
12
|
+
let event;
|
|
13
13
|
if (typeof MouseEvent == 'function') {
|
|
14
14
|
// current standard
|
|
15
|
-
|
|
15
|
+
event = new MouseEvent(eventType, { 'view': window, 'bubbles': true, 'cancelable': true });
|
|
16
16
|
}
|
|
17
17
|
else if (typeof document.createEvent == 'function') {
|
|
18
18
|
// older standard
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
event = document.createEvent('MouseEvents');
|
|
20
|
+
event.initEvent(eventType, true /* bubbles */, true /* cancelable */);
|
|
21
21
|
}
|
|
22
|
-
eventObj[eventType] =
|
|
22
|
+
eventObj[eventType] = event;
|
|
23
23
|
}
|
|
24
24
|
;
|
|
25
25
|
return eventObj;
|
|
@@ -33,17 +33,17 @@ var CustomEvents;
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
function add(plugin, targetElement) {
|
|
36
|
-
|
|
37
|
-
plugin.behaviors.interaction.click.subscribe(
|
|
36
|
+
const pdbevents = create(['PDB.molstar.click', 'PDB.molstar.mouseover', 'PDB.molstar.mouseout']);
|
|
37
|
+
plugin.behaviors.interaction.click.subscribe((e) => {
|
|
38
38
|
if (e.button === 1 && e.current && e.current.loci.kind !== 'empty-loci') {
|
|
39
|
-
|
|
39
|
+
const evData = (0, loci_details_1.lociDetails)(e.current.loci);
|
|
40
40
|
if (evData)
|
|
41
41
|
dispatchCustomEvent(pdbevents['PDB.molstar.click'], evData, targetElement);
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
plugin.behaviors.interaction.hover.pipe((0, operators_1.debounceTime)(100)).subscribe(
|
|
44
|
+
plugin.behaviors.interaction.hover.pipe((0, operators_1.debounceTime)(100)).subscribe((e) => {
|
|
45
45
|
if (e.current && e.current.loci && e.current.loci.kind !== 'empty-loci') {
|
|
46
|
-
|
|
46
|
+
const evData = (0, loci_details_1.lociDetails)(e.current.loci);
|
|
47
47
|
if (evData)
|
|
48
48
|
dispatchCustomEvent(pdbevents['PDB.molstar.mouseover'], evData, targetElement);
|
|
49
49
|
}
|
|
@@ -53,4 +53,4 @@ var CustomEvents;
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
CustomEvents.add = add;
|
|
56
|
-
})(CustomEvents
|
|
56
|
+
})(CustomEvents || (exports.CustomEvents = CustomEvents = {}));
|