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.
Files changed (250) hide show
  1. package/build/drugflow-molstar-0.4.1.css +1 -0
  2. package/build/drugflow-molstar-component-0.4.1.js +25 -0
  3. package/build/drugflow-molstar-plugin-0.4.1.js +2 -0
  4. package/build/drugflow-molstar-plugin-0.4.1.js.LICENSE.txt +64 -0
  5. package/lib/alphafold-transparency.js +58 -125
  6. package/lib/contact.d.ts +15 -6
  7. package/lib/contact.js +71 -66
  8. package/lib/custom-events.js +16 -16
  9. package/lib/domain-annotations/behavior.js +20 -24
  10. package/lib/domain-annotations/color.d.ts +1 -1
  11. package/lib/domain-annotations/color.js +23 -22
  12. package/lib/domain-annotations/prop.d.ts +3 -3
  13. package/lib/domain-annotations/prop.js +54 -76
  14. package/lib/drugflow-molstar-component-build-0.3.78.js +2 -0
  15. package/lib/drugflow-molstar-component-build-0.4.1.js +2 -0
  16. package/lib/helpers.d.ts +4 -4
  17. package/lib/helpers.js +94 -99
  18. package/lib/index.js +1785 -2608
  19. package/lib/labels.d.ts +1 -1
  20. package/lib/labels.js +20 -23
  21. package/lib/loci-details.d.ts +2 -2
  22. package/lib/loci-details.js +26 -29
  23. package/lib/sifts-mapping.js +30 -34
  24. package/lib/sifts-mappings-behaviour.js +26 -30
  25. package/lib/spec.d.ts +1 -1
  26. package/lib/spec.js +50 -38
  27. package/lib/structure_contact3d.d.ts +13 -4
  28. package/lib/structure_contact3d.js +25 -46
  29. package/lib/subscribe-events.js +17 -17
  30. package/lib/superposition-export.js +100 -144
  31. package/lib/superposition-focus-representation.d.ts +1 -1
  32. package/lib/superposition-focus-representation.js +74 -112
  33. package/lib/superposition-sifts-mapping.d.ts +1 -1
  34. package/lib/superposition-sifts-mapping.js +56 -62
  35. package/lib/superposition.d.ts +2 -2
  36. package/lib/superposition.js +490 -726
  37. package/lib/ui/alphafold-superposition.d.ts +8 -9
  38. package/lib/ui/alphafold-superposition.js +96 -120
  39. package/lib/ui/alphafold-tranparency.d.ts +1 -2
  40. package/lib/ui/alphafold-tranparency.js +27 -43
  41. package/lib/ui/annotation-controls.d.ts +2 -3
  42. package/lib/ui/annotation-controls.js +81 -87
  43. package/lib/ui/export-superposition.js +33 -51
  44. package/lib/ui/pdbe-left-panel.d.ts +3 -3
  45. package/lib/ui/pdbe-left-panel.js +82 -106
  46. package/lib/ui/pdbe-screenshot-controls.d.ts +1 -1
  47. package/lib/ui/pdbe-screenshot-controls.js +54 -83
  48. package/lib/ui/pdbe-structure-controls.d.ts +4 -5
  49. package/lib/ui/pdbe-structure-controls.js +34 -57
  50. package/lib/ui/pdbe-viewport-controls.d.ts +1 -2
  51. package/lib/ui/pdbe-viewport-controls.js +23 -29
  52. package/lib/ui/segment-tree.d.ts +1 -2
  53. package/lib/ui/segment-tree.js +438 -590
  54. package/lib/ui/superposition-components.d.ts +1 -2
  55. package/lib/ui/superposition-components.js +196 -266
  56. package/lib/ui/superposition-viewport.d.ts +1 -2
  57. package/lib/ui/superposition-viewport.js +11 -18
  58. package/package.json +7 -4
  59. package/build/drugflow-molstar-0.3.62.css +0 -1
  60. package/build/drugflow-molstar-0.3.77.css +0 -1
  61. package/build/drugflow-molstar-component-0.3.62.js +0 -25
  62. package/build/drugflow-molstar-component-0.3.77.js +0 -25
  63. package/build/drugflow-molstar-light.css +0 -1
  64. package/build/drugflow-molstar-plugin-0.3.62.js +0 -2
  65. package/build/drugflow-molstar-plugin-0.3.62.js.LICENSE.txt +0 -39
  66. package/build/drugflow-molstar-plugin-0.3.77.js +0 -2
  67. package/build/drugflow-molstar-plugin-0.3.77.js.LICENSE.txt +0 -39
  68. package/lib/drugflow-molstar-component-build-0.1.2.js +0 -4268
  69. package/lib/drugflow-molstar-component-build-0.1.2.js.map +0 -1
  70. package/lib/drugflow-molstar-component-build-0.1.3.js +0 -2
  71. package/lib/drugflow-molstar-component-build-0.1.4.js +0 -2
  72. package/lib/drugflow-molstar-component-build-0.1.4.js.LICENSE.txt +0 -24
  73. package/lib/drugflow-molstar-component-build-0.1.5.js +0 -2
  74. package/lib/drugflow-molstar-component-build-0.1.5.js.LICENSE.txt +0 -24
  75. package/lib/drugflow-molstar-component-build-0.1.6.js +0 -2
  76. package/lib/drugflow-molstar-component-build-0.1.6.js.LICENSE.txt +0 -24
  77. package/lib/drugflow-molstar-component-build-0.2.10.js +0 -2
  78. package/lib/drugflow-molstar-component-build-0.2.10.js.LICENSE.txt +0 -24
  79. package/lib/drugflow-molstar-component-build-0.2.2.js +0 -2
  80. package/lib/drugflow-molstar-component-build-0.2.2.js.LICENSE.txt +0 -24
  81. package/lib/drugflow-molstar-component-build-0.2.3.js +0 -2
  82. package/lib/drugflow-molstar-component-build-0.2.3.js.LICENSE.txt +0 -24
  83. package/lib/drugflow-molstar-component-build-0.2.4.js +0 -2
  84. package/lib/drugflow-molstar-component-build-0.2.4.js.LICENSE.txt +0 -24
  85. package/lib/drugflow-molstar-component-build-0.2.5.js +0 -2
  86. package/lib/drugflow-molstar-component-build-0.2.5.js.LICENSE.txt +0 -24
  87. package/lib/drugflow-molstar-component-build-0.2.6.js +0 -2
  88. package/lib/drugflow-molstar-component-build-0.2.6.js.LICENSE.txt +0 -24
  89. package/lib/drugflow-molstar-component-build-0.2.7.js +0 -2
  90. package/lib/drugflow-molstar-component-build-0.2.7.js.LICENSE.txt +0 -24
  91. package/lib/drugflow-molstar-component-build-0.2.9.js +0 -2
  92. package/lib/drugflow-molstar-component-build-0.2.9.js.LICENSE.txt +0 -24
  93. package/lib/drugflow-molstar-component-build-0.3.1.js +0 -2
  94. package/lib/drugflow-molstar-component-build-0.3.1.js.LICENSE.txt +0 -24
  95. package/lib/drugflow-molstar-component-build-0.3.10.js +0 -2
  96. package/lib/drugflow-molstar-component-build-0.3.10.js.LICENSE.txt +0 -24
  97. package/lib/drugflow-molstar-component-build-0.3.11.js +0 -2
  98. package/lib/drugflow-molstar-component-build-0.3.11.js.LICENSE.txt +0 -24
  99. package/lib/drugflow-molstar-component-build-0.3.12.js +0 -2
  100. package/lib/drugflow-molstar-component-build-0.3.12.js.LICENSE.txt +0 -24
  101. package/lib/drugflow-molstar-component-build-0.3.13.js +0 -2
  102. package/lib/drugflow-molstar-component-build-0.3.13.js.LICENSE.txt +0 -24
  103. package/lib/drugflow-molstar-component-build-0.3.14.js +0 -2
  104. package/lib/drugflow-molstar-component-build-0.3.14.js.LICENSE.txt +0 -24
  105. package/lib/drugflow-molstar-component-build-0.3.15.js +0 -2
  106. package/lib/drugflow-molstar-component-build-0.3.15.js.LICENSE.txt +0 -24
  107. package/lib/drugflow-molstar-component-build-0.3.16.js +0 -2
  108. package/lib/drugflow-molstar-component-build-0.3.16.js.LICENSE.txt +0 -24
  109. package/lib/drugflow-molstar-component-build-0.3.17.js +0 -2
  110. package/lib/drugflow-molstar-component-build-0.3.17.js.LICENSE.txt +0 -24
  111. package/lib/drugflow-molstar-component-build-0.3.18.js +0 -2
  112. package/lib/drugflow-molstar-component-build-0.3.18.js.LICENSE.txt +0 -24
  113. package/lib/drugflow-molstar-component-build-0.3.19.js +0 -2
  114. package/lib/drugflow-molstar-component-build-0.3.19.js.LICENSE.txt +0 -24
  115. package/lib/drugflow-molstar-component-build-0.3.2.js +0 -2
  116. package/lib/drugflow-molstar-component-build-0.3.2.js.LICENSE.txt +0 -24
  117. package/lib/drugflow-molstar-component-build-0.3.20.js +0 -2
  118. package/lib/drugflow-molstar-component-build-0.3.20.js.LICENSE.txt +0 -24
  119. package/lib/drugflow-molstar-component-build-0.3.21.js +0 -2
  120. package/lib/drugflow-molstar-component-build-0.3.21.js.LICENSE.txt +0 -24
  121. package/lib/drugflow-molstar-component-build-0.3.22.js +0 -2
  122. package/lib/drugflow-molstar-component-build-0.3.22.js.LICENSE.txt +0 -24
  123. package/lib/drugflow-molstar-component-build-0.3.23.js +0 -2
  124. package/lib/drugflow-molstar-component-build-0.3.23.js.LICENSE.txt +0 -24
  125. package/lib/drugflow-molstar-component-build-0.3.24.js +0 -2
  126. package/lib/drugflow-molstar-component-build-0.3.24.js.LICENSE.txt +0 -24
  127. package/lib/drugflow-molstar-component-build-0.3.25.js +0 -2
  128. package/lib/drugflow-molstar-component-build-0.3.25.js.LICENSE.txt +0 -24
  129. package/lib/drugflow-molstar-component-build-0.3.26.js +0 -2
  130. package/lib/drugflow-molstar-component-build-0.3.26.js.LICENSE.txt +0 -24
  131. package/lib/drugflow-molstar-component-build-0.3.27.js +0 -2
  132. package/lib/drugflow-molstar-component-build-0.3.27.js.LICENSE.txt +0 -24
  133. package/lib/drugflow-molstar-component-build-0.3.28.js +0 -2
  134. package/lib/drugflow-molstar-component-build-0.3.28.js.LICENSE.txt +0 -24
  135. package/lib/drugflow-molstar-component-build-0.3.29.js +0 -2
  136. package/lib/drugflow-molstar-component-build-0.3.29.js.LICENSE.txt +0 -24
  137. package/lib/drugflow-molstar-component-build-0.3.3.js +0 -2
  138. package/lib/drugflow-molstar-component-build-0.3.3.js.LICENSE.txt +0 -24
  139. package/lib/drugflow-molstar-component-build-0.3.30.js +0 -2
  140. package/lib/drugflow-molstar-component-build-0.3.30.js.LICENSE.txt +0 -24
  141. package/lib/drugflow-molstar-component-build-0.3.31.js +0 -2
  142. package/lib/drugflow-molstar-component-build-0.3.31.js.LICENSE.txt +0 -24
  143. package/lib/drugflow-molstar-component-build-0.3.32.js +0 -2
  144. package/lib/drugflow-molstar-component-build-0.3.32.js.LICENSE.txt +0 -24
  145. package/lib/drugflow-molstar-component-build-0.3.33.js +0 -2
  146. package/lib/drugflow-molstar-component-build-0.3.33.js.LICENSE.txt +0 -24
  147. package/lib/drugflow-molstar-component-build-0.3.34.js +0 -2
  148. package/lib/drugflow-molstar-component-build-0.3.34.js.LICENSE.txt +0 -24
  149. package/lib/drugflow-molstar-component-build-0.3.35.js +0 -2
  150. package/lib/drugflow-molstar-component-build-0.3.35.js.LICENSE.txt +0 -24
  151. package/lib/drugflow-molstar-component-build-0.3.36.js +0 -2
  152. package/lib/drugflow-molstar-component-build-0.3.36.js.LICENSE.txt +0 -24
  153. package/lib/drugflow-molstar-component-build-0.3.37.js +0 -2
  154. package/lib/drugflow-molstar-component-build-0.3.37.js.LICENSE.txt +0 -24
  155. package/lib/drugflow-molstar-component-build-0.3.38.js +0 -2
  156. package/lib/drugflow-molstar-component-build-0.3.38.js.LICENSE.txt +0 -24
  157. package/lib/drugflow-molstar-component-build-0.3.39.js +0 -2
  158. package/lib/drugflow-molstar-component-build-0.3.39.js.LICENSE.txt +0 -24
  159. package/lib/drugflow-molstar-component-build-0.3.4.js +0 -2
  160. package/lib/drugflow-molstar-component-build-0.3.4.js.LICENSE.txt +0 -24
  161. package/lib/drugflow-molstar-component-build-0.3.40.js +0 -2
  162. package/lib/drugflow-molstar-component-build-0.3.40.js.LICENSE.txt +0 -24
  163. package/lib/drugflow-molstar-component-build-0.3.41.js +0 -2
  164. package/lib/drugflow-molstar-component-build-0.3.41.js.LICENSE.txt +0 -24
  165. package/lib/drugflow-molstar-component-build-0.3.42.js +0 -2
  166. package/lib/drugflow-molstar-component-build-0.3.42.js.LICENSE.txt +0 -24
  167. package/lib/drugflow-molstar-component-build-0.3.43.js +0 -2
  168. package/lib/drugflow-molstar-component-build-0.3.43.js.LICENSE.txt +0 -24
  169. package/lib/drugflow-molstar-component-build-0.3.44.js +0 -2
  170. package/lib/drugflow-molstar-component-build-0.3.44.js.LICENSE.txt +0 -24
  171. package/lib/drugflow-molstar-component-build-0.3.46.js +0 -2
  172. package/lib/drugflow-molstar-component-build-0.3.46.js.LICENSE.txt +0 -24
  173. package/lib/drugflow-molstar-component-build-0.3.47.js +0 -2
  174. package/lib/drugflow-molstar-component-build-0.3.47.js.LICENSE.txt +0 -24
  175. package/lib/drugflow-molstar-component-build-0.3.48.js +0 -2
  176. package/lib/drugflow-molstar-component-build-0.3.48.js.LICENSE.txt +0 -24
  177. package/lib/drugflow-molstar-component-build-0.3.49.js +0 -2
  178. package/lib/drugflow-molstar-component-build-0.3.49.js.LICENSE.txt +0 -24
  179. package/lib/drugflow-molstar-component-build-0.3.5.js +0 -2
  180. package/lib/drugflow-molstar-component-build-0.3.5.js.LICENSE.txt +0 -24
  181. package/lib/drugflow-molstar-component-build-0.3.50.js +0 -2
  182. package/lib/drugflow-molstar-component-build-0.3.50.js.LICENSE.txt +0 -24
  183. package/lib/drugflow-molstar-component-build-0.3.51.js +0 -2
  184. package/lib/drugflow-molstar-component-build-0.3.51.js.LICENSE.txt +0 -24
  185. package/lib/drugflow-molstar-component-build-0.3.52.js +0 -2
  186. package/lib/drugflow-molstar-component-build-0.3.52.js.LICENSE.txt +0 -24
  187. package/lib/drugflow-molstar-component-build-0.3.53.js +0 -2
  188. package/lib/drugflow-molstar-component-build-0.3.53.js.LICENSE.txt +0 -24
  189. package/lib/drugflow-molstar-component-build-0.3.54.js +0 -2
  190. package/lib/drugflow-molstar-component-build-0.3.54.js.LICENSE.txt +0 -24
  191. package/lib/drugflow-molstar-component-build-0.3.55.js +0 -2
  192. package/lib/drugflow-molstar-component-build-0.3.55.js.LICENSE.txt +0 -24
  193. package/lib/drugflow-molstar-component-build-0.3.56.js +0 -2
  194. package/lib/drugflow-molstar-component-build-0.3.56.js.LICENSE.txt +0 -24
  195. package/lib/drugflow-molstar-component-build-0.3.57.js +0 -2
  196. package/lib/drugflow-molstar-component-build-0.3.57.js.LICENSE.txt +0 -24
  197. package/lib/drugflow-molstar-component-build-0.3.58.js +0 -2
  198. package/lib/drugflow-molstar-component-build-0.3.58.js.LICENSE.txt +0 -24
  199. package/lib/drugflow-molstar-component-build-0.3.59.js +0 -2
  200. package/lib/drugflow-molstar-component-build-0.3.59.js.LICENSE.txt +0 -24
  201. package/lib/drugflow-molstar-component-build-0.3.6.js +0 -2
  202. package/lib/drugflow-molstar-component-build-0.3.6.js.LICENSE.txt +0 -24
  203. package/lib/drugflow-molstar-component-build-0.3.60.js +0 -2
  204. package/lib/drugflow-molstar-component-build-0.3.60.js.LICENSE.txt +0 -24
  205. package/lib/drugflow-molstar-component-build-0.3.61.js +0 -2
  206. package/lib/drugflow-molstar-component-build-0.3.61.js.LICENSE.txt +0 -24
  207. package/lib/drugflow-molstar-component-build-0.3.62.js +0 -2
  208. package/lib/drugflow-molstar-component-build-0.3.62.js.LICENSE.txt +0 -24
  209. package/lib/drugflow-molstar-component-build-0.3.63.js +0 -2
  210. package/lib/drugflow-molstar-component-build-0.3.63.js.LICENSE.txt +0 -24
  211. package/lib/drugflow-molstar-component-build-0.3.64.js +0 -2
  212. package/lib/drugflow-molstar-component-build-0.3.64.js.LICENSE.txt +0 -24
  213. package/lib/drugflow-molstar-component-build-0.3.65.js +0 -2
  214. package/lib/drugflow-molstar-component-build-0.3.65.js.LICENSE.txt +0 -24
  215. package/lib/drugflow-molstar-component-build-0.3.66.js +0 -2
  216. package/lib/drugflow-molstar-component-build-0.3.66.js.LICENSE.txt +0 -24
  217. package/lib/drugflow-molstar-component-build-0.3.67.js +0 -2
  218. package/lib/drugflow-molstar-component-build-0.3.67.js.LICENSE.txt +0 -24
  219. package/lib/drugflow-molstar-component-build-0.3.68.js +0 -2
  220. package/lib/drugflow-molstar-component-build-0.3.68.js.LICENSE.txt +0 -24
  221. package/lib/drugflow-molstar-component-build-0.3.69.js +0 -2
  222. package/lib/drugflow-molstar-component-build-0.3.69.js.LICENSE.txt +0 -24
  223. package/lib/drugflow-molstar-component-build-0.3.7.js +0 -2
  224. package/lib/drugflow-molstar-component-build-0.3.7.js.LICENSE.txt +0 -24
  225. package/lib/drugflow-molstar-component-build-0.3.70.js +0 -2
  226. package/lib/drugflow-molstar-component-build-0.3.70.js.LICENSE.txt +0 -24
  227. package/lib/drugflow-molstar-component-build-0.3.71.js +0 -2
  228. package/lib/drugflow-molstar-component-build-0.3.71.js.LICENSE.txt +0 -24
  229. package/lib/drugflow-molstar-component-build-0.3.72.js +0 -2
  230. package/lib/drugflow-molstar-component-build-0.3.72.js.LICENSE.txt +0 -24
  231. package/lib/drugflow-molstar-component-build-0.3.73.js +0 -2
  232. package/lib/drugflow-molstar-component-build-0.3.73.js.LICENSE.txt +0 -24
  233. package/lib/drugflow-molstar-component-build-0.3.74.js +0 -2
  234. package/lib/drugflow-molstar-component-build-0.3.74.js.LICENSE.txt +0 -24
  235. package/lib/drugflow-molstar-component-build-0.3.75.js +0 -2
  236. package/lib/drugflow-molstar-component-build-0.3.75.js.LICENSE.txt +0 -24
  237. package/lib/drugflow-molstar-component-build-0.3.76.js +0 -2
  238. package/lib/drugflow-molstar-component-build-0.3.76.js.LICENSE.txt +0 -24
  239. package/lib/drugflow-molstar-component-build-0.3.77.js +0 -2
  240. package/lib/drugflow-molstar-component-build-0.3.77.js.LICENSE.txt +0 -24
  241. package/lib/drugflow-molstar-component-build-0.3.8.js +0 -2
  242. package/lib/drugflow-molstar-component-build-0.3.8.js.LICENSE.txt +0 -24
  243. package/lib/drugflow-molstar-component-build-0.3.9.js +0 -2
  244. package/lib/drugflow-molstar-component-build-0.3.9.js.LICENSE.txt +0 -24
  245. package/lib/index2.d.ts +0 -1
  246. package/lib/index2.js +0 -1369
  247. package/lib/pdbe-molstar-component-build-3.1.2.js +0 -2
  248. package/lib/pdbe-molstar-component-build-3.1.2.js.LICENSE.txt +0 -24
  249. /package/lib/{drugflow-molstar-component-build-0.1.2.js.LICENSE.txt → drugflow-molstar-component-build-0.3.78.js.LICENSE.txt} +0 -0
  250. /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
