molstar 3.0.0-dev.8 → 3.0.2

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 (316) hide show
  1. package/README.md +7 -0
  2. package/build/viewer/index.html +2 -2
  3. package/build/viewer/molstar.js +1 -1
  4. package/lib/apps/viewer/app.d.ts +230 -0
  5. package/lib/apps/viewer/app.js +528 -0
  6. package/lib/apps/viewer/index.d.ts +2 -225
  7. package/lib/apps/viewer/index.html +2 -2
  8. package/lib/apps/viewer/index.js +2 -509
  9. package/lib/commonjs/apps/viewer/app.d.ts +230 -0
  10. package/lib/commonjs/apps/viewer/app.js +534 -0
  11. package/lib/commonjs/apps/viewer/index.d.ts +2 -225
  12. package/lib/commonjs/apps/viewer/index.js +2 -512
  13. package/lib/commonjs/examples/basic-wrapper/index.js +7 -3
  14. package/lib/commonjs/examples/proteopedia-wrapper/index.js +7 -1
  15. package/lib/commonjs/extensions/anvil/representation.js +1 -1
  16. package/lib/commonjs/extensions/model-export/export.d.ts +9 -0
  17. package/lib/commonjs/extensions/model-export/export.js +129 -0
  18. package/lib/commonjs/extensions/model-export/index.d.ts +7 -0
  19. package/lib/commonjs/extensions/model-export/index.js +36 -0
  20. package/lib/commonjs/extensions/model-export/ui.d.ts +11 -0
  21. package/lib/commonjs/extensions/model-export/ui.js +77 -0
  22. package/lib/commonjs/extensions/mp4-export/encoder.js +1 -1
  23. package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
  24. package/lib/commonjs/extensions/rcsb/graphql/types.d.ts +2 -2
  25. package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +12 -4
  26. package/lib/commonjs/mol-canvas3d/canvas3d.js +2 -2
  27. package/lib/commonjs/mol-canvas3d/controls/trackball.d.ts +9 -4
  28. package/lib/commonjs/mol-canvas3d/controls/trackball.js +50 -11
  29. package/lib/commonjs/mol-canvas3d/helper/interaction-events.js +1 -1
  30. package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +1 -1
  31. package/lib/commonjs/mol-canvas3d/passes/draw.js +3 -3
  32. package/lib/commonjs/mol-gl/renderer.d.ts +2 -2
  33. package/lib/commonjs/mol-gl/renderer.js +3 -3
  34. package/lib/commonjs/mol-io/reader/cif/schema/bird.d.ts +1 -1
  35. package/lib/commonjs/mol-io/reader/cif/schema/bird.js +1 -1
  36. package/lib/commonjs/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  37. package/lib/commonjs/mol-io/reader/cif/schema/ccd.js +1 -1
  38. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
  39. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.js +1 -1
  40. package/lib/commonjs/mol-io/reader/mol/parser.d.ts +23 -1
  41. package/lib/commonjs/mol-io/reader/mol/parser.js +116 -4
  42. package/lib/commonjs/mol-io/reader/mol2/parser.d.ts +1 -1
  43. package/lib/commonjs/mol-io/reader/mol2/parser.js +33 -3
  44. package/lib/commonjs/mol-io/reader/mol2/schema.d.ts +12 -1
  45. package/lib/commonjs/mol-io/reader/mol2/schema.js +1 -1
  46. package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
  47. package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.js +9 -0
  48. package/lib/commonjs/mol-io/reader/sdf/parser.d.ts +3 -1
  49. package/lib/commonjs/mol-io/reader/sdf/parser.js +11 -2
  50. package/lib/commonjs/mol-io/writer/cif/encoder/binary.js +9 -2
  51. package/lib/commonjs/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
  52. package/lib/commonjs/mol-math/geometry/primitives/sphere3d.js +17 -4
  53. package/lib/commonjs/mol-math/geometry/symmetry-operator.d.ts +1 -1
  54. package/lib/commonjs/mol-math/geometry/symmetry-operator.js +10 -4
  55. package/lib/commonjs/mol-model/structure/export/mmcif.d.ts +1 -1
  56. package/lib/commonjs/mol-model/structure/export/mmcif.js +8 -5
  57. package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
  58. package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
  59. package/lib/commonjs/mol-model/structure/model/properties/common.d.ts +1 -1
  60. package/lib/commonjs/mol-model/structure/structure/element/loci.d.ts +1 -1
  61. package/lib/commonjs/mol-model/structure/structure/element/loci.js +4 -2
  62. package/lib/commonjs/mol-model/structure/structure/element/stats.js +8 -0
  63. package/lib/commonjs/mol-model/structure/structure/properties.d.ts +1 -0
  64. package/lib/commonjs/mol-model/structure/structure/properties.js +2 -1
  65. package/lib/commonjs/mol-model/structure/structure/symmetry.js +1 -3
  66. package/lib/commonjs/mol-model/structure/structure/unit/bonds/common.d.ts +2 -1
  67. package/lib/commonjs/mol-model/structure/structure/unit/bonds/common.js +11 -2
  68. package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.d.ts +1 -1
  69. package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.js +20 -10
  70. package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.d.ts +1 -1
  71. package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.js +21 -11
  72. package/lib/commonjs/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
  73. package/lib/commonjs/mol-model/volume/volume.d.ts +7 -0
  74. package/lib/commonjs/mol-model/volume/volume.js +18 -0
  75. package/lib/commonjs/mol-model-formats/structure/basic/atomic.d.ts +2 -2
  76. package/lib/commonjs/mol-model-formats/structure/basic/atomic.js +6 -6
  77. package/lib/commonjs/mol-model-formats/structure/basic/coarse.d.ts +1 -1
  78. package/lib/commonjs/mol-model-formats/structure/basic/coarse.js +3 -3
  79. package/lib/commonjs/mol-model-formats/structure/basic/entities.d.ts +2 -1
  80. package/lib/commonjs/mol-model-formats/structure/basic/entities.js +28 -24
  81. package/lib/commonjs/mol-model-formats/structure/basic/parser.js +17 -8
  82. package/lib/commonjs/mol-model-formats/structure/basic/properties.d.ts +6 -1
  83. package/lib/commonjs/mol-model-formats/structure/basic/properties.js +12 -22
  84. package/lib/commonjs/mol-model-formats/structure/mol.d.ts +2 -1
  85. package/lib/commonjs/mol-model-formats/structure/mol.js +19 -5
  86. package/lib/commonjs/mol-model-formats/structure/mol2.d.ts +1 -1
  87. package/lib/commonjs/mol-model-formats/structure/mol2.js +37 -7
  88. package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.d.ts +18 -1
  89. package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.js +18 -5
  90. package/lib/commonjs/mol-model-props/common/custom-property.d.ts +1 -1
  91. package/lib/commonjs/mol-model-props/computed/interactions/common.d.ts +1 -1
  92. package/lib/commonjs/mol-model-props/computed/interactions/common.js +16 -24
  93. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
  94. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
  95. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
  96. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +38 -13
  97. package/lib/commonjs/mol-model-props/sequence/best-database-mapping.js +15 -15
  98. package/lib/commonjs/mol-plugin/animation-loop.d.ts +2 -0
  99. package/lib/commonjs/mol-plugin/animation-loop.js +1 -1
  100. package/lib/commonjs/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
  101. package/lib/commonjs/mol-plugin/behavior/dynamic/representation.js +11 -6
  102. package/lib/commonjs/mol-plugin/behavior/static/representation.js +1 -1
  103. package/lib/commonjs/mol-plugin/commands.d.ts +6 -2
  104. package/lib/commonjs/mol-plugin/config.d.ts +1 -1
  105. package/lib/commonjs/mol-plugin/spec.d.ts +1 -1
  106. package/lib/commonjs/mol-plugin/spec.js +3 -1
  107. package/lib/commonjs/mol-plugin-state/actions/file.d.ts +3 -2
  108. package/lib/commonjs/mol-plugin-state/actions/file.js +67 -31
  109. package/lib/commonjs/mol-plugin-state/actions/structure.d.ts +1 -0
  110. package/lib/commonjs/mol-plugin-state/actions/structure.js +41 -8
  111. package/lib/commonjs/mol-plugin-state/actions/volume.d.ts +1 -1
  112. package/lib/commonjs/mol-plugin-state/actions/volume.js +3 -3
  113. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
  114. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.js +62 -0
  115. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
  116. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
  117. package/lib/commonjs/mol-plugin-state/animation/model.d.ts +4 -0
  118. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
  119. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
  120. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +172 -6
  121. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +74 -2
  122. package/lib/commonjs/mol-plugin-state/formats/volume.js +1 -11
  123. package/lib/commonjs/mol-plugin-state/manager/animation.d.ts +5 -1
  124. package/lib/commonjs/mol-plugin-state/manager/animation.js +5 -5
  125. package/lib/commonjs/mol-plugin-ui/structure/superposition.js +2 -2
  126. package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
  127. package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +4 -8
  128. package/lib/commonjs/mol-repr/shape/loci/common.d.ts +1 -1
  129. package/lib/commonjs/mol-repr/shape/loci/common.js +3 -3
  130. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
  131. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
  132. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
  133. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
  134. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
  135. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
  136. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
  137. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
  138. package/lib/commonjs/mol-repr/structure/visual/util/bond.d.ts +1 -1
  139. package/lib/commonjs/mol-repr/structure/visual/util/bond.js +5 -4
  140. package/lib/commonjs/mol-repr/visual.d.ts +1 -1
  141. package/lib/commonjs/mol-repr/visual.js +2 -1
  142. package/lib/commonjs/mol-state/transform.js +12 -2
  143. package/lib/commonjs/mol-state/tree/immutable.d.ts +18 -0
  144. package/lib/commonjs/mol-state/tree/transient.d.ts +3 -4
  145. package/lib/commonjs/mol-theme/color/element-symbol.d.ts +289 -3
  146. package/lib/commonjs/mol-theme/color/element-symbol.js +25 -15
  147. package/lib/commonjs/mol-theme/color/entity-id.d.ts +1 -1
  148. package/lib/commonjs/mol-theme/color/entity-id.js +29 -5
  149. package/lib/commonjs/mol-theme/color/illustrative.d.ts +100 -29
  150. package/lib/commonjs/mol-theme/color/illustrative.js +26 -7
  151. package/lib/commonjs/mol-theme/color/molecule-type.d.ts +19 -1
  152. package/lib/commonjs/mol-theme/color/molecule-type.js +10 -5
  153. package/lib/commonjs/mol-theme/color/residue-name.d.ts +77 -1
  154. package/lib/commonjs/mol-theme/color/residue-name.js +10 -5
  155. package/lib/commonjs/mol-theme/color/secondary-structure.d.ts +27 -1
  156. package/lib/commonjs/mol-theme/color/secondary-structure.js +10 -5
  157. package/lib/commonjs/mol-theme/color.d.ts +253 -15
  158. package/lib/commonjs/mol-util/color/color.d.ts +1 -1
  159. package/lib/commonjs/mol-util/color/color.js +1 -1
  160. package/lib/commonjs/mol-util/color/params.d.ts +10 -0
  161. package/lib/commonjs/mol-util/color/params.js +19 -0
  162. package/lib/commonjs/servers/volume/config.js +3 -3
  163. package/lib/commonjs/servers/volume/query.js +1 -1
  164. package/lib/examples/basic-wrapper/index.js +7 -3
  165. package/lib/examples/proteopedia-wrapper/index.js +7 -1
  166. package/lib/extensions/anvil/representation.js +1 -1
  167. package/lib/extensions/model-export/export.d.ts +9 -0
  168. package/lib/extensions/model-export/export.js +125 -0
  169. package/lib/extensions/model-export/index.d.ts +7 -0
  170. package/lib/extensions/model-export/index.js +33 -0
  171. package/lib/extensions/model-export/ui.d.ts +11 -0
  172. package/lib/extensions/model-export/ui.js +74 -0
  173. package/lib/extensions/mp4-export/encoder.js +1 -1
  174. package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
  175. package/lib/extensions/rcsb/graphql/types.d.ts +2 -2
  176. package/lib/mol-canvas3d/canvas3d.d.ts +12 -4
  177. package/lib/mol-canvas3d/canvas3d.js +2 -2
  178. package/lib/mol-canvas3d/controls/trackball.d.ts +9 -4
  179. package/lib/mol-canvas3d/controls/trackball.js +51 -12
  180. package/lib/mol-canvas3d/helper/interaction-events.js +1 -1
  181. package/lib/mol-canvas3d/passes/draw.d.ts +1 -1
  182. package/lib/mol-canvas3d/passes/draw.js +3 -3
  183. package/lib/mol-gl/renderer.d.ts +2 -2
  184. package/lib/mol-gl/renderer.js +3 -3
  185. package/lib/mol-io/reader/cif/schema/bird.d.ts +1 -1
  186. package/lib/mol-io/reader/cif/schema/bird.js +1 -1
  187. package/lib/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  188. package/lib/mol-io/reader/cif/schema/ccd.js +1 -1
  189. package/lib/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
  190. package/lib/mol-io/reader/cif/schema/mmcif.js +1 -1
  191. package/lib/mol-io/reader/mol/parser.d.ts +23 -1
  192. package/lib/mol-io/reader/mol/parser.js +112 -3
  193. package/lib/mol-io/reader/mol2/parser.d.ts +1 -1
  194. package/lib/mol-io/reader/mol2/parser.js +33 -3
  195. package/lib/mol-io/reader/mol2/schema.d.ts +12 -1
  196. package/lib/mol-io/reader/mol2/schema.js +1 -1
  197. package/lib/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
  198. package/lib/mol-io/reader/sdf/parser-v3-util.js +9 -0
  199. package/lib/mol-io/reader/sdf/parser.d.ts +3 -1
  200. package/lib/mol-io/reader/sdf/parser.js +12 -3
  201. package/lib/mol-io/writer/cif/encoder/binary.js +9 -2
  202. package/lib/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
  203. package/lib/mol-math/geometry/primitives/sphere3d.js +17 -4
  204. package/lib/mol-math/geometry/symmetry-operator.d.ts +1 -1
  205. package/lib/mol-math/geometry/symmetry-operator.js +10 -4
  206. package/lib/mol-model/structure/export/mmcif.d.ts +1 -1
  207. package/lib/mol-model/structure/export/mmcif.js +8 -5
  208. package/lib/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
  209. package/lib/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
  210. package/lib/mol-model/structure/model/properties/common.d.ts +1 -1
  211. package/lib/mol-model/structure/structure/element/loci.d.ts +1 -1
  212. package/lib/mol-model/structure/structure/element/loci.js +4 -2
  213. package/lib/mol-model/structure/structure/element/stats.js +8 -0
  214. package/lib/mol-model/structure/structure/properties.d.ts +1 -0
  215. package/lib/mol-model/structure/structure/properties.js +2 -1
  216. package/lib/mol-model/structure/structure/symmetry.js +1 -3
  217. package/lib/mol-model/structure/structure/unit/bonds/common.d.ts +2 -1
  218. package/lib/mol-model/structure/structure/unit/bonds/common.js +9 -1
  219. package/lib/mol-model/structure/structure/unit/bonds/inter-compute.d.ts +1 -1
  220. package/lib/mol-model/structure/structure/unit/bonds/inter-compute.js +21 -11
  221. package/lib/mol-model/structure/structure/unit/bonds/intra-compute.d.ts +1 -1
  222. package/lib/mol-model/structure/structure/unit/bonds/intra-compute.js +22 -12
  223. package/lib/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
  224. package/lib/mol-model/volume/volume.d.ts +7 -0
  225. package/lib/mol-model/volume/volume.js +18 -0
  226. package/lib/mol-model-formats/structure/basic/atomic.d.ts +2 -2
  227. package/lib/mol-model-formats/structure/basic/atomic.js +6 -6
  228. package/lib/mol-model-formats/structure/basic/coarse.d.ts +1 -1
  229. package/lib/mol-model-formats/structure/basic/coarse.js +3 -3
  230. package/lib/mol-model-formats/structure/basic/entities.d.ts +2 -1
  231. package/lib/mol-model-formats/structure/basic/entities.js +25 -22
  232. package/lib/mol-model-formats/structure/basic/parser.js +19 -10
  233. package/lib/mol-model-formats/structure/basic/properties.d.ts +6 -1
  234. package/lib/mol-model-formats/structure/basic/properties.js +12 -25
  235. package/lib/mol-model-formats/structure/mol.d.ts +2 -1
  236. package/lib/mol-model-formats/structure/mol.js +17 -3
  237. package/lib/mol-model-formats/structure/mol2.d.ts +1 -1
  238. package/lib/mol-model-formats/structure/mol2.js +37 -7
  239. package/lib/mol-model-formats/structure/property/bonds/index-pair.d.ts +18 -1
  240. package/lib/mol-model-formats/structure/property/bonds/index-pair.js +18 -5
  241. package/lib/mol-model-props/common/custom-property.d.ts +1 -1
  242. package/lib/mol-model-props/computed/interactions/common.d.ts +1 -1
  243. package/lib/mol-model-props/computed/interactions/common.js +16 -24
  244. package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
  245. package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
  246. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
  247. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +38 -13
  248. package/lib/mol-model-props/sequence/best-database-mapping.js +15 -15
  249. package/lib/mol-plugin/animation-loop.d.ts +2 -0
  250. package/lib/mol-plugin/animation-loop.js +1 -1
  251. package/lib/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
  252. package/lib/mol-plugin/behavior/dynamic/representation.js +11 -6
  253. package/lib/mol-plugin/behavior/static/representation.js +1 -1
  254. package/lib/mol-plugin/commands.d.ts +6 -2
  255. package/lib/mol-plugin/config.d.ts +1 -1
  256. package/lib/mol-plugin/spec.d.ts +1 -1
  257. package/lib/mol-plugin/spec.js +3 -1
  258. package/lib/mol-plugin/version.js +2 -2
  259. package/lib/mol-plugin-state/actions/file.d.ts +3 -2
  260. package/lib/mol-plugin-state/actions/file.js +67 -31
  261. package/lib/mol-plugin-state/actions/structure.d.ts +1 -0
  262. package/lib/mol-plugin-state/actions/structure.js +41 -8
  263. package/lib/mol-plugin-state/actions/volume.d.ts +1 -1
  264. package/lib/mol-plugin-state/actions/volume.js +3 -3
  265. package/lib/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
  266. package/lib/mol-plugin-state/animation/built-in/camera-rock.js +59 -0
  267. package/lib/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
  268. package/lib/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
  269. package/lib/mol-plugin-state/animation/model.d.ts +4 -0
  270. package/lib/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
  271. package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
  272. package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +172 -6
  273. package/lib/mol-plugin-state/builder/structure/representation-preset.js +74 -2
  274. package/lib/mol-plugin-state/formats/volume.js +1 -11
  275. package/lib/mol-plugin-state/manager/animation.d.ts +5 -1
  276. package/lib/mol-plugin-state/manager/animation.js +5 -5
  277. package/lib/mol-plugin-ui/structure/superposition.js +2 -2
  278. package/lib/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
  279. package/lib/mol-plugin-ui/viewport/simple-settings.js +4 -8
  280. package/lib/mol-repr/shape/loci/common.d.ts +1 -1
  281. package/lib/mol-repr/shape/loci/common.js +3 -3
  282. package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
  283. package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
  284. package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
  285. package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
  286. package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
  287. package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
  288. package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
  289. package/lib/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
  290. package/lib/mol-repr/structure/visual/util/bond.d.ts +1 -1
  291. package/lib/mol-repr/structure/visual/util/bond.js +5 -4
  292. package/lib/mol-repr/visual.d.ts +1 -1
  293. package/lib/mol-repr/visual.js +2 -1
  294. package/lib/mol-state/transform.js +12 -2
  295. package/lib/mol-state/tree/immutable.d.ts +18 -0
  296. package/lib/mol-state/tree/transient.d.ts +3 -4
  297. package/lib/mol-theme/color/element-symbol.d.ts +289 -3
  298. package/lib/mol-theme/color/element-symbol.js +25 -15
  299. package/lib/mol-theme/color/entity-id.d.ts +1 -1
  300. package/lib/mol-theme/color/entity-id.js +29 -5
  301. package/lib/mol-theme/color/illustrative.d.ts +100 -29
  302. package/lib/mol-theme/color/illustrative.js +26 -7
  303. package/lib/mol-theme/color/molecule-type.d.ts +19 -1
  304. package/lib/mol-theme/color/molecule-type.js +10 -5
  305. package/lib/mol-theme/color/residue-name.d.ts +77 -1
  306. package/lib/mol-theme/color/residue-name.js +10 -5
  307. package/lib/mol-theme/color/secondary-structure.d.ts +27 -1
  308. package/lib/mol-theme/color/secondary-structure.js +10 -5
  309. package/lib/mol-theme/color.d.ts +253 -15
  310. package/lib/mol-util/color/color.d.ts +1 -1
  311. package/lib/mol-util/color/color.js +1 -1
  312. package/lib/mol-util/color/params.d.ts +10 -0
  313. package/lib/mol-util/color/params.js +15 -0
  314. package/lib/servers/volume/config.js +3 -3
  315. package/lib/servers/volume/query.js +1 -1
  316. package/package.json +36 -38
