molstar 3.26.0 → 3.28.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 (499) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +202 -202
  3. package/build/viewer/embedded.html +52 -52
  4. package/build/viewer/index.html +115 -115
  5. package/build/viewer/molstar.css +1 -1
  6. package/build/viewer/molstar.js +1 -1
  7. package/lib/apps/docking-viewer/index.html +36 -36
  8. package/lib/apps/docking-viewer/viewport.d.ts +2 -0
  9. package/lib/apps/docking-viewer/viewport.js +1 -0
  10. package/lib/apps/viewer/app.d.ts +3 -1
  11. package/lib/apps/viewer/app.js +4 -0
  12. package/lib/apps/viewer/embedded.html +52 -52
  13. package/lib/apps/viewer/index.html +115 -115
  14. package/lib/cli/structure-info/volume.js +1 -1
  15. package/lib/commonjs/apps/docking-viewer/viewport.d.ts +2 -0
  16. package/lib/commonjs/apps/docking-viewer/viewport.js +1 -0
  17. package/lib/commonjs/apps/viewer/app.d.ts +3 -1
  18. package/lib/commonjs/apps/viewer/app.js +4 -0
  19. package/lib/commonjs/cli/structure-info/volume.js +1 -1
  20. package/lib/commonjs/examples/lighting/index.js +1 -1
  21. package/lib/commonjs/extensions/anvil/behavior.d.ts +1 -0
  22. package/lib/commonjs/extensions/cellpack/model.js +2 -1
  23. package/lib/commonjs/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
  24. package/lib/commonjs/extensions/meshes/choice.d.ts +26 -0
  25. package/lib/commonjs/extensions/meshes/choice.js +31 -0
  26. package/lib/commonjs/extensions/meshes/examples.d.ts +26 -0
  27. package/lib/commonjs/extensions/meshes/examples.js +337 -0
  28. package/lib/commonjs/extensions/meshes/mesh-cif-schema.d.ts +29 -0
  29. package/lib/commonjs/extensions/meshes/mesh-cif-schema.js +34 -0
  30. package/lib/commonjs/extensions/meshes/mesh-extension.d.ts +66 -0
  31. package/lib/commonjs/extensions/meshes/mesh-extension.js +221 -0
  32. package/lib/commonjs/extensions/meshes/mesh-streaming/behavior.d.ts +105 -0
  33. package/lib/commonjs/extensions/meshes/mesh-streaming/behavior.js +379 -0
  34. package/lib/commonjs/extensions/meshes/mesh-streaming/server-info.d.ts +54 -0
  35. package/lib/commonjs/extensions/meshes/mesh-streaming/server-info.js +30 -0
  36. package/lib/commonjs/extensions/meshes/mesh-streaming/transformers.d.ts +42 -0
  37. package/lib/commonjs/extensions/meshes/mesh-streaming/transformers.js +273 -0
  38. package/lib/commonjs/extensions/meshes/mesh-utils.d.ts +41 -0
  39. package/lib/commonjs/extensions/meshes/mesh-utils.js +357 -0
  40. package/lib/commonjs/extensions/meshes/metadata.d.ts +108 -0
  41. package/lib/commonjs/extensions/meshes/metadata.js +72 -0
  42. package/lib/commonjs/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
  43. package/lib/commonjs/extensions/model-archive/quality-assessment/prop.d.ts +1 -0
  44. package/lib/commonjs/extensions/model-archive/quality-assessment/prop.js +16 -4
  45. package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
  46. package/lib/commonjs/extensions/rcsb/validation-report/behavior.d.ts +3 -0
  47. package/lib/commonjs/extensions/volumes-and-segmentations/entry-meshes.d.ts +17 -0
  48. package/lib/commonjs/extensions/volumes-and-segmentations/entry-meshes.js +156 -0
  49. package/lib/commonjs/extensions/volumes-and-segmentations/entry-models.d.ts +12 -0
  50. package/lib/commonjs/extensions/volumes-and-segmentations/entry-models.js +96 -0
  51. package/lib/commonjs/extensions/volumes-and-segmentations/entry-root.d.ts +122 -0
  52. package/lib/commonjs/extensions/volumes-and-segmentations/entry-root.js +576 -0
  53. package/lib/commonjs/extensions/volumes-and-segmentations/entry-segmentation.d.ts +20 -0
  54. package/lib/commonjs/extensions/volumes-and-segmentations/entry-segmentation.js +200 -0
  55. package/lib/commonjs/extensions/volumes-and-segmentations/entry-state.d.ts +88 -0
  56. package/lib/commonjs/extensions/volumes-and-segmentations/entry-state.js +32 -0
  57. package/lib/commonjs/extensions/volumes-and-segmentations/entry-volume.d.ts +35 -0
  58. package/lib/commonjs/extensions/volumes-and-segmentations/entry-volume.js +234 -0
  59. package/lib/commonjs/extensions/volumes-and-segmentations/external-api.d.ts +11 -0
  60. package/lib/commonjs/extensions/volumes-and-segmentations/external-api.js +85 -0
  61. package/lib/commonjs/extensions/volumes-and-segmentations/global-state.d.ts +51 -0
  62. package/lib/commonjs/extensions/volumes-and-segmentations/global-state.js +83 -0
  63. package/lib/commonjs/extensions/volumes-and-segmentations/helpers.d.ts +56 -0
  64. package/lib/commonjs/extensions/volumes-and-segmentations/helpers.js +171 -0
  65. package/lib/commonjs/extensions/volumes-and-segmentations/index.d.ts +20 -0
  66. package/lib/commonjs/extensions/volumes-and-segmentations/index.js +130 -0
  67. package/lib/commonjs/extensions/volumes-and-segmentations/transformers.d.ts +33 -0
  68. package/lib/commonjs/extensions/volumes-and-segmentations/transformers.js +85 -0
  69. package/lib/commonjs/extensions/volumes-and-segmentations/ui.d.ts +29 -0
  70. package/lib/commonjs/extensions/volumes-and-segmentations/ui.js +232 -0
  71. package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/api.d.ts +22 -0
  72. package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/api.js +83 -0
  73. package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/data.d.ts +92 -0
  74. package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/data.js +7 -0
  75. package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/utils.d.ts +23 -0
  76. package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/utils.js +78 -0
  77. package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +2 -0
  78. package/lib/commonjs/mol-canvas3d/passes/draw.js +3 -3
  79. package/lib/commonjs/mol-canvas3d/passes/image.d.ts +1 -0
  80. package/lib/commonjs/mol-canvas3d/passes/postprocessing.d.ts +2 -1
  81. package/lib/commonjs/mol-canvas3d/passes/postprocessing.js +27 -13
  82. package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.d.ts +2 -1
  83. package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.js +3 -2
  84. package/lib/commonjs/mol-geo/geometry/lines/lines.d.ts +0 -1
  85. package/lib/commonjs/mol-geo/geometry/points/points.d.ts +1 -1
  86. package/lib/commonjs/mol-geo/geometry/spheres/spheres.d.ts +1 -0
  87. package/lib/commonjs/mol-geo/geometry/spheres/spheres.js +3 -2
  88. package/lib/commonjs/mol-gl/compute/histogram-pyramid/reduction.js +1 -2
  89. package/lib/commonjs/mol-gl/compute/marching-cubes/isosurface.js +4 -6
  90. package/lib/commonjs/mol-gl/renderable/cylinders.d.ts +1 -0
  91. package/lib/commonjs/mol-gl/renderable/cylinders.js +1 -1
  92. package/lib/commonjs/mol-gl/renderable/spheres.d.ts +1 -0
  93. package/lib/commonjs/mol-gl/renderable/spheres.js +1 -1
  94. package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +1 -1
  95. package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js +1 -1
  96. package/lib/commonjs/mol-gl/shader/chunks/clip-instance.glsl.d.ts +1 -1
  97. package/lib/commonjs/mol-gl/shader/chunks/clip-instance.glsl.js +1 -1
  98. package/lib/commonjs/mol-gl/shader/chunks/clip-pixel.glsl.d.ts +1 -1
  99. package/lib/commonjs/mol-gl/shader/chunks/clip-pixel.glsl.js +1 -1
  100. package/lib/commonjs/mol-gl/shader/chunks/common-clip.glsl.d.ts +2 -2
  101. package/lib/commonjs/mol-gl/shader/chunks/common-clip.glsl.js +2 -2
  102. package/lib/commonjs/mol-gl/shader/cylinders.frag.d.ts +1 -1
  103. package/lib/commonjs/mol-gl/shader/cylinders.frag.js +1 -1
  104. package/lib/commonjs/mol-gl/shader/cylinders.vert.d.ts +2 -2
  105. package/lib/commonjs/mol-gl/shader/cylinders.vert.js +2 -2
  106. package/lib/commonjs/mol-gl/shader/direct-volume.frag.d.ts +1 -1
  107. package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +1 -1
  108. package/lib/commonjs/mol-gl/shader/outlines.frag.d.ts +1 -1
  109. package/lib/commonjs/mol-gl/shader/outlines.frag.js +1 -1
  110. package/lib/commonjs/mol-gl/shader/postprocessing.frag.d.ts +1 -1
  111. package/lib/commonjs/mol-gl/shader/postprocessing.frag.js +1 -1
  112. package/lib/commonjs/mol-gl/shader/spheres.frag.d.ts +1 -1
  113. package/lib/commonjs/mol-gl/shader/spheres.frag.js +1 -1
  114. package/lib/commonjs/mol-gl/shader/spheres.vert.d.ts +2 -2
  115. package/lib/commonjs/mol-gl/shader/spheres.vert.js +2 -2
  116. package/lib/commonjs/mol-gl/webgl/renderbuffer.d.ts +1 -1
  117. package/lib/commonjs/mol-gl/webgl/renderbuffer.js +15 -0
  118. package/lib/commonjs/mol-gl/webgl/state.d.ts +12 -0
  119. package/lib/commonjs/mol-gl/webgl/state.js +136 -0
  120. package/lib/commonjs/mol-io/reader/cif/schema/segmentation.d.ts +38 -0
  121. package/lib/commonjs/mol-io/reader/cif/schema/segmentation.js +22 -0
  122. package/lib/commonjs/mol-io/reader/cif.d.ts +3 -1
  123. package/lib/commonjs/mol-io/reader/cif.js +3 -1
  124. package/lib/commonjs/mol-model/location.d.ts +2 -1
  125. package/lib/commonjs/mol-model/loci.d.ts +11 -11
  126. package/lib/commonjs/mol-model/loci.js +13 -1
  127. package/lib/commonjs/mol-model/sequence/alignment/sequence.d.ts +4 -1
  128. package/lib/commonjs/mol-model/sequence/alignment/sequence.js +4 -1
  129. package/lib/commonjs/mol-model/structure/model/properties/atomic/hierarchy.d.ts +6 -0
  130. package/lib/commonjs/mol-model/structure/model/properties/utils/atomic-index.js +8 -0
  131. package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.js +21 -5
  132. package/lib/commonjs/mol-model/structure/structure/util/superposition.d.ts +1 -0
  133. package/lib/commonjs/mol-model/structure/structure/util/superposition.js +2 -1
  134. package/lib/commonjs/mol-model/volume/volume.d.ts +35 -2
  135. package/lib/commonjs/mol-model/volume/volume.js +77 -2
  136. package/lib/commonjs/mol-model-formats/volume/segmentation.d.ts +23 -0
  137. package/lib/commonjs/mol-model-formats/volume/segmentation.js +138 -0
  138. package/lib/commonjs/mol-plugin/behavior/dynamic/representation.d.ts +2 -2
  139. package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +1 -0
  140. package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +2 -1
  141. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
  142. package/lib/commonjs/mol-plugin/commands.d.ts +1 -0
  143. package/lib/commonjs/mol-plugin-state/animation/built-in/model-index.js +4 -1
  144. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +2 -0
  145. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -0
  146. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +13 -4
  147. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +6 -1
  148. package/lib/commonjs/mol-plugin-state/builder/structure/representation.d.ts +1 -0
  149. package/lib/commonjs/mol-plugin-state/formats/provider.d.ts +2 -2
  150. package/lib/commonjs/mol-plugin-state/formats/provider.js +11 -3
  151. package/lib/commonjs/mol-plugin-state/formats/registry.js +6 -5
  152. package/lib/commonjs/mol-plugin-state/formats/volume.d.ts +27 -0
  153. package/lib/commonjs/mol-plugin-state/formats/volume.js +65 -1
  154. package/lib/commonjs/mol-plugin-state/manager/structure/component.d.ts +1 -1
  155. package/lib/commonjs/mol-plugin-state/manager/structure/component.js +18 -13
  156. package/lib/commonjs/mol-plugin-state/transforms/representation.d.ts +1 -2
  157. package/lib/commonjs/mol-plugin-state/transforms/representation.js +5 -6
  158. package/lib/commonjs/mol-plugin-state/transforms/volume.d.ts +11 -1
  159. package/lib/commonjs/mol-plugin-state/transforms/volume.js +55 -2
  160. package/lib/commonjs/mol-plugin-ui/controls/line-graph/line-graph-component.d.ts +1 -0
  161. package/lib/commonjs/mol-plugin-ui/controls/line-graph/line-graph-component.js +33 -13
  162. package/lib/commonjs/mol-plugin-ui/controls/parameters.d.ts +1 -0
  163. package/lib/commonjs/mol-plugin-ui/controls/parameters.js +22 -5
  164. package/lib/commonjs/mol-plugin-ui/sequence/sequence.d.ts +25 -17
  165. package/lib/commonjs/mol-plugin-ui/sequence.d.ts +19 -1
  166. package/lib/commonjs/mol-plugin-ui/sequence.js +8 -1
  167. package/lib/commonjs/mol-plugin-ui/state/apply-action.d.ts +2 -10
  168. package/lib/commonjs/mol-plugin-ui/state/apply-action.js +2 -2
  169. package/lib/commonjs/mol-plugin-ui/structure/quick-styles.js +2 -2
  170. package/lib/commonjs/mol-plugin-ui/structure/superposition.d.ts +1 -1
  171. package/lib/commonjs/mol-plugin-ui/structure/volume.d.ts +1 -1
  172. package/lib/commonjs/mol-plugin-ui/structure/volume.js +3 -2
  173. package/lib/commonjs/mol-repr/structure/complex-visual.d.ts +1 -0
  174. package/lib/commonjs/mol-repr/structure/params.d.ts +2 -0
  175. package/lib/commonjs/mol-repr/structure/registry.d.ts +12 -0
  176. package/lib/commonjs/mol-repr/structure/representation/backbone.d.ts +3 -0
  177. package/lib/commonjs/mol-repr/structure/representation/ball-and-stick.d.ts +6 -0
  178. package/lib/commonjs/mol-repr/structure/representation/ellipsoid.d.ts +6 -0
  179. package/lib/commonjs/mol-repr/structure/representation/gaussian-surface.d.ts +3 -0
  180. package/lib/commonjs/mol-repr/structure/representation/gaussian-volume.d.ts +3 -0
  181. package/lib/commonjs/mol-repr/structure/representation/line.d.ts +3 -0
  182. package/lib/commonjs/mol-repr/structure/representation/molecular-surface.d.ts +3 -0
  183. package/lib/commonjs/mol-repr/structure/representation/point.d.ts +3 -0
  184. package/lib/commonjs/mol-repr/structure/representation/spacefill.d.ts +6 -0
  185. package/lib/commonjs/mol-repr/structure/units-visual.d.ts +2 -0
  186. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +4 -0
  187. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.js +2 -0
  188. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-line.d.ts +1 -0
  189. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-line.js +1 -0
  190. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +4 -0
  191. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.js +2 -0
  192. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-line.d.ts +1 -0
  193. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-line.js +1 -0
  194. package/lib/commonjs/mol-repr/structure/visual/element-cross.d.ts +1 -0
  195. package/lib/commonjs/mol-repr/structure/visual/element-cross.js +2 -1
  196. package/lib/commonjs/mol-repr/structure/visual/element-point.d.ts +1 -0
  197. package/lib/commonjs/mol-repr/structure/visual/element-point.js +2 -1
  198. package/lib/commonjs/mol-repr/structure/visual/element-sphere.d.ts +4 -0
  199. package/lib/commonjs/mol-repr/structure/visual/element-sphere.js +3 -1
  200. package/lib/commonjs/mol-repr/structure/visual/gaussian-density-volume.d.ts +2 -0
  201. package/lib/commonjs/mol-repr/structure/visual/gaussian-density-volume.js +6 -2
  202. package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +4 -0
  203. package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.js +9 -1
  204. package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-wireframe.d.ts +1 -0
  205. package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-wireframe.js +3 -1
  206. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -0
  207. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +4 -0
  208. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-wireframe.d.ts +1 -0
  209. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-wireframe.js +2 -0
  210. package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +2 -0
  211. package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +2 -0
  212. package/lib/commonjs/mol-repr/structure/visual/util/bond.d.ts +7 -0
  213. package/lib/commonjs/mol-repr/structure/visual/util/bond.js +18 -7
  214. package/lib/commonjs/mol-repr/structure/visual/util/common.d.ts +4 -1
  215. package/lib/commonjs/mol-repr/structure/visual/util/common.js +10 -6
  216. package/lib/commonjs/mol-repr/structure/visual/util/element.d.ts +1 -0
  217. package/lib/commonjs/mol-repr/structure/visual/util/element.js +2 -3
  218. package/lib/commonjs/mol-repr/structure/visual/util/gaussian.d.ts +2 -0
  219. package/lib/commonjs/mol-repr/volume/direct-volume.d.ts +4 -4
  220. package/lib/commonjs/mol-repr/volume/direct-volume.js +8 -6
  221. package/lib/commonjs/mol-repr/volume/isosurface.d.ts +4 -4
  222. package/lib/commonjs/mol-repr/volume/isosurface.js +17 -16
  223. package/lib/commonjs/mol-repr/volume/registry.d.ts +54 -1
  224. package/lib/commonjs/mol-repr/volume/registry.js +3 -1
  225. package/lib/commonjs/mol-repr/volume/representation.d.ts +11 -7
  226. package/lib/commonjs/mol-repr/volume/representation.js +142 -47
  227. package/lib/commonjs/mol-repr/volume/segment.d.ts +291 -0
  228. package/lib/commonjs/mol-repr/volume/segment.js +289 -0
  229. package/lib/commonjs/mol-repr/volume/slice.d.ts +2 -2
  230. package/lib/commonjs/mol-repr/volume/slice.js +5 -5
  231. package/lib/commonjs/mol-repr/volume/util.d.ts +12 -3
  232. package/lib/commonjs/mol-repr/volume/util.js +72 -6
  233. package/lib/commonjs/mol-script/language/builder.d.ts +1 -0
  234. package/lib/commonjs/mol-theme/color/volume-segment.d.ts +41 -0
  235. package/lib/commonjs/mol-theme/color/volume-segment.js +58 -0
  236. package/lib/commonjs/mol-theme/color/volume-value.js +2 -1
  237. package/lib/commonjs/mol-theme/color.d.ts +15 -0
  238. package/lib/commonjs/mol-theme/color.js +2 -0
  239. package/lib/commonjs/mol-theme/label.d.ts +1 -1
  240. package/lib/commonjs/mol-theme/label.js +13 -1
  241. package/lib/commonjs/mol-util/param-definition.d.ts +4 -1
  242. package/lib/commonjs/mol-util/param-definition.js +5 -2
  243. package/lib/examples/alpha-orbitals/index.html +72 -72
  244. package/lib/examples/basic-wrapper/index.html +137 -137
  245. package/lib/examples/lighting/index.html +88 -88
  246. package/lib/examples/lighting/index.js +1 -1
  247. package/lib/examples/proteopedia-wrapper/index.html +236 -236
  248. package/lib/extensions/anvil/behavior.d.ts +1 -0
  249. package/lib/extensions/cellpack/model.js +2 -1
  250. package/lib/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
  251. package/lib/extensions/meshes/choice.d.ts +26 -0
  252. package/lib/extensions/meshes/choice.js +28 -0
  253. package/lib/extensions/meshes/examples.d.ts +26 -0
  254. package/lib/extensions/meshes/examples.js +325 -0
  255. package/lib/extensions/meshes/mesh-cif-schema.d.ts +29 -0
  256. package/lib/extensions/meshes/mesh-cif-schema.js +30 -0
  257. package/lib/extensions/meshes/mesh-extension.d.ts +66 -0
  258. package/lib/extensions/meshes/mesh-extension.js +218 -0
  259. package/lib/extensions/meshes/mesh-streaming/behavior.d.ts +105 -0
  260. package/lib/extensions/meshes/mesh-streaming/behavior.js +375 -0
  261. package/lib/extensions/meshes/mesh-streaming/server-info.d.ts +54 -0
  262. package/lib/extensions/meshes/mesh-streaming/server-info.js +26 -0
  263. package/lib/extensions/meshes/mesh-streaming/transformers.d.ts +42 -0
  264. package/lib/extensions/meshes/mesh-streaming/transformers.js +270 -0
  265. package/lib/extensions/meshes/mesh-utils.d.ts +41 -0
  266. package/lib/extensions/meshes/mesh-utils.js +346 -0
  267. package/lib/extensions/meshes/metadata.d.ts +108 -0
  268. package/lib/extensions/meshes/metadata.js +69 -0
  269. package/lib/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
  270. package/lib/extensions/model-archive/quality-assessment/prop.d.ts +1 -0
  271. package/lib/extensions/model-archive/quality-assessment/prop.js +16 -4
  272. package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
  273. package/lib/extensions/rcsb/validation-report/behavior.d.ts +3 -0
  274. package/lib/extensions/volumes-and-segmentations/entry-meshes.d.ts +17 -0
  275. package/lib/extensions/volumes-and-segmentations/entry-meshes.js +153 -0
  276. package/lib/extensions/volumes-and-segmentations/entry-models.d.ts +12 -0
  277. package/lib/extensions/volumes-and-segmentations/entry-models.js +93 -0
  278. package/lib/extensions/volumes-and-segmentations/entry-root.d.ts +122 -0
  279. package/lib/extensions/volumes-and-segmentations/entry-root.js +571 -0
  280. package/lib/extensions/volumes-and-segmentations/entry-segmentation.d.ts +20 -0
  281. package/lib/extensions/volumes-and-segmentations/entry-segmentation.js +197 -0
  282. package/lib/extensions/volumes-and-segmentations/entry-state.d.ts +88 -0
  283. package/lib/extensions/volumes-and-segmentations/entry-state.js +29 -0
  284. package/lib/extensions/volumes-and-segmentations/entry-volume.d.ts +35 -0
  285. package/lib/extensions/volumes-and-segmentations/entry-volume.js +231 -0
  286. package/lib/extensions/volumes-and-segmentations/external-api.d.ts +11 -0
  287. package/lib/extensions/volumes-and-segmentations/external-api.js +80 -0
  288. package/lib/extensions/volumes-and-segmentations/global-state.d.ts +51 -0
  289. package/lib/extensions/volumes-and-segmentations/global-state.js +80 -0
  290. package/lib/extensions/volumes-and-segmentations/helpers.d.ts +56 -0
  291. package/lib/extensions/volumes-and-segmentations/helpers.js +163 -0
  292. package/lib/extensions/volumes-and-segmentations/index.d.ts +20 -0
  293. package/lib/extensions/volumes-and-segmentations/index.js +127 -0
  294. package/lib/extensions/volumes-and-segmentations/transformers.d.ts +33 -0
  295. package/lib/extensions/volumes-and-segmentations/transformers.js +82 -0
  296. package/lib/extensions/volumes-and-segmentations/ui.d.ts +29 -0
  297. package/lib/extensions/volumes-and-segmentations/ui.js +229 -0
  298. package/lib/extensions/volumes-and-segmentations/volseg-api/api.d.ts +22 -0
  299. package/lib/extensions/volumes-and-segmentations/volseg-api/api.js +80 -0
  300. package/lib/extensions/volumes-and-segmentations/volseg-api/data.d.ts +92 -0
  301. package/lib/extensions/volumes-and-segmentations/volseg-api/data.js +6 -0
  302. package/lib/extensions/volumes-and-segmentations/volseg-api/utils.d.ts +23 -0
  303. package/lib/extensions/volumes-and-segmentations/volseg-api/utils.js +75 -0
  304. package/lib/mol-canvas3d/canvas3d.d.ts +2 -0
  305. package/lib/mol-canvas3d/passes/draw.js +3 -3
  306. package/lib/mol-canvas3d/passes/image.d.ts +1 -0
  307. package/lib/mol-canvas3d/passes/postprocessing.d.ts +2 -1
  308. package/lib/mol-canvas3d/passes/postprocessing.js +27 -13
  309. package/lib/mol-geo/geometry/cylinders/cylinders.d.ts +2 -1
  310. package/lib/mol-geo/geometry/cylinders/cylinders.js +3 -2
  311. package/lib/mol-geo/geometry/lines/lines.d.ts +0 -1
  312. package/lib/mol-geo/geometry/points/points.d.ts +1 -1
  313. package/lib/mol-geo/geometry/spheres/spheres.d.ts +1 -0
  314. package/lib/mol-geo/geometry/spheres/spheres.js +3 -2
  315. package/lib/mol-gl/compute/histogram-pyramid/reduction.js +1 -2
  316. package/lib/mol-gl/compute/marching-cubes/isosurface.js +4 -6
  317. package/lib/mol-gl/renderable/cylinders.d.ts +1 -0
  318. package/lib/mol-gl/renderable/cylinders.js +1 -1
  319. package/lib/mol-gl/renderable/spheres.d.ts +1 -0
  320. package/lib/mol-gl/renderable/spheres.js +1 -1
  321. package/lib/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +1 -1
  322. package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js +1 -1
  323. package/lib/mol-gl/shader/chunks/clip-instance.glsl.d.ts +1 -1
  324. package/lib/mol-gl/shader/chunks/clip-instance.glsl.js +1 -1
  325. package/lib/mol-gl/shader/chunks/clip-pixel.glsl.d.ts +1 -1
  326. package/lib/mol-gl/shader/chunks/clip-pixel.glsl.js +1 -1
  327. package/lib/mol-gl/shader/chunks/common-clip.glsl.d.ts +2 -2
  328. package/lib/mol-gl/shader/chunks/common-clip.glsl.js +2 -2
  329. package/lib/mol-gl/shader/cylinders.frag.d.ts +1 -1
  330. package/lib/mol-gl/shader/cylinders.frag.js +1 -1
  331. package/lib/mol-gl/shader/cylinders.vert.d.ts +2 -2
  332. package/lib/mol-gl/shader/cylinders.vert.js +2 -2
  333. package/lib/mol-gl/shader/direct-volume.frag.d.ts +1 -1
  334. package/lib/mol-gl/shader/direct-volume.frag.js +1 -1
  335. package/lib/mol-gl/shader/outlines.frag.d.ts +1 -1
  336. package/lib/mol-gl/shader/outlines.frag.js +1 -1
  337. package/lib/mol-gl/shader/postprocessing.frag.d.ts +1 -1
  338. package/lib/mol-gl/shader/postprocessing.frag.js +1 -1
  339. package/lib/mol-gl/shader/spheres.frag.d.ts +1 -1
  340. package/lib/mol-gl/shader/spheres.frag.js +1 -1
  341. package/lib/mol-gl/shader/spheres.vert.d.ts +2 -2
  342. package/lib/mol-gl/shader/spheres.vert.js +2 -2
  343. package/lib/mol-gl/webgl/renderbuffer.d.ts +1 -1
  344. package/lib/mol-gl/webgl/renderbuffer.js +15 -0
  345. package/lib/mol-gl/webgl/state.d.ts +12 -0
  346. package/lib/mol-gl/webgl/state.js +136 -0
  347. package/lib/mol-io/reader/cif/schema/segmentation.d.ts +38 -0
  348. package/lib/mol-io/reader/cif/schema/segmentation.js +19 -0
  349. package/lib/mol-io/reader/cif.d.ts +3 -1
  350. package/lib/mol-io/reader/cif.js +3 -1
  351. package/lib/mol-model/location.d.ts +2 -1
  352. package/lib/mol-model/loci.d.ts +11 -11
  353. package/lib/mol-model/loci.js +13 -1
  354. package/lib/mol-model/sequence/alignment/sequence.d.ts +4 -1
  355. package/lib/mol-model/sequence/alignment/sequence.js +3 -2
  356. package/lib/mol-model/structure/model/properties/atomic/hierarchy.d.ts +6 -0
  357. package/lib/mol-model/structure/model/properties/utils/atomic-index.js +8 -0
  358. package/lib/mol-model/structure/structure/unit/bonds/inter-compute.js +21 -5
  359. package/lib/mol-model/structure/structure/util/superposition.d.ts +1 -0
  360. package/lib/mol-model/structure/structure/util/superposition.js +1 -1
  361. package/lib/mol-model/volume/volume.d.ts +35 -2
  362. package/lib/mol-model/volume/volume.js +79 -4
  363. package/lib/mol-model-formats/volume/segmentation.d.ts +23 -0
  364. package/lib/mol-model-formats/volume/segmentation.js +135 -0
  365. package/lib/mol-plugin/behavior/dynamic/representation.d.ts +2 -2
  366. package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +1 -0
  367. package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +2 -1
  368. package/lib/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
  369. package/lib/mol-plugin/commands.d.ts +1 -0
  370. package/lib/mol-plugin/version.js +2 -2
  371. package/lib/mol-plugin-state/animation/built-in/model-index.js +4 -1
  372. package/lib/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +2 -0
  373. package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -0
  374. package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +13 -4
  375. package/lib/mol-plugin-state/builder/structure/representation-preset.js +6 -1
  376. package/lib/mol-plugin-state/builder/structure/representation.d.ts +1 -0
  377. package/lib/mol-plugin-state/formats/provider.d.ts +2 -2
  378. package/lib/mol-plugin-state/formats/provider.js +11 -3
  379. package/lib/mol-plugin-state/formats/registry.js +6 -5
  380. package/lib/mol-plugin-state/formats/volume.d.ts +27 -0
  381. package/lib/mol-plugin-state/formats/volume.js +64 -0
  382. package/lib/mol-plugin-state/manager/structure/component.d.ts +1 -1
  383. package/lib/mol-plugin-state/manager/structure/component.js +18 -13
  384. package/lib/mol-plugin-state/transforms/representation.d.ts +1 -2
  385. package/lib/mol-plugin-state/transforms/representation.js +5 -6
  386. package/lib/mol-plugin-state/transforms/volume.d.ts +11 -1
  387. package/lib/mol-plugin-state/transforms/volume.js +54 -1
  388. package/lib/mol-plugin-ui/controls/line-graph/line-graph-component.d.ts +1 -0
  389. package/lib/mol-plugin-ui/controls/line-graph/line-graph-component.js +33 -13
  390. package/lib/mol-plugin-ui/controls/parameters.d.ts +1 -0
  391. package/lib/mol-plugin-ui/controls/parameters.js +22 -5
  392. package/lib/mol-plugin-ui/sequence/sequence.d.ts +25 -17
  393. package/lib/mol-plugin-ui/sequence.d.ts +19 -1
  394. package/lib/mol-plugin-ui/sequence.js +7 -7
  395. package/lib/mol-plugin-ui/skin/base/base.scss +32 -32
  396. package/lib/mol-plugin-ui/skin/base/components/controls-base.scss +333 -333
  397. package/lib/mol-plugin-ui/skin/base/components/controls.scss +418 -418
  398. package/lib/mol-plugin-ui/skin/base/components/help.scss +27 -27
  399. package/lib/mol-plugin-ui/skin/base/components/line-graph.scss +67 -67
  400. package/lib/mol-plugin-ui/skin/base/components/log.scss +100 -100
  401. package/lib/mol-plugin-ui/skin/base/components/misc.scss +643 -643
  402. package/lib/mol-plugin-ui/skin/base/components/sequence.scss +125 -125
  403. package/lib/mol-plugin-ui/skin/base/components/slider.scss +165 -165
  404. package/lib/mol-plugin-ui/skin/base/components/tasks.scss +99 -99
  405. package/lib/mol-plugin-ui/skin/base/components/toast.scss +83 -83
  406. package/lib/mol-plugin-ui/skin/base/components/transformer.scss +163 -163
  407. package/lib/mol-plugin-ui/skin/base/components/viewport.scss +137 -128
  408. package/lib/mol-plugin-ui/skin/base/layout/common.scss +71 -71
  409. package/lib/mol-plugin-ui/skin/base/layout/controls-landscape.scss +89 -89
  410. package/lib/mol-plugin-ui/skin/base/layout/controls-outside.scss +98 -98
  411. package/lib/mol-plugin-ui/skin/base/layout/controls-portrait.scss +108 -108
  412. package/lib/mol-plugin-ui/skin/base/layout.scss +40 -40
  413. package/lib/mol-plugin-ui/skin/base/logo.scss +12 -12
  414. package/lib/mol-plugin-ui/skin/base/normalize.scss +209 -209
  415. package/lib/mol-plugin-ui/skin/base/ui.scss +40 -40
  416. package/lib/mol-plugin-ui/skin/base/variables.scss +85 -85
  417. package/lib/mol-plugin-ui/skin/blue.scss +1 -1
  418. package/lib/mol-plugin-ui/skin/colors/blue.scss +23 -23
  419. package/lib/mol-plugin-ui/skin/colors/dark.scss +23 -23
  420. package/lib/mol-plugin-ui/skin/colors/light.scss +29 -29
  421. package/lib/mol-plugin-ui/skin/dark.scss +1 -1
  422. package/lib/mol-plugin-ui/skin/light.scss +1 -1
  423. package/lib/mol-plugin-ui/state/apply-action.d.ts +2 -10
  424. package/lib/mol-plugin-ui/state/apply-action.js +2 -2
  425. package/lib/mol-plugin-ui/structure/quick-styles.js +2 -2
  426. package/lib/mol-plugin-ui/structure/superposition.d.ts +1 -1
  427. package/lib/mol-plugin-ui/structure/volume.d.ts +1 -1
  428. package/lib/mol-plugin-ui/structure/volume.js +3 -2
  429. package/lib/mol-repr/structure/complex-visual.d.ts +1 -0
  430. package/lib/mol-repr/structure/params.d.ts +2 -0
  431. package/lib/mol-repr/structure/registry.d.ts +12 -0
  432. package/lib/mol-repr/structure/representation/backbone.d.ts +3 -0
  433. package/lib/mol-repr/structure/representation/ball-and-stick.d.ts +6 -0
  434. package/lib/mol-repr/structure/representation/ellipsoid.d.ts +6 -0
  435. package/lib/mol-repr/structure/representation/gaussian-surface.d.ts +3 -0
  436. package/lib/mol-repr/structure/representation/gaussian-volume.d.ts +3 -0
  437. package/lib/mol-repr/structure/representation/line.d.ts +3 -0
  438. package/lib/mol-repr/structure/representation/molecular-surface.d.ts +3 -0
  439. package/lib/mol-repr/structure/representation/point.d.ts +3 -0
  440. package/lib/mol-repr/structure/representation/spacefill.d.ts +6 -0
  441. package/lib/mol-repr/structure/units-visual.d.ts +2 -0
  442. package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +4 -0
  443. package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.js +2 -0
  444. package/lib/mol-repr/structure/visual/bond-inter-unit-line.d.ts +1 -0
  445. package/lib/mol-repr/structure/visual/bond-inter-unit-line.js +1 -0
  446. package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +4 -0
  447. package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.js +2 -0
  448. package/lib/mol-repr/structure/visual/bond-intra-unit-line.d.ts +1 -0
  449. package/lib/mol-repr/structure/visual/bond-intra-unit-line.js +1 -0
  450. package/lib/mol-repr/structure/visual/element-cross.d.ts +1 -0
  451. package/lib/mol-repr/structure/visual/element-cross.js +2 -1
  452. package/lib/mol-repr/structure/visual/element-point.d.ts +1 -0
  453. package/lib/mol-repr/structure/visual/element-point.js +2 -1
  454. package/lib/mol-repr/structure/visual/element-sphere.d.ts +4 -0
  455. package/lib/mol-repr/structure/visual/element-sphere.js +3 -1
  456. package/lib/mol-repr/structure/visual/gaussian-density-volume.d.ts +2 -0
  457. package/lib/mol-repr/structure/visual/gaussian-density-volume.js +6 -2
  458. package/lib/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +4 -0
  459. package/lib/mol-repr/structure/visual/gaussian-surface-mesh.js +9 -1
  460. package/lib/mol-repr/structure/visual/gaussian-surface-wireframe.d.ts +1 -0
  461. package/lib/mol-repr/structure/visual/gaussian-surface-wireframe.js +3 -1
  462. package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -0
  463. package/lib/mol-repr/structure/visual/molecular-surface-mesh.js +4 -0
  464. package/lib/mol-repr/structure/visual/molecular-surface-wireframe.d.ts +1 -0
  465. package/lib/mol-repr/structure/visual/molecular-surface-wireframe.js +2 -0
  466. package/lib/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +2 -0
  467. package/lib/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +2 -0
  468. package/lib/mol-repr/structure/visual/util/bond.d.ts +7 -0
  469. package/lib/mol-repr/structure/visual/util/bond.js +19 -8
  470. package/lib/mol-repr/structure/visual/util/common.d.ts +4 -1
  471. package/lib/mol-repr/structure/visual/util/common.js +10 -6
  472. package/lib/mol-repr/structure/visual/util/element.d.ts +1 -0
  473. package/lib/mol-repr/structure/visual/util/element.js +3 -4
  474. package/lib/mol-repr/structure/visual/util/gaussian.d.ts +2 -0
  475. package/lib/mol-repr/volume/direct-volume.d.ts +4 -4
  476. package/lib/mol-repr/volume/direct-volume.js +8 -6
  477. package/lib/mol-repr/volume/isosurface.d.ts +4 -4
  478. package/lib/mol-repr/volume/isosurface.js +17 -16
  479. package/lib/mol-repr/volume/registry.d.ts +54 -1
  480. package/lib/mol-repr/volume/registry.js +3 -1
  481. package/lib/mol-repr/volume/representation.d.ts +11 -7
  482. package/lib/mol-repr/volume/representation.js +144 -49
  483. package/lib/mol-repr/volume/segment.d.ts +291 -0
  484. package/lib/mol-repr/volume/segment.js +279 -0
  485. package/lib/mol-repr/volume/slice.d.ts +2 -2
  486. package/lib/mol-repr/volume/slice.js +5 -5
  487. package/lib/mol-repr/volume/util.d.ts +12 -3
  488. package/lib/mol-repr/volume/util.js +71 -6
  489. package/lib/mol-script/language/builder.d.ts +1 -0
  490. package/lib/mol-theme/color/volume-segment.d.ts +41 -0
  491. package/lib/mol-theme/color/volume-segment.js +53 -0
  492. package/lib/mol-theme/color/volume-value.js +2 -1
  493. package/lib/mol-theme/color.d.ts +15 -0
  494. package/lib/mol-theme/color.js +2 -0
  495. package/lib/mol-theme/label.d.ts +1 -1
  496. package/lib/mol-theme/label.js +13 -1
  497. package/lib/mol-util/param-definition.d.ts +4 -1
  498. package/lib/mol-util/param-definition.js +5 -2
  499. package/package.json +169 -168
