molstar 3.0.0-dev.9 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) 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/docking-viewer/viewport.d.ts +2 -0
  5. package/lib/apps/viewer/app.d.ts +2 -1
  6. package/lib/apps/viewer/app.js +21 -8
  7. package/lib/apps/viewer/index.html +2 -2
  8. package/lib/commonjs/apps/docking-viewer/viewport.d.ts +2 -0
  9. package/lib/commonjs/apps/viewer/app.d.ts +2 -1
  10. package/lib/commonjs/apps/viewer/app.js +23 -10
  11. package/lib/commonjs/examples/basic-wrapper/index.js +7 -3
  12. package/lib/commonjs/examples/proteopedia-wrapper/index.js +7 -1
  13. package/lib/commonjs/extensions/anvil/behavior.d.ts +1 -0
  14. package/lib/commonjs/extensions/anvil/representation.js +1 -1
  15. package/lib/commonjs/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
  16. package/lib/commonjs/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
  17. package/lib/commonjs/extensions/model-export/export.d.ts +9 -0
  18. package/lib/commonjs/extensions/model-export/export.js +129 -0
  19. package/lib/commonjs/extensions/model-export/index.d.ts +7 -0
  20. package/lib/commonjs/extensions/model-export/index.js +36 -0
  21. package/lib/commonjs/extensions/model-export/ui.d.ts +11 -0
  22. package/lib/commonjs/extensions/model-export/ui.js +77 -0
  23. package/lib/commonjs/extensions/mp4-export/encoder.js +1 -1
  24. package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
  25. package/lib/commonjs/extensions/rcsb/graphql/types.d.ts +13 -13
  26. package/lib/commonjs/extensions/rcsb/validation-report/behavior.d.ts +3 -0
  27. package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +12 -4
  28. package/lib/commonjs/mol-canvas3d/canvas3d.js +1 -1
  29. package/lib/commonjs/mol-canvas3d/controls/trackball.d.ts +9 -4
  30. package/lib/commonjs/mol-canvas3d/controls/trackball.js +50 -11
  31. package/lib/commonjs/mol-canvas3d/helper/interaction-events.js +1 -1
  32. package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +1 -1
  33. package/lib/commonjs/mol-canvas3d/passes/draw.js +3 -3
  34. package/lib/commonjs/mol-gl/renderer.d.ts +2 -2
  35. package/lib/commonjs/mol-gl/renderer.js +3 -3
  36. package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +2 -2
  37. package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js +2 -2
  38. package/lib/commonjs/mol-gl/shader/cylinders.frag.d.ts +2 -2
  39. package/lib/commonjs/mol-gl/shader/cylinders.frag.js +2 -2
  40. package/lib/commonjs/mol-gl/shader/direct-volume.frag.d.ts +2 -2
  41. package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +2 -2
  42. package/lib/commonjs/mol-gl/shader/mesh.frag.d.ts +2 -2
  43. package/lib/commonjs/mol-gl/shader/mesh.frag.js +2 -2
  44. package/lib/commonjs/mol-gl/shader/spheres.frag.d.ts +2 -2
  45. package/lib/commonjs/mol-gl/shader/spheres.frag.js +2 -2
  46. package/lib/commonjs/mol-io/reader/cif/schema/bird.d.ts +1 -1
  47. package/lib/commonjs/mol-io/reader/cif/schema/bird.js +1 -1
  48. package/lib/commonjs/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  49. package/lib/commonjs/mol-io/reader/cif/schema/ccd.js +1 -1
  50. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
  51. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.js +1 -1
  52. package/lib/commonjs/mol-io/reader/mol/parser.d.ts +23 -1
  53. package/lib/commonjs/mol-io/reader/mol/parser.js +116 -4
  54. package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
  55. package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.js +9 -0
  56. package/lib/commonjs/mol-io/reader/sdf/parser.d.ts +3 -1
  57. package/lib/commonjs/mol-io/reader/sdf/parser.js +11 -2
  58. package/lib/commonjs/mol-io/writer/cif/encoder/binary.js +9 -2
  59. package/lib/commonjs/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
  60. package/lib/commonjs/mol-math/geometry/primitives/sphere3d.js +17 -4
  61. package/lib/commonjs/mol-math/geometry/symmetry-operator.d.ts +1 -1
  62. package/lib/commonjs/mol-math/geometry/symmetry-operator.js +10 -4
  63. package/lib/commonjs/mol-model/structure/export/categories/secondary-structure.js +8 -8
  64. package/lib/commonjs/mol-model/structure/export/mmcif.d.ts +1 -1
  65. package/lib/commonjs/mol-model/structure/export/mmcif.js +8 -5
  66. package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
  67. package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
  68. package/lib/commonjs/mol-model/structure/model/properties/common.d.ts +1 -1
  69. package/lib/commonjs/mol-model/structure/structure/element/loci.d.ts +1 -1
  70. package/lib/commonjs/mol-model/structure/structure/element/loci.js +4 -2
  71. package/lib/commonjs/mol-model/structure/structure/properties.d.ts +1 -0
  72. package/lib/commonjs/mol-model/structure/structure/properties.js +2 -1
  73. package/lib/commonjs/mol-model/structure/structure/symmetry.js +1 -3
  74. package/lib/commonjs/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
  75. package/lib/commonjs/mol-model/volume/volume.d.ts +7 -0
  76. package/lib/commonjs/mol-model/volume/volume.js +18 -0
  77. package/lib/commonjs/mol-model-formats/structure/basic/atomic.d.ts +2 -2
  78. package/lib/commonjs/mol-model-formats/structure/basic/atomic.js +6 -6
  79. package/lib/commonjs/mol-model-formats/structure/basic/coarse.d.ts +1 -1
  80. package/lib/commonjs/mol-model-formats/structure/basic/coarse.js +3 -3
  81. package/lib/commonjs/mol-model-formats/structure/basic/entities.d.ts +2 -1
  82. package/lib/commonjs/mol-model-formats/structure/basic/entities.js +28 -24
  83. package/lib/commonjs/mol-model-formats/structure/basic/parser.js +17 -8
  84. package/lib/commonjs/mol-model-formats/structure/basic/properties.d.ts +6 -1
  85. package/lib/commonjs/mol-model-formats/structure/basic/properties.js +12 -22
  86. package/lib/commonjs/mol-model-formats/structure/mol.d.ts +2 -1
  87. package/lib/commonjs/mol-model-formats/structure/mol.js +19 -5
  88. package/lib/commonjs/mol-model-props/common/custom-property.d.ts +1 -1
  89. package/lib/commonjs/mol-model-props/computed/interactions/common.d.ts +1 -1
  90. package/lib/commonjs/mol-model-props/computed/interactions/common.js +16 -24
  91. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
  92. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
  93. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
  94. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +38 -13
  95. package/lib/commonjs/mol-model-props/sequence/best-database-mapping.js +15 -15
  96. package/lib/commonjs/mol-plugin/animation-loop.d.ts +2 -0
  97. package/lib/commonjs/mol-plugin/animation-loop.js +1 -1
  98. package/lib/commonjs/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
  99. package/lib/commonjs/mol-plugin/behavior/dynamic/representation.js +11 -6
  100. package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +2 -1
  101. package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +16 -7
  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/spec.d.ts +1 -1
  105. package/lib/commonjs/mol-plugin/spec.js +3 -1
  106. package/lib/commonjs/mol-plugin-state/actions/file.d.ts +3 -2
  107. package/lib/commonjs/mol-plugin-state/actions/file.js +67 -31
  108. package/lib/commonjs/mol-plugin-state/actions/volume.d.ts +1 -1
  109. package/lib/commonjs/mol-plugin-state/actions/volume.js +3 -3
  110. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
  111. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.js +62 -0
  112. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
  113. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
  114. package/lib/commonjs/mol-plugin-state/animation/model.d.ts +4 -0
  115. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +8 -6
  116. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +2 -1
  117. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +180 -6
  118. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +48 -2
  119. package/lib/commonjs/mol-plugin-state/builder/structure/representation.d.ts +2 -1
  120. package/lib/commonjs/mol-plugin-state/formats/volume.js +1 -11
  121. package/lib/commonjs/mol-plugin-state/manager/animation.d.ts +5 -1
  122. package/lib/commonjs/mol-plugin-state/manager/animation.js +5 -5
  123. package/lib/commonjs/mol-plugin-state/manager/structure/component.d.ts +2 -1
  124. package/lib/commonjs/mol-plugin-state/manager/structure/component.js +11 -8
  125. package/lib/commonjs/mol-plugin-ui/controls/icons.d.ts +2 -1
  126. package/lib/commonjs/mol-plugin-ui/controls/icons.js +8 -5
  127. package/lib/commonjs/mol-plugin-ui/controls.d.ts +1 -1
  128. package/lib/commonjs/mol-plugin-ui/controls.js +2 -1
  129. package/lib/commonjs/mol-plugin-ui/structure/quick-styles.d.ts +25 -0
  130. package/lib/commonjs/mol-plugin-ui/structure/quick-styles.js +131 -0
  131. package/lib/commonjs/mol-plugin-ui/structure/superposition.js +2 -2
  132. package/lib/commonjs/mol-plugin-ui/structure/volume.js +4 -4
  133. package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
  134. package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +4 -8
  135. package/lib/commonjs/mol-repr/shape/loci/common.d.ts +1 -1
  136. package/lib/commonjs/mol-repr/shape/loci/common.js +3 -3
  137. package/lib/commonjs/mol-repr/structure/registry.d.ts +1 -1
  138. package/lib/commonjs/mol-repr/structure/representation/cartoon.d.ts +4 -4
  139. package/lib/commonjs/mol-repr/structure/representation/cartoon.js +3 -3
  140. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
  141. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
  142. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
  143. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
  144. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
  145. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
  146. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
  147. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
  148. package/lib/commonjs/mol-repr/structure/visual/util/bond.d.ts +1 -1
  149. package/lib/commonjs/mol-repr/structure/visual/util/bond.js +5 -4
  150. package/lib/commonjs/mol-repr/visual.d.ts +1 -1
  151. package/lib/commonjs/mol-repr/visual.js +2 -1
  152. package/lib/commonjs/mol-state/transform.js +12 -2
  153. package/lib/commonjs/mol-state/tree/immutable.d.ts +18 -0
  154. package/lib/commonjs/mol-state/tree/transient.d.ts +3 -4
  155. package/lib/commonjs/mol-theme/color/element-symbol.d.ts +289 -3
  156. package/lib/commonjs/mol-theme/color/element-symbol.js +25 -15
  157. package/lib/commonjs/mol-theme/color/entity-id.d.ts +1 -1
  158. package/lib/commonjs/mol-theme/color/entity-id.js +29 -5
  159. package/lib/commonjs/mol-theme/color/illustrative.d.ts +100 -29
  160. package/lib/commonjs/mol-theme/color/illustrative.js +26 -7
  161. package/lib/commonjs/mol-theme/color/molecule-type.d.ts +19 -1
  162. package/lib/commonjs/mol-theme/color/molecule-type.js +10 -5
  163. package/lib/commonjs/mol-theme/color/residue-name.d.ts +77 -1
  164. package/lib/commonjs/mol-theme/color/residue-name.js +10 -5
  165. package/lib/commonjs/mol-theme/color/secondary-structure.d.ts +27 -1
  166. package/lib/commonjs/mol-theme/color/secondary-structure.js +10 -5
  167. package/lib/commonjs/mol-theme/color.d.ts +253 -15
  168. package/lib/commonjs/mol-util/color/color.d.ts +1 -1
  169. package/lib/commonjs/mol-util/color/color.js +1 -1
  170. package/lib/commonjs/mol-util/color/params.d.ts +10 -0
  171. package/lib/commonjs/mol-util/color/params.js +19 -0
  172. package/lib/commonjs/servers/volume/config.js +3 -3
  173. package/lib/commonjs/servers/volume/query.js +1 -1
  174. package/lib/examples/basic-wrapper/index.js +7 -3
  175. package/lib/examples/proteopedia-wrapper/index.js +7 -1
  176. package/lib/extensions/anvil/behavior.d.ts +1 -0
  177. package/lib/extensions/anvil/representation.js +1 -1
  178. package/lib/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
  179. package/lib/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
  180. package/lib/extensions/model-export/export.d.ts +9 -0
  181. package/lib/extensions/model-export/export.js +125 -0
  182. package/lib/extensions/model-export/index.d.ts +7 -0
  183. package/lib/extensions/model-export/index.js +33 -0
  184. package/lib/extensions/model-export/ui.d.ts +11 -0
  185. package/lib/extensions/model-export/ui.js +74 -0
  186. package/lib/extensions/mp4-export/encoder.js +1 -1
  187. package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
  188. package/lib/extensions/rcsb/graphql/types.d.ts +13 -13
  189. package/lib/extensions/rcsb/validation-report/behavior.d.ts +3 -0
  190. package/lib/mol-canvas3d/canvas3d.d.ts +12 -4
  191. package/lib/mol-canvas3d/canvas3d.js +1 -1
  192. package/lib/mol-canvas3d/controls/trackball.d.ts +9 -4
  193. package/lib/mol-canvas3d/controls/trackball.js +51 -12
  194. package/lib/mol-canvas3d/helper/interaction-events.js +1 -1
  195. package/lib/mol-canvas3d/passes/draw.d.ts +1 -1
  196. package/lib/mol-canvas3d/passes/draw.js +3 -3
  197. package/lib/mol-gl/renderer.d.ts +2 -2
  198. package/lib/mol-gl/renderer.js +3 -3
  199. package/lib/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +2 -2
  200. package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js +2 -2
  201. package/lib/mol-gl/shader/cylinders.frag.d.ts +2 -2
  202. package/lib/mol-gl/shader/cylinders.frag.js +2 -2
  203. package/lib/mol-gl/shader/direct-volume.frag.d.ts +2 -2
  204. package/lib/mol-gl/shader/direct-volume.frag.js +2 -2
  205. package/lib/mol-gl/shader/mesh.frag.d.ts +2 -2
  206. package/lib/mol-gl/shader/mesh.frag.js +2 -2
  207. package/lib/mol-gl/shader/spheres.frag.d.ts +2 -2
  208. package/lib/mol-gl/shader/spheres.frag.js +2 -2
  209. package/lib/mol-io/reader/cif/schema/bird.d.ts +1 -1
  210. package/lib/mol-io/reader/cif/schema/bird.js +1 -1
  211. package/lib/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  212. package/lib/mol-io/reader/cif/schema/ccd.js +1 -1
  213. package/lib/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
  214. package/lib/mol-io/reader/cif/schema/mmcif.js +1 -1
  215. package/lib/mol-io/reader/mol/parser.d.ts +23 -1
  216. package/lib/mol-io/reader/mol/parser.js +112 -3
  217. package/lib/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
  218. package/lib/mol-io/reader/sdf/parser-v3-util.js +9 -0
  219. package/lib/mol-io/reader/sdf/parser.d.ts +3 -1
  220. package/lib/mol-io/reader/sdf/parser.js +12 -3
  221. package/lib/mol-io/writer/cif/encoder/binary.js +9 -2
  222. package/lib/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
  223. package/lib/mol-math/geometry/primitives/sphere3d.js +17 -4
  224. package/lib/mol-math/geometry/symmetry-operator.d.ts +1 -1
  225. package/lib/mol-math/geometry/symmetry-operator.js +10 -4
  226. package/lib/mol-model/structure/export/categories/secondary-structure.js +8 -8
  227. package/lib/mol-model/structure/export/mmcif.d.ts +1 -1
  228. package/lib/mol-model/structure/export/mmcif.js +8 -5
  229. package/lib/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
  230. package/lib/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
  231. package/lib/mol-model/structure/model/properties/common.d.ts +1 -1
  232. package/lib/mol-model/structure/structure/element/loci.d.ts +1 -1
  233. package/lib/mol-model/structure/structure/element/loci.js +4 -2
  234. package/lib/mol-model/structure/structure/properties.d.ts +1 -0
  235. package/lib/mol-model/structure/structure/properties.js +2 -1
  236. package/lib/mol-model/structure/structure/symmetry.js +1 -3
  237. package/lib/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
  238. package/lib/mol-model/volume/volume.d.ts +7 -0
  239. package/lib/mol-model/volume/volume.js +18 -0
  240. package/lib/mol-model-formats/structure/basic/atomic.d.ts +2 -2
  241. package/lib/mol-model-formats/structure/basic/atomic.js +6 -6
  242. package/lib/mol-model-formats/structure/basic/coarse.d.ts +1 -1
  243. package/lib/mol-model-formats/structure/basic/coarse.js +3 -3
  244. package/lib/mol-model-formats/structure/basic/entities.d.ts +2 -1
  245. package/lib/mol-model-formats/structure/basic/entities.js +25 -22
  246. package/lib/mol-model-formats/structure/basic/parser.js +19 -10
  247. package/lib/mol-model-formats/structure/basic/properties.d.ts +6 -1
  248. package/lib/mol-model-formats/structure/basic/properties.js +12 -25
  249. package/lib/mol-model-formats/structure/mol.d.ts +2 -1
  250. package/lib/mol-model-formats/structure/mol.js +17 -3
  251. package/lib/mol-model-props/common/custom-property.d.ts +1 -1
  252. package/lib/mol-model-props/computed/interactions/common.d.ts +1 -1
  253. package/lib/mol-model-props/computed/interactions/common.js +16 -24
  254. package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
  255. package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
  256. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
  257. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +38 -13
  258. package/lib/mol-model-props/sequence/best-database-mapping.js +15 -15
  259. package/lib/mol-plugin/animation-loop.d.ts +2 -0
  260. package/lib/mol-plugin/animation-loop.js +1 -1
  261. package/lib/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
  262. package/lib/mol-plugin/behavior/dynamic/representation.js +11 -6
  263. package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +2 -1
  264. package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +16 -7
  265. package/lib/mol-plugin/behavior/static/representation.js +1 -1
  266. package/lib/mol-plugin/commands.d.ts +6 -2
  267. package/lib/mol-plugin/spec.d.ts +1 -1
  268. package/lib/mol-plugin/spec.js +3 -1
  269. package/lib/mol-plugin/version.js +2 -2
  270. package/lib/mol-plugin-state/actions/file.d.ts +3 -2
  271. package/lib/mol-plugin-state/actions/file.js +67 -31
  272. package/lib/mol-plugin-state/actions/volume.d.ts +1 -1
  273. package/lib/mol-plugin-state/actions/volume.js +3 -3
  274. package/lib/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
  275. package/lib/mol-plugin-state/animation/built-in/camera-rock.js +59 -0
  276. package/lib/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
  277. package/lib/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
  278. package/lib/mol-plugin-state/animation/model.d.ts +4 -0
  279. package/lib/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +8 -6
  280. package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +2 -1
  281. package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +180 -6
  282. package/lib/mol-plugin-state/builder/structure/representation-preset.js +48 -2
  283. package/lib/mol-plugin-state/builder/structure/representation.d.ts +2 -1
  284. package/lib/mol-plugin-state/formats/volume.js +1 -11
  285. package/lib/mol-plugin-state/manager/animation.d.ts +5 -1
  286. package/lib/mol-plugin-state/manager/animation.js +5 -5
  287. package/lib/mol-plugin-state/manager/structure/component.d.ts +2 -1
  288. package/lib/mol-plugin-state/manager/structure/component.js +11 -8
  289. package/lib/mol-plugin-ui/controls/icons.d.ts +2 -1
  290. package/lib/mol-plugin-ui/controls/icons.js +5 -3
  291. package/lib/mol-plugin-ui/controls.d.ts +1 -1
  292. package/lib/mol-plugin-ui/controls.js +2 -1
  293. package/lib/mol-plugin-ui/structure/quick-styles.d.ts +25 -0
  294. package/lib/mol-plugin-ui/structure/quick-styles.js +128 -0
  295. package/lib/mol-plugin-ui/structure/superposition.js +2 -2
  296. package/lib/mol-plugin-ui/structure/volume.js +4 -4
  297. package/lib/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
  298. package/lib/mol-plugin-ui/viewport/simple-settings.js +4 -8
  299. package/lib/mol-repr/shape/loci/common.d.ts +1 -1
  300. package/lib/mol-repr/shape/loci/common.js +3 -3
  301. package/lib/mol-repr/structure/registry.d.ts +1 -1
  302. package/lib/mol-repr/structure/representation/cartoon.d.ts +4 -4
  303. package/lib/mol-repr/structure/representation/cartoon.js +3 -3
  304. package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
  305. package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
  306. package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
  307. package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
  308. package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
  309. package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
  310. package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
  311. package/lib/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
  312. package/lib/mol-repr/structure/visual/util/bond.d.ts +1 -1
  313. package/lib/mol-repr/structure/visual/util/bond.js +5 -4
  314. package/lib/mol-repr/visual.d.ts +1 -1
  315. package/lib/mol-repr/visual.js +2 -1
  316. package/lib/mol-state/transform.js +12 -2
  317. package/lib/mol-state/tree/immutable.d.ts +18 -0
  318. package/lib/mol-state/tree/transient.d.ts +3 -4
  319. package/lib/mol-theme/color/element-symbol.d.ts +289 -3
  320. package/lib/mol-theme/color/element-symbol.js +25 -15
  321. package/lib/mol-theme/color/entity-id.d.ts +1 -1
  322. package/lib/mol-theme/color/entity-id.js +29 -5
  323. package/lib/mol-theme/color/illustrative.d.ts +100 -29
  324. package/lib/mol-theme/color/illustrative.js +26 -7
  325. package/lib/mol-theme/color/molecule-type.d.ts +19 -1
  326. package/lib/mol-theme/color/molecule-type.js +10 -5
  327. package/lib/mol-theme/color/residue-name.d.ts +77 -1
  328. package/lib/mol-theme/color/residue-name.js +10 -5
  329. package/lib/mol-theme/color/secondary-structure.d.ts +27 -1
  330. package/lib/mol-theme/color/secondary-structure.js +10 -5
  331. package/lib/mol-theme/color.d.ts +253 -15
  332. package/lib/mol-util/color/color.d.ts +1 -1
  333. package/lib/mol-util/color/color.js +1 -1
  334. package/lib/mol-util/color/params.d.ts +10 -0
  335. package/lib/mol-util/color/params.js +15 -0
  336. package/lib/servers/volume/config.js +3 -3
  337. package/lib/servers/volume/query.js +1 -1
  338. package/package.json +38 -40