@@ -1,519 +1,12 @@
1
1
  /**
2
- * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author David Sehnal <david.sehnal@gmail.com>
5
5
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
6
6
  */
7
- import { __assign, __awaiter, __generator, __spreadArray } from "tslib";
8
- import { ANVILMembraneOrientation } from '../../extensions/anvil/behavior';
9
- import { CellPack } from '../../extensions/cellpack';
10
- import { DnatcoConfalPyramids } from '../../extensions/dnatco';
11
- import { G3DFormat, G3dProvider } from '../../extensions/g3d/format';
12
- import { GeometryExport } from '../../extensions/geo-export';
13
- import { MAQualityAssessment } from '../../extensions/model-archive/quality-assessment/behavior';
14
- import { QualityAssessmentPLDDTPreset, QualityAssessmentQmeanPreset } from '../../extensions/model-archive/quality-assessment/behavior';
15
- import { QualityAssessment } from '../../extensions/model-archive/quality-assessment/prop';
16
- import { Mp4Export } from '../../extensions/mp4-export';
17
- import { PDBeStructureQualityReport } from '../../extensions/pdbe';
18
- import { RCSBAssemblySymmetry, RCSBValidationReport } from '../../extensions/rcsb';
19
- import { DownloadStructure, PdbDownloadProvider } from '../../mol-plugin-state/actions/structure';
20
- import { DownloadDensity } from '../../mol-plugin-state/actions/volume';
21
- import { PresetStructureRepresentations, StructureRepresentationPresetProvider } from '../../mol-plugin-state/builder/structure/representation-preset';
22
- import { createVolumeRepresentationParams } from '../../mol-plugin-state/helpers/volume-representation-params';
23
- import { StateTransforms } from '../../mol-plugin-state/transforms';
24
- import { TrajectoryFromModelAndCoordinates } from '../../mol-plugin-state/transforms/model';
25
- import { createPluginUI } from '../../mol-plugin-ui';
26
- import { DefaultPluginUISpec } from '../../mol-plugin-ui/spec';
27
- import { PluginCommands } from '../../mol-plugin/commands';
28
- import { PluginConfig } from '../../mol-plugin/config';
29
- import { PluginSpec } from '../../mol-plugin/spec';
30
- import { StateObjectRef } from '../../mol-state';
31
- import { Asset } from '../../mol-util/assets';
32
- import '../../mol-util/polyfill';
33
- import { ObjectKeys } from '../../mol-util/type-helpers';
34
7
  import './embedded.html';
