matterviz 0.4.0 → 0.4.1

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 (326) hide show
  1. package/dist/brillouin/BrillouinZone.svelte +68 -145
  2. package/dist/brillouin/BrillouinZone.svelte.d.ts +5 -14
  3. package/dist/brillouin/BrillouinZoneExportPane.svelte +43 -96
  4. package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
  5. package/dist/brillouin/BrillouinZoneInfoPane.svelte +9 -32
  6. package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +2 -3
  7. package/dist/brillouin/BrillouinZoneScene.svelte +49 -203
  8. package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +3 -23
  9. package/dist/brillouin/ReciprocalVectors.svelte +39 -0
  10. package/dist/brillouin/ReciprocalVectors.svelte.d.ts +9 -0
  11. package/dist/brillouin/compute.d.ts +2 -0
  12. package/dist/brillouin/compute.js +80 -77
  13. package/dist/brillouin/geometry.d.ts +8 -0
  14. package/dist/brillouin/geometry.js +57 -0
  15. package/dist/brillouin/index.d.ts +2 -0
  16. package/dist/brillouin/index.js +2 -0
  17. package/dist/brillouin/types.d.ts +2 -2
  18. package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +1 -1
  19. package/dist/chempot-diagram/ChemPotDiagram2D.svelte +100 -191
  20. package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +4 -1
  21. package/dist/chempot-diagram/ChemPotDiagram3D.svelte +176 -464
  22. package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +7 -1
  23. package/dist/chempot-diagram/color.d.ts +3 -6
  24. package/dist/chempot-diagram/color.js +5 -5
  25. package/dist/chempot-diagram/compute.d.ts +3 -3
  26. package/dist/chempot-diagram/compute.js +3 -1
  27. package/dist/chempot-diagram/controls-state.svelte.d.ts +10 -0
  28. package/dist/chempot-diagram/controls-state.svelte.js +42 -0
  29. package/dist/chempot-diagram/export.d.ts +47 -0
  30. package/dist/chempot-diagram/export.js +133 -0
  31. package/dist/chempot-diagram/index.d.ts +1 -0
  32. package/dist/chempot-diagram/index.js +1 -0
  33. package/dist/chempot-diagram/pointer.d.ts +0 -10
  34. package/dist/chempot-diagram/pointer.js +4 -4
  35. package/dist/chempot-diagram/types.d.ts +3 -3
  36. package/dist/colors/index.js +2 -2
  37. package/dist/composition/FormulaFilter.svelte +6 -5
  38. package/dist/composition/PieChart.svelte +5 -5
  39. package/dist/composition/chem-sys.js +3 -2
  40. package/dist/composition/format.js +3 -2
  41. package/dist/composition/parse.d.ts +0 -1
  42. package/dist/composition/parse.js +17 -19
  43. package/dist/controls.d.ts +1 -0
  44. package/dist/controls.js +0 -1
  45. package/dist/convex-hull/ConvexHull.svelte +8 -10
  46. package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -4
  47. package/dist/convex-hull/ConvexHull2D.svelte +94 -175
  48. package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
  49. package/dist/convex-hull/ConvexHull3D.svelte +176 -680
  50. package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
  51. package/dist/convex-hull/ConvexHull4D.svelte +180 -680
  52. package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
  53. package/dist/convex-hull/ConvexHullChrome.svelte +268 -0
  54. package/dist/convex-hull/ConvexHullChrome.svelte.d.ts +30 -0
  55. package/dist/convex-hull/ConvexHullControls.svelte +88 -7
  56. package/dist/convex-hull/ConvexHullControls.svelte.d.ts +7 -6
  57. package/dist/convex-hull/ConvexHullInfoPane.svelte +18 -5
  58. package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +6 -5
  59. package/dist/convex-hull/ConvexHullStats.svelte +29 -168
  60. package/dist/convex-hull/ConvexHullStats.svelte.d.ts +3 -1
  61. package/dist/convex-hull/ConvexHullTooltip.svelte +11 -2
  62. package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +2 -1
  63. package/dist/convex-hull/barycentric-coords.d.ts +2 -4
  64. package/dist/convex-hull/barycentric-coords.js +6 -33
  65. package/dist/convex-hull/canvas-interactions.svelte.d.ts +79 -0
  66. package/dist/convex-hull/canvas-interactions.svelte.js +278 -0
  67. package/dist/convex-hull/helpers.d.ts +39 -7
  68. package/dist/convex-hull/helpers.js +154 -69
  69. package/dist/convex-hull/hull-state.svelte.d.ts +44 -0
  70. package/dist/convex-hull/hull-state.svelte.js +124 -0
  71. package/dist/convex-hull/index.d.ts +9 -7
  72. package/dist/convex-hull/index.js +7 -2
  73. package/dist/convex-hull/thermodynamics.js +91 -920
  74. package/dist/convex-hull/types.d.ts +12 -4
  75. package/dist/convex-hull/types.js +12 -0
  76. package/dist/coordination/CoordinationBarPlot.svelte +4 -11
  77. package/dist/element/BohrAtom.svelte +2 -1
  78. package/dist/element/ElementTile.svelte.d.ts +1 -1
  79. package/dist/element/index.d.ts +4 -0
  80. package/dist/element/index.js +18 -0
  81. package/dist/feedback/DragOverlay.svelte +3 -1
  82. package/dist/feedback/DragOverlay.svelte.d.ts +1 -0
  83. package/dist/feedback/StatusMessage.svelte +13 -3
  84. package/dist/fermi-surface/FermiSurface.svelte +67 -146
  85. package/dist/fermi-surface/FermiSurface.svelte.d.ts +5 -14
  86. package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
  87. package/dist/fermi-surface/FermiSurfaceScene.svelte +72 -224
  88. package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +3 -23
  89. package/dist/fermi-surface/compute.js +11 -10
  90. package/dist/fermi-surface/export.js +4 -15
  91. package/dist/fermi-surface/index.d.ts +0 -1
  92. package/dist/fermi-surface/index.js +0 -1
  93. package/dist/fermi-surface/parse.d.ts +1 -1
  94. package/dist/fermi-surface/parse.js +64 -75
  95. package/dist/fermi-surface/types.d.ts +2 -2
  96. package/dist/heatmap-matrix/HeatmapMatrix.svelte +55 -40
  97. package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +4 -3
  98. package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +3 -2
  99. package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +5 -5
  100. package/dist/heatmap-matrix/index.d.ts +3 -2
  101. package/dist/index.d.ts +1 -0
  102. package/dist/index.js +1 -0
  103. package/dist/io/ExportPane.svelte +166 -0
  104. package/dist/io/ExportPane.svelte.d.ts +17 -0
  105. package/dist/io/decompress.js +1 -2
  106. package/dist/io/export.d.ts +5 -1
  107. package/dist/io/export.js +32 -28
  108. package/dist/io/fetch.d.ts +2 -1
  109. package/dist/io/file-drop.d.ts +7 -0
  110. package/dist/io/file-drop.js +13 -0
  111. package/dist/io/index.d.ts +2 -0
  112. package/dist/io/index.js +10 -0
  113. package/dist/io/types.d.ts +13 -0
  114. package/dist/isosurface/parse.js +46 -44
  115. package/dist/labels.js +1 -1
  116. package/dist/layout/FullscreenButton.svelte +33 -0
  117. package/dist/layout/FullscreenButton.svelte.d.ts +10 -0
  118. package/dist/layout/FullscreenToggle.svelte +8 -14
  119. package/dist/layout/ViewerChrome.svelte +116 -0
  120. package/dist/layout/ViewerChrome.svelte.d.ts +17 -0
  121. package/dist/layout/fullscreen.d.ts +4 -0
  122. package/dist/layout/fullscreen.svelte.d.ts +8 -0
  123. package/dist/layout/fullscreen.svelte.js +37 -0
  124. package/dist/layout/index.d.ts +3 -0
  125. package/dist/layout/index.js +3 -0
  126. package/dist/math.d.ts +7 -3
  127. package/dist/math.js +18 -21
  128. package/dist/overlays/index.d.ts +4 -0
  129. package/dist/periodic-table/PeriodicTable.svelte +9 -8
  130. package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +1 -1
  131. package/dist/phase-diagram/PhaseDiagramControls.svelte +3 -2
  132. package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +4 -3
  133. package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +2 -1
  134. package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +2 -3
  135. package/dist/phase-diagram/PhaseDiagramExportPane.svelte +47 -132
  136. package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +3 -4
  137. package/dist/phase-diagram/colors.js +1 -1
  138. package/dist/phase-diagram/parse.d.ts +2 -1
  139. package/dist/plot/bar/BarPlot.svelte +79 -316
  140. package/dist/plot/bar/BarPlot.svelte.d.ts +7 -15
  141. package/dist/plot/bar/BarPlotControls.svelte.d.ts +1 -1
  142. package/dist/plot/bar/SpacegroupBarPlot.svelte +2 -1
  143. package/dist/plot/box/BoxPlot.svelte +76 -246
  144. package/dist/plot/box/BoxPlot.svelte.d.ts +4 -3
  145. package/dist/plot/box/BoxPlotControls.svelte.d.ts +1 -1
  146. package/dist/plot/box/Violin.svelte.d.ts +1 -1
  147. package/dist/plot/box/box-plot.d.ts +3 -2
  148. package/dist/plot/box/box-plot.js +5 -2
  149. package/dist/plot/box/kde.d.ts +2 -1
  150. package/dist/plot/box/kde.js +4 -4
  151. package/dist/plot/core/auto-place.d.ts +1 -1
  152. package/dist/plot/core/auto-place.js +4 -1
  153. package/dist/plot/core/components/ColorBar.svelte +5 -5
  154. package/dist/plot/core/components/ColorBar.svelte.d.ts +5 -4
  155. package/dist/plot/core/components/Line.svelte +3 -2
  156. package/dist/plot/core/components/Line.svelte.d.ts +3 -2
  157. package/dist/plot/core/components/PlotAxis.svelte +2 -1
  158. package/dist/plot/core/components/PlotAxis.svelte.d.ts +2 -1
  159. package/dist/plot/core/components/PlotControls.svelte.d.ts +1 -1
  160. package/dist/plot/core/components/ReferenceLine3D.svelte +2 -2
  161. package/dist/plot/core/components/ReferenceLine3D.svelte.d.ts +4 -4
  162. package/dist/plot/core/components/ReferencePlane.svelte +2 -2
  163. package/dist/plot/core/components/ReferencePlane.svelte.d.ts +4 -4
  164. package/dist/plot/core/data-cleaning.js +18 -18
  165. package/dist/plot/core/fill-utils.d.ts +4 -3
  166. package/dist/plot/core/fill-utils.js +6 -3
  167. package/dist/plot/core/interactions.d.ts +5 -1
  168. package/dist/plot/core/interactions.js +14 -0
  169. package/dist/plot/core/pan-zoom.svelte.d.ts +35 -0
  170. package/dist/plot/core/pan-zoom.svelte.js +221 -0
  171. package/dist/plot/core/placed-tween.svelte.d.ts +21 -0
  172. package/dist/plot/core/placed-tween.svelte.js +68 -0
  173. package/dist/plot/core/reference-line.d.ts +10 -10
  174. package/dist/plot/core/reference-line.js +6 -6
  175. package/dist/plot/core/scales.d.ts +17 -25
  176. package/dist/plot/core/scales.js +10 -8
  177. package/dist/plot/core/svg.d.ts +2 -1
  178. package/dist/plot/core/types.d.ts +18 -7
  179. package/dist/plot/core/utils/label-placement.d.ts +1 -1
  180. package/dist/plot/core/utils/label-placement.js +3 -3
  181. package/dist/plot/core/utils.d.ts +2 -1
  182. package/dist/plot/histogram/Histogram.svelte +77 -314
  183. package/dist/plot/histogram/HistogramControls.svelte.d.ts +1 -1
  184. package/dist/plot/sankey/Sankey.svelte +2 -5
  185. package/dist/plot/sankey/Sankey.svelte.d.ts +1 -1
  186. package/dist/plot/sankey/sankey.js +3 -1
  187. package/dist/plot/scatter/BinnedScatterPlot.svelte +3 -5
  188. package/dist/plot/scatter/BinnedScatterPlot.svelte.d.ts +4 -4
  189. package/dist/plot/scatter/ScatterPlot.svelte +160 -450
  190. package/dist/plot/scatter/ScatterPlot.svelte.d.ts +7 -15
  191. package/dist/plot/scatter/ScatterPlotControls.svelte.d.ts +1 -1
  192. package/dist/plot/scatter/binned-scatter-types.d.ts +4 -11
  193. package/dist/plot/scatter/index.d.ts +1 -1
  194. package/dist/plot/scatter-3d/ScatterPlot3D.svelte +15 -26
  195. package/dist/plot/scatter-3d/ScatterPlot3D.svelte.d.ts +6 -14
  196. package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte +9 -10
  197. package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte.d.ts +5 -5
  198. package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte +122 -121
  199. package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte.d.ts +5 -14
  200. package/dist/plot/scatter-3d/Surface3D.svelte +6 -5
  201. package/dist/plot/scatter-3d/Surface3D.svelte.d.ts +4 -3
  202. package/dist/plot/sunburst/Sunburst.svelte +16 -20
  203. package/dist/plot/sunburst/Sunburst.svelte.d.ts +4 -3
  204. package/dist/plot/sunburst/SunburstControls.svelte.d.ts +1 -1
  205. package/dist/plot/sunburst/sunburst.js +4 -1
  206. package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
  207. package/dist/sanitize.js +13 -2
  208. package/dist/scene/SceneCamera.svelte +62 -0
  209. package/dist/scene/SceneCamera.svelte.d.ts +19 -0
  210. package/dist/scene/bind-renderer.svelte.d.ts +2 -0
  211. package/dist/scene/bind-renderer.svelte.js +14 -0
  212. package/dist/scene/index.d.ts +4 -0
  213. package/dist/scene/index.js +5 -0
  214. package/dist/scene/props.js +52 -0
  215. package/dist/scene/types.d.ts +26 -0
  216. package/dist/scene/types.js +1 -0
  217. package/dist/settings.d.ts +14 -2
  218. package/dist/settings.js +59 -1
  219. package/dist/spectral/Bands.svelte +8 -7
  220. package/dist/spectral/Bands.svelte.d.ts +3 -2
  221. package/dist/spectral/BandsAndDos.svelte +22 -24
  222. package/dist/spectral/BrillouinBandsDos.svelte +3 -3
  223. package/dist/spectral/Dos.svelte +5 -4
  224. package/dist/spectral/Dos.svelte.d.ts +2 -1
  225. package/dist/spectral/helpers.d.ts +6 -6
  226. package/dist/spectral/helpers.js +43 -37
  227. package/dist/state.svelte.d.ts +0 -7
  228. package/dist/state.svelte.js +0 -6
  229. package/dist/structure/Arrow.svelte +2 -4
  230. package/dist/structure/AtomLegend.svelte.d.ts +1 -1
  231. package/dist/structure/CanvasTooltip.svelte +1 -0
  232. package/dist/structure/CellSelect.svelte +11 -3
  233. package/dist/structure/CellSelect.svelte.d.ts +2 -1
  234. package/dist/structure/Lattice.svelte +2 -2
  235. package/dist/structure/Structure.svelte +291 -355
  236. package/dist/structure/Structure.svelte.d.ts +5 -15
  237. package/dist/structure/StructureControls.svelte +217 -2
  238. package/dist/structure/StructureControls.svelte.d.ts +5 -3
  239. package/dist/structure/StructureExportPane.svelte +54 -156
  240. package/dist/structure/StructureExportPane.svelte.d.ts +4 -5
  241. package/dist/structure/StructureInfoPane.svelte +5 -3
  242. package/dist/structure/StructureInfoPane.svelte.d.ts +5 -5
  243. package/dist/structure/StructureScene.svelte +365 -198
  244. package/dist/structure/StructureScene.svelte.d.ts +22 -20
  245. package/dist/structure/{label-placement.d.ts → atom-label-placement.d.ts} +3 -3
  246. package/dist/structure/{label-placement.js → atom-label-placement.js} +12 -2
  247. package/dist/structure/atom-properties.d.ts +1 -1
  248. package/dist/structure/atom-properties.js +11 -16
  249. package/dist/structure/bond-order-perception.js +2 -4
  250. package/dist/structure/bonding.d.ts +3 -0
  251. package/dist/structure/bonding.js +91 -48
  252. package/dist/structure/export.d.ts +24 -4
  253. package/dist/structure/export.js +64 -122
  254. package/dist/structure/index.d.ts +2 -0
  255. package/dist/structure/index.js +2 -0
  256. package/dist/structure/parse.d.ts +3 -2
  257. package/dist/structure/parse.js +333 -370
  258. package/dist/structure/partial-occupancy.d.ts +0 -1
  259. package/dist/structure/partial-occupancy.js +1 -1
  260. package/dist/structure/pbc.d.ts +1 -1
  261. package/dist/structure/pbc.js +186 -13
  262. package/dist/structure/polyhedra.d.ts +41 -0
  263. package/dist/structure/polyhedra.js +602 -0
  264. package/dist/structure/site.d.ts +4 -0
  265. package/dist/structure/site.js +1 -0
  266. package/dist/structure/supercell.js +3 -2
  267. package/dist/structure/validation.js +5 -6
  268. package/dist/symmetry/SymmetryElementControls.svelte +69 -0
  269. package/dist/symmetry/SymmetryElementControls.svelte.d.ts +9 -0
  270. package/dist/symmetry/SymmetryElements.svelte +354 -0
  271. package/dist/symmetry/SymmetryElements.svelte.d.ts +24 -0
  272. package/dist/symmetry/SymmetryStats.svelte +111 -6
  273. package/dist/symmetry/WyckoffTable.svelte +68 -7
  274. package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -0
  275. package/dist/symmetry/cell-transform.js +7 -14
  276. package/dist/symmetry/index.d.ts +14 -4
  277. package/dist/symmetry/index.js +301 -80
  278. package/dist/symmetry/spacegroups.d.ts +5 -1
  279. package/dist/symmetry/spacegroups.js +15 -1
  280. package/dist/symmetry/symmetry-elements.d.ts +33 -0
  281. package/dist/symmetry/symmetry-elements.js +521 -0
  282. package/dist/symmetry/wyckoff-db.d.ts +9 -0
  283. package/dist/symmetry/wyckoff-db.js +87 -0
  284. package/dist/table/HeatmapTable.svelte +4 -15
  285. package/dist/table/HeatmapTable.svelte.d.ts +1 -1
  286. package/dist/trajectory/Trajectory.svelte +58 -61
  287. package/dist/trajectory/Trajectory.svelte.d.ts +10 -22
  288. package/dist/trajectory/TrajectoryExportPane.svelte +15 -24
  289. package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +4 -5
  290. package/dist/trajectory/TrajectoryInfoPane.svelte +3 -2
  291. package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -2
  292. package/dist/trajectory/constants.js +6 -2
  293. package/dist/trajectory/extract.js +17 -37
  294. package/dist/trajectory/format-detect.d.ts +0 -1
  295. package/dist/trajectory/format-detect.js +3 -9
  296. package/dist/trajectory/frame-reader.d.ts +0 -1
  297. package/dist/trajectory/frame-reader.js +62 -128
  298. package/dist/trajectory/helpers.d.ts +10 -2
  299. package/dist/trajectory/helpers.js +56 -36
  300. package/dist/trajectory/parse/ase.d.ts +9 -1
  301. package/dist/trajectory/parse/ase.js +47 -32
  302. package/dist/trajectory/parse/diagnostics.d.ts +3 -0
  303. package/dist/trajectory/parse/diagnostics.js +14 -0
  304. package/dist/trajectory/parse/index.d.ts +1 -1
  305. package/dist/trajectory/parse/index.js +54 -102
  306. package/dist/trajectory/parse/lammps.d.ts +0 -2
  307. package/dist/trajectory/parse/lammps.js +8 -6
  308. package/dist/trajectory/parse/pymatgen.d.ts +2 -0
  309. package/dist/trajectory/parse/pymatgen.js +74 -0
  310. package/dist/trajectory/parse/vasp.js +4 -3
  311. package/dist/trajectory/parse/xyz.d.ts +9 -21
  312. package/dist/trajectory/parse/xyz.js +28 -33
  313. package/dist/trajectory/plotting.d.ts +0 -1
  314. package/dist/trajectory/plotting.js +3 -100
  315. package/dist/utils.d.ts +1 -0
  316. package/dist/utils.js +1 -1
  317. package/dist/xrd/XrdPlot.svelte +14 -29
  318. package/dist/xrd/broadening.d.ts +2 -1
  319. package/dist/xrd/calc-xrd.js +6 -11
  320. package/dist/xrd/index.d.ts +2 -2
  321. package/package.json +29 -16
  322. package/dist/element/data.json +0 -11864
  323. package/dist/fermi-surface/marching-cubes.d.ts +0 -2
  324. package/dist/fermi-surface/marching-cubes.js +0 -2
  325. package/dist/plot/core/hover-lock.svelte.d.ts +0 -14
  326. package/dist/plot/core/hover-lock.svelte.js +0 -45
