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
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author Adam Midlik <midlik@gmail.com>
5
+ */
6
+ import { __awaiter, __generator } from "tslib";
7
+ import { PluginStateObject, PluginStateTransform } from '../../mol-plugin-state/objects';
8
+ import { StateTransformer } from '../../mol-state';
9
+ import { Task } from '../../mol-task';
10
+ import { VolsegEntry, VolsegEntryData, createVolsegEntryParams } from './entry-root';
11
+ import { VolsegState, VolsegStateParams, VOLSEG_STATE_FROM_ENTRY_TRANSFORMER_NAME } from './entry-state';
12
+ import { VolsegGlobalState, VolsegGlobalStateData, VolsegGlobalStateParams } from './global-state';
13
+ export var VolsegEntryFromRoot = PluginStateTransform.BuiltIn({
14
+ name: 'volseg-entry-from-root',
15
+ display: { name: 'Vol & Seg Entry', description: 'Vol & Seg Entry' },
16
+ from: PluginStateObject.Root,
17
+ to: VolsegEntry,
18
+ params: function (a, plugin) { return createVolsegEntryParams(plugin); },
19
+ })({
20
+ apply: function (_a, plugin) {
21
+ var _this = this;
22
+ var a = _a.a, params = _a.params;
23
+ return Task.create('Load Vol & Seg Entry', function () { return __awaiter(_this, void 0, void 0, function () {
24
+ var data;
25
+ return __generator(this, function (_a) {
26
+ switch (_a.label) {
27
+ case 0: return [4 /*yield*/, VolsegEntryData.create(plugin, params)];
28
+ case 1:
29
+ data = _a.sent();
30
+ return [2 /*return*/, new VolsegEntry(data, { label: data.entryId, description: 'Vol & Seg Entry' })];
31
+ }
32
+ });
33
+ }); });
34
+ },
35
+ update: function (_a) {
36
+ var b = _a.b, oldParams = _a.oldParams, newParams = _a.newParams;
37
+ Object.assign(newParams, oldParams);
38
+ console.error('Changing params of existing VolsegEntry node is not allowed');
39
+ return StateTransformer.UpdateResult.Unchanged;
40
+ }
41
+ });
42
+ export var VolsegStateFromEntry = PluginStateTransform.BuiltIn({
43
+ name: VOLSEG_STATE_FROM_ENTRY_TRANSFORMER_NAME,
44
+ display: { name: 'Vol & Seg Entry State', description: 'Vol & Seg Entry State' },
45
+ from: VolsegEntry,
46
+ to: VolsegState,
47
+ params: VolsegStateParams,
48
+ })({
49
+ apply: function (_a, plugin) {
50
+ var _this = this;
51
+ var a = _a.a, params = _a.params;
52
+ return Task.create('Create Vol & Seg Entry State', function () { return __awaiter(_this, void 0, void 0, function () {
53
+ return __generator(this, function (_a) {
54
+ return [2 /*return*/, new VolsegState(params, { label: 'State' })];
55
+ });
56
+ }); });
57
+ }
58
+ });
59
+ export var VolsegGlobalStateFromRoot = PluginStateTransform.BuiltIn({
60
+ name: 'volseg-global-state-from-root',
61
+ display: { name: 'Vol & Seg Global State', description: 'Vol & Seg Global State' },
62
+ from: PluginStateObject.Root,
63
+ to: VolsegGlobalState,
64
+ params: VolsegGlobalStateParams,
65
+ })({
66
+ apply: function (_a, plugin) {
67
+ var _this = this;
68
+ var a = _a.a, params = _a.params;
69
+ return Task.create('Create Vol & Seg Global State', function () { return __awaiter(_this, void 0, void 0, function () {
70
+ var data;
71
+ return __generator(this, function (_a) {
72
+ data = new VolsegGlobalStateData(plugin, params);
73
+ return [2 /*return*/, new VolsegGlobalState(data, { label: 'Global State', description: 'Vol & Seg Global State' })];
74
+ });
75
+ }); });
76
+ },
77
+ update: function (_a) {
78
+ var b = _a.b, oldParams = _a.oldParams, newParams = _a.newParams;
79
+ b.data.currentState.next(newParams);
80
+ return StateTransformer.UpdateResult.Updated;
81
+ }
82
+ });
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author Adam Midlik <midlik@gmail.com>
5
+ */
6
+ /// <reference types="react" />
7
+ import { CollapsableControls, CollapsableState } from '../../mol-plugin-ui/base';
8
+ import { VolsegEntry } from './entry-root';
9
+ import { VolsegGlobalStateData } from './global-state';
10
+ interface VolsegUIData {
11
+ globalState?: VolsegGlobalStateData;
12
+ availableNodes: VolsegEntry[];
13
+ activeNode?: VolsegEntry;
14
+ }
15
+ declare namespace VolsegUIData {
16
+ function changeAvailableNodes(data: VolsegUIData, newNodes: VolsegEntry[]): VolsegUIData;
17
+ function changeActiveNode(data: VolsegUIData, newActiveRef: string): VolsegUIData;
18
+ function equals(data1: VolsegUIData, data2: VolsegUIData): boolean;
19
+ }
20
+ export declare class VolsegUI extends CollapsableControls<{}, {
21
+ data: VolsegUIData;
22
+ }> {
23
+ protected defaultState(): CollapsableState & {
24
+ data: VolsegUIData;
25
+ };
26
+ protected renderControls(): JSX.Element | null;
27
+ componentDidMount(): void;
28
+ }
29
+ export {};
@@ -0,0 +1,229 @@
1
+ import { __assign, __awaiter, __extends, __generator, __rest } from "tslib";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
5
+ *
6
+ * @author Adam Midlik <midlik@gmail.com>
7
+ */
8
+ import { useCallback, useEffect, useRef, useState } from 'react';
9
+ import { CollapsableControls } from '../../mol-plugin-ui/base';
10
+ import { Button, ControlRow, ExpandGroup, IconButton } from '../../mol-plugin-ui/controls/common';
11
+ import * as Icons from '../../mol-plugin-ui/controls/icons';
12
+ import { ParameterControls } from '../../mol-plugin-ui/controls/parameters';
13
+ import { Slider } from '../../mol-plugin-ui/controls/slider';
14
+ import { useBehavior } from '../../mol-plugin-ui/hooks/use-behavior';
15
+ import { UpdateTransformControl } from '../../mol-plugin-ui/state/update-transform';
16
+ import { shallowEqualArrays } from '../../mol-util';
17
+ import { ParamDefinition as PD } from '../../mol-util/param-definition';
18
+ import { sleep } from '../../mol-util/sleep';
19
+ import { VolsegEntry } from './entry-root';
20
+ import { SimpleVolumeParams } from './entry-volume';
21
+ import { VolsegGlobalState, VolsegGlobalStateParams } from './global-state';
22
+ import { isDefined } from './helpers';
23
+ var VolsegUIData;
24
+ (function (VolsegUIData) {
25
+ function changeAvailableNodes(data, newNodes) {
26
+ var _a;
27
+ var newActiveNode = newNodes.length > data.availableNodes.length ?
28
+ newNodes[newNodes.length - 1]
29
+ : (_a = newNodes.find(function (node) { var _a; return node.data.ref === ((_a = data.activeNode) === null || _a === void 0 ? void 0 : _a.data.ref); })) !== null && _a !== void 0 ? _a : newNodes[0];
30
+ return __assign(__assign({}, data), { availableNodes: newNodes, activeNode: newActiveNode });
31
+ }
32
+ VolsegUIData.changeAvailableNodes = changeAvailableNodes;
33
+ function changeActiveNode(data, newActiveRef) {
34
+ var _a;
35
+ var newActiveNode = (_a = data.availableNodes.find(function (node) { return node.data.ref === newActiveRef; })) !== null && _a !== void 0 ? _a : data.availableNodes[0];
36
+ return __assign(__assign({}, data), { availableNodes: data.availableNodes, activeNode: newActiveNode });
37
+ }
38
+ VolsegUIData.changeActiveNode = changeActiveNode;
39
+ function equals(data1, data2) {
40
+ return shallowEqualArrays(data1.availableNodes, data2.availableNodes) && data1.activeNode === data2.activeNode && data1.globalState === data2.globalState;
41
+ }
42
+ VolsegUIData.equals = equals;
43
+ })(VolsegUIData || (VolsegUIData = {}));
44
+ var VolsegUI = /** @class */ (function (_super) {
45
+ __extends(VolsegUI, _super);
46
+ function VolsegUI() {
47
+ return _super !== null && _super.apply(this, arguments) || this;
48
+ }
49
+ VolsegUI.prototype.defaultState = function () {
50
+ return {
51
+ header: 'Volume & Segmentation',
52
+ isCollapsed: true,
53
+ brand: { accent: 'orange', svg: Icons.ExtensionSvg },
54
+ data: {
55
+ globalState: undefined,
56
+ availableNodes: [],
57
+ activeNode: undefined,
58
+ }
59
+ };
60
+ };
61
+ VolsegUI.prototype.renderControls = function () {
62
+ var _this = this;
63
+ return _jsx(VolsegControls, { plugin: this.plugin, data: this.state.data, setData: function (d) { return _this.setState({ data: d }); } });
64
+ };
65
+ VolsegUI.prototype.componentDidMount = function () {
66
+ var _this = this;
67
+ this.setState({ isHidden: true, isCollapsed: false });
68
+ this.subscribe(this.plugin.state.data.events.changed, function (e) {
69
+ var _a, _b, _c;
70
+ var nodes = e.state.selectQ(function (q) { return q.ofType(VolsegEntry); }).map(function (cell) { return cell === null || cell === void 0 ? void 0 : cell.obj; }).filter(isDefined);
71
+ var isHidden = nodes.length === 0;
72
+ var newData = VolsegUIData.changeAvailableNodes(_this.state.data, nodes);
73
+ if (!((_a = _this.state.data.globalState) === null || _a === void 0 ? void 0 : _a.isRegistered())) {
74
+ var globalState = (_c = (_b = e.state.selectQ(function (q) { return q.ofType(VolsegGlobalState); })[0]) === null || _b === void 0 ? void 0 : _b.obj) === null || _c === void 0 ? void 0 : _c.data;
75
+ if (globalState)
76
+ newData.globalState = globalState;
77
+ }
78
+ if (!VolsegUIData.equals(_this.state.data, newData) || _this.state.isHidden !== isHidden) {
79
+ _this.setState({ data: newData, isHidden: isHidden });
80
+ }
81
+ });
82
+ };
83
+ return VolsegUI;
84
+ }(CollapsableControls));
85
+ export { VolsegUI };
86
+ function VolsegControls(_a) {
87
+ var _this = this;
88
+ var _b;
89
+ var plugin = _a.plugin, data = _a.data, setData = _a.setData;
90
+ var entryData = (_b = data.activeNode) === null || _b === void 0 ? void 0 : _b.data;
91
+ if (!entryData) {
92
+ return _jsx("p", { children: "No data!" });
93
+ }
94
+ if (!data.globalState) {
95
+ return _jsx("p", { children: "No global state!" });
96
+ }
97
+ var params = {
98
+ /** Reference to the active VolsegEntry node */
99
+ entry: PD.Select(data.activeNode.data.ref, data.availableNodes.map(function (entry) { return [entry.data.ref, entry.data.entryId]; }))
100
+ };
101
+ var values = {
102
+ entry: data.activeNode.data.ref,
103
+ };
104
+ var globalState = useBehavior(data.globalState.currentState);
105
+ return _jsxs(_Fragment, { children: [_jsx(ParameterControls, { params: params, values: values, onChangeValues: function (next) { return setData(VolsegUIData.changeActiveNode(data, next.entry)); } }), _jsx(ExpandGroup, __assign({ header: 'Global options' }, { children: _jsx(WaitingParameterControls, { params: VolsegGlobalStateParams, values: globalState, onChangeValues: function (next) { return __awaiter(_this, void 0, void 0, function () { var _a; return __generator(this, function (_b) {
106
+ switch (_b.label) {
107
+ case 0: return [4 /*yield*/, ((_a = data.globalState) === null || _a === void 0 ? void 0 : _a.updateState(plugin, next))];
108
+ case 1: return [2 /*return*/, _b.sent()];
109
+ }
110
+ }); }); } }) })), _jsx(VolsegEntryControls, { entryData: entryData }, entryData.ref)] });
111
+ }
112
+ function VolsegEntryControls(_a) {
113
+ var _this = this;
114
+ var _b, _c, _d;
115
+ var entryData = _a.entryData;
116
+ var state = useBehavior(entryData.currentState);
117
+ var allSegments = entryData.metadata.allSegments;
118
+ var selectedSegment = entryData.metadata.getSegment(state.selectedSegment);
119
+ var visibleSegments = state.visibleSegments.map(function (seg) { return seg.segmentId; });
120
+ var visibleModels = state.visibleModels.map(function (model) { return model.pdbId; });
121
+ var allPdbs = entryData.pdbs;
122
+ return _jsxs(_Fragment, { children: [_jsx("div", __assign({ style: { fontWeight: 'bold', padding: 8, paddingTop: 6, paddingBottom: 4, overflow: 'hidden' } }, { children: (_c = (_b = entryData.metadata.raw.annotation) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : 'Unnamed Annotation' })), allPdbs.length > 0 && _jsx(ExpandGroup, __assign({ header: 'Fitted models in PDB', initiallyExpanded: true }, { children: allPdbs.map(function (pdb) {
123
+ return _jsx(WaitingButton, __assign({ onClick: function () { return entryData.actionShowFittedModel(visibleModels.includes(pdb) ? [] : [pdb]); }, style: { fontWeight: visibleModels.includes(pdb) ? 'bold' : undefined, textAlign: 'left', marginTop: 1 } }, { children: pdb }), pdb);
124
+ }) })), _jsx(VolumeControls, { entryData: entryData }), _jsxs(ExpandGroup, __assign({ header: 'Segmentation data', initiallyExpanded: true }, { children: [_jsx(ControlRow, { label: 'Opacity', control: _jsx(WaitingSlider, { min: 0, max: 1, value: state.segmentOpacity, step: 0.05, onChange: function (v) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
125
+ switch (_a.label) {
126
+ case 0: return [4 /*yield*/, entryData.actionSetOpacity(v)];
127
+ case 1: return [2 /*return*/, _a.sent()];
128
+ }
129
+ }); }); } }) }), allSegments.length > 0 && _jsxs(_Fragment, { children: [_jsx(WaitingButton, __assign({ onClick: function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
130
+ switch (_a.label) {
131
+ case 0: return [4 /*yield*/, sleep(20)];
132
+ case 1:
133
+ _a.sent();
134
+ return [4 /*yield*/, entryData.actionToggleAllSegments()];
135
+ case 2:
136
+ _a.sent();
137
+ return [2 /*return*/];
138
+ }
139
+ }); }); }, style: { marginTop: 1 } }, { children: "Toggle All segments" })), _jsx("div", __assign({ style: { maxHeight: 200, overflow: 'hidden', overflowY: 'auto', marginBlock: 1 } }, { children: allSegments.map(function (segment) {
140
+ var _a, _b;
141
+ return _jsxs("div", __assign({ style: { display: 'flex', marginBottom: 1 }, onMouseEnter: function () { return entryData.actionHighlightSegment(segment); }, onMouseLeave: function () { return entryData.actionHighlightSegment(); } }, { children: [_jsx(Button, __assign({ onClick: function () { return entryData.actionSelectSegment(segment !== selectedSegment ? segment.id : undefined); }, style: { fontWeight: segment.id === (selectedSegment === null || selectedSegment === void 0 ? void 0 : selectedSegment.id) ? 'bold' : undefined, marginRight: 1, flexGrow: 1, textAlign: 'left' } }, { children: _jsxs("div", __assign({ title: (_a = segment.biological_annotation.name) !== null && _a !== void 0 ? _a : 'Unnamed segment', style: { maxWidth: 240, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' } }, { children: [(_b = segment.biological_annotation.name) !== null && _b !== void 0 ? _b : 'Unnamed segment', " (", segment.id, ")"] })) })), _jsx(IconButton, { svg: visibleSegments.includes(segment.id) ? Icons.VisibilityOutlinedSvg : Icons.VisibilityOffOutlinedSvg, onClick: function () { return entryData.actionToggleSegment(segment.id); } })] }), segment.id);
142
+ }) }))] })] })), _jsx(ExpandGroup, __assign({ header: 'Selected segment annotation', initiallyExpanded: true }, { children: _jsxs("div", __assign({ style: { paddingTop: 4, paddingRight: 8, maxHeight: 300, overflow: 'hidden', overflowY: 'auto' } }, { children: [!selectedSegment && 'No segment selected', selectedSegment && _jsxs("b", { children: ["Segment ", selectedSegment.id, ":", _jsx("br", {}), (_d = selectedSegment.biological_annotation.name) !== null && _d !== void 0 ? _d : 'Unnamed segment'] }), selectedSegment === null || selectedSegment === void 0 ? void 0 : selectedSegment.biological_annotation.external_references.map(function (ref) {
143
+ return _jsxs("p", __assign({ style: { marginTop: 4 } }, { children: [_jsxs("small", { children: [ref.resource, ":", ref.accession] }), _jsx("br", {}), _jsx("b", { children: capitalize(ref.label) }), _jsx("br", {}), ref.description] }), ref.id);
144
+ })] })) }))] });
145
+ }
146
+ function VolumeControls(_a) {
147
+ var _this = this;
148
+ var _b, _c;
149
+ var entryData = _a.entryData;
150
+ var vol = useBehavior(entryData.currentVolume);
151
+ if (!vol)
152
+ return null;
153
+ var volumeValues = {
154
+ volumeType: vol.state.isHidden ? 'off' : (_b = vol.params) === null || _b === void 0 ? void 0 : _b.type.name,
155
+ opacity: (_c = vol.params) === null || _c === void 0 ? void 0 : _c.type.params.alpha,
156
+ };
157
+ return _jsxs(ExpandGroup, __assign({ header: 'Volume data', initiallyExpanded: true }, { children: [_jsx(WaitingParameterControls, { params: SimpleVolumeParams, values: volumeValues, onChangeValues: function (next) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
158
+ switch (_a.label) {
159
+ case 0: return [4 /*yield*/, sleep(20)];
160
+ case 1:
161
+ _a.sent();
162
+ return [4 /*yield*/, entryData.actionUpdateVolumeVisual(next)];
163
+ case 2:
164
+ _a.sent();
165
+ return [2 /*return*/];
166
+ }
167
+ }); }); } }), _jsx(ExpandGroup, __assign({ header: 'Detailed Volume Params', headerStyle: { marginTop: 1 } }, { children: _jsx(UpdateTransformControl, { state: entryData.plugin.state.data, transform: vol, customHeader: 'none' }) }))] }));
168
+ }
169
+ function WaitingSlider(_a) {
170
+ var value = _a.value, onChange = _a.onChange, etc = __rest(_a, ["value", "onChange"]);
171
+ var _b = useAsyncChange(value), changing = _b[0], sliderValue = _b[1], execute = _b[2];
172
+ return _jsx(Slider, __assign({ value: sliderValue, disabled: changing, onChange: function (newValue) { return execute(onChange, newValue); } }, etc));
173
+ }
174
+ function WaitingButton(_a) {
175
+ var onClick = _a.onClick, etc = __rest(_a, ["onClick"]);
176
+ var _b = useAsyncChange(undefined), changing = _b[0], _ = _b[1], execute = _b[2];
177
+ return _jsx(Button, __assign({ disabled: changing, onClick: function () { return execute(onClick, undefined); } }, etc, { children: etc.children }));
178
+ }
179
+ function WaitingParameterControls(_a) {
180
+ var values = _a.values, onChangeValues = _a.onChangeValues, etc = __rest(_a, ["values", "onChangeValues"]);
181
+ var _b = useAsyncChange(values), changing = _b[0], currentValues = _b[1], execute = _b[2];
182
+ return _jsx(ParameterControls, __assign({ isDisabled: changing, values: currentValues, onChangeValues: function (newValue) { return execute(onChangeValues, newValue); } }, etc));
183
+ }
184
+ function capitalize(text) {
185
+ var first = text.charAt(0);
186
+ var rest = text.slice(1);
187
+ return first.toUpperCase() + rest;
188
+ }
189
+ function useAsyncChange(initialValue) {
190
+ var _this = this;
191
+ var _a = useState(false), isExecuting = _a[0], setIsExecuting = _a[1];
192
+ var _b = useState(initialValue), value = _b[0], setValue = _b[1];
193
+ var isMounted = useRef(false);
194
+ useEffect(function () { return setValue(initialValue); }, [initialValue]);
195
+ useEffect(function () {
196
+ isMounted.current = true;
197
+ return function () { isMounted.current = false; };
198
+ }, []);
199
+ var execute = useCallback(function (func, val) { return __awaiter(_this, void 0, void 0, function () {
200
+ var err_1;
201
+ return __generator(this, function (_a) {
202
+ switch (_a.label) {
203
+ case 0:
204
+ setIsExecuting(true);
205
+ setValue(val);
206
+ _a.label = 1;
207
+ case 1:
208
+ _a.trys.push([1, 3, 4, 5]);
209
+ return [4 /*yield*/, func(val)];
210
+ case 2:
211
+ _a.sent();
212
+ return [3 /*break*/, 5];
213
+ case 3:
214
+ err_1 = _a.sent();
215
+ if (isMounted.current) {
216
+ setValue(initialValue);
217
+ }
218
+ throw err_1;
219
+ case 4:
220
+ if (isMounted.current) {
221
+ setIsExecuting(false);
222
+ }
223
+ return [7 /*endfinally*/];
224
+ case 5: return [2 /*return*/];
225
+ }
226
+ });
227
+ }); }, []);
228
+ return [isExecuting, value, execute];
229
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author Adam Midlik <midlik@gmail.com>
5
+ */
6
+ import { type Metadata } from './data';
7
+ export declare const DEFAULT_VOLSEG_SERVER = "https://molstarvolseg.ncbr.muni.cz/v2";
8
+ export declare class VolumeApiV2 {
9
+ volumeServerUrl: string;
10
+ constructor(volumeServerUrl?: string);
11
+ entryListUrl(maxEntries: number, keyword?: string): string;
12
+ metadataUrl(source: string, entryId: string): string;
13
+ volumeUrl(source: string, entryId: string, box: [[number, number, number], [number, number, number]] | null, maxPoints: number): string;
14
+ latticeUrl(source: string, entryId: string, segmentation: number, box: [[number, number, number], [number, number, number]] | null, maxPoints: number): string;
15
+ meshUrl_Json(source: string, entryId: string, segment: number, detailLevel: number): string;
16
+ meshUrl_Bcif(source: string, entryId: string, segment: number, detailLevel: number): string;
17
+ volumeInfoUrl(source: string, entryId: string): string;
18
+ getEntryList(maxEntries: number, keyword?: string): Promise<{
19
+ [source: string]: string[];
20
+ }>;
21
+ getMetadata(source: string, entryId: string): Promise<Metadata>;
22
+ }
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author Adam Midlik <midlik@gmail.com>
5
+ */
6
+ import { __awaiter, __generator } from "tslib";
7
+ export var DEFAULT_VOLSEG_SERVER = 'https://molstarvolseg.ncbr.muni.cz/v2';
8
+ var VolumeApiV2 = /** @class */ (function () {
9
+ function VolumeApiV2(volumeServerUrl) {
10
+ if (volumeServerUrl === void 0) { volumeServerUrl = DEFAULT_VOLSEG_SERVER; }
11
+ this.volumeServerUrl = volumeServerUrl.replace(/\/$/, ''); // trim trailing slash
12
+ }
13
+ VolumeApiV2.prototype.entryListUrl = function (maxEntries, keyword) {
14
+ return "".concat(this.volumeServerUrl, "/list_entries/").concat(maxEntries, "/").concat(keyword !== null && keyword !== void 0 ? keyword : '');
15
+ };
16
+ VolumeApiV2.prototype.metadataUrl = function (source, entryId) {
17
+ return "".concat(this.volumeServerUrl, "/").concat(source, "/").concat(entryId, "/metadata");
18
+ };
19
+ VolumeApiV2.prototype.volumeUrl = function (source, entryId, box, maxPoints) {
20
+ if (box) {
21
+ var _a = box[0], a1 = _a[0], a2 = _a[1], a3 = _a[2], _b = box[1], b1 = _b[0], b2 = _b[1], b3 = _b[2];
22
+ return "".concat(this.volumeServerUrl, "/").concat(source, "/").concat(entryId, "/volume/box/").concat(a1, "/").concat(a2, "/").concat(a3, "/").concat(b1, "/").concat(b2, "/").concat(b3, "?max_points=").concat(maxPoints);
23
+ }
24
+ else {
25
+ return "".concat(this.volumeServerUrl, "/").concat(source, "/").concat(entryId, "/volume/cell?max_points=").concat(maxPoints);
26
+ }
27
+ };
28
+ VolumeApiV2.prototype.latticeUrl = function (source, entryId, segmentation, box, maxPoints) {
29
+ if (box) {
30
+ var _a = box[0], a1 = _a[0], a2 = _a[1], a3 = _a[2], _b = box[1], b1 = _b[0], b2 = _b[1], b3 = _b[2];
31
+ return "".concat(this.volumeServerUrl, "/").concat(source, "/").concat(entryId, "/segmentation/box/").concat(segmentation, "/").concat(a1, "/").concat(a2, "/").concat(a3, "/").concat(b1, "/").concat(b2, "/").concat(b3, "?max_points=").concat(maxPoints);
32
+ }
33
+ else {
34
+ return "".concat(this.volumeServerUrl, "/").concat(source, "/").concat(entryId, "/segmentation/cell/").concat(segmentation, "?max_points=").concat(maxPoints);
35
+ }
36
+ };
37
+ VolumeApiV2.prototype.meshUrl_Json = function (source, entryId, segment, detailLevel) {
38
+ return "".concat(this.volumeServerUrl, "/").concat(source, "/").concat(entryId, "/mesh/").concat(segment, "/").concat(detailLevel);
39
+ };
40
+ VolumeApiV2.prototype.meshUrl_Bcif = function (source, entryId, segment, detailLevel) {
41
+ return "".concat(this.volumeServerUrl, "/").concat(source, "/").concat(entryId, "/mesh_bcif/").concat(segment, "/").concat(detailLevel);
42
+ };
43
+ VolumeApiV2.prototype.volumeInfoUrl = function (source, entryId) {
44
+ return "".concat(this.volumeServerUrl, "/").concat(source, "/").concat(entryId, "/volume_info");
45
+ };
46
+ VolumeApiV2.prototype.getEntryList = function (maxEntries, keyword) {
47
+ return __awaiter(this, void 0, void 0, function () {
48
+ var response;
49
+ return __generator(this, function (_a) {
50
+ switch (_a.label) {
51
+ case 0: return [4 /*yield*/, fetch(this.entryListUrl(maxEntries, keyword))];
52
+ case 1:
53
+ response = _a.sent();
54
+ return [4 /*yield*/, response.json()];
55
+ case 2: return [2 /*return*/, _a.sent()];
56
+ }
57
+ });
58
+ });
59
+ };
60
+ VolumeApiV2.prototype.getMetadata = function (source, entryId) {
61
+ return __awaiter(this, void 0, void 0, function () {
62
+ var url, response;
63
+ return __generator(this, function (_a) {
64
+ switch (_a.label) {
65
+ case 0:
66
+ url = this.metadataUrl(source, entryId);
67
+ return [4 /*yield*/, fetch(url)];
68
+ case 1:
69
+ response = _a.sent();
70
+ if (!response.ok)
71
+ throw new Error("Failed to fetch metadata from ".concat(url));
72
+ return [4 /*yield*/, response.json()];
73
+ case 2: return [2 /*return*/, _a.sent()];
74
+ }
75
+ });
76
+ });
77
+ };
78
+ return VolumeApiV2;
79
+ }());
80
+ export { VolumeApiV2 };
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author Adam Midlik <midlik@gmail.com>
5
+ */
6
+ export interface Metadata {
7
+ grid: {
8
+ general: {
9
+ details: string;
10
+ source_db_name: string;
11
+ source_db_id: string;
12
+ };
13
+ volumes: Volumes;
14
+ segmentation_lattices: SegmentationLattices;
15
+ segmentation_meshes: SegmentationMeshes;
16
+ };
17
+ annotation: Annotation | null;
18
+ }
19
+ export interface Volumes {
20
+ volume_downsamplings: number[];
21
+ voxel_size: {
22
+ [downsampling: number]: Vector3;
23
+ };
24
+ origin: Vector3;
25
+ grid_dimensions: Vector3;
26
+ sampled_grid_dimensions: {
27
+ [downsampling: number]: Vector3;
28
+ };
29
+ mean: {
30
+ [downsampling: number]: number;
31
+ };
32
+ std: {
33
+ [downsampling: number]: number;
34
+ };
35
+ min: {
36
+ [downsampling: number]: number;
37
+ };
38
+ max: {
39
+ [downsampling: number]: number;
40
+ };
41
+ volume_force_dtype: string;
42
+ }
43
+ export interface SegmentationLattices {
44
+ segmentation_lattice_ids: number[];
45
+ segmentation_downsamplings: {
46
+ [lattice: number]: number[];
47
+ };
48
+ }
49
+ export interface SegmentationMeshes {
50
+ mesh_component_numbers: {
51
+ segment_ids?: {
52
+ [segId: number]: {
53
+ detail_lvls: {
54
+ [detail: number]: {
55
+ mesh_ids: {
56
+ [meshId: number]: {
57
+ num_triangles: number;
58
+ num_vertices: number;
59
+ };
60
+ };
61
+ };
62
+ };
63
+ };
64
+ };
65
+ };
66
+ detail_lvl_to_fraction: {
67
+ [lvl: number]: number;
68
+ };
69
+ }
70
+ export interface Annotation {
71
+ name: string;
72
+ details: string;
73
+ segment_list: Segment[];
74
+ }
75
+ export interface Segment {
76
+ id: number;
77
+ colour: number[];
78
+ biological_annotation: BiologicalAnnotation;
79
+ }
80
+ export interface BiologicalAnnotation {
81
+ name: string;
82
+ external_references: ExternalReference[];
83
+ }
84
+ export interface ExternalReference {
85
+ id: number;
86
+ resource: string;
87
+ accession: string;
88
+ label: string;
89
+ description: string;
90
+ }
91
+ type Vector3 = [number, number, number];
92
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author Adam Midlik <midlik@gmail.com>
5
+ */
6
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author Adam Midlik <midlik@gmail.com>
5
+ */
6
+ import { Metadata, Segment } from './data';
7
+ export declare class MetadataWrapper {
8
+ raw: Metadata;
9
+ private segmentMap?;
10
+ constructor(rawMetadata: Metadata);
11
+ get allSegments(): Segment[];
12
+ get allSegmentIds(): number[];
13
+ getSegment(segmentId: number): Segment | undefined;
14
+ /** Get the list of detail levels available for the given mesh segment. */
15
+ getMeshDetailLevels(segmentId: number): number[];
16
+ /** Get the worst available detail level that is not worse than preferredDetail.
17
+ * If preferredDetail is null, get the worst detail level overall.
18
+ * (worse = greater number) */
19
+ getSufficientMeshDetail(segmentId: number, preferredDetail: number | null): number;
20
+ /** IDs of all segments available as meshes */
21
+ get meshSegmentIds(): number[];
22
+ get gridTotalVolume(): number;
23
+ }
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * @author Adam Midlik <midlik@gmail.com>
5
+ */
6
+ var MetadataWrapper = /** @class */ (function () {
7
+ function MetadataWrapper(rawMetadata) {
8
+ this.raw = rawMetadata;
9
+ }
10
+ Object.defineProperty(MetadataWrapper.prototype, "allSegments", {
11
+ get: function () {
12
+ var _a, _b;
13
+ return (_b = (_a = this.raw.annotation) === null || _a === void 0 ? void 0 : _a.segment_list) !== null && _b !== void 0 ? _b : [];
14
+ },
15
+ enumerable: false,
16
+ configurable: true
17
+ });
18
+ Object.defineProperty(MetadataWrapper.prototype, "allSegmentIds", {
19
+ get: function () {
20
+ return this.allSegments.map(function (segment) { return segment.id; });
21
+ },
22
+ enumerable: false,
23
+ configurable: true
24
+ });
25
+ MetadataWrapper.prototype.getSegment = function (segmentId) {
26
+ if (!this.segmentMap) {
27
+ this.segmentMap = {};
28
+ for (var _i = 0, _a = this.allSegments; _i < _a.length; _i++) {
29
+ var segment = _a[_i];
30
+ this.segmentMap[segment.id] = segment;
31
+ }
32
+ }
33
+ return this.segmentMap[segmentId];
34
+ };
35
+ /** Get the list of detail levels available for the given mesh segment. */
36
+ MetadataWrapper.prototype.getMeshDetailLevels = function (segmentId) {
37
+ var segmentIds = this.raw.grid.segmentation_meshes.mesh_component_numbers.segment_ids;
38
+ if (!segmentIds)
39
+ return [];
40
+ var details = segmentIds[segmentId].detail_lvls;
41
+ return Object.keys(details).map(function (s) { return parseInt(s); });
42
+ };
43
+ /** Get the worst available detail level that is not worse than preferredDetail.
44
+ * If preferredDetail is null, get the worst detail level overall.
45
+ * (worse = greater number) */
46
+ MetadataWrapper.prototype.getSufficientMeshDetail = function (segmentId, preferredDetail) {
47
+ var availDetails = this.getMeshDetailLevels(segmentId);
48
+ if (preferredDetail !== null) {
49
+ availDetails = availDetails.filter(function (det) { return det <= preferredDetail; });
50
+ }
51
+ return Math.max.apply(Math, availDetails);
52
+ };
53
+ Object.defineProperty(MetadataWrapper.prototype, "meshSegmentIds", {
54
+ /** IDs of all segments available as meshes */
55
+ get: function () {
56
+ var segmentIds = this.raw.grid.segmentation_meshes.mesh_component_numbers.segment_ids;
57
+ if (!segmentIds)
58
+ return [];
59
+ return Object.keys(segmentIds).map(function (s) { return parseInt(s); });
60
+ },
61
+ enumerable: false,
62
+ configurable: true
63
+ });
64
+ Object.defineProperty(MetadataWrapper.prototype, "gridTotalVolume", {
65
+ get: function () {
66
+ var _a = this.raw.grid.volumes.voxel_size[1], vx = _a[0], vy = _a[1], vz = _a[2];
67
+ var _b = this.raw.grid.volumes.grid_dimensions, gx = _b[0], gy = _b[1], gz = _b[2];
68
+ return vx * vy * vz * gx * gy * gz;
69
+ },
70
+ enumerable: false,
71
+ configurable: true
72
+ });
73
+ return MetadataWrapper;
74
+ }());
75
+ export { MetadataWrapper };
@@ -81,6 +81,7 @@ export declare const Canvas3DParams: {
81
81
  scale: any;
82
82
  threshold: any;
83
83
  color: any;
84
+ includeTransparent: any;
84
85
  }>, "on">;
85
86
  antialiasing: PD.NamedParams<PD.Normalize<unknown>, "off"> | PD.NamedParams<PD.Normalize<{
86
87
  edgeThreshold: any;
@@ -250,6 +251,7 @@ export declare const DefaultCanvas3DParams: PD.Values<{
250
251
  scale: any;
251
252
  threshold: any;
252
253
  color: any;
254
+ includeTransparent: any;
253
255
  }>, "on">;
254
256
  antialiasing: PD.NamedParams<PD.Normalize<unknown>, "off"> | PD.NamedParams<PD.Normalize<{
255
257
  edgeThreshold: any;