35
8
  import './favicon.ico';
36
9
  import './index.html';
37
10
  require('mol-plugin-ui/skin/light.scss');
38
- export { PLUGIN_VERSION as version } from '../../mol-plugin/version';
39
- export { setDebugMode, setProductionMode } from '../../mol-util/debug';
40
- var CustomFormats = [
41
- ['g3d', G3dProvider]
42
- ];
43
- var Extensions = {
44
- 'cellpack': PluginSpec.Behavior(CellPack),
45
- 'dnatco-confal-pyramids': PluginSpec.Behavior(DnatcoConfalPyramids),
46
- 'pdbe-structure-quality-report': PluginSpec.Behavior(PDBeStructureQualityReport),
47
- 'rcsb-assembly-symmetry': PluginSpec.Behavior(RCSBAssemblySymmetry),
48
- 'rcsb-validation-report': PluginSpec.Behavior(RCSBValidationReport),
49
- 'anvil-membrane-orientation': PluginSpec.Behavior(ANVILMembraneOrientation),
50
- 'g3d': PluginSpec.Behavior(G3DFormat),
51
- 'mp4-export': PluginSpec.Behavior(Mp4Export),
52
- 'geo-export': PluginSpec.Behavior(GeometryExport),
53
- 'ma-quality-assessment': PluginSpec.Behavior(MAQualityAssessment),
54
- };
55
- var DefaultViewerOptions = {
56
- customFormats: CustomFormats,
57
- extensions: ObjectKeys(Extensions),
58
- layoutIsExpanded: true,
59
- layoutShowControls: true,
60
- layoutShowRemoteState: true,
61
- layoutControlsDisplay: 'reactive',
62
- layoutShowSequence: true,
63
- layoutShowLog: true,
64
- layoutShowLeftPanel: true,
65
- collapseLeftPanel: false,
66
- collapseRightPanel: false,
67
- disableAntialiasing: PluginConfig.General.DisableAntialiasing.defaultValue,
68
- pixelScale: PluginConfig.General.PixelScale.defaultValue,
69
- pickScale: PluginConfig.General.PickScale.defaultValue,
70
- pickPadding: PluginConfig.General.PickPadding.defaultValue,
71
- enableWboit: PluginConfig.General.EnableWboit.defaultValue,
72
- preferWebgl1: PluginConfig.General.PreferWebGl1.defaultValue,
73
- viewportShowExpand: PluginConfig.Viewport.ShowExpand.defaultValue,
74
- viewportShowControls: PluginConfig.Viewport.ShowControls.defaultValue,
75
- viewportShowSettings: PluginConfig.Viewport.ShowSettings.defaultValue,
76
- viewportShowSelectionMode: PluginConfig.Viewport.ShowSelectionMode.defaultValue,
77
- viewportShowAnimation: PluginConfig.Viewport.ShowAnimation.defaultValue,
78
- pluginStateServer: PluginConfig.State.DefaultServer.defaultValue,
79
- volumeStreamingServer: PluginConfig.VolumeStreaming.DefaultServer.defaultValue,
80
- volumeStreamingDisabled: !PluginConfig.VolumeStreaming.Enabled.defaultValue,
81
- pdbProvider: PluginConfig.Download.DefaultPdbProvider.defaultValue,
82
- emdbProvider: PluginConfig.Download.DefaultEmdbProvider.defaultValue,
83
- };
84
- var Viewer = /** @class */ (function () {
85
- function Viewer(plugin) {
86
- this.plugin = plugin;
87
- }
88
- Viewer.create = function (elementOrId, options) {
89
- var _a;
90
- if (options === void 0) { options = {}; }
91
- return __awaiter(this, void 0, void 0, function () {
92
- var o, defaultSpec, spec, element, plugin;
93
- return __generator(this, function (_b) {
94
- switch (_b.label) {
95
- case 0:
96
- o = __assign(__assign({}, DefaultViewerOptions), options);
97
- defaultSpec = DefaultPluginUISpec();
98
- spec = {
99
- actions: defaultSpec.actions,
100
- behaviors: __spreadArray(__spreadArray([], defaultSpec.behaviors, true), o.extensions.map(function (e) { return Extensions[e]; }), true),
101
- animations: __spreadArray([], defaultSpec.animations || [], true),
102
- customParamEditors: defaultSpec.customParamEditors,
103
- customFormats: o === null || o === void 0 ? void 0 : o.customFormats,
104
- layout: {
105
- initial: {
106
- isExpanded: o.layoutIsExpanded,
107
- showControls: o.layoutShowControls,
108
- controlsDisplay: o.layoutControlsDisplay,
109
- regionState: {
110
- bottom: 'full',
111
- left: o.collapseLeftPanel ? 'collapsed' : 'full',
112
- right: o.collapseRightPanel ? 'hidden' : 'full',
113
- top: 'full',
114
- }
115
- },
116
- },
117
- components: __assign(__assign({}, defaultSpec.components), { controls: __assign(__assign({}, (_a = defaultSpec.components) === null || _a === void 0 ? void 0 : _a.controls), { top: o.layoutShowSequence ? undefined : 'none', bottom: o.layoutShowLog ? undefined : 'none', left: o.layoutShowLeftPanel ? undefined : 'none' }), remoteState: o.layoutShowRemoteState ? 'default' : 'none' }),
118
- config: [
119
- [PluginConfig.General.DisableAntialiasing, o.disableAntialiasing],
120
- [PluginConfig.General.PixelScale, o.pixelScale],
121
- [PluginConfig.General.PickScale, o.pickScale],
122
- [PluginConfig.General.PickPadding, o.pickPadding],
123
- [PluginConfig.General.EnableWboit, o.enableWboit],
124
- [PluginConfig.General.PreferWebGl1, o.preferWebgl1],
125
- [PluginConfig.Viewport.ShowExpand, o.viewportShowExpand],
126
- [PluginConfig.Viewport.ShowControls, o.viewportShowControls],
127
- [PluginConfig.Viewport.ShowSettings, o.viewportShowSettings],
128
- [PluginConfig.Viewport.ShowSelectionMode, o.viewportShowSelectionMode],
129
- [PluginConfig.Viewport.ShowAnimation, o.viewportShowAnimation],
130
- [PluginConfig.State.DefaultServer, o.pluginStateServer],
131
- [PluginConfig.State.CurrentServer, o.pluginStateServer],
132
- [PluginConfig.VolumeStreaming.DefaultServer, o.volumeStreamingServer],
133
- [PluginConfig.VolumeStreaming.Enabled, !o.volumeStreamingDisabled],
134
- [PluginConfig.Download.DefaultPdbProvider, o.pdbProvider],
135
- [PluginConfig.Download.DefaultEmdbProvider, o.emdbProvider],
136
- [PluginConfig.Structure.DefaultRepresentationPreset, ViewerAutoPreset.id],
137
- ]
138
- };
139
- element = typeof elementOrId === 'string'
140
- ? document.getElementById(elementOrId)
141
- : elementOrId;
142
- if (!element)
143
- throw new Error("Could not get element with id '".concat(elementOrId, "'"));
144
- return [4 /*yield*/, createPluginUI(element, spec, {
145
- onBeforeUIRender: function (plugin) {
146
- // the preset needs to be added before the UI renders otherwise
147
- // "Download Structure" wont be able to pick it up
148
- plugin.builders.structure.representation.registerPreset(ViewerAutoPreset);
149
- }
150
- })];
151
- case 1:
152
- plugin = _b.sent();
153
- return [2 /*return*/, new Viewer(plugin)];
154
- }
155
- });
156
- });
157
- };
158
- Viewer.prototype.setRemoteSnapshot = function (id) {
159
- var url = "".concat(this.plugin.config.get(PluginConfig.State.CurrentServer), "/get/").concat(id);
160
- return PluginCommands.State.Snapshots.Fetch(this.plugin, { url: url });
161
- };
162
- Viewer.prototype.loadSnapshotFromUrl = function (url, type) {
163
- return PluginCommands.State.Snapshots.OpenUrl(this.plugin, { url: url, type: type });
164
- };
165
- Viewer.prototype.loadStructureFromUrl = function (url, format, isBinary, options) {
166
- if (format === void 0) { format = 'mmcif'; }
167
- if (isBinary === void 0) { isBinary = false; }
168
- var params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj, this.plugin);
169
- return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
170
- source: {
171
- name: 'url',
172
- params: {
173
- url: Asset.Url(url),
174
- format: format,
175
- isBinary: isBinary,
176
- options: __assign(__assign({}, params.source.params.options), { representationParams: options === null || options === void 0 ? void 0 : options.representationParams }),
177
- }
178
- }
179
- }));
180
- };
181
- Viewer.prototype.loadAllModelsOrAssemblyFromUrl = function (url, format, isBinary, options) {
182
- if (format === void 0) { format = 'mmcif'; }
183
- if (isBinary === void 0) { isBinary = false; }
184
- return __awaiter(this, void 0, void 0, function () {
185
- var plugin, data, trajectory;
186
- return __generator(this, function (_a) {
187
- switch (_a.label) {
188
- case 0:
189
- plugin = this.plugin;
190
- return [4 /*yield*/, plugin.builders.data.download({ url: url, isBinary: isBinary }, { state: { isGhost: true } })];
191
- case 1:
192
- data = _a.sent();
193
- return [4 /*yield*/, plugin.builders.structure.parseTrajectory(data, format)];
194
- case 2:
195
- trajectory = _a.sent();
196
- return [4 /*yield*/, this.plugin.builders.structure.hierarchy.applyPreset(trajectory, 'all-models', { useDefaultIfSingleModel: true, representationPresetParams: options === null || options === void 0 ? void 0 : options.representationParams })];
197
- case 3:
198
- _a.sent();
199
- return [2 /*return*/];
200
- }
201
- });
202
- });
203
- };
204
- Viewer.prototype.loadStructureFromData = function (data, format, options) {
205
- return __awaiter(this, void 0, void 0, function () {
206
- var _data, trajectory;
207
- return __generator(this, function (_a) {
208
- switch (_a.label) {
209
- case 0: return [4 /*yield*/, this.plugin.builders.data.rawData({ data: data, label: options === null || options === void 0 ? void 0 : options.dataLabel })];
210
- case 1:
211
- _data = _a.sent();
212
- return [4 /*yield*/, this.plugin.builders.structure.parseTrajectory(_data, format)];
213
- case 2:
214
- trajectory = _a.sent();
215
- return [4 /*yield*/, this.plugin.builders.structure.hierarchy.applyPreset(trajectory, 'default')];
216
- case 3:
217
- _a.sent();
218
- return [2 /*return*/];
219
- }
220
- });
221
- });
222
- };
223
- Viewer.prototype.loadPdb = function (pdb, options) {
224
- var params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj, this.plugin);
225
- var provider = this.plugin.config.get(PluginConfig.Download.DefaultPdbProvider);
226
- return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
227
- source: {
228
- name: 'pdb',
229
- params: {
230
- provider: {
231
- id: pdb,
232
- server: {
233
- name: provider,
234
- params: PdbDownloadProvider[provider].defaultValue
235
- }
236
- },
237
- options: __assign(__assign({}, params.source.params.options), { representationParams: options === null || options === void 0 ? void 0 : options.representationParams }),
238
- }
239
- }
240
- }));
241
- };
242
- Viewer.prototype.loadPdbDev = function (pdbDev) {
243
- var params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj, this.plugin);
244
- return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
245
- source: {
246
- name: 'pdb-dev',
247
- params: {
248
- provider: {
249
- id: pdbDev,
250
- encoding: 'bcif',
251
- },
252
- options: params.source.params.options,
253
- }
254
- }
255
- }));
256
- };
257
- Viewer.prototype.loadEmdb = function (emdb, options) {
258
- var _a;
259
- var provider = this.plugin.config.get(PluginConfig.Download.DefaultEmdbProvider);
260
- return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadDensity, {
261
- source: {
262
- name: 'pdb-emd-ds',
263
- params: {
264
- provider: {
265
- id: emdb,
266
- server: provider,
267
- },
268
- detail: (_a = options === null || options === void 0 ? void 0 : options.detail) !== null && _a !== void 0 ? _a : 3,
269
- }
270
- }
271
- }));
272
- };
273
- Viewer.prototype.loadAlphaFoldDb = function (afdb) {
274
- var params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj, this.plugin);
275
- return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
276
- source: {
277
- name: 'alphafolddb',
278
- params: {
279
- id: afdb,
280
- options: __assign(__assign({}, params.source.params.options), { representation: 'preset-structure-representation-ma-quality-assessment-plddt' }),
281
- }
282
- }
283
- }));
284
- };
285
- Viewer.prototype.loadModelArchive = function (id) {
286
- var params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj, this.plugin);
287
- return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
288
- source: {
289
- name: 'modelarchive',
290
- params: {
291
- id: id,
292
- options: params.source.params.options,
293
- }
294
- }
295
- }));
296
- };
297
- /**
298
- * @example Load X-ray density from volume server
299
- viewer.loadVolumeFromUrl({
300
- url: 'https://www.ebi.ac.uk/pdbe/densities/x-ray/1tqn/cell?detail=3',
301
- format: 'dscif',
302
- isBinary: true
303
- }, [{
304
- type: 'relative',
305
- value: 1.5,
306
- color: 0x3362B2
307
- }, {
308
- type: 'relative',
309
- value: 3,
310
- color: 0x33BB33,
311
- volumeIndex: 1
312
- }, {
313
- type: 'relative',
314
- value: -3,
315
- color: 0xBB3333,
316
- volumeIndex: 1
317
- }], {
318
- entryId: ['2FO-FC', 'FO-FC'],
319
- isLazy: true
320
- });
321
- * *********************
322
- * @example Load EM density from volume server
323
- viewer.loadVolumeFromUrl({
324
- url: 'https://maps.rcsb.org/em/emd-30210/cell?detail=6',
325
- format: 'dscif',
326
- isBinary: true
327
- }, [{
328
- type: 'relative',
329
- value: 1,
330
- color: 0x3377aa
331
- }], {
332
- entryId: 'EMD-30210',
333
- isLazy: true
334
- });
335
- */
336
- Viewer.prototype.loadVolumeFromUrl = function (_a, isovalues, options) {
337
- var url = _a.url, format = _a.format, isBinary = _a.isBinary;
338
- return __awaiter(this, void 0, void 0, function () {
339
- var plugin, update;
340
- var _this = this;
341
- return __generator(this, function (_b) {
342
- plugin = this.plugin;
343
- if (!plugin.dataFormats.get(format)) {
344
- throw new Error("Unknown density format: ".concat(format));
345
- }
346
- if (options === null || options === void 0 ? void 0 : options.isLazy) {
347
- update = this.plugin.build();
348
- update.toRoot().apply(StateTransforms.Data.LazyVolume, {
349
- url: url,
350
- format: format,
351
- entryId: options === null || options === void 0 ? void 0 : options.entryId,
352
- isBinary: isBinary,
353
- isovalues: isovalues.map(function (v) { return (__assign({ alpha: 1, volumeIndex: 0 }, v)); })
354
- });
355
- return [2 /*return*/, update.commit()];
356
- }
357
- return [2 /*return*/, plugin.dataTransaction(function () { return __awaiter(_this, void 0, void 0, function () {
358
- var data, parsed, firstVolume, repr, _i, isovalues_1, iso;
359
- var _a, _b, _c, _d;
360
- return __generator(this, function (_e) {
361
- switch (_e.label) {
362
- case 0: return [4 /*yield*/, plugin.builders.data.download({ url: url, isBinary: isBinary }, { state: { isGhost: true } })];
363
- case 1:
364
- data = _e.sent();
365
- return [4 /*yield*/, plugin.dataFormats.get(format).parse(plugin, data, { entryId: options === null || options === void 0 ? void 0 : options.entryId })];
366
- case 2:
367
- parsed = _e.sent();
368
- firstVolume = (parsed.volume || parsed.volumes[0]);
369
- if (!(firstVolume === null || firstVolume === void 0 ? void 0 : firstVolume.isOk))
370
- throw new Error('Failed to parse any volume.');
371
- repr = plugin.build();
372
- for (_i = 0, isovalues_1 = isovalues; _i < isovalues_1.length; _i++) {
373
- iso = isovalues_1[_i];
374
- repr
375
- .to((_c = (_a = parsed.volumes) === null || _a === void 0 ? void 0 : _a[(_b = iso.volumeIndex) !== null && _b !== void 0 ? _b : 0]) !== null && _c !== void 0 ? _c : parsed.volume)
376
- .apply(StateTransforms.Representation.VolumeRepresentation3D, createVolumeRepresentationParams(this.plugin, firstVolume.data, {
377
- type: 'isosurface',
378
- typeParams: { alpha: (_d = iso.alpha) !== null && _d !== void 0 ? _d : 1, isoValue: iso.type === 'absolute' ? { kind: 'absolute', absoluteValue: iso.value } : { kind: 'relative', relativeValue: iso.value } },
379
- color: 'uniform',
380
- colorParams: { value: iso.color }
381
- }));
382
- }
383
- return [4 /*yield*/, repr.commit()];
384
- case 3:
385
- _e.sent();
386
- return [2 /*return*/];
387
- }
388
- });
389
- }); })];
390
- });
391
- });
392
- };
393
- /**
394
- * @example
395
- * viewer.loadTrajectory({
396
- * model: { kind: 'model-url', url: 'villin.gro', format: 'gro' },
397
- * coordinates: { kind: 'coordinates-url', url: 'villin.xtc', format: 'xtc', isBinary: true },
398
- * preset: 'all-models' // or 'default'
399
- * });
400
- */
401
- Viewer.prototype.loadTrajectory = function (params) {
402
- var _a, _b;
403
- return __awaiter(this, void 0, void 0, function () {
404
- var plugin, model, coords, data, _c, trajectory_1, data, _d, provider, data, _e, provider, trajectory, preset;
405
- return __generator(this, function (_f) {
406
- switch (_f.label) {
407
- case 0:
408
- plugin = this.plugin;
409
- if (!(params.model.kind === 'model-data' || params.model.kind === 'model-url')) return [3 /*break*/, 7];
410
- if (!(params.model.kind === 'model-data')) return [3 /*break*/, 2];
411
- return [4 /*yield*/, plugin.builders.data.rawData({ data: params.model.data, label: params.modelLabel })];
412
- case 1:
413
- _c = _f.sent();
414
- return [3 /*break*/, 4];
415
- case 2: return [4 /*yield*/, plugin.builders.data.download({ url: params.model.url, isBinary: params.model.isBinary, label: params.modelLabel })];
416
- case 3:
417
- _c = _f.sent();
418
- _f.label = 4;
419
- case 4:
420
- data = _c;
421
- return [4 /*yield*/, plugin.builders.structure.parseTrajectory(data, (_a = params.model.format) !== null && _a !== void 0 ? _a : 'mmcif')];
422
- case 5:
423
- trajectory_1 = _f.sent();
424
- return [4 /*yield*/, plugin.builders.structure.createModel(trajectory_1)];
425
- case 6:
426
- model = _f.sent();
427
- return [3 /*break*/, 13];
428
- case 7:
429
- if (!(params.model.kind === 'topology-data')) return [3 /*break*/, 9];
430
- return [4 /*yield*/, plugin.builders.data.rawData({ data: params.model.data, label: params.modelLabel })];
431
- case 8:
432
- _d = _f.sent();
433
- return [3 /*break*/, 11];
434
- case 9: return [4 /*yield*/, plugin.builders.data.download({ url: params.model.url, isBinary: params.model.isBinary, label: params.modelLabel })];
435
- case 10:
436
- _d = _f.sent();
437
- _f.label = 11;
438
- case 11:
439
- data = _d;
440
- provider = plugin.dataFormats.get(params.model.format);
441
- return [4 /*yield*/, provider.parse(plugin, data)];
442
- case 12:
443
- model = _f.sent();
444
- _f.label = 13;
445
- case 13:
446
- if (!(params.coordinates.kind === 'coordinates-data')) return [3 /*break*/, 15];
447
- return [4 /*yield*/, plugin.builders.data.rawData({ data: params.coordinates.data, label: params.coordinatesLabel })];
448
- case 14:
449
- _e = _f.sent();
450
- return [3 /*break*/, 17];
451
- case 15: return [4 /*yield*/, plugin.builders.data.download({ url: params.coordinates.url, isBinary: params.coordinates.isBinary, label: params.coordinatesLabel })];
452
- case 16:
453
- _e = _f.sent();
454
- _f.label = 17;
455
- case 17:
456
- data = _e;
457
- provider = plugin.dataFormats.get(params.coordinates.format);
458
- return [4 /*yield*/, provider.parse(plugin, data)];
459
- case 18:
460
- coords = _f.sent();
461
- return [4 /*yield*/, plugin.build().toRoot()
462
- .apply(TrajectoryFromModelAndCoordinates, {
463
- modelRef: model.ref,
464
- coordinatesRef: coords.ref
465
- }, { dependsOn: [model.ref, coords.ref] })
466
- .commit()];
467
- case 19:
468
- trajectory = _f.sent();
469
- return [4 /*yield*/, plugin.builders.structure.hierarchy.applyPreset(trajectory, (_b = params.preset) !== null && _b !== void 0 ? _b : 'default')];
470
- case 20:
471
- preset = _f.sent();
472
- return [2 /*return*/, { model: model, coords: coords, preset: preset }];
473
- }
474
- });
475
- });
476
- };
477
- Viewer.prototype.handleResize = function () {
478
- this.plugin.layout.events.updated.next(void 0);
479
- };
480
- return Viewer;
481
- }());
482
- export { Viewer };
483
- export var ViewerAutoPreset = StructureRepresentationPresetProvider({
484
- id: 'preset-structure-representation-viewer-auto',
485
- display: {
486
- name: 'Automatic (w/ Annotation)', group: 'Annotation',
487
- description: 'Show standard automatic representation but colored by quality assessment (if available in the model).'
488
- },
489
- isApplicable: function (a) {
490
- return (!!a.data.models.some(function (m) { return QualityAssessment.isApplicable(m, 'pLDDT'); }) ||
491
- !!a.data.models.some(function (m) { return QualityAssessment.isApplicable(m, 'qmean'); }));
492
- },
493
- params: function () { return StructureRepresentationPresetProvider.CommonParams; },
494
- apply: function (ref, params, plugin) {
495
- var _a;
496
- return __awaiter(this, void 0, void 0, function () {
497
- var structureCell, structure;
498
- return __generator(this, function (_b) {
499
- switch (_b.label) {
500
- case 0:
501
- structureCell = StateObjectRef.resolveAndCheck(plugin.state.data, ref);
502
- structure = (_a = structureCell === null || structureCell === void 0 ? void 0 : structureCell.obj) === null || _a === void 0 ? void 0 : _a.data;
503
- if (!structureCell || !structure)
504
- return [2 /*return*/, {}];
505
- if (!!!structure.models.some(function (m) { return QualityAssessment.isApplicable(m, 'pLDDT'); })) return [3 /*break*/, 2];
506
- return [4 /*yield*/, QualityAssessmentPLDDTPreset.apply(ref, params, plugin)];
507
- case 1: return [2 /*return*/, _b.sent()];
508
- case 2:
509
- if (!!!structure.models.some(function (m) { return QualityAssessment.isApplicable(m, 'qmean'); })) return [3 /*break*/, 4];
510
- return [4 /*yield*/, QualityAssessmentQmeanPreset.apply(ref, params, plugin)];
511
- case 3: return [2 /*return*/, _b.sent()];
512
- case 4: return [4 /*yield*/, PresetStructureRepresentations.auto.apply(ref, params, plugin)];
513
- case 5: return [2 /*return*/, _b.sent()];
514
- }
515
- });
516
- });
517
- }
518
- });
11
+ export * from './app';
519
12
  //# sourceMappingURL=index.js.map