@@ -110,6 +110,20 @@ export declare const DscifProvider: {
110
110
  volumes: StateObjectSelector<PluginStateObject.Volume.Data>[];
111
111
  }) => Promise<StateObjectSelector<PluginStateObject.Volume.Representation3D, import("../../mol-state/transformer").StateTransformer<import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, any>>[]>;
112
112
  };
113
+ export declare const SegcifProvider: {
114
+ label: string;
115
+ description: string;
116
+ category: string;
117
+ stringExtensions: string[];
118
+ binaryExtensions: string[];
119
+ isApplicable: (info: import("../../mol-util/file-info").FileInfo, data: string | Uint8Array) => boolean;
120
+ parse: (plugin: PluginContext, data: import("../../mol-state").StateObjectRef<PluginStateObject.Data.String | PluginStateObject.Data.Binary>) => Promise<{
121
+ volumes: StateObjectSelector<PluginStateObject.Volume.Data, import("../../mol-state/transformer").StateTransformer<import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, any>>[];
122
+ }>;
123
+ visuals: (plugin: PluginContext, data: {
124
+ volumes: StateObjectSelector<PluginStateObject.Volume.Data>[];
125
+ }) => Promise<StateObjectSelector<PluginStateObject.Volume.Representation3D, import("../../mol-state/transformer").StateTransformer<import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, any>>[]>;
126
+ };
113
127
  export declare const BuiltInVolumeFormats: readonly [readonly ["ccp4", {
114
128
  label: string;
115
129
  description: string;
@@ -196,6 +210,19 @@ export declare const BuiltInVolumeFormats: readonly [readonly ["ccp4", {
196
210
  visuals: (plugin: PluginContext, data: {
197
211
  volumes: StateObjectSelector<PluginStateObject.Volume.Data>[];
198
212
  }) => Promise<StateObjectSelector<PluginStateObject.Volume.Representation3D, import("../../mol-state/transformer").StateTransformer<import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, any>>[]>;
213
+ }], readonly ["segcif", {
214
+ label: string;
215
+ description: string;
216
+ category: string;
217
+ stringExtensions: string[];
218
+ binaryExtensions: string[];
219
+ isApplicable: (info: import("../../mol-util/file-info").FileInfo, data: string | Uint8Array) => boolean;
220
+ parse: (plugin: PluginContext, data: import("../../mol-state").StateObjectRef<PluginStateObject.Data.String | PluginStateObject.Data.Binary>) => Promise<{
221
+ volumes: StateObjectSelector<PluginStateObject.Volume.Data, import("../../mol-state/transformer").StateTransformer<import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, any>>[];
222
+ }>;
223
+ visuals: (plugin: PluginContext, data: {
224
+ volumes: StateObjectSelector<PluginStateObject.Volume.Data>[];
225
+ }) => Promise<StateObjectSelector<PluginStateObject.Volume.Representation3D, import("../../mol-state/transformer").StateTransformer<import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, any>>[]>;
199
226
  }]];
200
227
  export type BuildInVolumeFormat = (typeof BuiltInVolumeFormats)[number][0];
201
228
  export {};
@@ -7,7 +7,7 @@
7
7
  * @author Aliaksei Chareshneu <chareshneu.tech@gmail.com>
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.BuiltInVolumeFormats = exports.DscifProvider = exports.CubeProvider = exports.DxProvider = exports.Dsn6Provider = exports.Ccp4Provider = exports.VolumeFormatCategory = void 0;
10
+ exports.BuiltInVolumeFormats = exports.SegcifProvider = exports.DscifProvider = exports.CubeProvider = exports.DxProvider = exports.Dsn6Provider = exports.Ccp4Provider = exports.VolumeFormatCategory = void 0;
11
11
  var tslib_1 = require("tslib");
12
12
  var transforms_1 = require("../transforms");
13
13
  var provider_1 = require("./provider");
@@ -318,10 +318,74 @@ exports.DscifProvider = (0, provider_1.DataFormatProvider)({
318
318
  });
319
319
  }); }
