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
@@ -1,60 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StructureSelectionsContact3D = void 0;
4
- var tslib_1 = require("tslib");
5
- var mol_state_1 = require("molstar/lib/mol-state");
6
- var mol_task_1 = require("molstar/lib/mol-task");
7
- var objects_1 = require("molstar/lib/mol-plugin-state/objects");
8
- var helpers_1 = require("molstar/lib/mol-plugin-state/transforms/helpers");
9
- var contact_1 = require("./contact");
10
- var StructureSelectionsContact3D = objects_1.PluginStateTransform.BuiltIn({
4
+ const mol_state_1 = require("molstar/lib/mol-state");
5
+ const mol_task_1 = require("molstar/lib/mol-task");
6
+ const objects_1 = require("molstar/lib/mol-plugin-state/objects");
7
+ const helpers_1 = require("molstar/lib/mol-plugin-state/transforms/helpers");
8
+ const contact_1 = require("./contact");
9
+ const StructureSelectionsContact3D = objects_1.PluginStateTransform.BuiltIn({
11
10
  name: 'structure-selections-contact-3d',
12
11
  display: '3D Contact',
13
12
  from: objects_1.PluginStateObject.Molecule.Structure.Selections,
14
13
  to: objects_1.PluginStateObject.Shape.Representation3D,
15
- params: function () { return (tslib_1.__assign({}, contact_1.ContactParams)); }
14
+ params: () => ({
15
+ ...contact_1.ContactParams,
16
+ })
16
17
  })({
17
- canAutoUpdate: function (_a) {
18
- var oldParams = _a.oldParams, newParams = _a.newParams;
18
+ canAutoUpdate({ oldParams, newParams }) {
19
19
  return true;
20
20
  },
21
- apply: function (_a, plugin) {
22
- var _this = this;
23
- var a = _a.a, params = _a.params;
24
- return mol_task_1.Task.create('Structure Contact', function (ctx) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
25
- var data, repr;
26
- var _a;
27
- return tslib_1.__generator(this, function (_b) {
28
- switch (_b.label) {
29
- case 0:
30
- data = (0, helpers_1.getDistanceDataFromStructureSelections)(a.data);
31
- repr = (0, contact_1.ContactRepresentation)(tslib_1.__assign({ webgl: (_a = plugin.canvas3d) === null || _a === void 0 ? void 0 : _a.webgl }, plugin.representation.structure.themes), function () { return contact_1.ContactParams; });
32
- return [4 /*yield*/, repr.createOrUpdate(params, data).runInContext(ctx)];
33
- case 1:
34
- _b.sent();
35
- return [2 /*return*/, new objects_1.PluginStateObject.Shape.Representation3D({ repr: repr, sourceData: data }, { label: "Contact" })];
36
- }
37
- });
38
- }); });
21
+ apply({ a, params }, plugin) {
22
+ return mol_task_1.Task.create('Structure Contact', async (ctx) => {
23
+ const data = (0, helpers_1.getDistanceDataFromStructureSelections)(a.data);
24
+ const repr = (0, contact_1.ContactRepresentation)({ webgl: plugin.canvas3d?.webgl, ...plugin.representation.structure.themes }, () => contact_1.ContactParams);
25
+ await repr.createOrUpdate(params, data).runInContext(ctx);
26
+ return new objects_1.PluginStateObject.Shape.Representation3D({ repr, sourceData: data }, { label: `Contact` });
27
+ });
39
28
  },
40
- update: function (_a, plugin) {
41
- var _this = this;
42
- var a = _a.a, b = _a.b, oldParams = _a.oldParams, newParams = _a.newParams;
43
- return mol_task_1.Task.create('Structure Contact', function (ctx) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
44
- var props, data;
45
- return tslib_1.__generator(this, function (_a) {
46
- switch (_a.label) {
47
- case 0:
48
- props = tslib_1.__assign(tslib_1.__assign({}, b.data.repr.props), newParams);
49
- data = (0, helpers_1.getDistanceDataFromStructureSelections)(a.data);
50
- return [4 /*yield*/, b.data.repr.createOrUpdate(props, data).runInContext(ctx)];
51
- case 1:
52
- _a.sent();
53
- b.data.sourceData = data;
54
- return [2 /*return*/, mol_state_1.StateTransformer.UpdateResult.Updated];
55
- }
56
- });
57
- }); });
29
+ update({ a, b, oldParams, newParams }, plugin) {
30
+ return mol_task_1.Task.create('Structure Contact', async (ctx) => {
31
+ const props = { ...b.data.repr.props, ...newParams };
32
+ const data = (0, helpers_1.getDistanceDataFromStructureSelections)(a.data);
33
+ await b.data.repr.createOrUpdate(props, data).runInContext(ctx);
34
+ b.data.sourceData = data;
35
+ return mol_state_1.StateTransformer.UpdateResult.Updated;
36
+ });
58
37
  },
59
38
  });
