molstar 3.3.1 → 3.4.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 (777) hide show
  1. package/README.md +3 -0
  2. package/build/viewer/molstar.js +1 -1
  3. package/lib/apps/docking-viewer/viewport.js +1 -1
  4. package/lib/apps/viewer/app.d.ts +7 -6
  5. package/lib/apps/viewer/app.js +2 -0
  6. package/lib/cli/chem-comp-dict/create-saccharides.d.ts +7 -0
  7. package/lib/cli/chem-comp-dict/create-saccharides.js +67 -0
  8. package/lib/commonjs/apps/docking-viewer/index.js +12 -12
  9. package/lib/commonjs/apps/docking-viewer/viewport.js +33 -33
  10. package/lib/commonjs/apps/viewer/app.d.ts +7 -6
  11. package/lib/commonjs/apps/viewer/app.js +24 -22
  12. package/lib/commonjs/apps/viewer/index.js +1 -1
  13. package/lib/commonjs/cli/chem-comp-dict/create-ions.js +6 -6
  14. package/lib/commonjs/cli/chem-comp-dict/create-saccharides.d.ts +7 -0
  15. package/lib/commonjs/cli/chem-comp-dict/create-saccharides.js +69 -0
  16. package/lib/commonjs/cli/chem-comp-dict/create-table.js +8 -8
  17. package/lib/commonjs/cli/chem-comp-dict/util.js +17 -17
  18. package/lib/commonjs/cli/cif2bcif/converter.js +9 -9
  19. package/lib/commonjs/cli/cif2bcif/index.js +8 -8
  20. package/lib/commonjs/cli/cifschema/index.js +27 -27
  21. package/lib/commonjs/cli/cifschema/util/cif-dic.js +1 -1
  22. package/lib/commonjs/cli/lipid-params/index.js +9 -9
  23. package/lib/commonjs/cli/state-docs/index.js +2 -2
  24. package/lib/commonjs/cli/structure-info/helpers.js +11 -11
  25. package/lib/commonjs/cli/structure-info/model.js +15 -15
  26. package/lib/commonjs/cli/structure-info/volume.js +9 -9
  27. package/lib/commonjs/examples/alpha-orbitals/controls.js +3 -3
  28. package/lib/commonjs/examples/alpha-orbitals/index.js +11 -11
  29. package/lib/commonjs/examples/basic-wrapper/controls.js +2 -2
  30. package/lib/commonjs/examples/basic-wrapper/index.js +22 -22
  31. package/lib/commonjs/examples/basic-wrapper/superposition.js +8 -8
  32. package/lib/commonjs/examples/domain-annotation-server/mapping.js +3 -3
  33. package/lib/commonjs/examples/domain-annotation-server/server.js +6 -6
  34. package/lib/commonjs/examples/domain-annotation-server/test.js +3 -3
  35. package/lib/commonjs/examples/lighting/index.js +6 -6
  36. package/lib/commonjs/examples/proteopedia-wrapper/annotation.js +2 -2
  37. package/lib/commonjs/examples/proteopedia-wrapper/helpers.js +4 -4
  38. package/lib/commonjs/examples/proteopedia-wrapper/index.js +26 -26
  39. package/lib/commonjs/examples/proteopedia-wrapper/ui/controls.js +2 -2
  40. package/lib/commonjs/examples/task.js +15 -15
  41. package/lib/commonjs/extensions/alpha-orbitals/collocation.js +2 -2
  42. package/lib/commonjs/extensions/alpha-orbitals/data-model.js +1 -1
  43. package/lib/commonjs/extensions/alpha-orbitals/density.js +2 -2
  44. package/lib/commonjs/extensions/alpha-orbitals/gpu/compute.js +2 -2
  45. package/lib/commonjs/extensions/alpha-orbitals/orbitals.js +2 -2
  46. package/lib/commonjs/extensions/alpha-orbitals/transforms.js +13 -13
  47. package/lib/commonjs/extensions/anvil/algorithm.js +13 -13
  48. package/lib/commonjs/extensions/anvil/behavior.js +14 -14
  49. package/lib/commonjs/extensions/anvil/prop.js +7 -7
  50. package/lib/commonjs/extensions/anvil/representation.js +5 -5
  51. package/lib/commonjs/extensions/cellpack/index.js +1 -1
  52. package/lib/commonjs/extensions/cellpack/model.js +26 -24
  53. package/lib/commonjs/extensions/cellpack/preset.js +6 -6
  54. package/lib/commonjs/extensions/cellpack/property.js +3 -3
  55. package/lib/commonjs/extensions/cellpack/representation.js +2 -2
  56. package/lib/commonjs/extensions/cellpack/state.js +13 -13
  57. package/lib/commonjs/extensions/cellpack/util.js +14 -14
  58. package/lib/commonjs/extensions/dnatco/confal-pyramids/behavior.js +7 -7
  59. package/lib/commonjs/extensions/dnatco/confal-pyramids/property.js +5 -5
  60. package/lib/commonjs/extensions/dnatco/confal-pyramids/representation.js +2 -2
  61. package/lib/commonjs/extensions/dnatco/confal-pyramids/util.js +1 -1
  62. package/lib/commonjs/extensions/g3d/data.js +6 -6
  63. package/lib/commonjs/extensions/g3d/format.js +14 -14
  64. package/lib/commonjs/extensions/g3d/model.js +4 -4
  65. package/lib/commonjs/extensions/geo-export/controls.js +3 -3
  66. package/lib/commonjs/extensions/geo-export/glb-exporter.js +9 -9
  67. package/lib/commonjs/extensions/geo-export/index.js +1 -1
  68. package/lib/commonjs/extensions/geo-export/mesh-exporter.js +12 -12
  69. package/lib/commonjs/extensions/geo-export/obj-exporter.js +7 -7
  70. package/lib/commonjs/extensions/geo-export/stl-exporter.js +7 -7
  71. package/lib/commonjs/extensions/geo-export/ui.js +7 -7
  72. package/lib/commonjs/extensions/geo-export/usdz-exporter.js +9 -9
  73. package/lib/commonjs/extensions/model-archive/quality-assessment/behavior.js +9 -9
  74. package/lib/commonjs/extensions/model-archive/quality-assessment/color/plddt.js +4 -4
  75. package/lib/commonjs/extensions/model-archive/quality-assessment/color/qmean.js +4 -4
  76. package/lib/commonjs/extensions/model-archive/quality-assessment/prop.js +5 -5
  77. package/lib/commonjs/extensions/model-export/export.js +4 -4
  78. package/lib/commonjs/extensions/model-export/index.js +1 -1
  79. package/lib/commonjs/extensions/model-export/ui.js +5 -5
  80. package/lib/commonjs/extensions/mp4-export/controls.js +5 -5
  81. package/lib/commonjs/extensions/mp4-export/encoder.js +4 -4
  82. package/lib/commonjs/extensions/mp4-export/index.js +1 -1
  83. package/lib/commonjs/extensions/mp4-export/ui.js +5 -5
  84. package/lib/commonjs/extensions/pdbe/preferred-assembly.js +2 -2
  85. package/lib/commonjs/extensions/pdbe/struct-ref-domain.js +2 -2
  86. package/lib/commonjs/extensions/pdbe/structure-quality-report/behavior.js +1 -1
  87. package/lib/commonjs/extensions/pdbe/structure-quality-report/prop.js +8 -8
  88. package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.js +17 -17
  89. package/lib/commonjs/extensions/rcsb/assembly-symmetry/color.js +2 -2
  90. package/lib/commonjs/extensions/rcsb/assembly-symmetry/prop.js +9 -9
  91. package/lib/commonjs/extensions/rcsb/assembly-symmetry/representation.js +6 -6
  92. package/lib/commonjs/extensions/rcsb/assembly-symmetry/ui.js +9 -9
  93. package/lib/commonjs/extensions/rcsb/validation-report/behavior.js +17 -17
  94. package/lib/commonjs/extensions/rcsb/validation-report/prop.js +15 -15
  95. package/lib/commonjs/extensions/rcsb/validation-report/representation.js +3 -3
  96. package/lib/commonjs/extensions/zenodo/index.d.ts +7 -0
  97. package/lib/commonjs/extensions/zenodo/index.js +35 -0
  98. package/lib/commonjs/extensions/zenodo/ui.d.ts +61 -0
  99. package/lib/commonjs/extensions/zenodo/ui.js +306 -0
  100. package/lib/commonjs/mol-canvas3d/camera/stereo.js +1 -1
  101. package/lib/commonjs/mol-canvas3d/camera/util.js +1 -1
  102. package/lib/commonjs/mol-canvas3d/camera.js +2 -1
  103. package/lib/commonjs/mol-canvas3d/canvas3d.js +14 -14
  104. package/lib/commonjs/mol-canvas3d/controls/trackball.js +1 -1
  105. package/lib/commonjs/mol-canvas3d/helper/bounding-sphere-helper.js +1 -1
  106. package/lib/commonjs/mol-canvas3d/helper/camera-helper.js +5 -5
  107. package/lib/commonjs/mol-canvas3d/helper/handle-helper.js +5 -5
  108. package/lib/commonjs/mol-canvas3d/helper/helper.js +1 -1
  109. package/lib/commonjs/mol-canvas3d/helper/interaction-events.js +2 -2
  110. package/lib/commonjs/mol-canvas3d/passes/draw.js +3 -3
  111. package/lib/commonjs/mol-canvas3d/passes/fxaa.js +3 -3
  112. package/lib/commonjs/mol-canvas3d/passes/image.js +1 -1
  113. package/lib/commonjs/mol-canvas3d/passes/marking.js +6 -6
  114. package/lib/commonjs/mol-canvas3d/passes/multi-sample.js +3 -3
  115. package/lib/commonjs/mol-canvas3d/passes/postprocessing.js +12 -12
  116. package/lib/commonjs/mol-canvas3d/passes/smaa.js +9 -9
  117. package/lib/commonjs/mol-canvas3d/passes/wboit.js +3 -3
  118. package/lib/commonjs/mol-canvas3d/util.js +2 -2
  119. package/lib/commonjs/mol-data/db/column.js +2 -2
  120. package/lib/commonjs/mol-data/db/table.js +1 -1
  121. package/lib/commonjs/mol-data/db.js +1 -1
  122. package/lib/commonjs/mol-data/generic.js +3 -3
  123. package/lib/commonjs/mol-data/index.js +4 -4
  124. package/lib/commonjs/mol-data/int/interval.js +1 -1
  125. package/lib/commonjs/mol-data/int/ordered-set.js +1 -1
  126. package/lib/commonjs/mol-data/int/segmentation.js +1 -1
  127. package/lib/commonjs/mol-data/int/sorted-array.js +1 -1
  128. package/lib/commonjs/mol-data/util.js +7 -7
  129. package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.js +3 -3
  130. package/lib/commonjs/mol-geo/geometry/direct-volume/direct-volume.js +3 -3
  131. package/lib/commonjs/mol-geo/geometry/direct-volume/transfer-function.js +1 -1
  132. package/lib/commonjs/mol-geo/geometry/image/image.js +3 -3
  133. package/lib/commonjs/mol-geo/geometry/lines/lines.js +3 -3
  134. package/lib/commonjs/mol-geo/geometry/mesh/mesh.js +3 -3
  135. package/lib/commonjs/mol-geo/geometry/points/points.js +3 -3
  136. package/lib/commonjs/mol-geo/geometry/size-data.js +1 -1
  137. package/lib/commonjs/mol-geo/geometry/spheres/spheres.js +3 -3
  138. package/lib/commonjs/mol-geo/geometry/text/font-atlas.js +1 -1
  139. package/lib/commonjs/mol-geo/geometry/text/text-builder.js +3 -2
  140. package/lib/commonjs/mol-geo/geometry/text/text.js +3 -3
  141. package/lib/commonjs/mol-geo/geometry/texture-mesh/color-smoothing.js +4 -4
  142. package/lib/commonjs/mol-geo/geometry/texture-mesh/texture-mesh.js +3 -3
  143. package/lib/commonjs/mol-geo/primitive/circle.js +1 -1
  144. package/lib/commonjs/mol-geo/primitive/cylinder.js +1 -1
  145. package/lib/commonjs/mol-geo/primitive/polyhedron.js +1 -1
  146. package/lib/commonjs/mol-geo/primitive/prism.js +1 -1
  147. package/lib/commonjs/mol-geo/primitive/star.js +1 -1
  148. package/lib/commonjs/mol-geo/primitive/torus.js +1 -1
  149. package/lib/commonjs/mol-geo/util/marching-cubes/algorithm.js +9 -9
  150. package/lib/commonjs/mol-gl/compute/grid3d.js +5 -5
  151. package/lib/commonjs/mol-gl/compute/histogram-pyramid/reduction.js +3 -3
  152. package/lib/commonjs/mol-gl/compute/histogram-pyramid/sum.js +3 -3
  153. package/lib/commonjs/mol-gl/compute/marching-cubes/active-voxels.js +3 -3
  154. package/lib/commonjs/mol-gl/compute/marching-cubes/isosurface.js +3 -3
  155. package/lib/commonjs/mol-gl/compute/util.js +3 -3
  156. package/lib/commonjs/mol-gl/renderable/cylinders.js +3 -3
  157. package/lib/commonjs/mol-gl/renderable/direct-volume.js +3 -3
  158. package/lib/commonjs/mol-gl/renderable/image.js +3 -3
  159. package/lib/commonjs/mol-gl/renderable/lines.js +3 -3
  160. package/lib/commonjs/mol-gl/renderable/mesh.js +3 -3
  161. package/lib/commonjs/mol-gl/renderable/points.js +3 -3
  162. package/lib/commonjs/mol-gl/renderable/schema.js +1 -1
  163. package/lib/commonjs/mol-gl/renderable/spheres.js +3 -3
  164. package/lib/commonjs/mol-gl/renderable/text.js +3 -3
  165. package/lib/commonjs/mol-gl/renderable/texture-mesh.js +3 -3
  166. package/lib/commonjs/mol-gl/renderable/util.js +1 -1
  167. package/lib/commonjs/mol-gl/shader-code.js +2 -1
  168. package/lib/commonjs/mol-gl/webgl/buffer.js +4 -5
  169. package/lib/commonjs/mol-gl/webgl/context.js +3 -3
  170. package/lib/commonjs/mol-gl/webgl/render-item.js +1 -1
  171. package/lib/commonjs/mol-gl/webgl/resources.js +2 -2
  172. package/lib/commonjs/mol-io/common/binary-cif/classifier.js +7 -6
  173. package/lib/commonjs/mol-io/common/binary-cif/decoder.js +4 -3
  174. package/lib/commonjs/mol-io/common/binary-cif.js +3 -3
  175. package/lib/commonjs/mol-io/common/io-buffer.d.ts +206 -0
  176. package/lib/commonjs/mol-io/common/io-buffer.js +408 -0
  177. package/lib/commonjs/mol-io/common/netcdf/reader.d.ts +78 -0
  178. package/lib/commonjs/mol-io/common/netcdf/reader.js +459 -0
  179. package/lib/commonjs/mol-io/common/typed-array.js +2 -2
  180. package/lib/commonjs/mol-io/reader/ccp4/parser.js +8 -8
  181. package/lib/commonjs/mol-io/reader/cif/binary/parser.js +3 -3
  182. package/lib/commonjs/mol-io/reader/cif/data-model.js +1 -1
  183. package/lib/commonjs/mol-io/reader/cif/schema/mmcif-extras.js +2 -2
  184. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +1 -1
  185. package/lib/commonjs/mol-io/reader/cif/schema.js +2 -2
  186. package/lib/commonjs/mol-io/reader/cif/text/parser.js +7 -7
  187. package/lib/commonjs/mol-io/reader/cif.js +1 -1
  188. package/lib/commonjs/mol-io/reader/common/text/tokenizer.js +4 -4
  189. package/lib/commonjs/mol-io/reader/csv/data-model.js +1 -1
  190. package/lib/commonjs/mol-io/reader/csv/parser.js +7 -7
  191. package/lib/commonjs/mol-io/reader/cube/parser.js +2 -2
  192. package/lib/commonjs/mol-io/reader/dcd/parser.js +2 -2
  193. package/lib/commonjs/mol-io/reader/dsn6/parser.js +8 -8
  194. package/lib/commonjs/mol-io/reader/dx/parser.js +4 -4
  195. package/lib/commonjs/mol-io/reader/gro/parser.js +6 -6
  196. package/lib/commonjs/mol-io/reader/mol/parser.js +2 -2
  197. package/lib/commonjs/mol-io/reader/mol2/parser.js +8 -8
  198. package/lib/commonjs/mol-io/reader/nctraj/parser.d.ts +18 -0
  199. package/lib/commonjs/mol-io/reader/nctraj/parser.js +101 -0
  200. package/lib/commonjs/mol-io/reader/obj/parser.js +4 -4
  201. package/lib/commonjs/mol-io/reader/pdb/parser.js +2 -2
  202. package/lib/commonjs/mol-io/reader/ply/parser.js +4 -4
  203. package/lib/commonjs/mol-io/reader/prmtop/parser.d.ts +58 -0
  204. package/lib/commonjs/mol-io/reader/prmtop/parser.js +172 -0
  205. package/lib/commonjs/mol-io/reader/psf/parser.js +8 -8
  206. package/lib/commonjs/mol-io/reader/sdf/parser.js +2 -2
  207. package/lib/commonjs/mol-io/reader/top/parser.d.ts +37 -0
  208. package/lib/commonjs/mol-io/reader/top/parser.js +303 -0
  209. package/lib/commonjs/mol-io/reader/trr/parser.d.ts +22 -0
  210. package/lib/commonjs/mol-io/reader/trr/parser.js +146 -0
  211. package/lib/commonjs/mol-io/reader/xtc/parser.js +4 -4
  212. package/lib/commonjs/mol-io/reader/xyz/parser.js +2 -2
  213. package/lib/commonjs/mol-io/writer/cif/encoder.js +3 -2
  214. package/lib/commonjs/mol-io/writer/cif.js +1 -1
  215. package/lib/commonjs/mol-io/writer/ligand-encoder.js +1 -1
  216. package/lib/commonjs/mol-io/writer/mol/encoder.js +1 -1
  217. package/lib/commonjs/mol-io/writer/mol2/encoder.js +1 -1
  218. package/lib/commonjs/mol-math/geometry/boundary-helper.js +5 -5
  219. package/lib/commonjs/mol-math/geometry/gaussian-density/cpu.js +4 -4
  220. package/lib/commonjs/mol-math/geometry/gaussian-density/gpu.js +1 -1
  221. package/lib/commonjs/mol-math/geometry/gaussian-density.js +4 -4
  222. package/lib/commonjs/mol-math/geometry/molecular-surface.js +8 -8
  223. package/lib/commonjs/mol-math/geometry/primitives/sphere3d.js +1 -1
  224. package/lib/commonjs/mol-math/geometry.js +8 -8
  225. package/lib/commonjs/mol-math/graph/inter-unit-graph.js +1 -1
  226. package/lib/commonjs/mol-math/graph.js +1 -1
  227. package/lib/commonjs/mol-math/linear-algebra.js +2 -2
  228. package/lib/commonjs/mol-model/sequence/alignment/alignment.js +1 -1
  229. package/lib/commonjs/mol-model/sequence/sequence.js +2 -1
  230. package/lib/commonjs/mol-model/sequence.js +1 -1
  231. package/lib/commonjs/mol-model/shape.js +1 -1
  232. package/lib/commonjs/mol-model/structure/coordinates.js +1 -1
  233. package/lib/commonjs/mol-model/structure/export/categories/secondary-structure.js +2 -2
  234. package/lib/commonjs/mol-model/structure/model/model.js +3 -3
  235. package/lib/commonjs/mol-model/structure/model/properties/atomic.js +3 -3
  236. package/lib/commonjs/mol-model/structure/model/properties/coarse.js +2 -2
  237. package/lib/commonjs/mol-model/structure/model/types/saccharides.d.ts +8 -0
  238. package/lib/commonjs/mol-model/structure/model/types/saccharides.js +11 -0
  239. package/lib/commonjs/mol-model/structure/model.js +3 -3
  240. package/lib/commonjs/mol-model/structure/query/queries/generators.js +2 -2
  241. package/lib/commonjs/mol-model/structure/query/queries/modifiers.js +2 -2
  242. package/lib/commonjs/mol-model/structure/query.js +6 -6
  243. package/lib/commonjs/mol-model/structure/structure/carbohydrates/compute.js +1 -1
  244. package/lib/commonjs/mol-model/structure/structure/carbohydrates/constants.d.ts +1 -1
  245. package/lib/commonjs/mol-model/structure/structure/carbohydrates/constants.js +6 -9
  246. package/lib/commonjs/mol-model/structure/structure/element/element.js +5 -5
  247. package/lib/commonjs/mol-model/structure/structure/element.js +1 -1
  248. package/lib/commonjs/mol-model/structure/structure/structure.js +5 -5
  249. package/lib/commonjs/mol-model/structure/structure/symmetry.js +10 -10
  250. package/lib/commonjs/mol-model/structure/structure/unit/bonds/data.js +2 -2
  251. package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.js +3 -3
  252. package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.js +1 -1
  253. package/lib/commonjs/mol-model/structure/structure/unit/bonds.js +3 -3
  254. package/lib/commonjs/mol-model/structure/structure/unit.js +4 -4
  255. package/lib/commonjs/mol-model/structure/structure/util/superposition.js +1 -1
  256. package/lib/commonjs/mol-model/structure/structure.js +2 -2
  257. package/lib/commonjs/mol-model/structure/topology.js +1 -1
  258. package/lib/commonjs/mol-model/structure.js +6 -6
  259. package/lib/commonjs/mol-model/volume.js +2 -2
  260. package/lib/commonjs/mol-model-formats/shape/ply.js +7 -7
  261. package/lib/commonjs/mol-model-formats/structure/basic/atomic.d.ts +1 -1
  262. package/lib/commonjs/mol-model-formats/structure/basic/atomic.js +2 -15
  263. package/lib/commonjs/mol-model-formats/structure/basic/coarse.js +3 -3
  264. package/lib/commonjs/mol-model-formats/structure/basic/entities.js +1 -1
  265. package/lib/commonjs/mol-model-formats/structure/basic/parser.d.ts +1 -1
  266. package/lib/commonjs/mol-model-formats/structure/basic/parser.js +10 -10
  267. package/lib/commonjs/mol-model-formats/structure/basic/schema.d.ts +2 -2
  268. package/lib/commonjs/mol-model-formats/structure/basic/schema.js +7 -2
  269. package/lib/commonjs/mol-model-formats/structure/basic/sort.js +2 -2
  270. package/lib/commonjs/mol-model-formats/structure/basic/util.d.ts +33 -2
  271. package/lib/commonjs/mol-model-formats/structure/basic/util.js +26 -2
  272. package/lib/commonjs/mol-model-formats/structure/cif-core.js +6 -6
  273. package/lib/commonjs/mol-model-formats/structure/common/component.js +5 -1
  274. package/lib/commonjs/mol-model-formats/structure/cube.js +5 -5
  275. package/lib/commonjs/mol-model-formats/structure/dcd.js +2 -2
  276. package/lib/commonjs/mol-model-formats/structure/gro.js +5 -3
  277. package/lib/commonjs/mol-model-formats/structure/mmcif.d.ts +1 -1
  278. package/lib/commonjs/mol-model-formats/structure/mmcif.js +4 -2
  279. package/lib/commonjs/mol-model-formats/structure/mol.js +5 -5
  280. package/lib/commonjs/mol-model-formats/structure/mol2.js +6 -6
  281. package/lib/commonjs/mol-model-formats/structure/nctraj.d.ts +9 -0
  282. package/lib/commonjs/mol-model-formats/structure/nctraj.js +60 -0
  283. package/lib/commonjs/mol-model-formats/structure/pdb/to-cif.js +2 -2
  284. package/lib/commonjs/mol-model-formats/structure/pdb.d.ts +1 -1
  285. package/lib/commonjs/mol-model-formats/structure/pdb.js +7 -5
  286. package/lib/commonjs/mol-model-formats/structure/prmtop.d.ts +16 -0
  287. package/lib/commonjs/mol-model-formats/structure/prmtop.js +147 -0
  288. package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.js +1 -1
  289. package/lib/commonjs/mol-model-formats/structure/property/symmetry.js +11 -1
  290. package/lib/commonjs/mol-model-formats/structure/psf.js +5 -3
  291. package/lib/commonjs/mol-model-formats/structure/top.d.ts +16 -0
  292. package/lib/commonjs/mol-model-formats/structure/top.js +189 -0
  293. package/lib/commonjs/mol-model-formats/structure/trr.d.ts +9 -0
  294. package/lib/commonjs/mol-model-formats/structure/trr.js +46 -0
  295. package/lib/commonjs/mol-model-formats/structure/util.d.ts +2 -2
  296. package/lib/commonjs/mol-model-formats/structure/util.js +19 -20
  297. package/lib/commonjs/mol-model-formats/structure/xtc.js +2 -2
  298. package/lib/commonjs/mol-model-formats/structure/xyz.js +2 -2
  299. package/lib/commonjs/mol-model-formats/volume/ccp4.js +2 -2
  300. package/lib/commonjs/mol-model-formats/volume/cube.js +2 -2
  301. package/lib/commonjs/mol-model-formats/volume/density-server.js +2 -2
  302. package/lib/commonjs/mol-model-formats/volume/dsn6.js +2 -2
  303. package/lib/commonjs/mol-model-formats/volume/dx.js +2 -2
  304. package/lib/commonjs/mol-model-props/common/custom-element-property.js +2 -2
  305. package/lib/commonjs/mol-model-props/common/custom-model-property.js +5 -5
  306. package/lib/commonjs/mol-model-props/common/custom-property.js +1 -1
  307. package/lib/commonjs/mol-model-props/common/custom-structure-property.js +6 -6
  308. package/lib/commonjs/mol-model-props/computed/accessible-surface-area/shrake-rupley/area.js +2 -2
  309. package/lib/commonjs/mol-model-props/computed/accessible-surface-area/shrake-rupley.js +5 -5
  310. package/lib/commonjs/mol-model-props/computed/accessible-surface-area.js +4 -4
  311. package/lib/commonjs/mol-model-props/computed/chemistry/valence-model.js +3 -3
  312. package/lib/commonjs/mol-model-props/computed/helix-orientation.js +2 -2
  313. package/lib/commonjs/mol-model-props/computed/interactions/common.js +1 -1
  314. package/lib/commonjs/mol-model-props/computed/interactions/contacts.js +1 -1
  315. package/lib/commonjs/mol-model-props/computed/interactions/features.js +1 -1
  316. package/lib/commonjs/mol-model-props/computed/interactions/hydrogen-bonds.js +3 -3
  317. package/lib/commonjs/mol-model-props/computed/interactions/interactions.js +3 -3
  318. package/lib/commonjs/mol-model-props/computed/interactions.js +4 -4
  319. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +1 -1
  320. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +3 -3
  321. package/lib/commonjs/mol-model-props/computed/representations/interactions.js +1 -1
  322. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp.js +2 -2
  323. package/lib/commonjs/mol-model-props/computed/secondary-structure.js +7 -7
  324. package/lib/commonjs/mol-model-props/computed/valence-model.js +4 -4
  325. package/lib/commonjs/mol-model-props/integrative/cross-link-restraint/property.js +2 -2
  326. package/lib/commonjs/mol-model-props/integrative/cross-link-restraint/representation.js +2 -2
  327. package/lib/commonjs/mol-model-props/sequence/sifts-mapping.js +2 -2
  328. package/lib/commonjs/mol-model-props/sequence/themes/sifts-mapping.js +3 -3
  329. package/lib/commonjs/mol-plugin/animation-loop.js +2 -2
  330. package/lib/commonjs/mol-plugin/behavior/behavior.js +5 -5
  331. package/lib/commonjs/mol-plugin/behavior/dynamic/camera.js +2 -2
  332. package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props/computed/accessible-surface-area.js +1 -1
  333. package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props/computed/interactions.js +1 -1
  334. package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props/computed/secondary-structure.js +1 -1
  335. package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props/computed/valence-model.js +1 -1
  336. package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props/integrative/cross-link-restraint.js +1 -1
  337. package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props/sequence/sifts-mapping.js +1 -1
  338. package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props/structure-info.js +2 -2
  339. package/lib/commonjs/mol-plugin/behavior/dynamic/representation.js +3 -3
  340. package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +11 -11
  341. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/behavior.js +12 -12
  342. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/model.js +1 -1
  343. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/transformers.js +16 -16
  344. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/util.js +10 -10
  345. package/lib/commonjs/mol-plugin/behavior/static/state.js +6 -6
  346. package/lib/commonjs/mol-plugin/behavior.js +8 -8
  347. package/lib/commonjs/mol-plugin/command.js +2 -2
  348. package/lib/commonjs/mol-plugin/context.d.ts +2 -1
  349. package/lib/commonjs/mol-plugin/context.js +9 -8
  350. package/lib/commonjs/mol-plugin/layout.js +2 -2
  351. package/lib/commonjs/mol-plugin/spec.js +1 -1
  352. package/lib/commonjs/mol-plugin/state.js +5 -5
  353. package/lib/commonjs/mol-plugin/util/task-manager.js +4 -4
  354. package/lib/commonjs/mol-plugin/util/toast.js +1 -1
  355. package/lib/commonjs/mol-plugin/util/viewport-screenshot.js +17 -17
  356. package/lib/commonjs/mol-plugin-state/actions/file.d.ts +1 -1
  357. package/lib/commonjs/mol-plugin-state/actions/file.js +94 -61
  358. package/lib/commonjs/mol-plugin-state/actions/structure.d.ts +11 -2
  359. package/lib/commonjs/mol-plugin-state/actions/structure.js +190 -20
  360. package/lib/commonjs/mol-plugin-state/actions/volume.js +5 -4
  361. package/lib/commonjs/mol-plugin-state/actions.js +3 -3
  362. package/lib/commonjs/mol-plugin-state/animation/built-in/assembly-unwind.js +2 -2
  363. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.js +3 -3
  364. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.js +3 -3
  365. package/lib/commonjs/mol-plugin-state/animation/built-in/explode-units.js +4 -4
  366. package/lib/commonjs/mol-plugin-state/animation/built-in/model-index.js +2 -2
  367. package/lib/commonjs/mol-plugin-state/animation/built-in/spin-structure.js +5 -5
  368. package/lib/commonjs/mol-plugin-state/animation/built-in/state-interpolation.js +2 -2
  369. package/lib/commonjs/mol-plugin-state/animation/built-in/state-snapshots.js +5 -5
  370. package/lib/commonjs/mol-plugin-state/builder/data.js +2 -2
  371. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.js +16 -16
  372. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +28 -28
  373. package/lib/commonjs/mol-plugin-state/builder/structure/representation.js +2 -2
  374. package/lib/commonjs/mol-plugin-state/builder/structure.js +7 -7
  375. package/lib/commonjs/mol-plugin-state/component.js +1 -1
  376. package/lib/commonjs/mol-plugin-state/formats/{structure.d.ts → coordinates.d.ts} +34 -18
  377. package/lib/commonjs/mol-plugin-state/formats/coordinates.js +70 -0
  378. package/lib/commonjs/mol-plugin-state/formats/registry.d.ts +3 -3
  379. package/lib/commonjs/mol-plugin-state/formats/registry.js +13 -8
  380. package/lib/commonjs/mol-plugin-state/formats/shape.js +2 -2
  381. package/lib/commonjs/mol-plugin-state/formats/topology.d.ts +73 -0
  382. package/lib/commonjs/mol-plugin-state/formats/topology.js +87 -0
  383. package/lib/commonjs/mol-plugin-state/formats/trajectory.js +6 -6
  384. package/lib/commonjs/mol-plugin-state/formats/volume.js +21 -21
  385. package/lib/commonjs/mol-plugin-state/helpers/root-structure.js +14 -14
  386. package/lib/commonjs/mol-plugin-state/helpers/structure-clipping.js +7 -7
  387. package/lib/commonjs/mol-plugin-state/helpers/structure-component.js +2 -1
  388. package/lib/commonjs/mol-plugin-state/helpers/structure-overpaint.js +11 -11
  389. package/lib/commonjs/mol-plugin-state/helpers/structure-selection-query.js +3 -3
  390. package/lib/commonjs/mol-plugin-state/helpers/structure-substance.js +11 -11
  391. package/lib/commonjs/mol-plugin-state/helpers/structure-transparency.js +11 -11
  392. package/lib/commonjs/mol-plugin-state/manager/animation.js +17 -17
  393. package/lib/commonjs/mol-plugin-state/manager/camera.js +1 -1
  394. package/lib/commonjs/mol-plugin-state/manager/interactivity.js +6 -6
  395. package/lib/commonjs/mol-plugin-state/manager/snapshots.js +14 -14
  396. package/lib/commonjs/mol-plugin-state/manager/structure/component.js +26 -26
  397. package/lib/commonjs/mol-plugin-state/manager/structure/focus.js +2 -2
  398. package/lib/commonjs/mol-plugin-state/manager/structure/hierarchy-state.js +1 -1
  399. package/lib/commonjs/mol-plugin-state/manager/structure/hierarchy.js +8 -8
  400. package/lib/commonjs/mol-plugin-state/manager/structure/measurement.js +21 -21
  401. package/lib/commonjs/mol-plugin-state/manager/structure/selection.js +3 -3
  402. package/lib/commonjs/mol-plugin-state/manager/volume/hierarchy.js +1 -1
  403. package/lib/commonjs/mol-plugin-state/objects.d.ts +47 -1
  404. package/lib/commonjs/mol-plugin-state/objects.js +46 -30
  405. package/lib/commonjs/mol-plugin-state/transforms/data.d.ts +6 -0
  406. package/lib/commonjs/mol-plugin-state/transforms/data.js +93 -41
  407. package/lib/commonjs/mol-plugin-state/transforms/model.d.ts +14 -2
  408. package/lib/commonjs/mol-plugin-state/transforms/model.js +163 -54
  409. package/lib/commonjs/mol-plugin-state/transforms/representation.js +77 -77
  410. package/lib/commonjs/mol-plugin-state/transforms/shape.js +2 -2
  411. package/lib/commonjs/mol-plugin-state/transforms/volume.js +16 -16
  412. package/lib/commonjs/mol-plugin-state/transforms.js +6 -6
  413. package/lib/commonjs/mol-plugin-ui/base.js +5 -5
  414. package/lib/commonjs/mol-plugin-ui/context.js +1 -1
  415. package/lib/commonjs/mol-plugin-ui/controls/action-menu.js +14 -14
  416. package/lib/commonjs/mol-plugin-ui/controls/color.js +7 -7
  417. package/lib/commonjs/mol-plugin-ui/controls/common.js +16 -16
  418. package/lib/commonjs/mol-plugin-ui/controls/icons.js +70 -70
  419. package/lib/commonjs/mol-plugin-ui/controls/legend.js +7 -7
  420. package/lib/commonjs/mol-plugin-ui/controls/line-graph/line-graph-component.js +3 -3
  421. package/lib/commonjs/mol-plugin-ui/controls/line-graph/point-component.js +2 -2
  422. package/lib/commonjs/mol-plugin-ui/controls/parameters.js +94 -94
  423. package/lib/commonjs/mol-plugin-ui/controls/screenshot.js +5 -5
  424. package/lib/commonjs/mol-plugin-ui/controls/slider.js +16 -16
  425. package/lib/commonjs/mol-plugin-ui/controls.js +16 -16
  426. package/lib/commonjs/mol-plugin-ui/custom/volume.js +16 -16
  427. package/lib/commonjs/mol-plugin-ui/index.js +4 -4
  428. package/lib/commonjs/mol-plugin-ui/left-panel.d.ts +8 -1
  429. package/lib/commonjs/mol-plugin-ui/left-panel.js +40 -19
  430. package/lib/commonjs/mol-plugin-ui/plugin.js +17 -17
  431. package/lib/commonjs/mol-plugin-ui/sequence/chain.js +1 -1
  432. package/lib/commonjs/mol-plugin-ui/sequence/element.js +1 -1
  433. package/lib/commonjs/mol-plugin-ui/sequence/hetero.js +1 -1
  434. package/lib/commonjs/mol-plugin-ui/sequence/polymer.js +1 -1
  435. package/lib/commonjs/mol-plugin-ui/sequence/sequence.js +6 -6
  436. package/lib/commonjs/mol-plugin-ui/sequence.js +9 -9
  437. package/lib/commonjs/mol-plugin-ui/spec.js +1 -1
  438. package/lib/commonjs/mol-plugin-ui/state/actions.js +2 -2
  439. package/lib/commonjs/mol-plugin-ui/state/animation.js +2 -2
  440. package/lib/commonjs/mol-plugin-ui/state/apply-action.js +1 -1
  441. package/lib/commonjs/mol-plugin-ui/state/common.js +12 -12
  442. package/lib/commonjs/mol-plugin-ui/state/snapshots.js +29 -29
  443. package/lib/commonjs/mol-plugin-ui/state/tree.js +19 -19
  444. package/lib/commonjs/mol-plugin-ui/state/update-transform.js +3 -3
  445. package/lib/commonjs/mol-plugin-ui/structure/components.js +19 -19
  446. package/lib/commonjs/mol-plugin-ui/structure/focus.js +4 -4
  447. package/lib/commonjs/mol-plugin-ui/structure/generic.js +6 -6
  448. package/lib/commonjs/mol-plugin-ui/structure/measurements.js +13 -13
  449. package/lib/commonjs/mol-plugin-ui/structure/quick-styles.js +11 -11
  450. package/lib/commonjs/mol-plugin-ui/structure/selection.js +13 -13
  451. package/lib/commonjs/mol-plugin-ui/structure/source.js +12 -12
  452. package/lib/commonjs/mol-plugin-ui/structure/superposition.js +20 -20
  453. package/lib/commonjs/mol-plugin-ui/structure/volume.js +12 -12
  454. package/lib/commonjs/mol-plugin-ui/task.js +8 -8
  455. package/lib/commonjs/mol-plugin-ui/toast.js +6 -6
  456. package/lib/commonjs/mol-plugin-ui/viewport/canvas.js +5 -5
  457. package/lib/commonjs/mol-plugin-ui/viewport/help.js +14 -14
  458. package/lib/commonjs/mol-plugin-ui/viewport/screenshot.js +8 -8
  459. package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +6 -6
  460. package/lib/commonjs/mol-plugin-ui/viewport.js +7 -7
  461. package/lib/commonjs/mol-repr/representation.js +4 -4
  462. package/lib/commonjs/mol-repr/shape/loci/angle.js +9 -9
  463. package/lib/commonjs/mol-repr/shape/loci/common.js +1 -1
  464. package/lib/commonjs/mol-repr/shape/loci/dihedral.js +14 -14
  465. package/lib/commonjs/mol-repr/shape/loci/distance.js +5 -5
  466. package/lib/commonjs/mol-repr/shape/loci/label.js +3 -3
  467. package/lib/commonjs/mol-repr/shape/loci/orientation.js +4 -4
  468. package/lib/commonjs/mol-repr/shape/loci/plane.js +2 -2
  469. package/lib/commonjs/mol-repr/shape/model/unitcell.js +2 -2
  470. package/lib/commonjs/mol-repr/shape/representation.js +2 -2
  471. package/lib/commonjs/mol-repr/structure/complex-representation.js +2 -2
  472. package/lib/commonjs/mol-repr/structure/complex-visual.js +12 -12
  473. package/lib/commonjs/mol-repr/structure/params.js +8 -8
  474. package/lib/commonjs/mol-repr/structure/registry.js +1 -1
  475. package/lib/commonjs/mol-repr/structure/representation/backbone.js +1 -1
  476. package/lib/commonjs/mol-repr/structure/representation/ball-and-stick.js +1 -1
  477. package/lib/commonjs/mol-repr/structure/representation/carbohydrate.js +1 -1
  478. package/lib/commonjs/mol-repr/structure/representation/cartoon.js +3 -3
  479. package/lib/commonjs/mol-repr/structure/representation/ellipsoid.js +1 -1
  480. package/lib/commonjs/mol-repr/structure/representation/gaussian-surface.js +1 -1
  481. package/lib/commonjs/mol-repr/structure/representation/gaussian-volume.js +1 -1
  482. package/lib/commonjs/mol-repr/structure/representation/label.js +1 -1
  483. package/lib/commonjs/mol-repr/structure/representation/line.js +1 -1
  484. package/lib/commonjs/mol-repr/structure/representation/molecular-surface.js +1 -1
  485. package/lib/commonjs/mol-repr/structure/representation/orientation.js +1 -1
  486. package/lib/commonjs/mol-repr/structure/representation/point.js +1 -1
  487. package/lib/commonjs/mol-repr/structure/representation/putty.js +1 -1
  488. package/lib/commonjs/mol-repr/structure/representation/spacefill.js +1 -1
  489. package/lib/commonjs/mol-repr/structure/representation.js +1 -1
  490. package/lib/commonjs/mol-repr/structure/units-representation.js +2 -2
  491. package/lib/commonjs/mol-repr/structure/units-visual.js +16 -16
  492. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.js +1 -1
  493. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-line.js +1 -1
  494. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.js +1 -1
  495. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-line.js +1 -1
  496. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.js +1 -1
  497. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +1 -1
  498. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +1 -1
  499. package/lib/commonjs/mol-repr/structure/visual/element-cross.js +1 -1
  500. package/lib/commonjs/mol-repr/structure/visual/element-point.js +1 -1
  501. package/lib/commonjs/mol-repr/structure/visual/element-sphere.js +1 -1
  502. package/lib/commonjs/mol-repr/structure/visual/ellipsoid-mesh.js +1 -1
  503. package/lib/commonjs/mol-repr/structure/visual/gaussian-density-volume.js +6 -6
  504. package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.js +11 -11
  505. package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-wireframe.js +3 -3
  506. package/lib/commonjs/mol-repr/structure/visual/label-text.js +1 -1
  507. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +3 -3
  508. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-wireframe.js +3 -3
  509. package/lib/commonjs/mol-repr/structure/visual/nucleotide-block-mesh.js +1 -1
  510. package/lib/commonjs/mol-repr/structure/visual/nucleotide-ring-mesh.js +1 -1
  511. package/lib/commonjs/mol-repr/structure/visual/orientation-ellipsoid-mesh.js +1 -1
  512. package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-cylinder.js +1 -1
  513. package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-sphere.js +1 -1
  514. package/lib/commonjs/mol-repr/structure/visual/polymer-direction-wedge.js +1 -1
  515. package/lib/commonjs/mol-repr/structure/visual/polymer-gap-cylinder.js +1 -1
  516. package/lib/commonjs/mol-repr/structure/visual/polymer-trace-mesh.js +1 -1
  517. package/lib/commonjs/mol-repr/structure/visual/polymer-tube-mesh.js +1 -1
  518. package/lib/commonjs/mol-repr/structure/visual/util/bond.js +2 -2
  519. package/lib/commonjs/mol-repr/structure/visual/util/common.js +1 -1
  520. package/lib/commonjs/mol-repr/structure/visual/util/gaussian.js +13 -13
  521. package/lib/commonjs/mol-repr/structure/visual/util/molecular-surface.js +5 -5
  522. package/lib/commonjs/mol-repr/structure/visual/util/polymer.js +4 -4
  523. package/lib/commonjs/mol-repr/util.js +1 -1
  524. package/lib/commonjs/mol-repr/volume/direct-volume.js +3 -3
  525. package/lib/commonjs/mol-repr/volume/isosurface.js +9 -9
  526. package/lib/commonjs/mol-repr/volume/registry.js +1 -1
  527. package/lib/commonjs/mol-repr/volume/representation.js +5 -5
  528. package/lib/commonjs/mol-repr/volume/slice.js +4 -4
  529. package/lib/commonjs/mol-script/language/parser.js +7 -4
  530. package/lib/commonjs/mol-script/language/symbol-table/internal.js +1 -1
  531. package/lib/commonjs/mol-script/language/symbol-table/structure-query.js +1 -1
  532. package/lib/commonjs/mol-script/runtime/query/compiler.js +1 -1
  533. package/lib/commonjs/mol-script/script/mol-script/symbols.js +1 -1
  534. package/lib/commonjs/mol-state/action.js +1 -1
  535. package/lib/commonjs/mol-state/index.js +8 -8
  536. package/lib/commonjs/mol-state/state/builder.js +2 -2
  537. package/lib/commonjs/mol-state/state/selection.js +1 -1
  538. package/lib/commonjs/mol-state/state.js +21 -21
  539. package/lib/commonjs/mol-state/transform.js +4 -4
  540. package/lib/commonjs/mol-state/transformer.js +1 -1
  541. package/lib/commonjs/mol-task/execution/observable.js +5 -5
  542. package/lib/commonjs/mol-task/task.js +3 -3
  543. package/lib/commonjs/mol-task/util/chunked.js +2 -2
  544. package/lib/commonjs/mol-task/util/multistep.js +1 -1
  545. package/lib/commonjs/mol-task/util/scheduler.d.ts +2 -2
  546. package/lib/commonjs/mol-task/util/scheduler.js +8 -8
  547. package/lib/commonjs/mol-theme/color/atom-id.js +1 -1
  548. package/lib/commonjs/mol-theme/color/chain-id.js +1 -1
  549. package/lib/commonjs/mol-theme/color/element-index.js +1 -1
  550. package/lib/commonjs/mol-theme/color/entity-id.js +1 -1
  551. package/lib/commonjs/mol-theme/color/entity-source.js +2 -2
  552. package/lib/commonjs/mol-theme/color/hydrophobicity.js +2 -2
  553. package/lib/commonjs/mol-theme/color/model-index.js +1 -1
  554. package/lib/commonjs/mol-theme/color/operator-hkl.js +2 -2
  555. package/lib/commonjs/mol-theme/color/operator-name.js +1 -1
  556. package/lib/commonjs/mol-theme/color/polymer-id.js +2 -2
  557. package/lib/commonjs/mol-theme/color/polymer-index.js +2 -2
  558. package/lib/commonjs/mol-theme/color/unit-index.js +2 -2
  559. package/lib/commonjs/mol-theme/label.js +6 -6
  560. package/lib/commonjs/mol-theme/theme.js +3 -3
  561. package/lib/commonjs/mol-util/assets.js +7 -7
  562. package/lib/commonjs/mol-util/color/distinct.js +1 -1
  563. package/lib/commonjs/mol-util/color/palette.js +3 -3
  564. package/lib/commonjs/mol-util/color/scale.js +2 -2
  565. package/lib/commonjs/mol-util/data-source.js +14 -13
  566. package/lib/commonjs/mol-util/file-info.d.ts +1 -3
  567. package/lib/commonjs/mol-util/file-info.js +2 -10
  568. package/lib/commonjs/mol-util/graphql-client.js +4 -4
  569. package/lib/commonjs/mol-util/index.d.ts +1 -0
  570. package/lib/commonjs/mol-util/index.js +8 -2
  571. package/lib/commonjs/mol-util/input/input-observer.js +6 -6
  572. package/lib/commonjs/mol-util/make-dir.js +1 -1
  573. package/lib/commonjs/mol-util/material.js +2 -2
  574. package/lib/commonjs/mol-util/monadic-parser.js +2 -2
  575. package/lib/commonjs/mol-util/param-definition.js +7 -7
  576. package/lib/commonjs/mol-util/read.js +2 -2
  577. package/lib/commonjs/mol-util/retry-if.js +2 -2
  578. package/lib/commonjs/mol-util/string.js +1 -1
  579. package/lib/commonjs/mol-util/zip/deflate.js +4 -3
  580. package/lib/commonjs/mol-util/zip/inflate.js +2 -2
  581. package/lib/commonjs/mol-util/zip/zip.d.ts +7 -1
  582. package/lib/commonjs/mol-util/zip/zip.js +21 -16
  583. package/lib/commonjs/servers/common/file-handle.js +1 -1
  584. package/lib/commonjs/servers/common/swagger-ui/index.js +1 -1
  585. package/lib/commonjs/servers/model/config.d.ts +2 -2
  586. package/lib/commonjs/servers/model/config.js +5 -5
  587. package/lib/commonjs/servers/model/preprocess/converter.js +2 -2
  588. package/lib/commonjs/servers/model/preprocess/master.js +3 -3
  589. package/lib/commonjs/servers/model/preprocess/parallel.js +6 -6
  590. package/lib/commonjs/servers/model/preprocess/preprocess.js +4 -4
  591. package/lib/commonjs/servers/model/preprocess.js +1 -1
  592. package/lib/commonjs/servers/model/properties/providers/pdbe.js +8 -8
  593. package/lib/commonjs/servers/model/properties/providers/wwpdb.js +12 -12
  594. package/lib/commonjs/servers/model/property-provider.js +3 -3
  595. package/lib/commonjs/servers/model/query.js +1 -1
  596. package/lib/commonjs/servers/model/server/api-local.js +2 -2
  597. package/lib/commonjs/servers/model/server/api-schema.js +2 -2
  598. package/lib/commonjs/servers/model/server/api-web.js +5 -5
  599. package/lib/commonjs/servers/model/server/api.js +6 -6
  600. package/lib/commonjs/servers/model/server/query.js +15 -15
  601. package/lib/commonjs/servers/model/server/structure-wrapper.js +21 -21
  602. package/lib/commonjs/servers/model/server.js +2 -2
  603. package/lib/commonjs/servers/model/utils/fetch-props-pdbe.js +6 -6
  604. package/lib/commonjs/servers/model/utils/fetch-retry.js +3 -3
  605. package/lib/commonjs/servers/model/utils/writer.js +3 -3
  606. package/lib/commonjs/servers/plugin-state/config.js +1 -1
  607. package/lib/commonjs/servers/plugin-state/index.js +6 -6
  608. package/lib/commonjs/servers/volume/common/binary-schema.js +1 -1
  609. package/lib/commonjs/servers/volume/common/data-format.js +3 -3
  610. package/lib/commonjs/servers/volume/common/file.js +8 -8
  611. package/lib/commonjs/servers/volume/config.js +6 -6
  612. package/lib/commonjs/servers/volume/pack/format/ccp4.js +4 -4
  613. package/lib/commonjs/servers/volume/pack/format/dsn6.js +4 -4
  614. package/lib/commonjs/servers/volume/pack/format.js +3 -3
  615. package/lib/commonjs/servers/volume/pack/main.js +13 -13
  616. package/lib/commonjs/servers/volume/pack/sampling.js +13 -13
  617. package/lib/commonjs/servers/volume/pack/writer.js +2 -2
  618. package/lib/commonjs/servers/volume/pack.js +1 -1
  619. package/lib/commonjs/servers/volume/query.js +4 -4
  620. package/lib/commonjs/servers/volume/server/algebra/box.js +1 -1
  621. package/lib/commonjs/servers/volume/server/api.js +8 -8
  622. package/lib/commonjs/servers/volume/server/local-api.js +8 -8
  623. package/lib/commonjs/servers/volume/server/query/compose.js +8 -8
  624. package/lib/commonjs/servers/volume/server/query/execute.js +10 -10
  625. package/lib/commonjs/servers/volume/server/query/identify.js +2 -2
  626. package/lib/commonjs/servers/volume/server/web-api.js +7 -7
  627. package/lib/commonjs/servers/volume/server.js +2 -2
  628. package/lib/examples/alpha-orbitals/controls.js +2 -2
  629. package/lib/examples/basic-wrapper/controls.js +1 -1
  630. package/lib/examples/proteopedia-wrapper/ui/controls.js +1 -1
  631. package/lib/extensions/cellpack/model.js +4 -2
  632. package/lib/extensions/cellpack/state.js +2 -2
  633. package/lib/extensions/geo-export/ui.js +2 -2
  634. package/lib/extensions/model-export/ui.js +2 -2
  635. package/lib/extensions/mp4-export/ui.js +2 -2
  636. package/lib/extensions/rcsb/assembly-symmetry/ui.js +3 -3
  637. package/lib/extensions/zenodo/index.d.ts +7 -0
  638. package/lib/extensions/zenodo/index.js +32 -0
  639. package/lib/extensions/zenodo/ui.d.ts +61 -0
  640. package/lib/extensions/zenodo/ui.js +303 -0
  641. package/lib/mol-canvas3d/camera.js +2 -1
  642. package/lib/mol-canvas3d/helper/camera-helper.js +1 -1
  643. package/lib/mol-canvas3d/helper/handle-helper.js +1 -1
  644. package/lib/mol-canvas3d/helper/interaction-events.js +1 -1
  645. package/lib/mol-geo/geometry/text/text-builder.js +2 -1
  646. package/lib/mol-gl/shader-code.js +2 -1
  647. package/lib/mol-gl/webgl/buffer.js +2 -3
  648. package/lib/mol-io/common/binary-cif/classifier.js +3 -2
  649. package/lib/mol-io/common/binary-cif/decoder.js +4 -3
  650. package/lib/mol-io/common/io-buffer.d.ts +206 -0
  651. package/lib/mol-io/common/io-buffer.js +405 -0
  652. package/lib/mol-io/common/netcdf/reader.d.ts +78 -0
  653. package/lib/mol-io/common/netcdf/reader.js +456 -0
  654. package/lib/mol-io/reader/cif/schema/mmcif.d.ts +1 -1
  655. package/lib/mol-io/reader/nctraj/parser.d.ts +18 -0
  656. package/lib/mol-io/reader/nctraj/parser.js +97 -0
  657. package/lib/mol-io/reader/prmtop/parser.d.ts +58 -0
  658. package/lib/mol-io/reader/prmtop/parser.js +168 -0
  659. package/lib/mol-io/reader/top/parser.d.ts +37 -0
  660. package/lib/mol-io/reader/top/parser.js +299 -0
  661. package/lib/mol-io/reader/trr/parser.d.ts +22 -0
  662. package/lib/mol-io/reader/trr/parser.js +142 -0
  663. package/lib/mol-io/writer/cif/encoder.js +2 -1
  664. package/lib/mol-model/sequence/sequence.js +2 -1
  665. package/lib/mol-model/structure/model/types/saccharides.d.ts +8 -0
  666. package/lib/mol-model/structure/model/types/saccharides.js +8 -0
  667. package/lib/mol-model/structure/structure/carbohydrates/constants.d.ts +1 -1
  668. package/lib/mol-model/structure/structure/carbohydrates/constants.js +6 -9
  669. package/lib/mol-model-formats/structure/basic/atomic.d.ts +1 -1
  670. package/lib/mol-model-formats/structure/basic/atomic.js +1 -14
  671. package/lib/mol-model-formats/structure/basic/parser.d.ts +1 -1
  672. package/lib/mol-model-formats/structure/basic/parser.js +1 -1
  673. package/lib/mol-model-formats/structure/basic/schema.d.ts +2 -2
  674. package/lib/mol-model-formats/structure/basic/schema.js +7 -2
  675. package/lib/mol-model-formats/structure/basic/util.d.ts +33 -2
  676. package/lib/mol-model-formats/structure/basic/util.js +24 -1
  677. package/lib/mol-model-formats/structure/cif-core.js +4 -4
  678. package/lib/mol-model-formats/structure/common/component.js +5 -1
  679. package/lib/mol-model-formats/structure/cube.js +3 -3
  680. package/lib/mol-model-formats/structure/gro.js +3 -1
  681. package/lib/mol-model-formats/structure/mmcif.d.ts +1 -1
  682. package/lib/mol-model-formats/structure/mmcif.js +4 -2
  683. package/lib/mol-model-formats/structure/mol.js +3 -3
  684. package/lib/mol-model-formats/structure/mol2.js +4 -4
  685. package/lib/mol-model-formats/structure/nctraj.d.ts +9 -0
  686. package/lib/mol-model-formats/structure/nctraj.js +56 -0
  687. package/lib/mol-model-formats/structure/pdb.d.ts +1 -1
  688. package/lib/mol-model-formats/structure/pdb.js +5 -3
  689. package/lib/mol-model-formats/structure/prmtop.d.ts +16 -0
  690. package/lib/mol-model-formats/structure/prmtop.js +144 -0
  691. package/lib/mol-model-formats/structure/property/symmetry.js +11 -1
  692. package/lib/mol-model-formats/structure/psf.js +3 -1
  693. package/lib/mol-model-formats/structure/top.d.ts +16 -0
  694. package/lib/mol-model-formats/structure/top.js +186 -0
  695. package/lib/mol-model-formats/structure/trr.d.ts +9 -0
  696. package/lib/mol-model-formats/structure/trr.js +42 -0
  697. package/lib/mol-model-formats/structure/util.d.ts +2 -2
  698. package/lib/mol-model-formats/structure/util.js +19 -20
  699. package/lib/mol-model-formats/structure/xyz.js +2 -2
  700. package/lib/mol-plugin/context.d.ts +2 -1
  701. package/lib/mol-plugin/context.js +4 -3
  702. package/lib/mol-plugin/spec.js +1 -1
  703. package/lib/mol-plugin/version.js +2 -2
  704. package/lib/mol-plugin-state/actions/file.d.ts +1 -1
  705. package/lib/mol-plugin-state/actions/file.js +88 -55
  706. package/lib/mol-plugin-state/actions/structure.d.ts +11 -2
  707. package/lib/mol-plugin-state/actions/structure.js +174 -4
  708. package/lib/mol-plugin-state/actions/volume.js +3 -2
  709. package/lib/mol-plugin-state/formats/{structure.d.ts → coordinates.d.ts} +34 -18
  710. package/lib/mol-plugin-state/formats/coordinates.js +67 -0
  711. package/lib/mol-plugin-state/formats/registry.d.ts +3 -3
  712. package/lib/mol-plugin-state/formats/registry.js +13 -8
  713. package/lib/mol-plugin-state/formats/topology.d.ts +73 -0
  714. package/lib/mol-plugin-state/formats/topology.js +84 -0
  715. package/lib/mol-plugin-state/helpers/structure-component.js +2 -1
  716. package/lib/mol-plugin-state/manager/snapshots.js +4 -4
  717. package/lib/mol-plugin-state/objects.d.ts +47 -1
  718. package/lib/mol-plugin-state/objects.js +17 -1
  719. package/lib/mol-plugin-state/transforms/data.d.ts +6 -0
  720. package/lib/mol-plugin-state/transforms/data.js +61 -9
  721. package/lib/mol-plugin-state/transforms/model.d.ts +14 -2
  722. package/lib/mol-plugin-state/transforms/model.js +112 -3
  723. package/lib/mol-plugin-ui/base.js +1 -1
  724. package/lib/mol-plugin-ui/controls/action-menu.js +7 -7
  725. package/lib/mol-plugin-ui/controls/color.js +3 -3
  726. package/lib/mol-plugin-ui/controls/common.js +10 -10
  727. package/lib/mol-plugin-ui/controls/icons.js +70 -70
  728. package/lib/mol-plugin-ui/controls/legend.js +3 -3
  729. package/lib/mol-plugin-ui/controls/line-graph/line-graph-component.js +1 -1
  730. package/lib/mol-plugin-ui/controls/parameters.js +51 -51
  731. package/lib/mol-plugin-ui/controls/screenshot.js +2 -2
  732. package/lib/mol-plugin-ui/controls/slider.js +5 -5
  733. package/lib/mol-plugin-ui/controls.js +7 -7
  734. package/lib/mol-plugin-ui/custom/volume.js +4 -4
  735. package/lib/mol-plugin-ui/left-panel.d.ts +8 -1
  736. package/lib/mol-plugin-ui/left-panel.js +33 -12
  737. package/lib/mol-plugin-ui/plugin.js +10 -10
  738. package/lib/mol-plugin-ui/sequence/sequence.js +1 -1
  739. package/lib/mol-plugin-ui/sequence.js +5 -5
  740. package/lib/mol-plugin-ui/state/actions.js +1 -1
  741. package/lib/mol-plugin-ui/state/animation.js +1 -1
  742. package/lib/mol-plugin-ui/state/common.js +7 -7
  743. package/lib/mol-plugin-ui/state/snapshots.js +9 -9
  744. package/lib/mol-plugin-ui/state/tree.js +14 -14
  745. package/lib/mol-plugin-ui/state/update-transform.js +1 -1
  746. package/lib/mol-plugin-ui/structure/components.js +10 -10
  747. package/lib/mol-plugin-ui/structure/focus.js +1 -1
  748. package/lib/mol-plugin-ui/structure/generic.js +4 -4
  749. package/lib/mol-plugin-ui/structure/measurements.js +8 -8
  750. package/lib/mol-plugin-ui/structure/quick-styles.js +2 -2
  751. package/lib/mol-plugin-ui/structure/selection.js +7 -7
  752. package/lib/mol-plugin-ui/structure/source.js +4 -4
  753. package/lib/mol-plugin-ui/structure/superposition.js +8 -8
  754. package/lib/mol-plugin-ui/structure/volume.js +4 -4
  755. package/lib/mol-plugin-ui/task.js +5 -5
  756. package/lib/mol-plugin-ui/toast.js +4 -4
  757. package/lib/mol-plugin-ui/viewport/canvas.js +3 -3
  758. package/lib/mol-plugin-ui/viewport/help.js +8 -8
  759. package/lib/mol-plugin-ui/viewport/screenshot.js +3 -3
  760. package/lib/mol-plugin-ui/viewport/simple-settings.js +1 -1
  761. package/lib/mol-plugin-ui/viewport.js +4 -4
  762. package/lib/mol-script/language/parser.js +7 -4
  763. package/lib/mol-task/util/scheduler.d.ts +2 -2
  764. package/lib/mol-task/util/scheduler.js +7 -7
  765. package/lib/mol-theme/color/hydrophobicity.js +2 -2
  766. package/lib/mol-util/data-source.js +2 -1
  767. package/lib/mol-util/file-info.d.ts +1 -3
  768. package/lib/mol-util/file-info.js +2 -10
  769. package/lib/mol-util/index.d.ts +1 -0
  770. package/lib/mol-util/index.js +5 -0
  771. package/lib/mol-util/zip/deflate.js +2 -1
  772. package/lib/mol-util/zip/zip.d.ts +7 -1
  773. package/lib/mol-util/zip/zip.js +5 -1
  774. package/lib/servers/model/config.d.ts +2 -2
  775. package/package.json +16 -16
  776. package/lib/commonjs/mol-plugin-state/formats/structure.js +0 -64
  777. package/lib/mol-plugin-state/formats/structure.js +0 -61
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * Adapted and converted to TypeScript from https://github.com/image-js/iobuffer
5
+ * MIT License, Copyright (c) 2015 Michaël Zasso
6
+ *
7
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
8
+ */
9
+ import { TypedArray } from '../../mol-util/type-helpers';
10
+ export interface IOBufferParameters {
11
+ offset?: number;
12
+ }
13
+ /**
14
+ * Class for writing and reading binary data
15
+ */
16
+ export declare class IOBuffer {
17
+ private _lastWrittenByte;
18
+ private _mark;
19
+ private _marks;
20
+ private _data;
21
+ offset: number;
22
+ littleEndian: boolean;
23
+ buffer: ArrayBuffer;
24
+ length: number;
25
+ byteLength: number;
26
+ byteOffset: number;
27
+ /**
28
+ * If it's a number, it will initialize the buffer with the number as
29
+ * the buffer's length. If it's undefined, it will initialize the buffer
30
+ * with a default length of 8 Kb. If its an ArrayBuffer, a TypedArray,
31
+ * it will create a view over the underlying ArrayBuffer.
32
+ */
33
+ constructor(data: number | ArrayBuffer | TypedArray, params?: IOBufferParameters);
34
+ /**
35
+ * Checks if the memory allocated to the buffer is sufficient to store more bytes after the offset
36
+ * @param byteLength The needed memory in bytes
37
+ */
38
+ available(byteLength?: number): boolean;
39
+ /**
40
+ * Check if little-endian mode is used for reading and writing multi-byte values
41
+ * Returns true if little-endian mode is used, false otherwise
42
+ */
43
+ isLittleEndian(): boolean;
44
+ /**
45
+ * Set little-endian mode for reading and writing multi-byte values
46
+ */
47
+ setLittleEndian(): this;
48
+ /**
49
+ * Check if big-endian mode is used for reading and writing multi-byte values
50
+ * Returns true if big-endian mode is used, false otherwise
51
+ */
52
+ isBigEndian(): boolean;
53
+ /**
54
+ * Switches to big-endian mode for reading and writing multi-byte values
55
+ */
56
+ setBigEndian(): this;
57
+ /**
58
+ * Move the pointer n bytes forward
59
+ */
60
+ skip(n: number): this;
61
+ /**
62
+ * Move the pointer to the given offset
63
+ */
64
+ seek(offset: number): this;
65
+ /**
66
+ * Store the current pointer offset.
67
+ */
68
+ mark(): this;
69
+ /**
70
+ * Move the pointer back to the last pointer offset set by mark
71
+ */
72
+ reset(): this;
73
+ /**
74
+ * Push the current pointer offset to the mark stack
75
+ */
76
+ pushMark(): this;
77
+ /**
78
+ * Pop the last pointer offset from the mark stack, and set the current pointer offset to the popped value
79
+ */
80
+ popMark(): this;
81
+ /**
82
+ * Move the pointer offset back to 0
83
+ */
84
+ rewind(): this;
85
+ /**
86
+ * Make sure the buffer has sufficient memory to write a given byteLength at the current pointer offset
87
+ * If the buffer's memory is insufficient, this method will create a new buffer (a copy) with a length
88
+ * that is twice (byteLength + current offset)
89
+ */
90
+ ensureAvailable(byteLength: number): this;
91
+ /**
92
+ * Read a byte and return false if the byte's value is 0, or true otherwise
93
+ * Moves pointer forward
94
+ */
95
+ readBoolean(): boolean;
96
+ /**
97
+ * Read a signed 8-bit integer and move pointer forward
98
+ */
99
+ readInt8(): number;
100
+ /**
101
+ * Read an unsigned 8-bit integer and move pointer forward
102
+ */
103
+ readUint8(): number;
104
+ /**
105
+ * Alias for {@link IOBuffer#readUint8}
106
+ */
107
+ readByte(): number;
108
+ /**
109
+ * Read n bytes and move pointer forward.
110
+ */
111
+ readBytes(n: number): Uint8Array;
112
+ /**
113
+ * Read a 16-bit signed integer and move pointer forward
114
+ */
115
+ readInt16(): number;
116
+ /**
117
+ * Read a 16-bit unsigned integer and move pointer forward
118
+ */
119
+ readUint16(): number;
120
+ /**
121
+ * Read a 32-bit signed integer and move pointer forward
122
+ */
123
+ readInt32(): number;
124
+ /**
125
+ * Read a 32-bit unsigned integer and move pointer forward
126
+ */
127
+ readUint32(): number;
128
+ /**
129
+ * Read a 32-bit floating number and move pointer forward
130
+ */
131
+ readFloat32(): number;
132
+ /**
133
+ * Read a 64-bit floating number and move pointer forward
134
+ */
135
+ readFloat64(): number;
136
+ /**
137
+ * Read 1-byte ascii character and move pointer forward
138
+ */
139
+ readChar(): string;
140
+ /**
141
+ * Read n 1-byte ascii characters and move pointer forward
142
+ */
143
+ readChars(n?: number): string;
144
+ /**
145
+ * Write 0xff if the passed value is truthy, 0x00 otherwise
146
+ */
147
+ writeBoolean(value?: boolean): this;
148
+ /**
149
+ * Write value as an 8-bit signed integer
150
+ */
151
+ writeInt8(value: number): this;
152
+ /**
153
+ * Write value as a 8-bit unsigned integer
154
+ */
155
+ writeUint8(value: number): this;
156
+ /**
157
+ * An alias for IOBuffer#writeUint8
158
+ */
159
+ writeByte(value: number): this;
160
+ /**
161
+ * Write bytes
162
+ */
163
+ writeBytes(bytes: number[] | Uint8Array): this;
164
+ /**
165
+ * Write value as an 16-bit signed integer
166
+ */
167
+ writeInt16(value: number): this;
168
+ /**
169
+ * Write value as a 16-bit unsigned integer
170
+ */
171
+ writeUint16(value: number): this;
172
+ /**
173
+ * Write a 32-bit signed integer at the current pointer offset
174
+ */
175
+ writeInt32(value: number): this;
176
+ /**
177
+ * Write a 32-bit unsigned integer at the current pointer offset
178
+ */
179
+ writeUint32(value: number): this;
180
+ /**
181
+ * Write a 32-bit floating number at the current pointer offset
182
+ */
183
+ writeFloat32(value: number): this;
184
+ /**
185
+ * Write a 64-bit floating number at the current pointer offset
186
+ */
187
+ writeFloat64(value: number): this;
188
+ /**
189
+ * Write the charCode of the passed string's first character to the current pointer offset
190
+ */
191
+ writeChar(str: string): this;
192
+ /**
193
+ * Write the charCodes of the passed string's characters to the current pointer offset
194
+ */
195
+ writeChars(str: string): this;
196
+ /**
197
+ * Export a Uint8Array view of the internal buffer.
198
+ * The view starts at the byte offset and its length
199
+ * is calculated to stop at the last written byte or the original length.
200
+ */
201
+ toArray(): Uint8Array;
202
+ /**
203
+ * Update the last written byte offset
204
+ */
205
+ private _updateLastWrittenByte;
206
+ }
@@ -0,0 +1,405 @@
1
+ /**
2
+ * Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * Adapted and converted to TypeScript from https://github.com/image-js/iobuffer
5
+ * MIT License, Copyright (c) 2015 Michaël Zasso
6
+ *
7
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
8
+ */
9
+ var defaultByteLength = 1024 * 8;
10
+ var charArray = [];
11
+ /**
12
+ * Class for writing and reading binary data
13
+ */
14
+ var IOBuffer = /** @class */ (function () {
15
+ /**
16
+ * If it's a number, it will initialize the buffer with the number as
17
+ * the buffer's length. If it's undefined, it will initialize the buffer
18
+ * with a default length of 8 Kb. If its an ArrayBuffer, a TypedArray,
19
+ * it will create a view over the underlying ArrayBuffer.
20
+ */
21
+ function IOBuffer(data, params) {
22
+ if (params === void 0) { params = {}; }
23
+ this._mark = 0;
24
+ this._marks = [];
25
+ this.offset = 0; // The current offset of the buffer's pointer
26
+ this.littleEndian = true;
27
+ var dataIsGiven = false;
28
+ if (data === undefined) {
29
+ data = defaultByteLength;
30
+ }
31
+ if (typeof data === 'number') {
32
+ data = new ArrayBuffer(data);
33
+ }
34
+ else {
35
+ dataIsGiven = true;
36
+ }
37
+ var offset = params.offset ? params.offset >>> 0 : 0;
38
+ var byteLength = data.byteLength - offset;
39
+ var dvOffset = offset;
40
+ if (!(data instanceof ArrayBuffer)) {
41
+ if (data.byteLength !== data.buffer.byteLength) {
42
+ dvOffset = data.byteOffset + offset;
43
+ }
44
+ data = data.buffer;
45
+ }
46
+ if (dataIsGiven) {
47
+ this._lastWrittenByte = byteLength;
48
+ }
49
+ else {
50
+ this._lastWrittenByte = 0;
51
+ }
52
+ this.buffer = data;
53
+ this.length = byteLength;
54
+ this.byteLength = byteLength;
55
+ this.byteOffset = dvOffset;
56
+ this._data = new DataView(this.buffer, dvOffset, byteLength);
57
+ }
58
+ /**
59
+ * Checks if the memory allocated to the buffer is sufficient to store more bytes after the offset
60
+ * @param byteLength The needed memory in bytes
61
+ */
62
+ IOBuffer.prototype.available = function (byteLength) {
63
+ if (byteLength === void 0) { byteLength = 1; }
64
+ return (this.offset + byteLength) <= this.length;
65
+ };
66
+ /**
67
+ * Check if little-endian mode is used for reading and writing multi-byte values
68
+ * Returns true if little-endian mode is used, false otherwise
69
+ */
70
+ IOBuffer.prototype.isLittleEndian = function () {
71
+ return this.littleEndian;
72
+ };
73
+ /**
74
+ * Set little-endian mode for reading and writing multi-byte values
75
+ */
76
+ IOBuffer.prototype.setLittleEndian = function () {
77
+ this.littleEndian = true;
78
+ return this;
79
+ };
80
+ /**
81
+ * Check if big-endian mode is used for reading and writing multi-byte values
82
+ * Returns true if big-endian mode is used, false otherwise
83
+ */
84
+ IOBuffer.prototype.isBigEndian = function () {
85
+ return !this.littleEndian;
86
+ };
87
+ /**
88
+ * Switches to big-endian mode for reading and writing multi-byte values
89
+ */
90
+ IOBuffer.prototype.setBigEndian = function () {
91
+ this.littleEndian = false;
92
+ return this;
93
+ };
94
+ /**
95
+ * Move the pointer n bytes forward
96
+ */
97
+ IOBuffer.prototype.skip = function (n) {
98
+ if (n === undefined)
99
+ n = 1;
100
+ this.offset += n;
101
+ return this;
102
+ };
103
+ /**
104
+ * Move the pointer to the given offset
105
+ */
106
+ IOBuffer.prototype.seek = function (offset) {
107
+ this.offset = offset;
108
+ return this;
109
+ };
110
+ /**
111
+ * Store the current pointer offset.
112
+ */
113
+ IOBuffer.prototype.mark = function () {
114
+ this._mark = this.offset;
115
+ return this;
116
+ };
117
+ /**
118
+ * Move the pointer back to the last pointer offset set by mark
119
+ */
120
+ IOBuffer.prototype.reset = function () {
121
+ this.offset = this._mark;
122
+ return this;
123
+ };
124
+ /**
125
+ * Push the current pointer offset to the mark stack
126
+ */
127
+ IOBuffer.prototype.pushMark = function () {
128
+ this._marks.push(this.offset);
129
+ return this;
130
+ };
131
+ /**
132
+ * Pop the last pointer offset from the mark stack, and set the current pointer offset to the popped value
133
+ */
134
+ IOBuffer.prototype.popMark = function () {
135
+ var offset = this._marks.pop();
136
+ if (offset === undefined)
137
+ throw new Error('Mark stack empty');
138
+ this.seek(offset);
139
+ return this;
140
+ };
141
+ /**
142
+ * Move the pointer offset back to 0
143
+ */
144
+ IOBuffer.prototype.rewind = function () {
145
+ this.offset = 0;
146
+ return this;
147
+ };
148
+ /**
149
+ * Make sure the buffer has sufficient memory to write a given byteLength at the current pointer offset
150
+ * If the buffer's memory is insufficient, this method will create a new buffer (a copy) with a length
151
+ * that is twice (byteLength + current offset)
152
+ */
153
+ IOBuffer.prototype.ensureAvailable = function (byteLength) {
154
+ if (byteLength === undefined)
155
+ byteLength = 1;
156
+ if (!this.available(byteLength)) {
157
+ var lengthNeeded = this.offset + byteLength;
158
+ var newLength = lengthNeeded * 2;
159
+ var newArray = new Uint8Array(newLength);
160
+ newArray.set(new Uint8Array(this.buffer));
161
+ this.buffer = newArray.buffer;
162
+ this.length = this.byteLength = newLength;
163
+ this._data = new DataView(this.buffer);
164
+ }
165
+ return this;
166
+ };
167
+ /**
168
+ * Read a byte and return false if the byte's value is 0, or true otherwise
169
+ * Moves pointer forward
170
+ */
171
+ IOBuffer.prototype.readBoolean = function () {
172
+ return this.readUint8() !== 0;
173
+ };
174
+ /**
175
+ * Read a signed 8-bit integer and move pointer forward
176
+ */
177
+ IOBuffer.prototype.readInt8 = function () {
178
+ return this._data.getInt8(this.offset++);
179
+ };
180
+ /**
181
+ * Read an unsigned 8-bit integer and move pointer forward
182
+ */
183
+ IOBuffer.prototype.readUint8 = function () {
184
+ return this._data.getUint8(this.offset++);
185
+ };
186
+ /**
187
+ * Alias for {@link IOBuffer#readUint8}
188
+ */
189
+ IOBuffer.prototype.readByte = function () {
190
+ return this.readUint8();
191
+ };
192
+ /**
193
+ * Read n bytes and move pointer forward.
194
+ */
195
+ IOBuffer.prototype.readBytes = function (n) {
196
+ if (n === undefined)
197
+ n = 1;
198
+ var bytes = new Uint8Array(n);
199
+ for (var i = 0; i < n; i++) {
200
+ bytes[i] = this.readByte();
201
+ }
202
+ return bytes;
203
+ };
204
+ /**
205
+ * Read a 16-bit signed integer and move pointer forward
206
+ */
207
+ IOBuffer.prototype.readInt16 = function () {
208
+ var value = this._data.getInt16(this.offset, this.littleEndian);
209
+ this.offset += 2;
210
+ return value;
211
+ };
212
+ /**
213
+ * Read a 16-bit unsigned integer and move pointer forward
214
+ */
215
+ IOBuffer.prototype.readUint16 = function () {
216
+ var value = this._data.getUint16(this.offset, this.littleEndian);
217
+ this.offset += 2;
218
+ return value;
219
+ };
220
+ /**
221
+ * Read a 32-bit signed integer and move pointer forward
222
+ */
223
+ IOBuffer.prototype.readInt32 = function () {
224
+ var value = this._data.getInt32(this.offset, this.littleEndian);
225
+ this.offset += 4;
226
+ return value;
227
+ };
228
+ /**
229
+ * Read a 32-bit unsigned integer and move pointer forward
230
+ */
231
+ IOBuffer.prototype.readUint32 = function () {
232
+ var value = this._data.getUint32(this.offset, this.littleEndian);
233
+ this.offset += 4;
234
+ return value;
235
+ };
236
+ /**
237
+ * Read a 32-bit floating number and move pointer forward
238
+ */
239
+ IOBuffer.prototype.readFloat32 = function () {
240
+ var value = this._data.getFloat32(this.offset, this.littleEndian);
241
+ this.offset += 4;
242
+ return value;
243
+ };
244
+ /**
245
+ * Read a 64-bit floating number and move pointer forward
246
+ */
247
+ IOBuffer.prototype.readFloat64 = function () {
248
+ var value = this._data.getFloat64(this.offset, this.littleEndian);
249
+ this.offset += 8;
250
+ return value;
251
+ };
252
+ /**
253
+ * Read 1-byte ascii character and move pointer forward
254
+ */
255
+ IOBuffer.prototype.readChar = function () {
256
+ return String.fromCharCode(this.readInt8());
257
+ };
258
+ /**
259
+ * Read n 1-byte ascii characters and move pointer forward
260
+ */
261
+ IOBuffer.prototype.readChars = function (n) {
262
+ if (n === void 0) { n = 1; }
263
+ charArray.length = n;
264
+ for (var i = 0; i < n; i++) {
265
+ charArray[i] = this.readChar();
266
+ }
267
+ return charArray.join('');
268
+ };
269
+ /**
270
+ * Write 0xff if the passed value is truthy, 0x00 otherwise
271
+ */
272
+ IOBuffer.prototype.writeBoolean = function (value) {
273
+ if (value === void 0) { value = false; }
274
+ this.writeUint8(value ? 0xff : 0x00);
275
+ return this;
276
+ };
277
+ /**
278
+ * Write value as an 8-bit signed integer
279
+ */
280
+ IOBuffer.prototype.writeInt8 = function (value) {
281
+ this.ensureAvailable(1);
282
+ this._data.setInt8(this.offset++, value);
283
+ this._updateLastWrittenByte();
284
+ return this;
285
+ };
286
+ /**
287
+ * Write value as a 8-bit unsigned integer
288
+ */
289
+ IOBuffer.prototype.writeUint8 = function (value) {
290
+ this.ensureAvailable(1);
291
+ this._data.setUint8(this.offset++, value);
292
+ this._updateLastWrittenByte();
293
+ return this;
294
+ };
295
+ /**
296
+ * An alias for IOBuffer#writeUint8
297
+ */
298
+ IOBuffer.prototype.writeByte = function (value) {
299
+ return this.writeUint8(value);
300
+ };
301
+ /**
302
+ * Write bytes
303
+ */
304
+ IOBuffer.prototype.writeBytes = function (bytes) {
305
+ this.ensureAvailable(bytes.length);
306
+ for (var i = 0; i < bytes.length; i++) {
307
+ this._data.setUint8(this.offset++, bytes[i]);
308
+ }
309
+ this._updateLastWrittenByte();
310
+ return this;
311
+ };
312
+ /**
313
+ * Write value as an 16-bit signed integer
314
+ */
315
+ IOBuffer.prototype.writeInt16 = function (value) {
316
+ this.ensureAvailable(2);
317
+ this._data.setInt16(this.offset, value, this.littleEndian);
318
+ this.offset += 2;
319
+ this._updateLastWrittenByte();
320
+ return this;
321
+ };
322
+ /**
323
+ * Write value as a 16-bit unsigned integer
324
+ */
325
+ IOBuffer.prototype.writeUint16 = function (value) {
326
+ this.ensureAvailable(2);
327
+ this._data.setUint16(this.offset, value, this.littleEndian);
328
+ this.offset += 2;
329
+ this._updateLastWrittenByte();
330
+ return this;
331
+ };
332
+ /**
333
+ * Write a 32-bit signed integer at the current pointer offset
334
+ */
335
+ IOBuffer.prototype.writeInt32 = function (value) {
336
+ this.ensureAvailable(4);
337
+ this._data.setInt32(this.offset, value, this.littleEndian);
338
+ this.offset += 4;
339
+ this._updateLastWrittenByte();
340
+ return this;
341
+ };
342
+ /**
343
+ * Write a 32-bit unsigned integer at the current pointer offset
344
+ */
345
+ IOBuffer.prototype.writeUint32 = function (value) {
346
+ this.ensureAvailable(4);
347
+ this._data.setUint32(this.offset, value, this.littleEndian);
348
+ this.offset += 4;
349
+ this._updateLastWrittenByte();
350
+ return this;
351
+ };
352
+ /**
353
+ * Write a 32-bit floating number at the current pointer offset
354
+ */
355
+ IOBuffer.prototype.writeFloat32 = function (value) {
356
+ this.ensureAvailable(4);
357
+ this._data.setFloat32(this.offset, value, this.littleEndian);
358
+ this.offset += 4;
359
+ this._updateLastWrittenByte();
360
+ return this;
361
+ };
362
+ /**
363
+ * Write a 64-bit floating number at the current pointer offset
364
+ */
365
+ IOBuffer.prototype.writeFloat64 = function (value) {
366
+ this.ensureAvailable(8);
367
+ this._data.setFloat64(this.offset, value, this.littleEndian);
368
+ this.offset += 8;
369
+ this._updateLastWrittenByte();
370
+ return this;
371
+ };
372
+ /**
373
+ * Write the charCode of the passed string's first character to the current pointer offset
374
+ */
375
+ IOBuffer.prototype.writeChar = function (str) {
376
+ return this.writeUint8(str.charCodeAt(0));
377
+ };
378
+ /**
379
+ * Write the charCodes of the passed string's characters to the current pointer offset
380
+ */
381
+ IOBuffer.prototype.writeChars = function (str) {
382
+ for (var i = 0; i < str.length; i++) {
383
+ this.writeUint8(str.charCodeAt(i));
384
+ }
385
+ return this;
386
+ };
387
+ /**
388
+ * Export a Uint8Array view of the internal buffer.
389
+ * The view starts at the byte offset and its length
390
+ * is calculated to stop at the last written byte or the original length.
391
+ */
392
+ IOBuffer.prototype.toArray = function () {
393
+ return new Uint8Array(this.buffer, this.byteOffset, this._lastWrittenByte);
394
+ };
395
+ /**
396
+ * Update the last written byte offset
397
+ */
398
+ IOBuffer.prototype._updateLastWrittenByte = function () {
399
+ if (this.offset > this._lastWrittenByte) {
400
+ this._lastWrittenByte = this.offset;
401
+ }
402
+ };
403
+ return IOBuffer;
404
+ }());
405
+ export { IOBuffer };
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
+ *
4
+ * Adapted from https://github.com/cheminfo-js/netcdfjs
5
+ * MIT License, Copyright (c) 2016 cheminfo
6
+ *
7
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
8
+ */
9
+ import { IOBuffer } from '../io-buffer';
10
+ export interface NetCDFRecordDimension {
11
+ length: number;
12
+ id?: number;
13
+ name?: string;
14
+ recordStep?: number;
15
+ }
16
+ export interface NetCDFVariable {
17
+ name: string;
18
+ dimensions: any[];
19
+ attributes: any[];
20
+ type: string;
21
+ size: number;
22
+ offset: number;
23
+ record: boolean;
24
+ }
25
+ export interface NetCDFHeader {
26
+ recordDimension: NetCDFRecordDimension;
27
+ version: number;
28
+ dimensions: {
29
+ name: string;
30
+ size: number;
31
+ }[];
32
+ globalAttributes: {
33
+ name: string;
34
+ type: string;
35
+ value: string | number;
36
+ }[];
37
+ variables: NetCDFVariable[];
38
+ }
39
+ export interface NetCDFDimension {
40
+ name: string;
41
+ size: number;
42
+ }
43
+ /**
44
+ * Reads a NetCDF v3.x file
45
+ * https://www.unidata.ucar.edu/software/netcdf/docs/file_format_specifications.html
46
+ */
47
+ export declare class NetcdfReader {
48
+ header: Partial<NetCDFHeader>;
49
+ buffer: IOBuffer;
50
+ constructor(data: ArrayBuffer);
51
+ /**
52
+ * Version for the NetCDF format
53
+ */
54
+ get version(): "classic format" | "64-bit offset format";
55
+ get recordDimension(): NetCDFRecordDimension | undefined;
56
+ get dimensions(): {
57
+ name: string;
58
+ size: number;
59
+ }[] | undefined;
60
+ get globalAttributes(): {
61
+ name: string;
62
+ type: string;
63
+ value: string | number;
64
+ }[] | undefined;
65
+ get variables(): NetCDFVariable[] | undefined;
66
+ /**
67
+ * Checks if a variable is available
68
+ * @param {string|object} variableName - Name of the variable to check
69
+ * @return {Boolean} - Variable existence
70
+ */
71
+ hasDataVariable(variableName: string): boolean | undefined;
72
+ /**
73
+ * Retrieves the data for a given variable
74
+ * @param {string|object} variableName - Name of the variable to search or variable object
75
+ * @return {Array} - List with the variable values
76
+ */
77
+ getDataVariable(variableName: string | NetCDFVariable): any[];
78
+ }