@@ -9,6 +9,7 @@ import { StructureRef } from '../../mol-plugin-state/manager/structure/hierarchy
9
9
  import { PluginUIComponent } from '../../mol-plugin-ui/base';
10
10
  export declare const StructurePreset: StructureRepresentationPresetProvider<{
11
11
  ignoreHydrogens: boolean | undefined;
12
+ ignoreLight: boolean | undefined;
12
13
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined;
13
14
  theme: import("../../mol-util/param-definition").ParamDefinition.Normalize<{
14
15
  globalName: any;
@@ -31,6 +32,7 @@ export declare const StructurePreset: StructureRepresentationPresetProvider<{
31
32
  }>;
32
33
  export declare const IllustrativePreset: StructureRepresentationPresetProvider<{
33
34
  ignoreHydrogens: boolean | undefined;
35
+ ignoreLight: boolean | undefined;
34
36
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined;
35
37
  theme: import("../../mol-util/param-definition").ParamDefinition.Normalize<{
36
38
  globalName: any;
@@ -21,7 +21,7 @@ export { PLUGIN_VERSION as version } from '../../mol-plugin/version';
21
21
  export { setDebugMode, setProductionMode } from '../../mol-util/debug';
22
22
  declare const DefaultViewerOptions: {
23
23
  customFormats: [string, DataFormatProvider<any, any, any>][];
24
- extensions: ("cellpack" | "g3d" | "geo-export" | "mp4-export" | "pdbe-structure-quality-report" | "dnatco-confal-pyramids" | "rcsb-assembly-symmetry" | "rcsb-validation-report" | "anvil-membrane-orientation" | "ma-quality-assessment")[];
24
+ extensions: ("cellpack" | "g3d" | "geo-export" | "model-export" | "mp4-export" | "pdbe-structure-quality-report" | "dnatco-confal-pyramids" | "rcsb-assembly-symmetry" | "rcsb-validation-report" | "anvil-membrane-orientation" | "ma-quality-assessment")[];
25
25
  layoutIsExpanded: boolean;
26
26
  layoutShowControls: boolean;
27
27
  layoutShowRemoteState: boolean;
@@ -202,6 +202,7 @@ export interface LoadTrajectoryParams {
202
202
  }
203
203
  export declare const ViewerAutoPreset: StructureRepresentationPresetProvider<{
204
204
  ignoreHydrogens: boolean | undefined;
205
+ ignoreLight: boolean | undefined;
205
206
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined;
206
207
  theme: import("../../mol-util/param-definition").ParamDefinition.Normalize<{
207
208
  globalName: any;
@@ -13,9 +13,11 @@ import { GeometryExport } from '../../extensions/geo-export';
13
13
  import { MAQualityAssessment } from '../../extensions/model-archive/quality-assessment/behavior';
14
14
  import { QualityAssessmentPLDDTPreset, QualityAssessmentQmeanPreset } from '../../extensions/model-archive/quality-assessment/behavior';
15
15
  import { QualityAssessment } from '../../extensions/model-archive/quality-assessment/prop';
16
+ import { ModelExport } from '../../extensions/model-export';
16
17
  import { Mp4Export } from '../../extensions/mp4-export';
17
18
  import { PDBeStructureQualityReport } from '../../extensions/pdbe';
18
19
  import { RCSBAssemblySymmetry, RCSBValidationReport } from '../../extensions/rcsb';
20
+ import { Volume } from '../../mol-model/volume';
19
21
  import { DownloadStructure, PdbDownloadProvider } from '../../mol-plugin-state/actions/structure';
20
22
  import { DownloadDensity } from '../../mol-plugin-state/actions/volume';
21
23
  import { PresetStructureRepresentations, StructureRepresentationPresetProvider } from '../../mol-plugin-state/builder/structure/representation-preset';
@@ -44,6 +46,7 @@ var Extensions = {
44
46
  'rcsb-validation-report': PluginSpec.Behavior(RCSBValidationReport),
45
47
  'anvil-membrane-orientation': PluginSpec.Behavior(ANVILMembraneOrientation),
46
48
  'g3d': PluginSpec.Behavior(G3DFormat),
49
+ 'model-export': PluginSpec.Behavior(ModelExport),
47
50
  'mp4-export': PluginSpec.Behavior(Mp4Export),
48
51
  'geo-export': PluginSpec.Behavior(GeometryExport),
49
52
  'ma-quality-assessment': PluginSpec.Behavior(MAQualityAssessment),
@@ -85,11 +88,19 @@ var Viewer = /** @class */ (function () {
85
88
  var _a;
86
89
  if (options === void 0) { options = {}; }
87
90
  return __awaiter(this, void 0, void 0, function () {
88
- var o, defaultSpec, spec, element, plugin;
89
- return __generator(this, function (_b) {
90
- switch (_b.label) {
91
+ var definedOptions, _i, _b, p, o, defaultSpec, spec, element, plugin;
92
+ return __generator(this, function (_c) {
93
+ switch (_c.label) {
91
94
  case 0:
92
- o = __assign(__assign({}, DefaultViewerOptions), options);
95
+ definedOptions = {};
96
+ // filter for defined properies only so the default values
97
+ // are property applied
98
+ for (_i = 0, _b = Object.keys(options); _i < _b.length; _i++) {
99
+ p = _b[_i];
100
+ if (options[p] !== void 0)
101
+ definedOptions[p] = options[p];
102
+ }
103
+ o = __assign(__assign({}, DefaultViewerOptions), definedOptions);
93
104
  defaultSpec = DefaultPluginUISpec();
94
105
  spec = {
95
106
  actions: defaultSpec.actions,
@@ -145,7 +156,7 @@ var Viewer = /** @class */ (function () {
145
156
  }
146
157
  })];
147
158
  case 1:
148
- plugin = _b.sent();
159
+ plugin = _c.sent();
149
160
  return [2 /*return*/, new Viewer(plugin)];
150
161
  }
151
162
  });
@@ -351,7 +362,7 @@ var Viewer = /** @class */ (function () {
351
362
  return [2 /*return*/, update.commit()];
352
363
  }
353
364
  return [2 /*return*/, plugin.dataTransaction(function () { return __awaiter(_this, void 0, void 0, function () {
354
- var data, parsed, firstVolume, repr, _i, isovalues_1, iso;
365
+ var data, parsed, firstVolume, repr, _i, isovalues_1, iso, volume, volumeData;
355
366
  var _a, _b, _c, _d;
356
367
  return __generator(this, function (_e) {
357
368
  switch (_e.label) {
@@ -367,11 +378,13 @@ var Viewer = /** @class */ (function () {
367
378
  repr = plugin.build();
368
379
  for (_i = 0, isovalues_1 = isovalues; _i < isovalues_1.length; _i++) {
369
380
  iso = isovalues_1[_i];
381
+ volume = (_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;
382
+ volumeData = volume.cell.obj.data;
370
383
  repr
371
- .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)
384
+ .to(volume)
372
385
  .apply(StateTransforms.Representation.VolumeRepresentation3D, createVolumeRepresentationParams(this.plugin, firstVolume.data, {
373
386
  type: 'isosurface',
374
- 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 } },
387
+ typeParams: { alpha: (_d = iso.alpha) !== null && _d !== void 0 ? _d : 1, isoValue: Volume.adjustedIsoValue(volumeData, iso.value, iso.type) },
375
388
  color: 'uniform',
376
389
  colorParams: { value: iso.color }
377
390
  }));
@@ -57,7 +57,7 @@
57
57
  var pickScale = getParam('pick-scale', '[^&]+').trim();
58
58
  var pickPadding = getParam('pick-padding', '[^&]+').trim();
59
59
  var disableWboit = getParam('disable-wboit', '[^&]+').trim() === '1';
60
- var preferWebgl1 = getParam('prefer-webgl1', '[^&]+').trim() === '1';
60
+ var preferWebgl1 = getParam('prefer-webgl1', '[^&]+').trim() === '1' || void 0;
61
61
 
62
62
  molstar.Viewer.create('app', {
63
63
  layoutShowControls: !hideControls,
@@ -71,7 +71,7 @@
71
71
  pixelScale: parseFloat(pixelScale) || 1,
72
72
  pickScale: parseFloat(pickScale) || 0.25,
73
73
  pickPadding: isNaN(parseFloat(pickPadding)) ? 1 : parseFloat(pickPadding),
74
- enableWboit: !disableWboit,
74
+ enableWboit: disableWboit ? true : void 0, // use default value if disable-wboit is not set
75
75
  preferWebgl1: preferWebgl1,
76
76
  }).then(viewer => {
77
77
  var snapshotId = getParam('snapshot-id', '[^&]+').trim();
@@ -9,6 +9,7 @@ import { StructureRef } from '../../mol-plugin-state/manager/structure/hierarchy
9
9
  import { PluginUIComponent } from '../../mol-plugin-ui/base';
10
10
  export declare const StructurePreset: StructureRepresentationPresetProvider<{
11
11
  ignoreHydrogens: boolean | undefined;
12
+ ignoreLight: boolean | undefined;
12
13
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined;
13
14
  theme: import("../../mol-util/param-definition").ParamDefinition.Normalize<{
14
15
  globalName: any;
@@ -31,6 +32,7 @@ export declare const StructurePreset: StructureRepresentationPresetProvider<{
31
32
  }>;
32
33
  export declare const IllustrativePreset: StructureRepresentationPresetProvider<{
33
34
  ignoreHydrogens: boolean | undefined;
35
+ ignoreLight: boolean | undefined;
34
36
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined;
35
37
  theme: import("../../mol-util/param-definition").ParamDefinition.Normalize<{
36
38
  globalName: any;
@@ -21,7 +21,7 @@ export { PLUGIN_VERSION as version } from '../../mol-plugin/version';
21
21
  export { setDebugMode, setProductionMode } from '../../mol-util/debug';
22
22
  declare const DefaultViewerOptions: {
23
23
  customFormats: [string, DataFormatProvider<any, any, any>][];
24
- extensions: ("cellpack" | "g3d" | "geo-export" | "mp4-export" | "pdbe-structure-quality-report" | "dnatco-confal-pyramids" | "rcsb-assembly-symmetry" | "rcsb-validation-report" | "anvil-membrane-orientation" | "ma-quality-assessment")[];
24
+ extensions: ("cellpack" | "g3d" | "geo-export" | "model-export" | "mp4-export" | "pdbe-structure-quality-report" | "dnatco-confal-pyramids" | "rcsb-assembly-symmetry" | "rcsb-validation-report" | "anvil-membrane-orientation" | "ma-quality-assessment")[];
25
25
  layoutIsExpanded: boolean;
26
26
  layoutShowControls: boolean;
27
27
  layoutShowRemoteState: boolean;
@@ -202,6 +202,7 @@ export interface LoadTrajectoryParams {
202
202
  }
203
203
  export declare const ViewerAutoPreset: StructureRepresentationPresetProvider<{
204
204
  ignoreHydrogens: boolean | undefined;
205
+ ignoreLight: boolean | undefined;
205
206
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined;
206
207
  theme: import("../../mol-util/param-definition").ParamDefinition.Normalize<{
207
208
  globalName: any;
@@ -16,11 +16,13 @@ var geo_export_1 = require("../../extensions/geo-export");
16
16
  var behavior_2 = require("../../extensions/model-archive/quality-assessment/behavior");
17
17
  var behavior_3 = require("../../extensions/model-archive/quality-assessment/behavior");
18
18
  var prop_1 = require("../../extensions/model-archive/quality-assessment/prop");
19
+ var model_export_1 = require("../../extensions/model-export");
19
20
  var mp4_export_1 = require("../../extensions/mp4-export");
20
21
  var pdbe_1 = require("../../extensions/pdbe");
21
22
  var rcsb_1 = require("../../extensions/rcsb");
23
+ var volume_1 = require("../../mol-model/volume");
22
24
  var structure_1 = require("../../mol-plugin-state/actions/structure");
23
- var volume_1 = require("../../mol-plugin-state/actions/volume");
25
+ var volume_2 = require("../../mol-plugin-state/actions/volume");
24
26
  var representation_preset_1 = require("../../mol-plugin-state/builder/structure/representation-preset");
25
27
  var volume_representation_params_1 = require("../../mol-plugin-state/helpers/volume-representation-params");
26
28
  var transforms_1 = require("../../mol-plugin-state/transforms");
@@ -50,6 +52,7 @@ var Extensions = {
50
52
  'rcsb-validation-report': spec_2.PluginSpec.Behavior(rcsb_1.RCSBValidationReport),
51
53
  'anvil-membrane-orientation': spec_2.PluginSpec.Behavior(behavior_1.ANVILMembraneOrientation),
52
54
  'g3d': spec_2.PluginSpec.Behavior(format_1.G3DFormat),
55
+ 'model-export': spec_2.PluginSpec.Behavior(model_export_1.ModelExport),
53
56
  'mp4-export': spec_2.PluginSpec.Behavior(mp4_export_1.Mp4Export),
54
57
  'geo-export': spec_2.PluginSpec.Behavior(geo_export_1.GeometryExport),
55
58
  'ma-quality-assessment': spec_2.PluginSpec.Behavior(behavior_2.MAQualityAssessment),
@@ -91,11 +94,19 @@ var Viewer = /** @class */ (function () {
91
94
  var _a;
92
95
  if (options === void 0) { options = {}; }
93
96
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
94
- var o, defaultSpec, spec, element, plugin;
95
- return (0, tslib_1.__generator)(this, function (_b) {
96
- switch (_b.label) {
97
+ var definedOptions, _i, _b, p, o, defaultSpec, spec, element, plugin;
98
+ return (0, tslib_1.__generator)(this, function (_c) {
99
+ switch (_c.label) {
97
100
  case 0:
98
- o = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, DefaultViewerOptions), options);
101
+ definedOptions = {};
102
+ // filter for defined properies only so the default values
103
+ // are property applied
104
+ for (_i = 0, _b = Object.keys(options); _i < _b.length; _i++) {
105
+ p = _b[_i];
106
+ if (options[p] !== void 0)
107
+ definedOptions[p] = options[p];
108
+ }
109
+ o = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, DefaultViewerOptions), definedOptions);
99
110
  defaultSpec = (0, spec_1.DefaultPluginUISpec)();
100
111
  spec = {
101
112
  actions: defaultSpec.actions,
@@ -151,7 +162,7 @@ var Viewer = /** @class */ (function () {
151
162
  }
152
163
  })];
153
164
  case 1:
154
- plugin = _b.sent();
165
+ plugin = _c.sent();
155
166
  return [2 /*return*/, new Viewer(plugin)];
156
167
  }
157
168
  });
@@ -259,7 +270,7 @@ var Viewer = /** @class */ (function () {
259
270
  Viewer.prototype.loadEmdb = function (emdb, options) {
260
271
  var _a;
261
272
  var provider = this.plugin.config.get(config_1.PluginConfig.Download.DefaultEmdbProvider);
262
- return this.plugin.runTask(this.plugin.state.data.applyAction(volume_1.DownloadDensity, {
273
+ return this.plugin.runTask(this.plugin.state.data.applyAction(volume_2.DownloadDensity, {
263
274
  source: {
264
275
  name: 'pdb-emd-ds',
265
276
  params: {
@@ -357,7 +368,7 @@ var Viewer = /** @class */ (function () {
357
368
  return [2 /*return*/, update.commit()];
358
369
  }
359
370
  return [2 /*return*/, plugin.dataTransaction(function () { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
360
- var data, parsed, firstVolume, repr, _i, isovalues_1, iso;
371
+ var data, parsed, firstVolume, repr, _i, isovalues_1, iso, volume, volumeData;
361
372
  var _a, _b, _c, _d;
362
373
  return (0, tslib_1.__generator)(this, function (_e) {
363
374
  switch (_e.label) {
@@ -373,11 +384,13 @@ var Viewer = /** @class */ (function () {
373
384
  repr = plugin.build();
374
385
  for (_i = 0, isovalues_1 = isovalues; _i < isovalues_1.length; _i++) {
375
386
  iso = isovalues_1[_i];
387
+ volume = (_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;
388
+ volumeData = volume.cell.obj.data;
376
389
  repr
377
- .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)
390
+ .to(volume)
378
391
  .apply(transforms_1.StateTransforms.Representation.VolumeRepresentation3D, (0, volume_representation_params_1.createVolumeRepresentationParams)(this.plugin, firstVolume.data, {
379
392
  type: 'isosurface',
380
- 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 } },
393
+ typeParams: { alpha: (_d = iso.alpha) !== null && _d !== void 0 ? _d : 1, isoValue: volume_1.Volume.adjustedIsoValue(volumeData, iso.value, iso.type) },
381
394
  color: 'uniform',
382
395
  colorParams: { value: iso.color }
383
396
  }));
@@ -244,13 +244,17 @@ var BasicWrapper = /** @class */ (function () {
244
244
  BasicWrapper.prototype.toggleSpin = function () {
245
245
  if (!this.plugin.canvas3d)
246
246
  return;
247
+ var trackball = this.plugin.canvas3d.props.trackball;
247
248
  commands_1.PluginCommands.Canvas3D.SetSettings(this.plugin, {
248
- settings: function (props) {
249
- props.trackball.spin = !props.trackball.spin;
249
+ settings: {
250
+ trackball: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, trackball), { animate: trackball.animate.name === 'spin'
251
+ ? { name: 'off', params: {} }
252
+ : { name: 'spin', params: { speed: 1 } } })
250
253
  }
251
254
  });
252
- if (!this.plugin.canvas3d.props.trackball.spin)
255
+ if (this.plugin.canvas3d.props.trackball.animate.name !== 'spin') {
253
256
  commands_1.PluginCommands.Camera.Reset(this.plugin, {});
257
+ }
254
258
  };
255
259
  BasicWrapper.prototype.animateModelIndexTargetFps = function () {
256
260
  return Math.max(1, this.animate.modelIndex.targetFps | 0);
@@ -479,7 +479,13 @@ var MolStarProteopediaWrapper = /** @class */ (function () {
479
479
  if (!this.plugin.canvas3d)
480
480
  return;
481
481
  var trackball = this.plugin.canvas3d.props.trackball;
482
- commands_1.PluginCommands.Canvas3D.SetSettings(this.plugin, { settings: { trackball: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, trackball), { spin: !trackball.spin }) } });
482
+ commands_1.PluginCommands.Canvas3D.SetSettings(this.plugin, {
483
+ settings: {
484
+ trackball: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, trackball), { animate: trackball.animate.name === 'spin'
485
+ ? { name: 'off', params: {} }
486
+ : { name: 'spin', params: { speed: 1 } } })
487
+ }
488
+ });
483
489
  };
484
490
  MolStarProteopediaWrapper.prototype.animateModelIndexTargetFps = function () {
485
491
  return Math.max(1, this.animate.modelIndex.targetFps | 0);
@@ -47,6 +47,7 @@ declare const MembraneOrientation3D: StateTransformer<PluginStateObject.Molecule
47
47
  }>>;
48
48
  export declare const MembraneOrientationPreset: StructureRepresentationPresetProvider<{
49
49
  ignoreHydrogens: boolean | undefined;
50
+ ignoreLight: boolean | undefined;
50
51
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined;
51
52
  theme: PD.Normalize<{
52
53
  globalName: any;
@@ -30,7 +30,7 @@ var SharedParams = {
30
30
  radiusFactor: param_definition_1.ParamDefinition.Numeric(1.2, { min: 0.1, max: 3.0, step: 0.01 }, { description: 'Scale the radius of the membrane layer' })
31
31
  };
32
32
  var BilayerPlanesParams = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, mesh_1.Mesh.Params), SharedParams), { sectorOpacity: param_definition_1.ParamDefinition.Numeric(0.5, { min: 0, max: 1, step: 0.01 }) });
33
- var BilayerRimsParams = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, lines_1.Lines.Params), SharedParams), { lineSizeAttenuation: param_definition_1.ParamDefinition.Boolean(true), linesSize: param_definition_1.ParamDefinition.Numeric(0.3, { min: 0.01, max: 50, step: 0.01 }), dashedLines: param_definition_1.ParamDefinition.Boolean(true) });
33
+ var BilayerRimsParams = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, lines_1.Lines.Params), SharedParams), { lineSizeAttenuation: param_definition_1.ParamDefinition.Boolean(false), linesSize: param_definition_1.ParamDefinition.Numeric(0.5, { min: 0.01, max: 50, step: 0.01 }), dashedLines: param_definition_1.ParamDefinition.Boolean(false) });
34
34
  var MembraneOrientationVisuals = {
35
35
  'bilayer-planes': function (ctx, getParams) { return (0, representation_3.ShapeRepresentation)(getBilayerPlanes, mesh_1.Mesh.Utils, { modifyState: function (s) { return ((0, tslib_1.__assign)((0, tslib_1.__assign)({}, s), { markerActions: marker_action_1.MarkerActions.Highlighting })); }, modifyProps: function (p) { return ((0, tslib_1.__assign)((0, tslib_1.__assign)({}, p), { alpha: p.sectorOpacity, ignoreLight: true, doubleSided: false })); } }); },
36
36
  'bilayer-rims': function (ctx, getParams) { return (0, representation_3.ShapeRepresentation)(getBilayerRims, lines_1.Lines.Utils, { modifyState: function (s) { return ((0, tslib_1.__assign)((0, tslib_1.__assign)({}, s), { markerActions: marker_action_1.MarkerActions.Highlighting })); } }); }
@@ -9,6 +9,7 @@ import { StructureRepresentationPresetProvider } from '../../../mol-plugin-state
9
9
  import { ParamDefinition as PD } from '../../../mol-util/param-definition';
10
10
  export declare const DnatcoConfalPyramidsPreset: StructureRepresentationPresetProvider<{
11
11
  ignoreHydrogens: boolean | undefined;
12
+ ignoreLight: boolean | undefined;
12
13
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined;
13
14
  theme: PD.Normalize<{
14
15
  globalName: any;
@@ -12,6 +12,7 @@ export declare const MAQualityAssessment: import("../../../mol-state/transformer
12
12
  }>;
13
13
  export declare const QualityAssessmentPLDDTPreset: StructureRepresentationPresetProvider<{
14
14
  ignoreHydrogens: boolean | undefined;
15
+ ignoreLight: boolean | undefined;
15
16
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined;
16
17
  theme: PD.Normalize<{
17
18
  globalName: any;
@@ -40,6 +41,7 @@ export declare const QualityAssessmentPLDDTPreset: StructureRepresentationPreset
40
41
  }>;
41
42
  export declare const QualityAssessmentQmeanPreset: StructureRepresentationPresetProvider<{
42
43
  ignoreHydrogens: boolean | undefined;
44
+ ignoreLight: boolean | undefined;
43
45
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined;
44
46
  theme: PD.Normalize<{
45
47
  globalName: any;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author David Sehnal <david.sehnal@gmail.com>
5
+ */
6
+ import { PluginContext } from '../../mol-plugin/context';
7
+ export declare function exportHierarchy(plugin: PluginContext, options?: {
8
+ format?: 'cif' | 'bcif';
9
+ }): Promise<void>;
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
4
+ *
5
+ * @author David Sehnal <david.sehnal@gmail.com>
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.exportHierarchy = void 0;
9
+ var tslib_1 = require("tslib");
10
+ var utf8_1 = require("../../mol-io/common/utf8");
11
+ var structure_1 = require("../../mol-model/structure");
12
+ var mol_task_1 = require("../../mol-task");
13
+ var date_1 = require("../../mol-util/date");
14
+ var download_1 = require("../../mol-util/download");
15
+ var zip_1 = require("../../mol-util/zip/zip");
16
+ function exportHierarchy(plugin, options) {
17
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
18
+ var e_1;
19
+ return (0, tslib_1.__generator)(this, function (_a) {
20
+ switch (_a.label) {
21
+ case 0:
22
+ _a.trys.push([0, 2, , 3]);
23
+ return [4 /*yield*/, plugin.runTask(_exportHierarchy(plugin, options), { useOverlay: true })];
24
+ case 1:
25
+ _a.sent();
26
+ return [3 /*break*/, 3];
27
+ case 2:
28
+ e_1 = _a.sent();
29
+ console.error(e_1);
30
+ plugin.log.error("Model export failed. See console for details.");
31
+ return [3 /*break*/, 3];
32
+ case 3: return [2 /*return*/];
33
+ }
34
+ });
35
+ });
36
+ }
37
+ exports.exportHierarchy = exportHierarchy;
38
+ function _exportHierarchy(plugin, options) {
39
+ var _this = this;
40
+ return mol_task_1.Task.create('Export', function (ctx) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
41
+ var format, structures, files, entryMap, _i, structures_1, _s, s, name_1, zipData, _a, files_1, _b, fn, data, bytes, buffer;
42
+ var _c, _d, _e, _f, _g, _h, _j, _k;
43
+ return (0, tslib_1.__generator)(this, function (_l) {
44
+ switch (_l.label) {
45
+ case 0: return [4 /*yield*/, ctx.update({ message: 'Exporting...', isIndeterminate: true, canAbort: false })];
46
+ case 1:
47
+ _l.sent();
48
+ format = (_c = options === null || options === void 0 ? void 0 : options.format) !== null && _c !== void 0 ? _c : 'cif';
49
+ structures = plugin.managers.structure.hierarchy.current.structures;
50
+ files = [];
51
+ entryMap = new Map();
52
+ _i = 0, structures_1 = structures;
53
+ _l.label = 2;
54
+ case 2:
55
+ if (!(_i < structures_1.length)) return [3 /*break*/, 7];
56
+ _s = structures_1[_i];
57
+ s = (_f = (_e = (_d = _s.transform) === null || _d === void 0 ? void 0 : _d.cell.obj) === null || _e === void 0 ? void 0 : _e.data) !== null && _f !== void 0 ? _f : (_g = _s.cell.obj) === null || _g === void 0 ? void 0 : _g.data;
58
+ if (!s)
59
+ return [3 /*break*/, 6];
60
+ if (s.models.length > 1) {
61
+ plugin.log.warn("[Export] Skipping ".concat((_h = _s.cell.obj) === null || _h === void 0 ? void 0 : _h.label, ": Multimodel exports not supported."));
62
+ return [3 /*break*/, 6];
63
+ }
64
+ if (s.units.some(function (u) { return !structure_1.Unit.isAtomic(u); })) {
65
+ plugin.log.warn("[Export] Skipping ".concat((_j = _s.cell.obj) === null || _j === void 0 ? void 0 : _j.label, ": Non-atomic model exports not supported."));
66
+ return [3 /*break*/, 6];
67
+ }
68
+ name_1 = entryMap.has(s.model.entryId)
69
+ ? "".concat(s.model.entryId, "_").concat(entryMap.get(s.model.entryId) + 1, ".").concat(format)
70
+ : "".concat(s.model.entryId, ".").concat(format);
71
+ entryMap.set(s.model.entryId, ((_k = entryMap.get(s.model.entryId)) !== null && _k !== void 0 ? _k : 0) + 1);
72
+ return [4 /*yield*/, ctx.update({ message: "Exporting ".concat(s.model.entryId, "..."), isIndeterminate: true, canAbort: false })];
73
+ case 3:
74
+ _l.sent();
75
+ if (!(s.elementCount > 100000)) return [3 /*break*/, 5];
76
+ // Give UI chance to update, only needed for larger structures.
77
+ return [4 /*yield*/, new Promise(function (res) { return setTimeout(res, 50); })];
78
+ case 4:
79
+ // Give UI chance to update, only needed for larger structures.
80
+ _l.sent();
81
+ _l.label = 5;
82
+ case 5:
83
+ try {
84
+ files.push([name_1, (0, structure_1.to_mmCIF)(s.model.entryId, s, format === 'bcif', { copyAllCategories: true })]);
85
+ }
86
+ catch (e) {
87
+ if (format === 'cif' && s.elementCount > 2000000) {
88
+ plugin.log.warn("[Export] The structure might be too big to be exported as Text CIF, consider using the BinaryCIF format instead.");
89
+ }
90
+ throw e;
91
+ }
92
+ _l.label = 6;
93
+ case 6:
94
+ _i++;
95
+ return [3 /*break*/, 2];
96
+ case 7:
97
+ if (!(files.length === 1)) return [3 /*break*/, 8];
98
+ (0, download_1.download)(new Blob([files[0][1]]), files[0][0]);
99
+ return [3 /*break*/, 11];
100
+ case 8:
101
+ if (!(files.length > 1)) return [3 /*break*/, 11];
102
+ zipData = {};
103
+ for (_a = 0, files_1 = files; _a < files_1.length; _a++) {
104
+ _b = files_1[_a], fn = _b[0], data = _b[1];
105
+ if (data instanceof Uint8Array) {
106
+ zipData[fn] = data;
107
+ }
108
+ else {
109
+ bytes = new Uint8Array((0, utf8_1.utf8ByteCount)(data));
110
+ (0, utf8_1.utf8Write)(bytes, 0, data);
111
+ zipData[fn] = bytes;
112
+ }
113
+ }
114
+ return [4 /*yield*/, ctx.update({ message: "Compressing Data...", isIndeterminate: true, canAbort: false })];
115
+ case 9:
116
+ _l.sent();
117
+ return [4 /*yield*/, (0, zip_1.zip)(ctx, zipData)];
118
+ case 10:
119
+ buffer = _l.sent();
120
+ (0, download_1.download)(new Blob([new Uint8Array(buffer, 0, buffer.byteLength)]), "structures_".concat((0, date_1.getFormattedTime)(), ".zip"));
121
+ _l.label = 11;
122
+ case 11:
123
+ plugin.log.info("[Export] Done.");
124
+ return [2 /*return*/];
125
+ }
126
+ });
127
+ }); });
128
+ }
129
+ //# sourceMappingURL=export.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author David Sehnal <david.sehnal@gmail.com>
5
+ */
6
+ import { PluginBehavior } from '../../mol-plugin/behavior/behavior';
7
+ export declare const ModelExport: import("../../mol-state/transformer").StateTransformer<PluginBehavior.Category, PluginBehavior.Behavior, {}>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
4
+ *
5
+ * @author David Sehnal <david.sehnal@gmail.com>
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ModelExport = void 0;
9
+ var tslib_1 = require("tslib");
10
+ var behavior_1 = require("../../mol-plugin/behavior/behavior");
11
+ var ui_1 = require("./ui");
12
+ exports.ModelExport = behavior_1.PluginBehavior.create({
13
+ name: 'extension-model-export',
14
+ category: 'misc',
15
+ display: {
16
+ name: 'Model Export'
17
+ },
18
+ ctor: /** @class */ (function (_super) {
19
+ (0, tslib_1.__extends)(class_1, _super);
20
+ function class_1() {
21
+ return _super !== null && _super.apply(this, arguments) || this;
22
+ }
23
+ class_1.prototype.register = function () {
24
+ this.ctx.customStructureControls.set('model-export', ui_1.ModelExportUI);
25
+ };
26
+ class_1.prototype.update = function () {
27
+ return false;
28
+ };
29
+ class_1.prototype.unregister = function () {
30
+ this.ctx.customStructureControls.delete('model-export');
31
+ };
32
+ return class_1;
33
+ }(behavior_1.PluginBehavior.Handler)),
34
+ params: function () { return ({}); }
35
+ });
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author David Sehnal <david.sehnal@gmail.com>
5
+ */
6
+ /// <reference types="react" />
7
+ import { CollapsableControls, CollapsableState } from '../../mol-plugin-ui/base';
8
+ export declare class ModelExportUI extends CollapsableControls<{}, {}> {
9
+ protected defaultState(): CollapsableState;
10
+ protected renderControls(): JSX.Element | null;
11
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ModelExportUI = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ /**
7
+ * Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
8
+ *
9
+ * @author David Sehnal <david.sehnal@gmail.com>
10
+ */
11
+ var react_1 = require("react");
12
+ var base_1 = require("../../mol-plugin-ui/base");
13
+ var common_1 = require("../../mol-plugin-ui/controls/common");
14
+ var icons_1 = require("../../mol-plugin-ui/controls/icons");
15
+ var parameters_1 = require("../../mol-plugin-ui/controls/parameters");
16
+ var use_behavior_1 = require("../../mol-plugin-ui/hooks/use-behavior");
17
+ var param_definition_1 = require("../../mol-util/param-definition");
18
+ var export_1 = require("./export");
19
+ var ModelExportUI = /** @class */ (function (_super) {
20
+ (0, tslib_1.__extends)(ModelExportUI, _super);
21
+ function ModelExportUI() {
22
+ return _super !== null && _super.apply(this, arguments) || this;
23
+ }
24
+ ModelExportUI.prototype.defaultState = function () {
25
+ return {
26
+ header: 'Export Models',
27
+ isCollapsed: true,
28
+ brand: { accent: 'cyan', svg: icons_1.GetAppSvg }
29
+ };
30
+ };
31
+ ModelExportUI.prototype.renderControls = function () {
32
+ return (0, jsx_runtime_1.jsx)(ExportControls, { plugin: this.plugin }, void 0);
33
+ };
34
+ return ModelExportUI;
35
+ }(base_1.CollapsableControls));
36
+ exports.ModelExportUI = ModelExportUI;
37
+ var Params = {
38
+ format: param_definition_1.ParamDefinition.Select('cif', [['cif', 'mmCIF'], ['bcif', 'Binary mmCIF']])
39
+ };
40
+ var DefaultParams = param_definition_1.ParamDefinition.getDefaultValues(Params);
41
+ function ExportControls(_a) {
42
+ var _this = this;
43
+ var plugin = _a.plugin;
44
+ var _b = (0, react_1.useState)(DefaultParams), params = _b[0], setParams = _b[1];
45
+ var _c = (0, react_1.useState)(false), exporting = _c[0], setExporting = _c[1];
46
+ (0, use_behavior_1.useBehavior)(plugin.managers.structure.hierarchy.behaviors.selection); // triggers UI update
47
+ var isBusy = (0, use_behavior_1.useBehavior)(plugin.behaviors.state.isBusy);
48
+ var hierarchy = plugin.managers.structure.hierarchy.current;
49
+ var label = 'Nothing to Export';
50
+ if (hierarchy.structures.length === 1) {
51
+ label = 'Export';
52
+ }
53
+ if (hierarchy.structures.length > 1) {
54
+ label = 'Export (as ZIP)';
55
+ }
56
+ var onExport = function () { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
57
+ return (0, tslib_1.__generator)(this, function (_a) {
58
+ switch (_a.label) {
59
+ case 0:
60
+ setExporting(true);
61
+ _a.label = 1;
62
+ case 1:
63
+ _a.trys.push([1, , 3, 4]);
64
+ return [4 /*yield*/, (0, export_1.exportHierarchy)(plugin, { format: params.format })];
65
+ case 2:
66
+ _a.sent();
67
+ return [3 /*break*/, 4];
68
+ case 3:
69
+ setExporting(false);
70
+ return [7 /*endfinally*/];
71
+ case 4: return [2 /*return*/];
72
+ }
73
+ });
74
+ }); };
75
+ return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: Params, values: params, onChangeValues: setParams, isDisabled: isBusy || exporting }, void 0), (0, jsx_runtime_1.jsx)(common_1.Button, (0, tslib_1.__assign)({ onClick: onExport, style: { marginTop: 1 }, disabled: isBusy || hierarchy.structures.length === 0 || exporting, commit: hierarchy.structures.length ? 'on' : 'off' }, { children: label }), void 0)] }, void 0);
76
+ }
77
+ //# sourceMappingURL=ui.js.map
@@ -67,7 +67,7 @@ function encodeMp4Animation(plugin, ctx, params) {
67
67
  _d.label = 6;
68
68
  case 6:
69
69
  if (!(i <= N)) return [3 /*break*/, 10];
70
- return [4 /*yield*/, loop.tick(i * dt, { isSynchronous: true, manualDraw: true })];
70
+ return [4 /*yield*/, loop.tick(i * dt, { isSynchronous: true, animation: { currentFrame: i, frameCount: N }, manualDraw: true })];
71
71
  case 7:
72
72
  _d.sent();
73
73
  image = params.pass.getImageData(width, height, normalizedViewport);