60
39
  exports.StructureSelectionsContact3D = StructureSelectionsContact3D;
@@ -4,14 +4,14 @@ exports.subscribeToComponentEvents = void 0;
4
4
  function subscribeToComponentEvents(wrapperCtx) {
5
5
  document.addEventListener('PDB.interactions.click', function (e) {
6
6
  if (typeof e.detail !== 'undefined') {
7
- var data = e.detail.interacting_nodes ? { data: e.detail.interacting_nodes } : { data: [e.detail.selected_node] };
7
+ const data = e.detail.interacting_nodes ? { data: e.detail.interacting_nodes } : { data: [e.detail.selected_node] };
8
8
  data.data[0]['focus'] = true;
9
9
  wrapperCtx.visual.select(data);
10
10
  }
11
11
  });
12
12
  document.addEventListener('PDB.interactions.mouseover', function (e) {
13
13
  if (typeof e.detail !== 'undefined') {
14
- var data = e.detail.interacting_nodes ? { data: e.detail.interacting_nodes } : { data: [e.detail.selected_node] };
14
+ const data = e.detail.interacting_nodes ? { data: e.detail.interacting_nodes } : { data: [e.detail.selected_node] };
15
15
  wrapperCtx.visual.highlight(data);
16
16
  }
17
17
  });
@@ -21,7 +21,7 @@ function subscribeToComponentEvents(wrapperCtx) {
21
21
  document.addEventListener('PDB.topologyViewer.click', function (e) {
22
22
  if (typeof e.eventData !== 'undefined') {
23
23
  // Create query object from event data
24
- var highlightQuery = {
24
+ let highlightQuery = {
25
25
  entity_id: e.eventData.entityId,
26
26
  struct_asym_id: e.eventData.structAsymId,
27
27
  start_residue_number: e.eventData.residueNumber,
@@ -38,7 +38,7 @@ function subscribeToComponentEvents(wrapperCtx) {
38
38
  // Abort if entryid do not match or viewer type is unipdb
39
39
  // if(e.eventData.entryId != scope.pdbId) return;
40
40
  // Create query object from event data
41
- var highlightQuery = {
41
+ let highlightQuery = {
42
42
  entity_id: e.eventData.entityId,
43
43
  struct_asym_id: e.eventData.structAsymId,
44
44
  start_residue_number: e.eventData.residueNumber,
@@ -53,7 +53,7 @@ function subscribeToComponentEvents(wrapperCtx) {
53
53
  });
54
54
  document.addEventListener('protvista-mouseover', function (e) {
55
55
  if (typeof e.detail !== 'undefined') {
56
- var highlightQuery = undefined;
56
+ let highlightQuery = undefined;
57
57
  // Create query object from event data
58
58
  if (e.detail.start && e.detail.end) {
59
59
  highlightQuery = {
@@ -76,8 +76,8 @@ function subscribeToComponentEvents(wrapperCtx) {
76
76
  });
77
77
  document.addEventListener('protvista-click', function (e) {
78
78
  if (typeof e.detail !== 'undefined') {
79
- var showInteraction = false;
80
- var highlightQuery = undefined;
79
+ let showInteraction = false;
80
+ let highlightQuery = undefined;
81
81
  // Create query object from event data
82
82
  if (e.detail.start && e.detail.end) {
83
83
  highlightQuery = {
@@ -101,7 +101,7 @@ function subscribeToComponentEvents(wrapperCtx) {
101
101
  highlightQuery['sideChain'] = true;
102
102
  }
103
103
  else {
104
- var selColor = undefined;
104
+ let selColor = undefined;
105
105
  if (e.detail.trackIndex > -1 && e.detail.feature.locations && e.detail.feature.locations[0].fragments[e.detail.trackIndex].color)
106
106
  selColor = e.detail.feature.locations[0].fragments[e.detail.trackIndex].color;
107
107
  if (typeof selColor == 'undefined' && e.detail.feature.color)
@@ -112,9 +112,9 @@ function subscribeToComponentEvents(wrapperCtx) {
112
112
  selColor = { r: 65, g: 96, b: 91 };
113
113
  }
114
114
  else {
115
- var isRgb = /rgb/g;
115
+ let isRgb = /rgb/g;
116
116
  if (isRgb.test(selColor)) {
117
- var rgbArr = selColor.substring(4, selColor.length - 1).split(',');
117
+ let rgbArr = selColor.substring(4, selColor.length - 1).split(',');
118
118
  selColor = { r: rgbArr[0], g: rgbArr[1], b: rgbArr[2] };
119
119
  }
120
120
  }
@@ -125,15 +125,15 @@ function subscribeToComponentEvents(wrapperCtx) {
125
125
  }
126
126
  }
127
127
  });
128
- var elementTypeArrForRange = ['uniprot', 'pfam', 'cath', 'scop', 'strand', 'helice'];
129
- var elementTypeArrForSingle = ['chain', 'quality', 'quality_outlier', 'binding site', 'alternate conformer'];
128
+ const elementTypeArrForRange = ['uniprot', 'pfam', 'cath', 'scop', 'strand', 'helice'];
129
+ const elementTypeArrForSingle = ['chain', 'quality', 'quality_outlier', 'binding site', 'alternate conformer'];
130
130
  document.addEventListener('PDB.seqViewer.click', function (e) {
131
131
  if (typeof e.eventData !== 'undefined') {
132
132
  // Abort if entryid and entityid do not match or viewer type is unipdb
133
133
  // if(e.eventData.entryId != scope.pdbId) return;
134
134
  if (typeof e.eventData.elementData !== 'undefined' && elementTypeArrForSingle.indexOf(e.eventData.elementData.elementType) > -1) {
135
135
  // Create query object from event data
136
- var highlightQuery = {
136
+ const highlightQuery = {
137
137
  entity_id: e.eventData.entityId,
138
138
  struct_asym_id: e.eventData.elementData.pathData.struct_asym_id,
139
139
  start_residue_number: e.eventData.residueNumber,
@@ -145,9 +145,9 @@ function subscribeToComponentEvents(wrapperCtx) {
145
145
  wrapperCtx.visual.select({ data: [highlightQuery] });
146
146
  }
147
147
  else if (typeof e.eventData.elementData !== 'undefined' && elementTypeArrForRange.indexOf(e.eventData.elementData.elementType) > -1) {
148
- var seqColorArray = e.eventData.elementData.color;
148
+ const seqColorArray = e.eventData.elementData.color;
149
149
  // Create query object from event data
150
- var highlightQuery = {
150
+ const highlightQuery = {
151
151
  entity_id: e.eventData.entityId,
152
152
  struct_asym_id: e.eventData.elementData.pathData.struct_asym_id,
153
153
  start_residue_number: e.eventData.elementData.pathData.start.residue_number,
@@ -165,7 +165,7 @@ function subscribeToComponentEvents(wrapperCtx) {
165
165
  // if(e.eventData.entryId != scope.pdbId) return;
166
166
  if (typeof e.eventData.elementData !== 'undefined' && elementTypeArrForSingle.indexOf(e.eventData.elementData.elementType) > -1) {
167
167
  // Create query object from event data
168
- var highlightQuery = {
168
+ let highlightQuery = {
169
169
  entity_id: e.eventData.entityId,
170
170
  struct_asym_id: e.eventData.elementData.pathData.struct_asym_id,
171
171
  start_residue_number: e.eventData.residueNumber,
@@ -176,7 +176,7 @@ function subscribeToComponentEvents(wrapperCtx) {
176
176
  }
177
177
  else if (typeof e.eventData.elementData !== 'undefined' && elementTypeArrForRange.indexOf(e.eventData.elementData.elementType) > -1) {
178
178
  // Create query object from event data
179
- var highlightQuery = {
179
+ let highlightQuery = {
180
180
  entity_id: e.eventData.entityId,
181
181
  struct_asym_id: e.eventData.elementData.pathData.struct_asym_id,
182
182
  start_residue_number: e.eventData.elementData.pathData.start.residue_number,
@@ -1,152 +1,108 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.superpositionExportHierarchy = void 0;
4
- var tslib_1 = require("tslib");
5
- var utf8_1 = require("Molstar/mol-io/common/utf8");
6
- var structure_1 = require("Molstar/mol-model/structure");
7
- var mol_task_1 = require("Molstar/mol-task");
8
- var date_1 = require("Molstar/mol-util/date");
9
- var download_1 = require("Molstar/mol-util/download");
10
- var zip_1 = require("Molstar/mol-util/zip/zip");
11
- var commands_1 = require("Molstar/mol-plugin/commands");
12
- function superpositionExportHierarchy(plugin, options) {
13
- return tslib_1.__awaiter(this, void 0, void 0, function () {
14
- var e_1;
15
- return tslib_1.__generator(this, function (_a) {
16
- switch (_a.label) {
17
- case 0:
18
- _a.trys.push([0, 2, , 3]);
19
- return [4 /*yield*/, plugin.runTask(_superpositionExportHierarchy(plugin, options), { useOverlay: true })];
20
- case 1:
21
- _a.sent();
22
- return [3 /*break*/, 3];
23
- case 2:
24
- e_1 = _a.sent();
25
- console.error(e_1);
26
- plugin.log.error("Model export failed. See console for details.");
27
- return [3 /*break*/, 3];
28
- case 3: return [2 /*return*/];
29
- }
30
- });
31
- });
4
+ const utf8_1 = require("Molstar/mol-io/common/utf8");
5
+ const structure_1 = require("Molstar/mol-model/structure");
6
+ const mol_task_1 = require("Molstar/mol-task");
7
+ const date_1 = require("Molstar/mol-util/date");
8
+ const download_1 = require("Molstar/mol-util/download");
9
+ const zip_1 = require("Molstar/mol-util/zip/zip");
10
+ const commands_1 = require("Molstar/mol-plugin/commands");
11
+ async function superpositionExportHierarchy(plugin, options) {
12
+ try {
13
+ await plugin.runTask(_superpositionExportHierarchy(plugin, options), { useOverlay: true });
14
+ }
15
+ catch (e) {
16
+ console.error(e);
17
+ plugin.log.error(`Model export failed. See console for details.`);
18
+ }
32
19
  }
33
20
  exports.superpositionExportHierarchy = superpositionExportHierarchy;
34
21
  function _superpositionExportHierarchy(plugin, options) {
35
- var _this = this;
36
- return mol_task_1.Task.create('Export', function (ctx) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
37
- var format, customState, superpositionState, segmentIndex, files, entryMap, structures, _i, structures_1, molId, modelRef, isStrHidden, _s, _a, _b, strComp, s, name_1, zipData, _c, files_1, _d, fn, data, bytes, buffer;
38
- var _e, _f, _g, _h, _j, _k, _l, _m;
39
- return tslib_1.__generator(this, function (_o) {
40
- switch (_o.label) {
41
- case 0: return [4 /*yield*/, ctx.update({ message: 'Exporting...', isIndeterminate: true, canAbort: false })];
42
- case 1:
43
- _o.sent();
44
- format = (_e = options === null || options === void 0 ? void 0 : options.format) !== null && _e !== void 0 ? _e : 'cif';
45
- customState = plugin.customState;
46
- superpositionState = customState.superpositionState;
47
- segmentIndex = superpositionState.activeSegment - 1;
48
- files = [];
49
- entryMap = new Map();
50
- structures = superpositionState.loadedStructs[segmentIndex].slice();
51
- if (superpositionState.alphafold.ref)
52
- structures.push("AF-".concat(customState.initParams.moleculeId));
53
- _i = 0, structures_1 = structures;
54
- _o.label = 2;
55
- case 2:
56
- if (!(_i < structures_1.length)) return [3 /*break*/, 7];
57
- molId = structures_1[_i];
58
- modelRef = superpositionState.models[molId];
59
- if (!modelRef)
60
- return [3 /*break*/, 6];
61
- isStrHidden = false;
62
- _s = plugin.managers.structure.hierarchy.current.refs.get(modelRef);
63
- if (_s.cell.state.isHidden)
64
- isStrHidden = true;
65
- for (_a = 0, _b = _s.components; _a < _b.length; _a++) {
66
- strComp = _b[_a];
67
- if (strComp.cell.state.isHidden)
68
- isStrHidden = true;
69
- }
70
- if (isStrHidden)
71
- return [3 /*break*/, 6];
72
- s = (_h = (_g = (_f = _s.transform) === null || _f === void 0 ? void 0 : _f.cell.obj) === null || _g === void 0 ? void 0 : _g.data) !== null && _h !== void 0 ? _h : (_j = _s.cell.obj) === null || _j === void 0 ? void 0 : _j.data;
73
- if (!s)
74
- return [3 /*break*/, 6];
75
- if (s.models.length > 1) {
76
- plugin.log.warn("[Export] Skipping ".concat((_k = _s.cell.obj) === null || _k === void 0 ? void 0 : _k.label, ": Multimodel exports not supported."));
77
- return [3 /*break*/, 6];
78
- }
79
- if (s.units.some(function (u) { return !structure_1.Unit.isAtomic(u); })) {
80
- plugin.log.warn("[Export] Skipping ".concat((_l = _s.cell.obj) === null || _l === void 0 ? void 0 : _l.label, ": Non-atomic model exports not supported."));
81
- return [3 /*break*/, 6];
82
- }
83
- name_1 = entryMap.has(s.model.entryId)
84
- ? "".concat(s.model.entryId, "_").concat(entryMap.get(s.model.entryId) + 1, ".").concat(format)
85
- : "".concat(s.model.entryId, ".").concat(format);
86
- entryMap.set(s.model.entryId, ((_m = entryMap.get(s.model.entryId)) !== null && _m !== void 0 ? _m : 0) + 1);
87
- return [4 /*yield*/, ctx.update({ message: "Exporting ".concat(s.model.entryId, "..."), isIndeterminate: true, canAbort: false })];
88
- case 3:
89
- _o.sent();
90
- if (!(s.elementCount > 100000)) return [3 /*break*/, 5];
91
- // Give UI chance to update, only needed for larger structures.
92
- return [4 /*yield*/, new Promise(function (res) { return setTimeout(res, 50); })];
93
- case 4:
94
- // Give UI chance to update, only needed for larger structures.
95
- _o.sent();
96
- _o.label = 5;
97
- case 5:
98
- try {
99
- files.push([name_1, (0, structure_1.to_mmCIF)(s.model.entryId, s, format === 'bcif', { copyAllCategories: true })]);
100
- }
101
- catch (e) {
102
- if (format === 'cif' && s.elementCount > 2000000) {
103
- plugin.log.warn("[Export] The structure might be too big to be exported as Text CIF, consider using the BinaryCIF format instead.");
104
- }
105
- throw e;
106
- }
107
- _o.label = 6;
108
- case 6:
109
- _i++;
110
- return [3 /*break*/, 2];
111
- case 7:
112
- if (files.length === 0) {
113
- commands_1.PluginCommands.Toast.Show(plugin, {
114
- title: 'Export Models',
115
- message: 'No visible structure in the 3D view to export!',
116
- key: 'superposition-toast-1',
117
- timeoutMs: 7000
118
- });
119
- return [2 /*return*/];
120
- }
121
- if (!(files.length === 1)) return [3 /*break*/, 8];
122
- (0, download_1.download)(new Blob([files[0][1]]), files[0][0]);
123
- return [3 /*break*/, 11];
124
- case 8:
125
- if (!(files.length > 1)) return [3 /*break*/, 11];
126
- zipData = {};
127
- for (_c = 0, files_1 = files; _c < files_1.length; _c++) {
128
- _d = files_1[_c], fn = _d[0], data = _d[1];
129
- if (data instanceof Uint8Array) {
130
- zipData[fn] = data;
131
- }
132
- else {
133
- bytes = new Uint8Array((0, utf8_1.utf8ByteCount)(data));
134
- (0, utf8_1.utf8Write)(bytes, 0, data);
135
- zipData[fn] = bytes;
136
- }
137
- }
138
- return [4 /*yield*/, ctx.update({ message: "Compressing Data...", isIndeterminate: true, canAbort: false })];
139
- case 9:
140
- _o.sent();
141
- return [4 /*yield*/, (0, zip_1.zip)(ctx, zipData)];
142
- case 10:
143
- buffer = _o.sent();
144
- (0, download_1.download)(new Blob([new Uint8Array(buffer, 0, buffer.byteLength)]), "structures_".concat((0, date_1.getFormattedTime)(), ".zip"));
145
- _o.label = 11;
146
- case 11:
147
- plugin.log.info("[Export] Done.");
148
- return [2 /*return*/];
22
+ return mol_task_1.Task.create('Export', async (ctx) => {
23
+ await ctx.update({ message: 'Exporting...', isIndeterminate: true, canAbort: false });
24
+ const format = options?.format ?? 'cif';
25
+ // const { structures } = plugin.managers.structure.hierarchy.current;
26
+ const customState = plugin.customState;
27
+ const superpositionState = customState.superpositionState;
28
+ const segmentIndex = superpositionState.activeSegment - 1;
29
+ const files = [];
30
+ const entryMap = new Map();
31
+ const structures = superpositionState.loadedStructs[segmentIndex].slice();
32
+ if (superpositionState.alphafold.ref)
33
+ structures.push(`AF-${customState.initParams.moleculeId}`);
34
+ for (const molId of structures) {
35
+ const modelRef = superpositionState.models[molId];
36
+ if (!modelRef)
37
+ continue;
38
+ let isStrHidden = false;
39
+ const _s = plugin.managers.structure.hierarchy.current.refs.get(modelRef);
40
+ if (_s.cell.state.isHidden)
41
+ isStrHidden = true;
42
+ for (const strComp of _s.components) {
43
+ if (strComp.cell.state.isHidden)
44
+ isStrHidden = true;
45
+ }
46
+ if (isStrHidden)
47
+ continue;
48
+ const s = _s.transform?.cell.obj?.data ?? _s.cell.obj?.data;
49
+ if (!s)
50
+ continue;
51
+ if (s.models.length > 1) {
52
+ plugin.log.warn(`[Export] Skipping ${_s.cell.obj?.label}: Multimodel exports not supported.`);
53
+ continue;
54
+ }
55
+ if (s.units.some((u) => !structure_1.Unit.isAtomic(u))) {
56
+ plugin.log.warn(`[Export] Skipping ${_s.cell.obj?.label}: Non-atomic model exports not supported.`);
57
+ continue;
58
+ }
59
+ const name = entryMap.has(s.model.entryId)
60
+ ? `${s.model.entryId}_${entryMap.get(s.model.entryId) + 1}.${format}`
61
+ : `${s.model.entryId}.${format}`;
62
+ entryMap.set(s.model.entryId, (entryMap.get(s.model.entryId) ?? 0) + 1);
63
+ await ctx.update({ message: `Exporting ${s.model.entryId}...`, isIndeterminate: true, canAbort: false });
64
+ if (s.elementCount > 100000) {
65
+ // Give UI chance to update, only needed for larger structures.
66
+ await new Promise(res => setTimeout(res, 50));
149
67
  }
150
- });
151
- }); });
68
+ try {
69
+ files.push([name, (0, structure_1.to_mmCIF)(s.model.entryId, s, format === 'bcif', { copyAllCategories: true })]);
70
+ }
71
+ catch (e) {
72
+ if (format === 'cif' && s.elementCount > 2000000) {
73
+ plugin.log.warn(`[Export] The structure might be too big to be exported as Text CIF, consider using the BinaryCIF format instead.`);
74
+ }
75
+ throw e;
76
+ }
77
+ }
78
+ if (files.length === 0) {
79
+ commands_1.PluginCommands.Toast.Show(plugin, {
80
+ title: 'Export Models',
81
+ message: 'No visible structure in the 3D view to export!',
82
+ key: 'superposition-toast-1',
83
+ timeoutMs: 7000
84
+ });
85
+ return;
86
+ }
87
+ if (files.length === 1) {
88
+ (0, download_1.download)(new Blob([files[0][1]]), files[0][0]);
89
+ }
90
+ else if (files.length > 1) {
91
+ const zipData = {};
92
+ for (const [fn, data] of files) {
93
+ if (data instanceof Uint8Array) {
94
+ zipData[fn] = data;
95
+ }
96
+ else {
97
+ const bytes = new Uint8Array((0, utf8_1.utf8ByteCount)(data));
98
+ (0, utf8_1.utf8Write)(bytes, 0, data);
99
+ zipData[fn] = bytes;
100
+ }
101
+ }
102
+ await ctx.update({ message: `Compressing Data...`, isIndeterminate: true, canAbort: false });
103
+ const buffer = await (0, zip_1.zip)(ctx, zipData);
104
+ (0, download_1.download)(new Blob([new Uint8Array(buffer, 0, buffer.byteLength)]), `structures_${(0, date_1.getFormattedTime)()}.zip`);
105
+ }
106
+ plugin.log.info(`[Export] Done.`);
107
+ });
152
108
  }
@@ -7,7 +7,7 @@ declare const SuperpositionFocusRepresentationParams: (plugin: PluginContext) =>
7
7
  [x: string]: any;
8
8
  }>>;
9
9
  };
10
- declare type SuperpositionFocusRepresentationProps = PD.ValuesFor<ReturnType<typeof SuperpositionFocusRepresentationParams>>;
10
+ type SuperpositionFocusRepresentationProps = PD.ValuesFor<ReturnType<typeof SuperpositionFocusRepresentationParams>>;
11
11
  export declare enum SuperpositionFocusRepresentationTags {
12
12
  SurrSel = "superposition-focus-surr-sel",
13
13
  SurrRepr = "superposition-focus-surr-repr"