320
320
  });
321
+ exports.SegcifProvider = (0, provider_1.DataFormatProvider)({
322
+ label: 'Segmentation CIF',
323
+ description: 'Segmentation CIF',
324
+ category: exports.VolumeFormatCategory,
325
+ stringExtensions: ['cif'],
326
+ binaryExtensions: ['bcif'],
327
+ isApplicable: function (info, data) {
328
+ return (0, provider_1.guessCifVariant)(info, data) === 'segcif' ? true : false;
329
+ },
330
+ parse: function (plugin, data) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
331
+ var cifCell, b, blocks, volumes, _i, blocks_2, block;
332
+ var _a;
333
+ return tslib_1.__generator(this, function (_b) {
334
+ switch (_b.label) {
335
+ case 0: return [4 /*yield*/, plugin.build().to(data).apply(transforms_1.StateTransforms.Data.ParseCif).commit()];
336
+ case 1:
337
+ cifCell = _b.sent();
338
+ b = plugin.build().to(cifCell);
339
+ blocks = cifCell.obj.data.blocks;
340
+ if (blocks.length === 0)
341
+ throw new Error('no data blocks');
342
+ volumes = [];
343
+ for (_i = 0, blocks_2 = blocks; _i < blocks_2.length; _i++) {
344
+ block = blocks_2[_i];
345
+ // Skip "server" data block.
346
+ if (block.header.toUpperCase() === 'SERVER')
347
+ continue;
348
+ if (((_a = block.categories['volume_data_3d_info']) === null || _a === void 0 ? void 0 : _a.rowCount) > 0) {
349
+ volumes.push(b.apply(transforms_1.StateTransforms.Volume.VolumeFromSegmentationCif, { blockHeader: block.header }).selector);
350
+ }
351
+ }
352
+ return [4 /*yield*/, b.commit()];
353
+ case 2:
354
+ _b.sent();
355
+ return [2 /*return*/, { volumes: volumes }];
356
+ }
357
+ });
358
+ }); },
359
+ visuals: function (plugin, data) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
360
+ var volumes, tree, visuals, segmentation;
361
+ return tslib_1.__generator(this, function (_a) {
362
+ switch (_a.label) {
363
+ case 0:
364
+ volumes = data.volumes;
365
+ tree = plugin.build();
366
+ visuals = [];
367
+ if (volumes.length > 0) {
368
+ segmentation = volume_1.Volume.Segmentation.get(volumes[0].data);
369
+ if (segmentation) {
370
+ visuals[visuals.length] = tree
371
+ .to(volumes[0])
372
+ .apply(transforms_1.StateTransforms.Representation.VolumeRepresentation3D, representation_1.VolumeRepresentation3DHelpers.getDefaultParams(plugin, 'segment', volumes[0].data, { alpha: 1, instanceGranularity: true }, 'volume-segment', {}))
373
+ .selector;
374
+ }
375
+ }
376
+ return [4 /*yield*/, tree.commit()];
377
+ case 1:
378
+ _a.sent();
379
+ return [2 /*return*/, visuals];
380
+ }
381
+ });
382
+ }); }
383
+ });
321
384
  exports.BuiltInVolumeFormats = [
322
385
  ['ccp4', exports.Ccp4Provider],
323
386
  ['dsn6', exports.Dsn6Provider],
324
387
  ['cube', exports.CubeProvider],
325
388
  ['dx', exports.DxProvider],
326
389
  ['dscif', exports.DscifProvider],
390
+ ['segcif', exports.SegcifProvider],
327
391
  ];