@@ -1,5 +1,7 @@
1
+ import * as math from '../math';
2
+ import { is_plain_object } from '../utils';
1
3
  import * as constants from './constants';
2
- import { compute_vertex_normals } from './marching-cubes';
4
+ import { compute_vertex_normals } from '../marching-cubes';
3
5
  const parse_number_tokens = (line) => line.split(/\s+/).filter(Boolean);
4
6
  // Parse whitespace-separated floats from a line (optimized with unary +)
5
7
  const parse_floats = (line) => parse_number_tokens(line).map(Number);
@@ -224,14 +226,9 @@ function parse_frmsf(content) {
224
226
  }
225
227
  // Validate that an object has the required Isosurface shape
226
228
  function is_valid_isosurface(obj) {
227
- if (!obj || typeof obj !== `object`)
229
+ if (!is_plain_object(obj))
228
230
  return false;
229
- const isosurface_obj = obj;
230
- const vertices = isosurface_obj.vertices;
231
- const faces = isosurface_obj.faces;
232
- const normals = isosurface_obj.normals;
233
- const band_index = isosurface_obj.band_index;
234
- const spin = isosurface_obj.spin;
231
+ const { vertices, faces, normals, band_index, spin } = obj;
235
232
  if (!Array.isArray(vertices) || vertices.length === 0)
236
233
  return false;
237
234
  if (!Array.isArray(faces))
@@ -246,27 +243,35 @@ function is_valid_isosurface(obj) {
246
243
  }
247
244
  // Validate FermiSurfaceData shape
248
245
  function is_valid_fermi_surface_data(obj) {
249
- if (!obj || typeof obj !== `object`)
246
+ if (!is_plain_object(obj))
250
247
  return false;
251
- const data = obj;
252
248
  // Check required fields
253
- if (!Array.isArray(data.isosurfaces))
249
+ if (!Array.isArray(obj.isosurfaces))
254
250
  return false;
255
- if (!Array.isArray(data.k_lattice) || data.k_lattice.length !== 3)
251
+ if (!math.is_square_matrix(obj.k_lattice, 3))
256
252
  return false;
257
- if (typeof data.fermi_energy !== `number`)
253
+ if (typeof obj.fermi_energy !== `number`)
258
254
  return false;
259
- if (data.reciprocal_cell !== `wigner_seitz` && data.reciprocal_cell !== `parallelepiped`) {
255
+ if (obj.reciprocal_cell !== `wigner_seitz` && obj.reciprocal_cell !== `parallelepiped`) {
260
256
  return false;
261
257
  }
262
- if (!data.metadata || typeof data.metadata !== `object`)
258
+ if (!obj.metadata || typeof obj.metadata !== `object`)
263
259
  return false;
264
260
  // Validate each isosurface
265
- for (const iso of data.isosurfaces) {
266
- if (!is_valid_isosurface(iso))
267
- return false;
268
- }
269
- return true;
261
+ return obj.isosurfaces.every(is_valid_isosurface);
262
+ }
263
+ // Validate BandGridData shape: non-empty energies grid, 3 k-grid dims, 3x3 k-lattice
264
+ function is_valid_band_grid_data(obj) {
265
+ if (!is_plain_object(obj))
266
+ return false;
267
+ const { energies, k_grid, k_lattice } = obj;
268
+ if (!Array.isArray(energies) || energies.length === 0)
269
+ return false;
270
+ if (!Array.isArray(k_grid) ||
271
+ k_grid.length !== 3 ||
272
+ !k_grid.every((dim) => Number.isInteger(dim) && dim > 0))
273
+ return false;
274
+ return math.is_square_matrix(k_lattice, 3);
270
275
  }
271
276
  // Parse Matterviz/IFermi JSON format for Fermi surface data
272
277
  // Throws on invalid input; returns parsed data on success
@@ -287,22 +292,21 @@ function parse_fermi_json(content) {
287
292
  }
288
293
  // Check if it's BandGridData (raw grid data)
289
294
  if (data.energies && data.k_grid && data.k_lattice) {
290
- // Minimal validation of required fields
291
- if (!Array.isArray(data.energies) ||
292
- !Array.isArray(data.k_grid) ||
293
- data.k_grid.length !== 3 ||
294
- !Array.isArray(data.k_lattice) ||
295
- data.k_lattice.length !== 3)
296
- throw new Error(`Invalid BandGridData JSON: malformed required fields`);
295
+ if (!is_valid_band_grid_data(data)) {
296
+ throw new Error(`Invalid BandGridData JSON: expected non-empty 'energies' grid, 3 'k_grid' dims, and 3x3 'k_lattice'`);
297
+ }
297
298
  return data;
298
299
  }
299
300
  // Try to extract from nested structure (e.g. IFermi output)
300
301
  if (data.fermi_surface) {
302
+ if (!is_valid_fermi_surface_data(data.fermi_surface)) {
303
+ throw new Error(`Invalid nested 'fermi_surface' JSON: expected isosurfaces array, 3x3 k_lattice, numeric fermi_energy, reciprocal_cell, and metadata`);
304
+ }
301
305
  return data.fermi_surface;
302
306
  }
303
307
  if (data.band_structure?.energies || data.bands?.energies) {
304
308
  const bs = data.band_structure ?? data.bands;
305
- return {
309
+ const grid_data = {
306
310
  energies: bs.energies,
307
311
  k_grid: bs.k_grid ?? bs.kgrid,
308
312
  k_lattice: bs.k_lattice ?? bs.reciprocal_lattice,
@@ -312,6 +316,10 @@ function parse_fermi_json(content) {
312
316
  // oxlint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- numeric fallback chain (0 falls through)
313
317
  n_spins: (bs.n_spins ?? bs.nspins) || bs.energies.length || 1,
314
318
  };
319
+ if (!is_valid_band_grid_data(grid_data)) {
320
+ throw new Error(`Invalid band_structure JSON: expected non-empty 'energies' grid, 3 'k_grid' dims, and 3x3 'k_lattice'`);
321
+ }
322
+ return grid_data;
315
323
  }
316
324
  // Check for pymatgen BandStructure format (k-path, not k-grid)
317
325
  // These files cannot be used for Fermi surface visualization directly
@@ -387,14 +395,8 @@ function parse_ifermi_surface(data) {
387
395
  for (let fan_idx = 1; fan_idx < face.length - 1; fan_idx++) {
388
396
  const v1 = vertices[face[fan_idx]];
389
397
  const v2 = vertices[face[fan_idx + 1]];
390
- const e1 = [v1[0] - v0[0], v1[1] - v0[1], v1[2] - v0[2]];
391
- const e2 = [v2[0] - v0[0], v2[1] - v0[1], v2[2] - v0[2]];
392
- const cross = [
393
- e1[1] * e2[2] - e1[2] * e2[1],
394
- e1[2] * e2[0] - e1[0] * e2[2],
395
- e1[0] * e2[1] - e1[1] * e2[0],
396
- ];
397
- area += 0.5 * Math.hypot(cross[0], cross[1], cross[2]);
398
+ const cross = math.cross_3d(math.subtract(v1, v0), math.subtract(v2, v0));
399
+ area += 0.5 * Math.hypot(...cross);
398
400
  }
399
401
  }
400
402
  isosurfaces.push({
@@ -427,68 +429,55 @@ function parse_ifermi_surface(data) {
427
429
  },
428
430
  };
429
431
  }
430
- // Auto-detect file format and parse accordingly
432
+ // Auto-detect file format and parse; throws an Error aggregating per-format failure reasons when nothing parses
431
433
  export function parse_fermi_file(content, filename) {
432
434
  const lower_name = filename?.toLowerCase() ?? ``;
433
- // Detect by filename extension
434
- if (lower_name.endsWith(`.bxsf`) || lower_name.endsWith(`.bxsf.gz`)) {
435
+ const errors = [];
436
+ const attempt = (format, parse) => {
435
437
  try {
436
- return parse_bxsf(content);
438
+ return parse();
437
439
  }
438
440
  catch (error) {
439
- console.error(`BXSF parse error:`, error);
441
+ errors.push(`${format}: ${error instanceof Error ? error.message : String(error)}`);
442
+ console.error(`${format} parse error:`, error);
440
443
  return null;
441
444
  }
445
+ };
446
+ const fail = () => {
447
+ const detail = errors.length ? `: ${errors.join(`; `)}` : `: unrecognized format`;
448
+ throw new Error(`Failed to parse Fermi surface file${filename ? ` '${filename}'` : ``}${detail}`);
449
+ };
450
+ // Detect by filename extension (authoritative: parse failure throws immediately)
451
+ if (lower_name.endsWith(`.bxsf`) || lower_name.endsWith(`.bxsf.gz`)) {
452
+ return attempt(`BXSF`, () => parse_bxsf(content)) ?? fail();
442
453
  }
443
454
  if (lower_name.endsWith(`.frmsf`) || lower_name.endsWith(`.frmsf.gz`)) {
444
- try {
445
- return parse_frmsf(content);
446
- }
447
- catch (error) {
448
- console.error(`FRMSF parse error:`, error);
449
- return null;
450
- }
455
+ return attempt(`FRMSF`, () => parse_frmsf(content)) ?? fail();
451
456
  }
452
457
  if (lower_name.endsWith(`.json`) || lower_name.endsWith(`.json.gz`)) {
453
- try {
454
- return parse_fermi_json(content);
455
- }
456
- catch (error) {
457
- console.error(`JSON parse error:`, error);
458
- return null;
459
- }
458
+ return attempt(`JSON`, () => parse_fermi_json(content)) ?? fail();
460
459
  }
461
460
  // Try auto-detection based on content
462
461
  const trimmed = content.trim();
463
462
  // BXSF format detection
464
463
  if (trimmed.includes(`BEGIN_BLOCK_BANDGRID_3D`) || trimmed.includes(`BEGIN_BANDGRID_3D`)) {
465
- try {
466
- return parse_bxsf(content);
467
- }
468
- catch (error) {
469
- console.error(`BXSF auto-detect parse error:`, error);
470
- }
464
+ const result = attempt(`BXSF`, () => parse_bxsf(content));
465
+ if (result)
466
+ return result;
471
467
  }
472
468
  // JSON format detection
473
469
  if (trimmed.startsWith(`{`) || trimmed.startsWith(`[`)) {
474
- try {
475
- return parse_fermi_json(content);
476
- }
477
- catch (error) {
478
- console.error(`JSON auto-detect parse error:`, error);
479
- }
470
+ const result = attempt(`JSON`, () => parse_fermi_json(content));
471
+ if (result)
472
+ return result;
480
473
  }
481
474
  // FRMSF format detection (starts with grid dimensions)
482
475
  const first_line = trimmed.split(/\r?\n/)[0];
483
476
  const first_tokens = first_line.split(/\s+/).filter(Boolean);
484
477
  if (first_tokens.length === 3 && first_tokens.every((token) => /^\d+$/.test(token))) {
485
- try {
486
- return parse_frmsf(content);
487
- }
488
- catch (error) {
489
- console.error(`FRMSF auto-detect parse error:`, error);
490
- }
478
+ const result = attempt(`FRMSF`, () => parse_frmsf(content));
479
+ if (result)
480
+ return result;
491
481
  }
492
- console.warn(`Could not detect Fermi surface file format for: ${filename}`);
493
- return null;
482
+ return fail();
494
483
  }
@@ -1,4 +1,4 @@
1
- import type { Matrix3x3, Point2D, Vec3 } from '../math';
1
+ import type { Matrix3x3, Point2D, Vec2, Vec3 } from '../math';
2
2
  import type { TooltipConfig, TooltipProp } from '../tooltip';
3
3
  export type SpinChannel = `up` | `down` | null;
4
4
  export type RepresentationMode = `solid` | `wireframe` | `transparent`;
@@ -62,7 +62,7 @@ export interface FermiSliceData {
62
62
  }
63
63
  export interface Isoline {
64
64
  points: Vec3[];
65
- points_2d: [number, number][];
65
+ points_2d: Vec2[];
66
66
  properties?: number[];
67
67
  band_index: number;
68
68
  spin: SpinChannel;
@@ -1,11 +1,11 @@
1
1
  <script lang="ts">
2
2
  import type { D3InterpolateName } from '../colors'
3
- import { is_color, pick_contrast_color } from '../colors'
3
+ import { get_d3_interpolator, is_color, pick_contrast_color } from '../colors'
4
4
  import { format_num } from '../labels'
5
+ import type { Vec2 } from '../math'
5
6
  import type { AxisConfig } from '../plot'
6
7
  import ColorBar from '../plot/core/components/ColorBar.svelte'
7
- import { make_change_detector } from '../utils'
8
- import * as d3_sc from 'd3-scale-chromatic'
8
+ import { quickselect } from '../plot/box/quantile'
9
9
  import { type ComponentProps, onDestroy, onMount, type Snippet } from 'svelte'
10
10
  import type { HTMLAttributes } from 'svelte/elements'
11
11
  import { SvelteMap, SvelteSet } from 'svelte/reactivity'
@@ -127,7 +127,7 @@
127
127
  ) => number | null
128
128
  normalize?: NormalizeMode
129
129
  domain_mode?: DomainMode
130
- quantile_clip?: [number, number]
130
+ quantile_clip?: Vec2
131
131
  show_legend?: boolean
132
132
  legend_position?: LegendPosition
133
133
  legend_label?: string
@@ -146,8 +146,8 @@
146
146
  oncontextmenu?: (cell: CellContext, event: MouseEvent) => void
147
147
  enable_brush?: boolean
148
148
  onbrush?: (payload: {
149
- x_range: [number, number]
150
- y_range: [number, number]
149
+ x_range: Vec2
150
+ y_range: Vec2
151
151
  cells: CellContext[]
152
152
  }) => void
153
153
  tile_size?: string
@@ -213,7 +213,6 @@
213
213
  // === Value resolution ===
214
214
  let x_keys = $derived(x_items.map((item) => item.key ?? item.label))
215
215
  let y_keys = $derived(y_items.map((item) => item.key ?? item.label))
216
- let interaction_axis_signature = $derived(JSON.stringify([x_keys, y_keys]))
217
216
  let highlight_x_key_set = $derived(new SvelteSet(highlight_x_keys))
218
217
  let highlight_y_key_set = $derived(new SvelteSet(highlight_y_keys))
219
218
  let search_query_norm = $derived(search_query.trim().toLowerCase())
@@ -290,11 +289,23 @@
290
289
 
291
290
  const col_has_data = Array(x_items.length).fill(false)
292
291
  const row_has_data = Array(y_items.length).fill(false)
292
+ // Early-exit: skip cells whose row+col are already non-empty, stop once all resolved (dense matrices touch ~n+m cells, not n*m)
293
+ let unknown_cols = x_items.length
294
+ let unknown_rows = y_items.length
293
295
  for (let y_idx = 0; y_idx < y_items.length; y_idx++) {
296
+ if (unknown_cols === 0 && unknown_rows === 0) break
294
297
  for (let x_idx = 0; x_idx < x_items.length; x_idx++) {
295
- if (get_value(x_idx, y_idx) !== null) {
298
+ if (row_has_data[y_idx] && col_has_data[x_idx]) continue
299
+ // ignore cells hidden by symmetric rendering so emptiness reflects only visible cells
300
+ if (is_hidden_cell(x_idx, y_idx)) continue
301
+ if (get_value(x_idx, y_idx) === null) continue
302
+ if (!col_has_data[x_idx]) {
296
303
  col_has_data[x_idx] = true
304
+ unknown_cols--
305
+ }
306
+ if (!row_has_data[y_idx]) {
297
307
  row_has_data[y_idx] = true
308
+ unknown_rows--
298
309
  }
299
310
  }
300
311
  }
@@ -313,11 +324,9 @@
313
324
  })
314
325
 
315
326
  // === Color computation ===
316
- let color_scale_fn = $derived.by(() => {
317
- if (typeof color_scale === `function`) return color_scale
318
- const named_scale = d3_sc[color_scale]
319
- return typeof named_scale === `function` ? named_scale : d3_sc.interpolateViridis
320
- })
327
+ let color_scale_fn = $derived(
328
+ typeof color_scale === `function` ? color_scale : get_d3_interpolator(color_scale),
329
+ )
321
330
 
322
331
  function get_transformed_value(x_idx: number, y_idx: number): number | null {
323
332
  const raw_value = get_value(x_idx, y_idx)
@@ -333,53 +342,53 @@
333
342
  return transformed_value
334
343
  }
335
344
 
336
- function get_quantile(sorted_values: number[], quantile: number): number {
337
- if (sorted_values.length === 0) return 0
345
+ // Interpolated quantile via quickselect (O(n) avg vs full sort); reorders `scratch_values` in place so callers must pass a copy they own
346
+ function get_quantile(scratch_values: number[], quantile: number): number {
347
+ if (scratch_values.length === 0) return 0
338
348
  const clipped_quantile = Math.max(0, Math.min(1, quantile))
339
- const float_idx = (sorted_values.length - 1) * clipped_quantile
349
+ const float_idx = (scratch_values.length - 1) * clipped_quantile
340
350
  const low_idx = Math.floor(float_idx)
341
351
  const high_idx = Math.ceil(float_idx)
342
- if (low_idx === high_idx) return sorted_values[low_idx]
352
+ const low_val = quickselect(scratch_values, low_idx)
353
+ if (low_idx === high_idx) return low_val
354
+ const high_val = quickselect(scratch_values, high_idx)
343
355
  const low_weight = high_idx - float_idx
344
356
  const high_weight = float_idx - low_idx
345
- return sorted_values[low_idx] * low_weight + sorted_values[high_idx] * high_weight
357
+ return low_val * low_weight + high_val * high_weight
346
358
  }
347
359
 
348
- let valid_numeric_values = $derived.by(() => {
360
+ // Single pass collecting transformed values + min/max (avoids spreading large arrays into
361
+ // Math.min/max). min_pos is the log-mode lower bound when domain min <= 0 (the old
362
+ // Number.MIN_VALUE floor gave log_min ~ -744, squashing all colors to the top)
363
+ let { valid_numeric_values, auto_min, auto_max, min_pos } = $derived.by(() => {
349
364
  const numeric_values: number[] = []
365
+ let [min, max, pos] = [Infinity, -Infinity, Infinity]
350
366
  for (let y_idx = 0; y_idx < y_items.length; y_idx++) {
351
367
  for (let x_idx = 0; x_idx < x_items.length; x_idx++) {
352
368
  if (is_hidden_cell(x_idx, y_idx)) continue
353
369
  const value = get_transformed_value(x_idx, y_idx)
354
370
  if (value === null) continue
355
371
  numeric_values.push(value)
372
+ if (value < min) min = value
373
+ if (value > max) max = value
374
+ if (value > 0 && value < pos) pos = value
356
375
  }
357
376
  }
358
- return numeric_values
359
- })
360
-
361
- // Single-pass min/max to avoid spreading large arrays into Math.min/max. min_pos is
362
- // the log-mode lower bound when the domain min is <= 0 (the old Number.MIN_VALUE
363
- // floor gave log_min ~ -744, squashing all colors to the top)
364
- let [auto_min, auto_max, min_pos] = $derived.by(() => {
365
- let [min, max, pos] = [Infinity, -Infinity, Infinity]
366
- for (const value of valid_numeric_values) {
367
- if (value < min) min = value
368
- if (value > max) max = value
369
- if (value > 0 && value < pos) pos = value
377
+ return {
378
+ valid_numeric_values: numeric_values,
379
+ auto_min: min <= max ? min : 0,
380
+ auto_max: min <= max ? max : 1,
381
+ min_pos: Number.isFinite(pos) ? pos : null,
370
382
  }
371
- const min_pos_val = Number.isFinite(pos) ? pos : null
372
- return min <= max ? [min, max, min_pos_val] as const : [0, 1, min_pos_val] as const
373
383
  })
374
384
 
385
+ // Lazy derived: only evaluated while domain_mode === 'robust' reads it
375
386
  let [robust_min, robust_max] = $derived.by(() => {
376
387
  if (valid_numeric_values.length === 0) return [0, 1] as const
377
- const sorted_values = valid_numeric_values.toSorted((value_a, value_b) =>
378
- value_a - value_b
379
- )
388
+ const scratch = [...valid_numeric_values]
380
389
  const [q_low, q_high] = quantile_clip
381
- const clipped_min = get_quantile(sorted_values, q_low)
382
- const clipped_max = get_quantile(sorted_values, q_high)
390
+ const clipped_min = get_quantile(scratch, q_low)
391
+ const clipped_max = get_quantile(scratch, q_high)
383
392
  return clipped_min <= clipped_max
384
393
  ? [clipped_min, clipped_max] as const
385
394
  : [clipped_max, clipped_min] as const
@@ -1089,9 +1098,15 @@
1089
1098
 
1090
1099
  // Tooltip state: only used for custom tooltip snippets (function tooltips)
1091
1100
  let tooltip_cell: CellContext | null = $state(null)
1092
- const axis_changed = make_change_detector()
1101
+ // Reset interactions when axis keys change; element-wise compare beats JSON.stringify-ing every key on each x_items/y_items update
1102
+ const keys_equal = (keys_a: string[], keys_b: string[]): boolean =>
1103
+ keys_a.length === keys_b.length && keys_a.every((key, idx) => key === keys_b[idx])
1104
+ let prev_axis_keys: { x: string[]; y: string[] } | null = null
1093
1105
  $effect(() => {
1094
- if (!axis_changed(interaction_axis_signature)) return
1106
+ const changed = prev_axis_keys !== null &&
1107
+ !(keys_equal(x_keys, prev_axis_keys.x) && keys_equal(y_keys, prev_axis_keys.y))
1108
+ prev_axis_keys = { x: x_keys, y: y_keys }
1109
+ if (!changed) return
1095
1110
  cancel_raf(active_cell_raf)
1096
1111
  // Cancel delayed clicks before old cell coordinates can fire on new axes.
1097
1112
  clear_pending_click()
@@ -1,4 +1,5 @@
1
1
  import type { D3InterpolateName } from '../colors';
2
+ import type { Vec2 } from '../math';
2
3
  import type { AxisConfig } from '../plot';
3
4
  import { type ComponentProps, type Snippet } from 'svelte';
4
5
  import type { HTMLAttributes } from 'svelte/elements';
@@ -29,7 +30,7 @@ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `onclick` | `ondblc
29
30
  }) => number | null;
30
31
  normalize?: NormalizeMode;
31
32
  domain_mode?: DomainMode;
32
- quantile_clip?: [number, number];
33
+ quantile_clip?: Vec2;
33
34
  show_legend?: boolean;
34
35
  legend_position?: LegendPosition;
35
36
  legend_label?: string;
@@ -51,8 +52,8 @@ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `onclick` | `ondblc
51
52
  oncontextmenu?: (cell: CellContext, event: MouseEvent) => void;
52
53
  enable_brush?: boolean;
53
54
  onbrush?: (payload: {
54
- x_range: [number, number];
55
- y_range: [number, number];
55
+ x_range: Vec2;
56
+ y_range: Vec2;
56
57
  cells: CellContext[];
57
58
  }) => void;
58
59
  tile_size?: string;
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import type { PaneProps, PaneToggleProps } from '../overlays'
2
3
  import DraggablePane from '../overlays/DraggablePane.svelte'
3
4
  import type { ComponentProps, Snippet } from 'svelte'
4
5
  import {
@@ -46,8 +47,8 @@
46
47
  export_formats?: HeatmapExportFormat[]
47
48
  onexport?: (format: HeatmapExportFormat) => void
48
49
  show_pane?: boolean
49
- pane_props?: ComponentProps<typeof DraggablePane>[`pane_props`]
50
- toggle_props?: ComponentProps<typeof DraggablePane>[`toggle_props`]
50
+ pane_props?: PaneProps
51
+ toggle_props?: PaneToggleProps
51
52
  children?: Snippet<[{ controls_open: boolean }]>
52
53
  } = $props()
53
54
 
@@ -1,5 +1,5 @@
1
- import DraggablePane from '../overlays/DraggablePane.svelte';
2
- import type { ComponentProps, Snippet } from 'svelte';
1
+ import type { PaneProps, PaneToggleProps } from '../overlays';
2
+ import type { Snippet } from 'svelte';
3
3
  import type { ElementAxisOrderingKey, DomainMode, HeatmapExportFormat, LegendPosition, NormalizeMode, SymmetricMode } from './index';
4
4
  type $$ComponentProps = {
5
5
  ordering?: ElementAxisOrderingKey;
@@ -19,12 +19,12 @@ type $$ComponentProps = {
19
19
  export_formats?: HeatmapExportFormat[];
20
20
  onexport?: (format: HeatmapExportFormat) => void;
21
21
  show_pane?: boolean;
22
- pane_props?: ComponentProps<typeof DraggablePane>[`pane_props`];
23
- toggle_props?: ComponentProps<typeof DraggablePane>[`toggle_props`];
22
+ pane_props?: PaneProps;
23
+ toggle_props?: PaneToggleProps;
24
24
  children?: Snippet<[{
25
25
  controls_open: boolean;
26
26
  }]>;
27
27
  };
28
- declare const HeatmapMatrixControls: import("svelte").Component<$$ComponentProps, {}, "normalize" | "theme" | "show_legend" | "controls_open" | "show_values" | "ordering" | "toggle_visible" | "domain_mode" | "legend_position" | "search_query" | "symmetric" | "show_row_summaries" | "show_col_summaries">;
28
+ declare const HeatmapMatrixControls: import("svelte").Component<$$ComponentProps, {}, "normalize" | "show_values" | "show_legend" | "controls_open" | "ordering" | "theme" | "toggle_visible" | "domain_mode" | "legend_position" | "search_query" | "symmetric" | "show_row_summaries" | "show_col_summaries">;
29
29
  type HeatmapMatrixControls = ReturnType<typeof HeatmapMatrixControls>;
30
30
  export default HeatmapMatrixControls;
@@ -1,4 +1,5 @@
1
1
  import type { ChemicalElement, ElementSymbol } from '../element';
2
+ import type { Vec2 } from '../math';
2
3
  import type { Snippet } from 'svelte';
3
4
  export { COLOR_OVERRIDE_KEY_SEPARATOR, make_color_override_key } from './shared';
4
5
  export type AxisItem<T = Record<string, unknown>> = {
@@ -41,8 +42,8 @@ export type HeatmapSelection = {
41
42
  };
42
43
  export type HeatmapExportFormat = `csv` | `json`;
43
44
  export type HeatmapBrushPayload = {
44
- x_range: [number, number];
45
- y_range: [number, number];
45
+ x_range: Vec2;
46
+ y_range: Vec2;
46
47
  cells: CellContext[];
47
48
  };
48
49
  export declare const ELEMENT_ORDERINGS: ElementAxisOrderingKey[];
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export * from './phase-diagram';
27
27
  export * from './plot';
28
28
  export * from './rdf';
29
29
  export * from './sanitize';
30
+ export * from './scene';
30
31
  export * from './settings';
31
32
  export * from './spectral';
32
33
  export * from './structure';
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ export * from './phase-diagram';
27
27
  export * from './plot';
28
28
  export * from './rdf';
29
29
  export * from './sanitize';
30
+ export * from './scene';
30
31
  export * from './settings';
31
32
  export * from './spectral';
32
33
  export * from './structure';