- var tslib_1 = require("tslib");
5
- var structure_1 = require("Molstar/mol-model/structure");
6
- var transforms_1 = require("Molstar/mol-plugin-state/transforms");
7
- var mol_state_1 = require("Molstar/mol-state");
8
- var loci_1 = require("Molstar/mol-model/loci");
9
- var transparency_1 = require("Molstar/mol-theme/transparency");
10
- var builder_1 = require("Molstar/mol-script/language/builder");
11
- var prop_1 = require("Molstar/extensions/model-archive/quality-assessment/prop");
12
- var compiler_1 = require("Molstar/mol-script/runtime/query/compiler");
13
- var structure_2 = require("Molstar/mol-model/structure");
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
- var queryExp = builder_1.MolScriptBuilder.struct.modifier.union([
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
- var query = (0, compiler_1.compile)(queryExp);
27
- var sel = query(new structure_2.QueryContext(contextData));
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
- if (pLDDT === void 0) { pLDDT = 70; }
32
- return tslib_1.__awaiter(this, void 0, void 0, function () {
33
- var _this = this;
34
- return tslib_1.__generator(this, function (_a) {
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
- return tslib_1.__awaiter(this, void 0, void 0, function () {
55
- var _this = this;
56
- return tslib_1.__generator(this, function (_a) {
57
- switch (_a.label) {
58
- case 0: return [4 /*yield*/, eachRepr(plugin, components, function (update, repr, transparencyCell) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
59
- var structure, layer, bundleLayers, filtered, filtered;
60
- return tslib_1.__generator(this, function (_a) {
61
- if (types && types.length > 0 && !types.includes(repr.params.values.type.name))
62
- return [2 /*return*/];
63
- structure = repr.obj.data.sourceData;
64
- if (loci_1.Loci.isEmpty(loci) || (0, loci_1.isEmptyLoci)(loci))
65
- return [2 /*return*/];
66
- layer = {
67
- bundle: structure_1.StructureElement.Bundle.fromLoci(loci),
68
- value: value,
69
- };
70
- if (transparencyCell) {
71
- bundleLayers = tslib_1.__spreadArray(tslib_1.__spreadArray([], transparencyCell.params.values.layers, true), [layer], false);
72
- filtered = getFilteredBundle(bundleLayers, structure);
73
- update.to(transparencyCell).update(transparency_1.Transparency.toBundle(filtered));
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
- return tslib_1.__awaiter(this, void 0, void 0, function () {
93
- var _this = this;
94
- return tslib_1.__generator(this, function (_a) {
95
- switch (_a.label) {
96
- case 0: return [4 /*yield*/, eachRepr(plugin, components, function (update, repr, transparencyCell) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
97
- return tslib_1.__generator(this, function (_a) {
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
- return tslib_1.__awaiter(this, void 0, void 0, function () {
116
- var state, update, _i, components_1, c, _a, _b, r, transparency;
117
- return tslib_1.__generator(this, function (_c) {
118
- switch (_c.label) {
119
- case 0:
120
- state = plugin.state.data;
121
- update = state.build();
122
- _i = 0, components_1 = components;
123
- _c.label = 1;
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
- var transparency = transparency_1.Transparency.ofBundle(layers, structure.root);
151
- var merged = transparency_1.Transparency.merge(transparency);
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<"bottom-left" | "bottom-center" | "bottom-right" | "middle-left" | "middle-center" | "middle-right" | "top-left" | "top-center" | "top-right">;
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
- xrayShaded: PD.BooleanParam;
60
- transparentBackfaces: PD.Select<string>;
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 declare type ContactParams = typeof ContactParams;
65
- export declare type ContactProps = PD.Values<ContactParams>;
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 declare type ContactRepresentation = Representation<ContactData, ContactParams>;
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
- var loci_1 = require("molstar/lib/mol-model/loci");
7
- var text_1 = require("molstar/lib/mol-geo/geometry/text/text");
8
- var param_definition_1 = require("molstar/lib/mol-util/param-definition");
9
- var names_1 = require("molstar/lib/mol-util/color/names");
10
- var representation_1 = require("molstar/lib/mol-repr/shape/representation");
11
- var representation_2 = require("molstar/lib/mol-repr/representation");
12
- var shape_1 = require("molstar/lib/mol-model/shape");
13
- var text_builder_1 = require("molstar/lib/mol-geo/geometry/text/text-builder");
14
- var linear_algebra_1 = require("molstar/lib/mol-math/linear-algebra");
15
- var marker_action_1 = require("molstar/lib/mol-util/marker-action");
16
- var label_1 = require("molstar/lib/mol-theme/label");
17
- var common_1 = require("molstar/lib/mol-repr/shape/loci/common");
18
- var geometry_1 = require("molstar/lib/mol-math/geometry");
19
- var cylinders_builder_1 = require("molstar/lib/mol-geo/geometry/cylinders/cylinders-builder");
20
- var cylinders_1 = require("molstar/lib/mol-geo/geometry/cylinders/cylinders");
21
- var label_2 = require("molstar/lib/mol-theme/label");
22
- var SharedParams = {
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
- var CylinderParams = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, cylinders_1.Cylinders.Params), SharedParams), { lineSizeAttenuation: param_definition_1.ParamDefinition.Boolean(true), linesSize: param_definition_1.ParamDefinition.Numeric(0.075, { min: 0.01, max: 5, step: 0.01 }), dashLength: param_definition_1.ParamDefinition.Numeric(0.12, { min: 0.01, max: 0.2, step: 0.01 }), interactionType: param_definition_1.ParamDefinition.Text('', { isEssential: true }), cylinderColor: param_definition_1.ParamDefinition.Color(names_1.ColorNames.lightgreen, { isEssential: true }) });
26
- var TextParams = tslib_1.__assign(tslib_1.__assign({}, common_1.LociLabelTextParams), SharedParams);
27
- var ContactVisuals = {
28
- cylinder: function (ctx, getParams) {
29
- return (0, representation_1.ShapeRepresentation)(getCylindersShape, cylinders_1.Cylinders.Utils, {
30
- modifyState: function (s) { return (tslib_1.__assign(tslib_1.__assign({}, s), { markerActions: marker_action_1.MarkerActions.Highlighting })); },
31
- });
32
- },
33
- text: function (ctx, getParams) {
34
- return (0, representation_1.ShapeRepresentation)(getTextShape, text_1.Text.Utils, {
35
- modifyState: function (s) { return (tslib_1.__assign(tslib_1.__assign({}, s), { markerActions: marker_action_1.MarkerAction.None })); },
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
- var _a;
43
- if (options === void 0) { options = {}; }
44
- var o = tslib_1.__assign(tslib_1.__assign({}, label_2.DefaultLabelOptions), options);
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
- var sphereA = state.sphereA, sphereB = state.sphereB, center = state.center;
59
- var _a = pair.loci, lociA = _a[0], lociB = _a[1];
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
- var tmpState = getContactState();
75
+ const tmpState = getContactState();
68
76
  function getContactName(data, unitLabel) {
69
77
  return data.pairs.length === 1
70
- ? "Contact ".concat((0, label_1.distanceLabel)(data.pairs[0], {
71
- unitLabel: unitLabel,
78
+ ? `Contact ${(0, label_1.distanceLabel)(data.pairs[0], {
79
+ unitLabel,
72
80
  measureOnly: true,
73
- }))
74
- : "".concat(data.pairs.length, " Contacts");
81
+ })}`
82
+ : `${data.pairs.length} Contacts`;
75
83
  }
76
84
  //
77
85
  function buildCylinders(data, props, cylinders) {
78
- var builder = cylinders_builder_1.CylindersBuilder.create(128, 64, cylinders);
79
- for (var i = 0, il = data.pairs.length; i < il; ++i) {
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, i);
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
- var cylinders = buildCylinders(data, props, shape && shape.geometry);
88
- var name = getContactName(data, props.unitLabel);
89
- var getLabel = function (groupId) {
90
- return contactLabel(data.pairs[groupId], props);
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
- var builder = text_builder_1.TextBuilder.create(props, 128, 64, text);
97
- for (var i = 0, il = data.pairs.length; i < il; ++i) {
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
- var center = tmpState.center, distance = tmpState.distance, sphereA = tmpState.sphereA, sphereB = tmpState.sphereB;
100
- var label = props.customText || "".concat(distance.toFixed(2), " ").concat(props.unitLabel);
101
- var radius = Math.max(2, sphereA.radius, sphereB.radius);
102
- var scale = radius / 2;
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
- var text = buildText(data, props, shape && shape.geometry);
109
- var name = getContactName(data, props.unitLabel);
110
- var getLabel = function (groupId) {
111
- return (0, label_1.distanceLabel)(data.pairs[groupId], props);
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);
@@ -1,25 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CustomEvents = void 0;
4
- var loci_details_1 = require("./loci-details");
5
- var operators_1 = require("rxjs/operators");
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
- var eventObj = {};
10
- for (var ei = 0, el = eventTypeArr.length; ei < el; ei++) {
11
- var eventType = eventTypeArr[ei];
12
- var event_1 = void 0;
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
- event_1 = new MouseEvent(eventType, { 'view': window, 'bubbles': true, 'cancelable': true });
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
- event_1 = document.createEvent('MouseEvents');
20
- event_1.initEvent(eventType, true /* bubbles */, true /* cancelable */);
19
+ event = document.createEvent('MouseEvents');
20
+ event.initEvent(eventType, true /* bubbles */, true /* cancelable */);
21
21
  }
22
- eventObj[eventType] = event_1;
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
- var pdbevents = create(['PDB.molstar.click', 'PDB.molstar.mouseover', 'PDB.molstar.mouseout']);
37
- plugin.behaviors.interaction.click.subscribe(function (e) {
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
- var evData = (0, loci_details_1.lociDetails)(e.current.loci);
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(function (e) {
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
- var evData = (0, loci_details_1.lociDetails)(e.current.loci);
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 = exports.CustomEvents || (exports.CustomEvents = {}));
56
+ })(CustomEvents || (exports.CustomEvents = CustomEvents = {}));