@@ -58,7 +58,7 @@ declare class StructureComponentManager extends StatefulPluginComponent<Structur
58
58
  }
59
59
  declare namespace StructureComponentManager {
60
60
  const OptionsParams: {
61
- showHydrogens: PD.BooleanParam;
61
+ hydrogens: PD.Select<"all" | "hide-all" | "only-polar">;
62
62
  visualQuality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
63
63
  ignoreLight: PD.BooleanParam;
64
64
  materialStyle: PD.Group<PD.Normalize<{
@@ -77,7 +77,8 @@ var StructureComponentManager = /** @class */ (function (_super) {
77
77
  case 1:
78
78
  _a.sent();
79
79
  return [4 /*yield*/, this.plugin.state.updateBehavior(structure_focus_representation_1.StructureFocusRepresentation, function (p) {
80
- p.ignoreHydrogens = !options.showHydrogens;
80
+ p.ignoreHydrogens = options.hydrogens !== 'all';
81
+ p.ignoreHydrogensVariant = options.hydrogens === 'only-polar' ? 'non-polar' : 'all';
81
82
  p.ignoreLight = options.ignoreLight;
82
83
  p.material = options.materialStyle;
83
84
  p.clip = options.clipObjects;
@@ -97,16 +98,18 @@ var StructureComponentManager = /** @class */ (function (_super) {
97
98
  });
98
99
  };
99
100
  StructureComponentManager.prototype.updateReprParams = function (update, component) {
100
- var _a = this.state.options, showHydrogens = _a.showHydrogens, quality = _a.visualQuality, ignoreLight = _a.ignoreLight, material = _a.materialStyle, clip = _a.clipObjects;
101
- var ignoreHydrogens = !showHydrogens;
101
+ var _a = this.state.options, hydrogens = _a.hydrogens, quality = _a.visualQuality, ignoreLight = _a.ignoreLight, material = _a.materialStyle, clip = _a.clipObjects;
102
+ var ignoreHydrogens = hydrogens !== 'all';
103
+ var ignoreHydrogensVariant = hydrogens === 'only-polar' ? 'non-polar' : 'all';
102
104
  for (var _i = 0, _b = component.representations; _i < _b.length; _i++) {
103
105
  var r = _b[_i];
104
106
  if (r.cell.transform.transformer !== representation_1.StructureRepresentation3D)
105
107
  continue;
106
108
  var params = r.cell.transform.params;
107
- if (!!params.type.params.ignoreHydrogens !== ignoreHydrogens || params.type.params.quality !== quality || params.type.params.ignoreLight !== ignoreLight || !(0, mol_util_1.shallowEqual)(params.type.params.material, material) || !param_definition_1.ParamDefinition.areEqual(clip_1.Clip.Params, params.type.params.clip, clip)) {
109
+ if (!!params.type.params.ignoreHydrogens !== ignoreHydrogens || params.type.params.ignoreHydrogensVariant !== ignoreHydrogensVariant || params.type.params.quality !== quality || params.type.params.ignoreLight !== ignoreLight || !(0, mol_util_1.shallowEqual)(params.type.params.material, material) || !param_definition_1.ParamDefinition.areEqual(clip_1.Clip.Params, params.type.params.clip, clip)) {
108
110
  update.to(r.cell).update(function (old) {
109
111
  old.type.params.ignoreHydrogens = ignoreHydrogens;
112
+ old.type.params.ignoreHydrogensVariant = ignoreHydrogensVariant;
110
113
  old.type.params.quality = quality;
111
114
  old.type.params.ignoreLight = ignoreLight;
112
115
  old.type.params.material = material;
@@ -382,9 +385,10 @@ var StructureComponentManager = /** @class */ (function (_super) {
382
385
  var _this = this;
383
386
  if (components.length === 0)
384
387
  return;
385
- var _a = this.state.options, showHydrogens = _a.showHydrogens, quality = _a.visualQuality, ignoreLight = _a.ignoreLight, material = _a.materialStyle, clip = _a.clipObjects;
386
- var ignoreHydrogens = !showHydrogens;
387
- var typeParams = { ignoreHydrogens: ignoreHydrogens, quality: quality, ignoreLight: ignoreLight, material: material, clip: clip };
388
+ var _a = this.state.options, hydrogens = _a.hydrogens, quality = _a.visualQuality, ignoreLight = _a.ignoreLight, material = _a.materialStyle, clip = _a.clipObjects;
389
+ var ignoreHydrogens = hydrogens !== 'all';
390
+ var ignoreHydrogensVariant = hydrogens === 'only-polar' ? 'non-polar' : 'all';
391
+ var typeParams = { ignoreHydrogens: ignoreHydrogens, ignoreHydrogensVariant: ignoreHydrogensVariant, quality: quality, ignoreLight: ignoreLight, material: material, clip: clip };
388
392
  return this.plugin.dataTransaction(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
389
393
  var _i, components_9, component;
390
394
  return tslib_1.__generator(this, function (_a) {
@@ -445,16 +449,17 @@ var StructureComponentManager = /** @class */ (function (_super) {
445
449
  var _this = this;
446
450
  return tslib_1.__generator(this, function (_a) {
447
451
  return [2 /*return*/, this.plugin.dataTransaction(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
448
- var xs, _a, showHydrogens, quality, ignoreLight, material, clip, ignoreHydrogens, typeParams, componentKey, _i, xs_1, s, component;
452
+ var xs, _a, hydrogens, quality, ignoreLight, material, clip, ignoreHydrogens, ignoreHydrogensVariant, typeParams, componentKey, _i, xs_1, s, component;
449
453
  return tslib_1.__generator(this, function (_b) {
450
454
  switch (_b.label) {
451
455
  case 0:
452
456
  xs = structures || this.currentStructures;
453
457
  if (xs.length === 0)
454
458
  return [2 /*return*/];
455
- _a = this.state.options, showHydrogens = _a.showHydrogens, quality = _a.visualQuality, ignoreLight = _a.ignoreLight, material = _a.materialStyle, clip = _a.clipObjects;
456
- ignoreHydrogens = !showHydrogens;
457
- typeParams = { ignoreHydrogens: ignoreHydrogens, quality: quality, ignoreLight: ignoreLight, material: material, clip: clip };
459
+ _a = this.state.options, hydrogens = _a.hydrogens, quality = _a.visualQuality, ignoreLight = _a.ignoreLight, material = _a.materialStyle, clip = _a.clipObjects;
460
+ ignoreHydrogens = hydrogens !== 'all';
461
+ ignoreHydrogensVariant = hydrogens === 'only-polar' ? 'non-polar' : 'all';
462
+ typeParams = { ignoreHydrogens: ignoreHydrogens, ignoreHydrogensVariant: ignoreHydrogensVariant, quality: quality, ignoreLight: ignoreLight, material: material, clip: clip };
458
463
  componentKey = mol_util_1.UUID.create22();
459
464
  _i = 0, xs_1 = xs;
460
465
  _b.label = 1;
@@ -628,9 +633,9 @@ var StructureComponentManager = /** @class */ (function (_super) {
628
633
  exports.StructureComponentManager = StructureComponentManager;
629
634
  (function (StructureComponentManager) {
630
635
  StructureComponentManager.OptionsParams = {
631
- showHydrogens: param_definition_1.ParamDefinition.Boolean(true, { description: 'Toggle display of hydrogen atoms in representations' }),
636
+ hydrogens: param_definition_1.ParamDefinition.Select('all', [['all', 'Show All'], ['hide-all', 'Hide All'], ['only-polar', 'Only Polar']], { description: 'Determine display of hydrogen atoms in representations' }),
632
637
  visualQuality: param_definition_1.ParamDefinition.Select('auto', base_1.VisualQualityOptions, { description: 'Control the visual/rendering quality of representations' }),
633
- ignoreLight: param_definition_1.ParamDefinition.Boolean(false, { description: 'Ignore light for stylized rendering of representtions' }),
638
+ ignoreLight: param_definition_1.ParamDefinition.Boolean(false, { description: 'Ignore light for stylized rendering of representations' }),
634
639
  materialStyle: material_1.Material.getParam(),
635
640
  clipObjects: param_definition_1.ParamDefinition.Group(clip_1.Clip.Params),
636
641
  interactions: param_definition_1.ParamDefinition.Group(interactions_1.InteractionsProvider.defaultParams, { label: 'Non-covalent Interactions' }),
@@ -8,7 +8,6 @@ import { StructureElement } from '../../mol-model/structure';
8
8
  import { Volume } from '../../mol-model/volume';
9
9
  import { PluginContext } from '../../mol-plugin/context';
10
10
  import { VolumeRepresentationRegistry } from '../../mol-repr/volume/registry';
11
- import { VolumeParams } from '../../mol-repr/volume/representation';
12
11
  import { StateTransformer } from '../../mol-state';
13
12
  import { ColorTheme } from '../../mol-theme/color';
14
13
  import { SizeTheme } from '../../mol-theme/size';
@@ -132,7 +131,7 @@ declare const ThemeStrengthRepresentation3D: StateTransformer<SO.Molecule.Struct
132
131
  substanceStrength: number;
133
132
  }>>;
134
133
  export declare namespace VolumeRepresentation3DHelpers {
135
- function getDefaultParams(ctx: PluginContext, name: VolumeRepresentationRegistry.BuiltIn, volume: Volume, volumeParams?: Partial<PD.Values<VolumeParams>>): StateTransformer.Params<VolumeRepresentation3D>;
134
+ function getDefaultParams(ctx: PluginContext, name: VolumeRepresentationRegistry.BuiltIn, volume: Volume, volumeParams?: Partial<PD.Values<PD.Params>>, colorName?: ColorTheme.BuiltIn, colorParams?: Partial<ColorTheme.Props>, sizeName?: SizeTheme.BuiltIn, sizeParams?: Partial<SizeTheme.Props>): StateTransformer.Params<VolumeRepresentation3D>;
136
135
  function getDefaultParamsStatic(ctx: PluginContext, name: VolumeRepresentationRegistry.BuiltIn, volumeParams?: Partial<PD.Values<PD.Params>>, colorName?: ColorTheme.BuiltIn, colorParams?: Partial<ColorTheme.Props>, sizeName?: SizeTheme.BuiltIn, sizeParams?: Partial<SizeTheme.Props>): StateTransformer.Params<VolumeRepresentation3D>;
137
136
  function getDescription(props: any): string | undefined;
138
137
  }
@@ -805,16 +805,15 @@ exports.ThemeStrengthRepresentation3D = ThemeStrengthRepresentation3D;
805
805
  //
806
806
  var VolumeRepresentation3DHelpers;
807
807
  (function (VolumeRepresentation3DHelpers) {
808
- function getDefaultParams(ctx, name, volume, volumeParams) {
808
+ function getDefaultParams(ctx, name, volume, volumeParams, colorName, colorParams, sizeName, sizeParams) {
809
809
  var type = ctx.representation.volume.registry.get(name);
810
- var themeDataCtx = { volume: volume };
811
- var colorParams = ctx.representation.volume.themes.colorThemeRegistry.get(type.defaultColorTheme.name).getParams(themeDataCtx);
812
- var sizeParams = ctx.representation.volume.themes.sizeThemeRegistry.get(type.defaultSizeTheme.name).getParams(themeDataCtx);
810
+ var colorType = ctx.representation.volume.themes.colorThemeRegistry.get(colorName || type.defaultColorTheme.name);
811
+ var sizeType = ctx.representation.volume.themes.sizeThemeRegistry.get(sizeName || type.defaultSizeTheme.name);
813
812
  var volumeDefaultParams = param_definition_1.ParamDefinition.getDefaultValues(type.getParams(ctx.representation.volume.themes, volume));
814
813
  return ({
815
814
  type: { name: name, params: volumeParams ? tslib_1.__assign(tslib_1.__assign({}, volumeDefaultParams), volumeParams) : volumeDefaultParams },
816
- colorTheme: { name: type.defaultColorTheme.name, params: param_definition_1.ParamDefinition.getDefaultValues(colorParams) },
817
- sizeTheme: { name: type.defaultSizeTheme.name, params: param_definition_1.ParamDefinition.getDefaultValues(sizeParams) }
815
+ colorTheme: { name: colorType.name, params: colorParams ? tslib_1.__assign(tslib_1.__assign({}, colorType.defaultValues), colorParams) : colorType.defaultValues },
816
+ sizeTheme: { name: sizeType.name, params: sizeParams ? tslib_1.__assign(tslib_1.__assign({}, sizeType.defaultValues), sizeParams) : sizeType.defaultValues }
818
817
  });
819
818
  }
820
819
  VolumeRepresentation3DHelpers.getDefaultParams = getDefaultParams;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2020 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>
@@ -13,6 +13,7 @@ export { VolumeFromCube };
13
13
  export { VolumeFromDx };
14
14
  export { AssignColorVolume };
15
15
  export { VolumeFromDensityServerCif };
16
+ export { VolumeFromSegmentationCif };
16
17
  type VolumeFromCcp4 = typeof VolumeFromCcp4;
17
18
  declare const VolumeFromCcp4: import("../../mol-state/transformer").StateTransformer<SO.Format.Ccp4, SO.Volume.Data, PD.Normalize<{
18
19
  voxelSize: Vec3;
@@ -36,6 +37,15 @@ declare const VolumeFromDensityServerCif: import("../../mol-state/transformer").
36
37
  blockHeader: string | undefined;
37
38
  entryId: string;
38
39
  }>>;
40
+ type VolumeFromSegmentationCif = typeof VolumeFromSegmentationCif;
41
+ declare const VolumeFromSegmentationCif: import("../../mol-state/transformer").StateTransformer<SO.Format.Cif, SO.Volume.Data, PD.Normalize<{
42
+ blockHeader: string | undefined;
43
+ segmentLabels: PD.Normalize<{
44
+ id: any;
45
+ label: any;
46
+ }>[];
47
+ ownerId: string;
48
+ }>>;
39
49
  type AssignColorVolume = typeof AssignColorVolume;
40
50
  declare const AssignColorVolume: import("../../mol-state/transformer").StateTransformer<SO.Volume.Data, SO.Volume.Data, PD.Normalize<{
41
51
  ref: string;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
4
4
  *
5
5
  * @author David Sehnal <david.sehnal@gmail.com>
6
6
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.VolumeFromDensityServerCif = exports.AssignColorVolume = exports.VolumeFromDx = exports.VolumeFromCube = exports.VolumeFromDsn6 = exports.VolumeFromCcp4 = void 0;
9
+ exports.VolumeFromSegmentationCif = exports.VolumeFromDensityServerCif = exports.AssignColorVolume = exports.VolumeFromDx = exports.VolumeFromCube = exports.VolumeFromDsn6 = exports.VolumeFromCcp4 = void 0;
10
10
  var tslib_1 = require("tslib");
11
11
  var cif_1 = require("../../mol-io/reader/cif");
12
12
  var linear_algebra_1 = require("../../mol-math/linear-algebra");
@@ -19,6 +19,7 @@ var objects_1 = require("../objects");
19
19
  var cube_1 = require("../../mol-model-formats/volume/cube");
20
20
  var dx_1 = require("../../mol-model-formats/volume/dx");
21
21
  var mol_state_1 = require("../../mol-state");
22
+ var segmentation_1 = require("../../mol-model-formats/volume/segmentation");
22
23
  var VolumeFromCcp4 = objects_1.PluginStateTransform.BuiltIn({
23
24
  name: 'volume-from-ccp4',
24
25
  display: { name: 'Volume from CCP4/MRC/MAP', description: 'Create Volume from CCP4/MRC/MAP data' },
@@ -201,6 +202,58 @@ var VolumeFromDensityServerCif = objects_1.PluginStateTransform.BuiltIn({
201
202
  }
202
203
  });
203
204
  exports.VolumeFromDensityServerCif = VolumeFromDensityServerCif;
205
+ var VolumeFromSegmentationCif = objects_1.PluginStateTransform.BuiltIn({
206
+ name: 'volume-from-segmentation-cif',
207
+ display: { name: 'Volume from Segmentation CIF' },
208
+ from: objects_1.PluginStateObject.Format.Cif,
209
+ to: objects_1.PluginStateObject.Volume.Data,
210
+ params: function (a) {
211
+ var blocks = a === null || a === void 0 ? void 0 : a.data.blocks.slice(1);
212
+ var blockHeaderParam = blocks ?
213
+ param_definition_1.ParamDefinition.Optional(param_definition_1.ParamDefinition.Select(blocks[0] && blocks[0].header, blocks.map(function (b) { return [b.header, b.header]; }), { description: 'Header of the block to parse' }))
214
+ : param_definition_1.ParamDefinition.Optional(param_definition_1.ParamDefinition.Text(void 0, { description: 'Header of the block to parse. If none is specifed, the 1st data block in the file is used.' }));
215
+ return {
216
+ blockHeader: blockHeaderParam,
217
+ segmentLabels: param_definition_1.ParamDefinition.ObjectList({ id: param_definition_1.ParamDefinition.Numeric(-1), label: param_definition_1.ParamDefinition.Text('') }, function (s) { return "".concat(s.id, " = ").concat(s.label); }, { description: 'Mapping of segment IDs to segment labels' }),
218
+ ownerId: param_definition_1.ParamDefinition.Text('', { isHidden: true, description: 'Reference to the object which manages this volume' }),
219
+ };
220
+ }
221
+ })({
222
+ isApplicable: function (a) { return a.data.blocks.length > 0; },
223
+ apply: function (_a) {
224
+ var _this = this;
225
+ var a = _a.a, params = _a.params;
226
+ return mol_task_1.Task.create('Parse segmentation CIF', function (ctx) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
227
+ var header, block, segmentationCif, segmentLabels, _i, _a, segment, volume, _b, x, y, z, props;
228
+ return tslib_1.__generator(this, function (_c) {
229
+ switch (_c.label) {
230
+ case 0:
231
+ header = params.blockHeader || a.data.blocks[1].header;
232
+ block = a.data.blocks.find(function (b) { return b.header === header; });
233
+ if (!block)
234
+ throw new Error("Data block '".concat([header], "' not found."));
235
+ segmentationCif = cif_1.CIF.schema.segmentation(block);
236
+ segmentLabels = {};
237
+ for (_i = 0, _a = params.segmentLabels; _i < _a.length; _i++) {
238
+ segment = _a[_i];
239
+ segmentLabels[segment.id] = segment.label;
240
+ }
241
+ return [4 /*yield*/, (0, segmentation_1.volumeFromSegmentationData)(segmentationCif, { segmentLabels: segmentLabels, ownerId: params.ownerId }).runInContext(ctx)];
242
+ case 1:
243
+ volume = _c.sent();
244
+ _b = volume.grid.cells.space.dimensions, x = _b[0], y = _b[1], z = _b[2];
245
+ props = { label: segmentationCif.volume_data_3d_info.name.value(0), description: "Segmentation ".concat(x, "\u00D7").concat(y, "\u00D7").concat(z) };
246
+ return [2 /*return*/, new objects_1.PluginStateObject.Volume.Data(volume, props)];
247
+ }
248
+ });
249
+ }); });
250
+ },
251
+ dispose: function (_a) {
252
+ var b = _a.b;
253
+ b === null || b === void 0 ? void 0 : b.data.customProperties.dispose();
254
+ }
255
+ });
256
+ exports.VolumeFromSegmentationCif = VolumeFromSegmentationCif;
204
257
  var AssignColorVolume = objects_1.PluginStateTransform.BuiltIn({
205
258
  name: 'assign-color-volume',
206
259
  display: { name: 'Assign Color Volume', description: 'Assigns another volume to be available for coloring.' },
@@ -34,6 +34,7 @@ export declare class LineGraphComponent extends React.Component<any, LineGraphCo
34
34
  private normalizePoint;
35
35
  private unNormalizePoint;
36
36
  private refCallBack;
37
+ private renderHistogram;
37
38
  private renderPoints;
38
39
  private renderLines;
39
40
  }
@@ -4,13 +4,16 @@ exports.LineGraphComponent = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var jsx_runtime_1 = require("react/jsx-runtime");
6
6
  /**
7
- * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
7
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
8
8
  *
9
9
  * @author Paul Luna <paulluna0215@gmail.com>
10
+ * @author David Sehnal <david.sehnal@gmail.com>
10
11
  */
11
12
  var point_component_1 = require("./point-component");
12
13
  var React = tslib_1.__importStar(require("react"));
13
14
  var linear_algebra_1 = require("../../../mol-math/linear-algebra");
15
+ var volume_1 = require("../../../mol-model/volume");
16
+ var array_1 = require("../../../mol-util/array");
14
17
  var LineGraphComponent = /** @class */ (function (_super) {
15
18
  tslib_1.__extends(LineGraphComponent, _super);
16
19
  function LineGraphComponent(props) {
@@ -109,8 +112,9 @@ var LineGraphComponent = /** @class */ (function (_super) {
109
112
  LineGraphComponent.prototype.render = function () {
110
113
  var points = this.renderPoints();
111
114
  var lines = this.renderLines();
115
+ var histogram = this.renderHistogram();
112
116
  return ([
113
- (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("svg", tslib_1.__assign({ className: "msp-canvas", ref: this.refCallBack, viewBox: "0 0 ".concat(this.width + this.padding, " ").concat(this.height + this.padding), onMouseMove: this.handleDrag, onMouseUp: this.handlePointUpdate, onMouseLeave: this.handleLeave, onMouseEnter: this.handleEnter, tabIndex: 0, onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, onDoubleClick: this.handleDoubleClick }, { children: [(0, jsx_runtime_1.jsxs)("g", tslib_1.__assign({ stroke: "black", fill: "black" }, { children: [lines, points] })), (0, jsx_runtime_1.jsx)("g", { className: "ghost-points", stroke: "black", fill: "black" })] })) }, "LineGraph"),
117
+ (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("svg", tslib_1.__assign({ className: "msp-canvas", ref: this.refCallBack, viewBox: "0 0 ".concat(this.width + this.padding, " ").concat(this.height + this.padding), onMouseMove: this.handleDrag, onMouseUp: this.handlePointUpdate, onMouseLeave: this.handleLeave, onMouseEnter: this.handleEnter, tabIndex: 0, onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, onDoubleClick: this.handleDoubleClick }, { children: [(0, jsx_runtime_1.jsxs)("g", tslib_1.__assign({ stroke: "black", fill: "black" }, { children: [histogram, lines, points] })), (0, jsx_runtime_1.jsx)("g", { className: "ghost-points", stroke: "black", fill: "black" })] })) }, "LineGraph"),
114
118
  (0, jsx_runtime_1.jsx)("div", { id: "modal-root" }, "modal")
115
119
  ]);
116
120
  };
@@ -241,11 +245,11 @@ var LineGraphComponent = /** @class */ (function (_super) {
241
245
  document.removeEventListener('mouseup', this.handlePointUpdate, true);
242
246
  };
243
247
  LineGraphComponent.prototype.normalizePoint = function (point) {
244
- var min = this.padding / 2;
245
- var maxX = this.width + min;
246
- var maxY = this.height + min;
247
- var normalizedX = (point[0] * (maxX - min)) + min;
248
- var normalizedY = (point[1] * (maxY - min)) + min;
248
+ var offset = this.padding / 2;
249
+ var maxX = this.width + offset;
250
+ var maxY = this.height + offset;
251
+ var normalizedX = (point[0] * (maxX - offset)) + offset;
252
+ var normalizedY = (point[1] * (maxY - offset)) + offset;
249
253
  var reverseY = (this.height + this.padding) - normalizedY;
250
254
  var newPoint = linear_algebra_1.Vec2.create(normalizedX, reverseY);
251
255
  return newPoint;
@@ -264,6 +268,23 @@ var LineGraphComponent = /** @class */ (function (_super) {
264
268
  this.myRef = element;
265
269
  }
266
270
  };
271
+ LineGraphComponent.prototype.renderHistogram = function () {
272
+ if (!this.props.volume)
273
+ return null;
274
+ var histogram = volume_1.Grid.getHistogram(this.props.volume.grid, 40);
275
+ var bars = [];
276
+ var N = histogram.counts.length;
277
+ var w = this.width / N;
278
+ var offset = this.padding / 2;
279
+ var max = (0, array_1.arrayMax)(histogram.counts) || 1;
280
+ for (var i = 0; i < N; i++) {
281
+ var x = this.width * i / (N - 1) + offset;
282
+ var y1 = this.height + offset;
283
+ var y2 = this.height * (1 - histogram.counts[i] / max) + offset;
284
+ bars.push((0, jsx_runtime_1.jsx)("line", { x1: x, x2: x, y1: y1, y2: y2, stroke: "#ded9ca", strokeWidth: w }, "histogram".concat(i)));
285
+ }
286
+ return bars;
287
+ };
267
288
  LineGraphComponent.prototype.renderPoints = function () {
268
289
  var points = [];
269
290
  var point;
@@ -278,19 +299,18 @@ var LineGraphComponent = /** @class */ (function (_super) {
278
299
  LineGraphComponent.prototype.renderLines = function () {
279
300
  var points = [];
280
301
  var lines = [];
281
- var min;
282
302
  var maxX;
283
303
  var maxY;
284
304
  var normalizedX;
285
305
  var normalizedY;
286
306
  var reverseY;
307
+ var o = this.padding / 2;
287
308
  for (var _i = 0, _a = this.state.points; _i < _a.length; _i++) {
288
309
  var point = _a[_i];
289
- min = this.padding / 2;
290
- maxX = this.width + min;
291
- maxY = this.height + min;
292
- normalizedX = (point[0] * (maxX - min)) + min;
293
- normalizedY = (point[1] * (maxY - min)) + min;
310
+ maxX = this.width + o;
311
+ maxY = this.height + this.padding;
312
+ normalizedX = (point[0] * (maxX - o)) + o;
313
+ normalizedY = (point[1] * (maxY - o)) + o;
294
314
  reverseY = this.height + this.padding - normalizedY;
295
315
  points.push(linear_algebra_1.Vec2.create(normalizedX, reverseY));
296
316
  }
@@ -94,6 +94,7 @@ export declare class LineGraphControl extends React.PureComponent<ParamProps<PD.
94
94
  isOverPoint: boolean;
95
95
  message: string;
96
96
  };
97
+ private pointToLabel;
97
98
  onHover: (point?: Vec2) => void;
98
99
  onDrag: (point: Vec2) => void;
99
100
  onChange: (value: PD.LineGraph['defaultValue']) => void;
@@ -280,13 +280,14 @@ var LineGraphControl = /** @class */ (function (_super) {
280
280
  _this.onHover = function (point) {
281
281
  _this.setState({ isOverPoint: !_this.state.isOverPoint });
282
282
  if (point) {
283
- _this.setState({ message: "(".concat(point[0].toFixed(2), ", ").concat(point[1].toFixed(2), ")") });
284
- return;
283
+ _this.setState({ message: _this.pointToLabel(point) });
284
+ }
285
+ else {
286
+ _this.setState({ message: "".concat(_this.props.value.length, " points") });
285
287
  }
286
- _this.setState({ message: "".concat(_this.props.value.length, " points") });
287
288
  };
288
289
  _this.onDrag = function (point) {
289
- _this.setState({ message: "(".concat(point[0].toFixed(2), ", ").concat(point[1].toFixed(2), ")") });
290
+ _this.setState({ message: _this.pointToLabel(point) });
290
291
  };
291
292
  _this.onChange = function (value) {
292
293
  _this.props.onChange({ name: _this.props.name, param: _this.props.param, value: value });
@@ -297,9 +298,25 @@ var LineGraphControl = /** @class */ (function (_super) {
297
298
  };
298
299
  return _this;
299
300
  }
301
+ LineGraphControl.prototype.pointToLabel = function (point) {
302
+ var _a, _b;
303
+ if (!point)
304
+ return '';
305
+ var volume = (_b = (_a = this.props.param).getVolume) === null || _b === void 0 ? void 0 : _b.call(_a);
306
+ if (volume) {
307
+ var _c = volume.grid.stats, min = _c.min, max = _c.max, mean = _c.mean, sigma = _c.sigma;
308
+ var v = min + (max - min) * point[0];
309
+ var s = (v - mean) / sigma;
310
+ return "(".concat(v.toFixed(2), " | ").concat(s.toFixed(2), "\u03C3, ").concat(point[1].toFixed(2), ")");
311
+ }
312
+ else {
313
+ return "(".concat(point[0].toFixed(2), ", ").concat(point[1].toFixed(2), ")");
314
+ }
315
+ };
300
316
  LineGraphControl.prototype.render = function () {
317
+ var _a, _b;
301
318
  var label = this.props.param.label || (0, string_1.camelCaseToWords)(this.props.name);
302
- return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.ControlRow, { label: label, control: (0, jsx_runtime_1.jsx)("button", tslib_1.__assign({ onClick: this.toggleExpanded, disabled: this.props.isDisabled }, { children: "".concat(this.state.message) })) }), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-control-offset', style: { display: this.state.isExpanded ? 'block' : 'none' } }, { children: (0, jsx_runtime_1.jsx)(line_graph_component_1.LineGraphComponent, { data: this.props.param.defaultValue, onChange: this.onChange, onHover: this.onHover, onDrag: this.onDrag }) }))] });
319
+ return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.ControlRow, { label: label, control: (0, jsx_runtime_1.jsx)("button", tslib_1.__assign({ onClick: this.toggleExpanded, disabled: this.props.isDisabled }, { children: "".concat(this.state.message) })) }), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-control-offset', style: { display: this.state.isExpanded ? 'block' : 'none', marginTop: 1 } }, { children: (0, jsx_runtime_1.jsx)(line_graph_component_1.LineGraphComponent, { data: this.props.value, volume: (_b = (_a = this.props.param).getVolume) === null || _b === void 0 ? void 0 : _b.call(_a), onChange: this.onChange, onHover: this.onHover, onDrag: this.onDrag }) }))] });
303
320
  };
304
321
  return LineGraphControl;
305
322
  }(React.PureComponent));
@@ -5,8 +5,11 @@
5
5
  * @author David Sehnal <david.sehnal@gmail.com>
6
6
  */
7
7
  import * as React from 'react';
8
- import { StructureElement } from '../../mol-model/structure';
8
+ import { Subject } from 'rxjs';
9
+ import { StructureElement, Unit } from '../../mol-model/structure';
10
+ import { Representation } from '../../mol-repr/representation';
9
11
  import { ButtonsType, ModifiersKeys } from '../../mol-util/input/input-observer';
12
+ import { MarkerAction } from '../../mol-util/marker-action';
10
13
  import { PluginUIComponent } from '../base';
11
14
  import { SequenceWrapper } from './wrapper';
12
15
  type SequenceProps = {
@@ -15,12 +18,17 @@ type SequenceProps = {
15
18
  hideSequenceNumbers?: boolean;
16
19
  };
17
20
  export declare class Sequence<P extends SequenceProps> extends PluginUIComponent<P> {
18
- private parentDiv;
19
- private lastMouseOverSeqIdx;
20
- private highlightQueue;
21
- private lociHighlightProvider;
22
- private lociSelectionProvider;
23
- private get sequenceNumberPeriod();
21
+ protected parentDiv: React.RefObject<HTMLDivElement>;
22
+ protected lastMouseOverSeqIdx: number;
23
+ protected highlightQueue: Subject<{
24
+ seqIdx: number;
25
+ buttons: number;
26
+ button: number;
27
+ modifiers: ModifiersKeys;
28
+ }>;
29
+ protected lociHighlightProvider: (loci: Representation.Loci, action: MarkerAction) => void;
30
+ protected lociSelectionProvider: (loci: Representation.Loci, action: MarkerAction) => void;
31
+ protected get sequenceNumberPeriod(): number;
24
32
  componentDidMount(): void;
25
33
  componentWillUnmount(): void;
26
34
  getLoci(seqIdx: number | undefined): StructureElement.Loci | undefined;
@@ -28,18 +36,18 @@ export declare class Sequence<P extends SequenceProps> extends PluginUIComponent
28
36
  hover(loci: StructureElement.Loci | undefined, buttons: ButtonsType, button: ButtonsType.Flag, modifiers: ModifiersKeys): void;
29
37
  click(loci: StructureElement.Loci | undefined, buttons: ButtonsType, button: ButtonsType.Flag, modifiers: ModifiersKeys): void;
30
38
  contextMenu: (e: React.MouseEvent) => void;
31
- private mouseDownLoci;
39
+ protected mouseDownLoci: StructureElement.Loci | undefined;
32
40
  mouseDown: (e: React.MouseEvent) => void;
33
41
  mouseUp: (e: React.MouseEvent) => void;
34
- private getBackgroundColor;
35
- private getResidueClass;
36
- private residue;
37
- private getSequenceNumberClass;
38
- private location;
39
- private getSequenceNumber;
40
- private padSeqNum;
41
- private getSequenceNumberSpan;
42
- private updateMarker;
42
+ protected getBackgroundColor(marker: number): "" | "rgb(51, 255, 25)" | "rgb(255, 102, 153)";
43
+ protected getResidueClass(seqIdx: number, label: string): string;
44
+ protected residue(seqIdx: number, label: string, marker: number): JSX.Element;
45
+ protected getSequenceNumberClass(seqIdx: number, seqNum: string, label: string): string;
46
+ protected location: StructureElement.Location<Unit>;
47
+ protected getSequenceNumber(seqIdx: number): string;
48
+ protected padSeqNum(n: string): string;
49
+ protected getSequenceNumberSpan(seqIdx: number, label: string): JSX.Element;
50
+ protected updateMarker(): void;
43
51
  mouseMove: (e: React.MouseEvent) => void;
44
52
  mouseLeave: (e: React.MouseEvent) => void;
45
53
  render(): JSX.Element;