matterviz 0.4.1 → 0.4.2

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 (395) hide show
  1. package/dist/EmptyState.svelte +10 -4
  2. package/dist/FilePicker.svelte +12 -14
  3. package/dist/Icon.svelte +7 -4
  4. package/dist/MillerIndexInput.svelte +2 -2
  5. package/dist/app.css +53 -0
  6. package/dist/brillouin/BrillouinZone.svelte +75 -85
  7. package/dist/brillouin/BrillouinZone.svelte.d.ts +5 -7
  8. package/dist/brillouin/BrillouinZoneControls.svelte +3 -6
  9. package/dist/brillouin/BrillouinZoneExportPane.svelte +18 -14
  10. package/dist/brillouin/BrillouinZoneInfoPane.svelte +6 -10
  11. package/dist/brillouin/BrillouinZoneScene.svelte +26 -39
  12. package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +1 -1
  13. package/dist/chempot-diagram/ChemPotDiagram.svelte +33 -38
  14. package/dist/chempot-diagram/ChemPotDiagram2D.svelte +62 -74
  15. package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +1 -1
  16. package/dist/chempot-diagram/ChemPotDiagram3D.svelte +511 -547
  17. package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +1 -1
  18. package/dist/chempot-diagram/async-compute.svelte.js +1 -1
  19. package/dist/chempot-diagram/controls-state.svelte.js +1 -1
  20. package/dist/colors/index.d.ts +0 -4
  21. package/dist/colors/index.js +19 -20
  22. package/dist/composition/BarChart.svelte +37 -31
  23. package/dist/composition/BubbleChart.svelte +17 -17
  24. package/dist/composition/Composition.svelte +7 -11
  25. package/dist/composition/Formula.svelte +18 -25
  26. package/dist/composition/FormulaFilter.svelte +92 -95
  27. package/dist/composition/PieChart.svelte +55 -41
  28. package/dist/composition/format.js +1 -1
  29. package/dist/composition/index.d.ts +2 -0
  30. package/dist/composition/index.js +14 -0
  31. package/dist/composition/parse.d.ts +2 -2
  32. package/dist/composition/parse.js +11 -10
  33. package/dist/constants.js +11 -9
  34. package/dist/convex-hull/ConvexHull.svelte +12 -15
  35. package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -1
  36. package/dist/convex-hull/ConvexHull2D.svelte +93 -92
  37. package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
  38. package/dist/convex-hull/ConvexHull3D.svelte +109 -140
  39. package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
  40. package/dist/convex-hull/ConvexHull4D.svelte +75 -94
  41. package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
  42. package/dist/convex-hull/ConvexHullChrome.svelte +36 -40
  43. package/dist/convex-hull/ConvexHullControls.svelte +46 -48
  44. package/dist/convex-hull/ConvexHullStats.svelte +193 -195
  45. package/dist/convex-hull/ConvexHullTooltip.svelte +5 -12
  46. package/dist/convex-hull/GasPressureControls.svelte +5 -12
  47. package/dist/convex-hull/StructurePopup.svelte +17 -21
  48. package/dist/convex-hull/StructurePopup.svelte.d.ts +2 -0
  49. package/dist/convex-hull/TemperatureSlider.svelte +4 -10
  50. package/dist/convex-hull/canvas-interactions.svelte.js +2 -1
  51. package/dist/convex-hull/helpers.d.ts +8 -10
  52. package/dist/convex-hull/helpers.js +36 -36
  53. package/dist/convex-hull/hull-state.svelte.d.ts +1 -1
  54. package/dist/convex-hull/thermodynamics.js +18 -17
  55. package/dist/coordination/CoordinationBarPlot.svelte +38 -33
  56. package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
  57. package/dist/coordination/calc-coordination.d.ts +1 -1
  58. package/dist/coordination/calc-coordination.js +28 -25
  59. package/dist/element/BohrAtom.svelte +5 -8
  60. package/dist/element/ElementHeading.svelte +4 -1
  61. package/dist/element/ElementPhoto.svelte +11 -9
  62. package/dist/element/ElementStats.svelte +12 -10
  63. package/dist/element/ElementTile.svelte +24 -29
  64. package/dist/element/Nucleus.svelte +4 -2
  65. package/dist/element/data.d.ts +1 -2
  66. package/dist/element/helpers.d.ts +4 -0
  67. package/dist/element/helpers.js +18 -0
  68. package/dist/element/index.d.ts +1 -4
  69. package/dist/element/index.js +3 -18
  70. package/dist/feedback/DragOverlay.svelte +5 -5
  71. package/dist/feedback/DragOverlay.svelte.d.ts +2 -2
  72. package/dist/feedback/StatusMessage.svelte +7 -4
  73. package/dist/fermi-surface/FermiSlice.svelte +21 -18
  74. package/dist/fermi-surface/FermiSurface.svelte +14 -22
  75. package/dist/fermi-surface/FermiSurface.svelte.d.ts +5 -7
  76. package/dist/fermi-surface/FermiSurfaceControls.svelte +6 -20
  77. package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
  78. package/dist/fermi-surface/FermiSurfaceScene.svelte +37 -64
  79. package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +1 -1
  80. package/dist/fermi-surface/FermiSurfaceTooltip.svelte +9 -6
  81. package/dist/fermi-surface/compute.js +3 -3
  82. package/dist/fermi-surface/parse.js +22 -24
  83. package/dist/heatmap-matrix/HeatmapMatrix.svelte +109 -148
  84. package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +2 -2
  85. package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +9 -7
  86. package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +1 -1
  87. package/dist/heatmap-matrix/index.d.ts +5 -0
  88. package/dist/icons.d.ts +4 -0
  89. package/dist/icons.js +4 -0
  90. package/dist/io/ExportPane.svelte +10 -6
  91. package/dist/io/decompress.d.ts +2 -1
  92. package/dist/io/decompress.js +22 -35
  93. package/dist/io/export.d.ts +4 -0
  94. package/dist/io/export.js +5 -1
  95. package/dist/io/fetch.d.ts +0 -3
  96. package/dist/io/fetch.js +0 -11
  97. package/dist/io/index.d.ts +0 -1
  98. package/dist/io/index.js +2 -9
  99. package/dist/io/is-binary.d.ts +9 -0
  100. package/dist/io/is-binary.js +45 -1
  101. package/dist/io/url-drop.js +13 -25
  102. package/dist/isosurface/Isosurface.svelte +17 -23
  103. package/dist/isosurface/IsosurfaceControls.svelte +37 -42
  104. package/dist/isosurface/parse-vaspwave.d.ts +3 -0
  105. package/dist/isosurface/parse-vaspwave.js +138 -0
  106. package/dist/isosurface/parse.js +6 -6
  107. package/dist/labels.d.ts +6 -2
  108. package/dist/labels.js +43 -13
  109. package/dist/layout/FullscreenButton.svelte +2 -1
  110. package/dist/layout/FullscreenToggle.svelte +10 -4
  111. package/dist/layout/InfoCard.svelte +7 -18
  112. package/dist/layout/InfoTag.svelte +1 -3
  113. package/dist/layout/NumberRangeInput.svelte +46 -0
  114. package/dist/layout/NumberRangeInput.svelte.d.ts +12 -0
  115. package/dist/layout/PropertyFilter.svelte +2 -6
  116. package/dist/layout/SettingsSection.svelte +21 -17
  117. package/dist/layout/SubpageGrid.svelte +3 -1
  118. package/dist/layout/ViewerChrome.svelte +9 -10
  119. package/dist/layout/ViewerChrome.svelte.d.ts +2 -1
  120. package/dist/layout/fullscreen.js +3 -5
  121. package/dist/layout/fullscreen.svelte.js +1 -2
  122. package/dist/layout/index.d.ts +1 -0
  123. package/dist/layout/index.js +1 -0
  124. package/dist/layout/json-tree/JsonNode.svelte +8 -11
  125. package/dist/layout/json-tree/JsonTree.svelte +53 -77
  126. package/dist/layout/json-tree/JsonValue.svelte +7 -15
  127. package/dist/layout/json-tree/utils.js +14 -23
  128. package/dist/math.d.ts +2 -0
  129. package/dist/math.js +19 -0
  130. package/dist/overlays/ContextMenu.svelte +4 -2
  131. package/dist/overlays/CopyButton.svelte +11 -5
  132. package/dist/overlays/DragControlTab.svelte +6 -1
  133. package/dist/overlays/DraggablePane.svelte +81 -26
  134. package/dist/overlays/DraggablePane.svelte.d.ts +1 -0
  135. package/dist/overlays/GlassChip.svelte +30 -0
  136. package/dist/overlays/GlassChip.svelte.d.ts +8 -0
  137. package/dist/overlays/InfoPaneCards.svelte +11 -23
  138. package/dist/overlays/index.d.ts +7 -0
  139. package/dist/overlays/index.js +26 -0
  140. package/dist/overlays/portal.d.ts +2 -0
  141. package/dist/overlays/portal.js +14 -0
  142. package/dist/periodic-table/PeriodicTable.svelte +113 -145
  143. package/dist/periodic-table/PeriodicTable.svelte.d.ts +5 -3
  144. package/dist/periodic-table/PeriodicTableControls.svelte +11 -63
  145. package/dist/periodic-table/TableInset.svelte +9 -4
  146. package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +50 -71
  147. package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +6 -8
  148. package/dist/phase-diagram/PhaseDiagramControls.svelte +70 -94
  149. package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +1 -1
  150. package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +2 -1
  151. package/dist/phase-diagram/PhaseDiagramExportPane.svelte +12 -12
  152. package/dist/phase-diagram/PhaseDiagramTooltip.svelte +54 -58
  153. package/dist/phase-diagram/TdbInfoPanel.svelte +21 -15
  154. package/dist/phase-diagram/build-diagram.js +3 -3
  155. package/dist/phase-diagram/diagram-input.d.ts +1 -2
  156. package/dist/phase-diagram/parse.js +15 -15
  157. package/dist/phase-diagram/svg-to-diagram.js +21 -15
  158. package/dist/phase-diagram/utils.js +2 -3
  159. package/dist/plot/bar/BarPlot.svelte +430 -391
  160. package/dist/plot/bar/BarPlot.svelte.d.ts +2 -0
  161. package/dist/plot/bar/BarPlotControls.svelte +1 -3
  162. package/dist/plot/bar/BarPlotControls.svelte.d.ts +4 -6
  163. package/dist/plot/bar/SpacegroupBarPlot.svelte +29 -36
  164. package/dist/plot/bar/data.d.ts +5 -4
  165. package/dist/plot/bar/data.js +2 -1
  166. package/dist/plot/box/BoxPlot.svelte +301 -209
  167. package/dist/plot/box/BoxPlot.svelte.d.ts +2 -0
  168. package/dist/plot/box/Violin.svelte.d.ts +1 -0
  169. package/dist/plot/box/box-plot.js +1 -1
  170. package/dist/plot/core/auto-place.js +1 -1
  171. package/dist/plot/core/axis-utils.d.ts +12 -7
  172. package/dist/plot/core/axis-utils.js +48 -48
  173. package/dist/plot/core/components/AxisLabel.svelte +82 -20
  174. package/dist/plot/core/components/AxisLabel.svelte.d.ts +1 -0
  175. package/dist/plot/core/components/ColorBar.svelte +101 -106
  176. package/dist/plot/core/components/ColorScaleSelect.svelte +1 -1
  177. package/dist/plot/core/components/FillArea.svelte +10 -17
  178. package/dist/plot/core/components/HierarchyControls.svelte +249 -0
  179. package/dist/plot/{sunburst/SunburstControls.svelte.d.ts → core/components/HierarchyControls.svelte.d.ts} +12 -8
  180. package/dist/plot/core/components/InteractiveAxisLabel.svelte +1 -1
  181. package/dist/plot/core/components/InteractiveAxisLabel.svelte.d.ts +1 -1
  182. package/dist/plot/core/components/Line.svelte +18 -9
  183. package/dist/plot/core/components/Line.svelte.d.ts +2 -0
  184. package/dist/plot/core/components/PlotAxis.svelte +40 -17
  185. package/dist/plot/core/components/PlotControls.svelte +65 -41
  186. package/dist/plot/core/components/PlotLegend.svelte +31 -35
  187. package/dist/plot/core/components/PlotMarginals.svelte +616 -0
  188. package/dist/plot/core/components/PlotMarginals.svelte.d.ts +15 -0
  189. package/dist/plot/core/components/PlotTooltip.svelte +1 -1
  190. package/dist/plot/core/components/PortalSelect.svelte +4 -8
  191. package/dist/plot/core/components/ReferenceLine.svelte +27 -24
  192. package/dist/plot/core/components/ReferenceLine3D.svelte +54 -57
  193. package/dist/plot/core/components/ReferencePlane.svelte +7 -8
  194. package/dist/plot/core/components/ZeroLines.svelte +4 -8
  195. package/dist/plot/core/components/ZoomRect.svelte +1 -2
  196. package/dist/plot/core/components/index.d.ts +1 -0
  197. package/dist/plot/core/components/index.js +1 -0
  198. package/dist/plot/core/data-cleaning-signal.d.ts +46 -0
  199. package/dist/plot/core/data-cleaning-signal.js +467 -0
  200. package/dist/plot/core/data-cleaning.d.ts +2 -42
  201. package/dist/plot/core/data-cleaning.js +27 -474
  202. package/dist/plot/core/data-transform.js +9 -5
  203. package/dist/plot/core/fill-utils.d.ts +3 -1
  204. package/dist/plot/core/fill-utils.js +28 -6
  205. package/dist/plot/core/index.d.ts +1 -0
  206. package/dist/plot/core/index.js +1 -0
  207. package/dist/plot/core/interactions.js +0 -2
  208. package/dist/plot/core/layout.d.ts +3 -1
  209. package/dist/plot/core/layout.js +22 -13
  210. package/dist/plot/core/marginals.d.ts +170 -0
  211. package/dist/plot/core/marginals.js +436 -0
  212. package/dist/plot/core/reference-line.js +1 -1
  213. package/dist/plot/core/scales.d.ts +23 -0
  214. package/dist/plot/core/scales.js +39 -13
  215. package/dist/plot/core/types/fills.d.ts +101 -0
  216. package/dist/plot/core/types/fills.js +15 -0
  217. package/dist/plot/core/types/plot-3d.d.ts +87 -0
  218. package/dist/plot/core/types/plot-3d.js +4 -0
  219. package/dist/plot/core/types/reference-lines.d.ts +140 -0
  220. package/dist/plot/core/types/reference-lines.js +9 -0
  221. package/dist/plot/core/types.d.ts +29 -324
  222. package/dist/plot/core/types.js +23 -20
  223. package/dist/plot/core/utils/hierarchy-chart.d.ts +51 -0
  224. package/dist/plot/core/utils/hierarchy-chart.js +179 -0
  225. package/dist/plot/core/utils/hierarchy-labels.d.ts +20 -0
  226. package/dist/plot/core/utils/hierarchy-labels.js +99 -0
  227. package/dist/plot/core/utils/label-placement.js +2 -2
  228. package/dist/plot/histogram/Histogram.svelte +304 -325
  229. package/dist/plot/histogram/Histogram.svelte.d.ts +7 -7
  230. package/dist/plot/histogram/HistogramControls.svelte +30 -28
  231. package/dist/plot/histogram/histogram.d.ts +31 -0
  232. package/dist/plot/histogram/histogram.js +70 -0
  233. package/dist/plot/histogram/index.d.ts +1 -0
  234. package/dist/plot/histogram/index.js +1 -0
  235. package/dist/plot/index.d.ts +1 -0
  236. package/dist/plot/index.js +1 -0
  237. package/dist/plot/sankey/Sankey.svelte +78 -69
  238. package/dist/plot/sankey/Sankey.svelte.d.ts +2 -2
  239. package/dist/plot/sankey/SankeyControls.svelte +22 -16
  240. package/dist/plot/scatter/BinnedScatterPlot.svelte +263 -109
  241. package/dist/plot/scatter/BinnedScatterPlot.svelte.d.ts +7 -0
  242. package/dist/plot/scatter/ElementScatter.svelte +4 -1
  243. package/dist/plot/scatter/ScatterPlot.svelte +477 -385
  244. package/dist/plot/scatter/ScatterPlot.svelte.d.ts +2 -0
  245. package/dist/plot/scatter/ScatterPlotControls.svelte +18 -19
  246. package/dist/plot/scatter/ScatterPlotControls.svelte.d.ts +1 -1
  247. package/dist/plot/scatter/ScatterPoint.svelte +16 -9
  248. package/dist/plot/scatter/binned-scatter-types.d.ts +3 -2
  249. package/dist/plot/scatter/binned-scatter-types.js +6 -1
  250. package/dist/plot/scatter/scatter-data.d.ts +1 -1
  251. package/dist/plot/scatter/scatter-data.js +8 -7
  252. package/dist/plot/scatter-3d/ScatterPlot3D.svelte +25 -34
  253. package/dist/plot/scatter-3d/ScatterPlot3D.svelte.d.ts +2 -2
  254. package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte +8 -5
  255. package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte +113 -116
  256. package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte.d.ts +2 -2
  257. package/dist/plot/scatter-3d/Surface3D.svelte +4 -13
  258. package/dist/plot/sunburst/Sunburst.svelte +251 -329
  259. package/dist/plot/sunburst/Sunburst.svelte.d.ts +2 -2
  260. package/dist/plot/sunburst/index.d.ts +1 -1
  261. package/dist/plot/sunburst/index.js +2 -1
  262. package/dist/plot/sunburst/render.d.ts +2 -2
  263. package/dist/plot/sunburst/render.js +47 -22
  264. package/dist/plot/sunburst/sunburst.d.ts +5 -1
  265. package/dist/plot/sunburst/sunburst.js +10 -3
  266. package/dist/plot/treemap/Treemap.svelte +907 -0
  267. package/dist/plot/treemap/Treemap.svelte.d.ts +84 -0
  268. package/dist/plot/treemap/index.d.ts +3 -0
  269. package/dist/plot/treemap/index.js +4 -0
  270. package/dist/plot/treemap/treemap.d.ts +26 -0
  271. package/dist/plot/treemap/treemap.js +99 -0
  272. package/dist/rdf/RdfPlot.svelte +22 -26
  273. package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
  274. package/dist/rdf/calc-rdf.js +4 -8
  275. package/dist/sanitize.js +1 -1
  276. package/dist/scene/bind-renderer.svelte.js +14 -6
  277. package/dist/settings.d.ts +19 -9
  278. package/dist/settings.js +77 -50
  279. package/dist/spectral/Bands.svelte +223 -230
  280. package/dist/spectral/BandsAndDos.svelte +11 -9
  281. package/dist/spectral/BrillouinBandsDos.svelte +19 -27
  282. package/dist/spectral/Dos.svelte +70 -73
  283. package/dist/spectral/helpers.d.ts +3 -3
  284. package/dist/spectral/helpers.js +25 -35
  285. package/dist/state.svelte.js +5 -18
  286. package/dist/structure/Arrow.svelte +5 -18
  287. package/dist/structure/ArrowInstances.svelte +160 -0
  288. package/dist/structure/ArrowInstances.svelte.d.ts +16 -0
  289. package/dist/structure/AtomLegend.svelte +115 -75
  290. package/dist/structure/AtomLegend.svelte.d.ts +1 -1
  291. package/dist/structure/Bond.svelte +31 -23
  292. package/dist/structure/CanvasTooltip.svelte +15 -3
  293. package/dist/structure/CellSelect.svelte +11 -26
  294. package/dist/structure/Cylinder.svelte +24 -40
  295. package/dist/structure/InstancedAtoms.svelte +114 -0
  296. package/dist/structure/InstancedAtoms.svelte.d.ts +15 -0
  297. package/dist/structure/Lattice.svelte +85 -149
  298. package/dist/structure/SiteLabels.svelte +122 -0
  299. package/dist/structure/SiteLabels.svelte.d.ts +18 -0
  300. package/dist/structure/Structure.svelte +473 -419
  301. package/dist/structure/Structure.svelte.d.ts +4 -2
  302. package/dist/structure/StructureCarousel.svelte +630 -0
  303. package/dist/structure/StructureCarousel.svelte.d.ts +19 -0
  304. package/dist/structure/StructureControls.svelte +157 -399
  305. package/dist/structure/StructureControls.svelte.d.ts +1 -1
  306. package/dist/structure/StructureExportPane.svelte +17 -21
  307. package/dist/structure/StructureInfoPane.svelte +72 -66
  308. package/dist/structure/StructureInfoPane.svelte.d.ts +1 -1
  309. package/dist/structure/StructureScene.svelte +467 -476
  310. package/dist/structure/StructureScene.svelte.d.ts +3 -1
  311. package/dist/structure/StructureViewport.svelte +386 -0
  312. package/dist/structure/StructureViewport.svelte.d.ts +63 -0
  313. package/dist/structure/atom-label-placement.d.ts +16 -12
  314. package/dist/structure/atom-label-placement.js +70 -37
  315. package/dist/structure/atom-properties.d.ts +2 -0
  316. package/dist/structure/atom-properties.js +104 -38
  317. package/dist/structure/bonding.d.ts +10 -3
  318. package/dist/structure/bonding.js +84 -28
  319. package/dist/structure/edit-history.d.ts +6 -0
  320. package/dist/structure/edit-history.js +27 -0
  321. package/dist/structure/export.d.ts +1 -0
  322. package/dist/structure/export.js +39 -31
  323. package/dist/structure/format-detect.d.ts +1 -0
  324. package/dist/structure/format-detect.js +22 -0
  325. package/dist/structure/geometry.d.ts +9 -0
  326. package/dist/structure/geometry.js +27 -0
  327. package/dist/structure/index.d.ts +16 -1
  328. package/dist/structure/index.js +13 -2
  329. package/dist/structure/measure.d.ts +1 -1
  330. package/dist/structure/measure.js +6 -12
  331. package/dist/structure/parse.d.ts +2 -1
  332. package/dist/structure/parse.js +243 -222
  333. package/dist/structure/partial-occupancy.js +4 -2
  334. package/dist/structure/pbc.js +78 -98
  335. package/dist/structure/polyhedra.d.ts +0 -1
  336. package/dist/structure/polyhedra.js +3 -18
  337. package/dist/structure/supercell.d.ts +1 -2
  338. package/dist/structure/supercell.js +7 -13
  339. package/dist/symmetry/SymmetryElements.svelte +11 -15
  340. package/dist/symmetry/SymmetryStats.svelte +56 -68
  341. package/dist/symmetry/WyckoffTable.svelte +5 -24
  342. package/dist/symmetry/cell-transform.js +1 -0
  343. package/dist/symmetry/index.d.ts +1 -0
  344. package/dist/symmetry/index.js +8 -2
  345. package/dist/symmetry/spacegroups.js +3 -2
  346. package/dist/table/HeatmapTable.svelte +1102 -365
  347. package/dist/table/HeatmapTable.svelte.d.ts +12 -2
  348. package/dist/table/ToggleMenu.svelte +5 -12
  349. package/dist/table/index.d.ts +21 -6
  350. package/dist/table/index.js +34 -21
  351. package/dist/theme/ThemeControl.svelte +16 -8
  352. package/dist/theme/index.d.ts +1 -5
  353. package/dist/theme/index.js +4 -10
  354. package/dist/theme/themes.mjs +14 -7
  355. package/dist/tooltip/KCoords.svelte +4 -1
  356. package/dist/tooltip/TooltipContent.svelte +2 -5
  357. package/dist/trajectory/Trajectory.svelte +515 -308
  358. package/dist/trajectory/Trajectory.svelte.d.ts +1 -1
  359. package/dist/trajectory/TrajectoryError.svelte +11 -8
  360. package/dist/trajectory/TrajectoryExportPane.svelte +14 -31
  361. package/dist/trajectory/TrajectoryInfoPane.svelte +85 -97
  362. package/dist/trajectory/extract.js +56 -34
  363. package/dist/trajectory/format-detect.js +11 -9
  364. package/dist/trajectory/frame-reader.d.ts +2 -0
  365. package/dist/trajectory/frame-reader.js +33 -29
  366. package/dist/trajectory/helpers.d.ts +2 -0
  367. package/dist/trajectory/helpers.js +18 -7
  368. package/dist/trajectory/index.d.ts +1 -0
  369. package/dist/trajectory/index.js +3 -0
  370. package/dist/trajectory/parse/h5-utils.d.ts +13 -0
  371. package/dist/trajectory/parse/h5-utils.js +109 -0
  372. package/dist/trajectory/parse/hdf5.d.ts +1 -1
  373. package/dist/trajectory/parse/hdf5.js +116 -106
  374. package/dist/trajectory/parse/index.d.ts +2 -3
  375. package/dist/trajectory/parse/index.js +17 -20
  376. package/dist/trajectory/parse/lammps.js +8 -12
  377. package/dist/trajectory/parse/vasp.js +10 -7
  378. package/dist/trajectory/parse/vaspout-electronic.d.ts +13 -0
  379. package/dist/trajectory/parse/vaspout-electronic.js +207 -0
  380. package/dist/trajectory/parse/vaspout-h5.d.ts +5 -0
  381. package/dist/trajectory/parse/vaspout-h5.js +284 -0
  382. package/dist/trajectory/parse/xyz.js +11 -7
  383. package/dist/trajectory/plotting.d.ts +8 -9
  384. package/dist/trajectory/plotting.js +99 -27
  385. package/dist/utils.d.ts +3 -0
  386. package/dist/utils.js +7 -0
  387. package/dist/xrd/XrdPlot.svelte +47 -61
  388. package/dist/xrd/broadening.js +2 -1
  389. package/dist/xrd/calc-xrd.js +2 -4
  390. package/dist/xrd/parse.d.ts +0 -1
  391. package/dist/xrd/parse.js +56 -73
  392. package/package.json +61 -33
  393. package/dist/api/mp.d.ts +0 -6
  394. package/dist/api/mp.js +0 -22
  395. package/dist/plot/sunburst/SunburstControls.svelte +0 -200
@@ -12,7 +12,8 @@
12
12
  import type { Label, RowData } from '../table'
13
13
  import HeatmapTable from '../table/HeatmapTable.svelte'
14
14
  import type { HTMLAttributes } from 'svelte/elements'
15
- import { SvelteMap, SvelteSet } from 'svelte/reactivity'
15
+ import { SvelteMap } from 'svelte/reactivity'
16
+ import { create_clipboard_feedback } from '../overlays'
16
17
  import type {
17
18
  ConvexHullEntry,
18
19
  EntryCategoryConfig,
@@ -36,54 +37,46 @@
36
37
  min_n_elements = $bindable(1),
37
38
  entry_href,
38
39
  ...rest
39
- }:
40
- & HTMLAttributes<HTMLDivElement>
41
- & {
42
- phase_stats: PhaseStats | null
43
- stable_entries: ConvexHullEntry[]
44
- unstable_entries: ConvexHullEntry[]
45
- show_stable?: boolean
46
- show_unstable?: boolean
47
- // Categorical classification + hidden values (excluded from shown counts/table)
48
- entry_category?: EntryCategoryConfig | null
49
- hidden_categories?: string[]
50
- // 'toggle' shows stats/table with toggle buttons (default)
51
- // 'side-by-side' shows both stats and table next to each other without toggle
52
- layout?: `toggle` | `side-by-side`
53
- // Called when a table row is clicked, with the corresponding entry
54
- on_entry_click?: (entry: ConvexHullEntry) => void
55
- // Entry ID to highlight in the table (e.g. current material on detail page)
56
- highlighted_entry_id?: string
57
- // Minimum number of elements filter for table (bindable for URL sync)
58
- min_n_elements?: number
59
- // Generate URL for an entry (makes ID column a clickable link)
60
- entry_href?: (entry: ConvexHullEntry) => string | null
61
- } = $props()
40
+ }: HTMLAttributes<HTMLDivElement> & {
41
+ phase_stats: PhaseStats | null
42
+ stable_entries: ConvexHullEntry[]
43
+ unstable_entries: ConvexHullEntry[]
44
+ show_stable?: boolean
45
+ show_unstable?: boolean
46
+ // Categorical classification + hidden values (excluded from shown counts/table)
47
+ entry_category?: EntryCategoryConfig | null
48
+ hidden_categories?: string[]
49
+ // 'toggle' shows stats/table with toggle buttons (default)
50
+ // 'side-by-side' shows both stats and table next to each other without toggle
51
+ layout?: `toggle` | `side-by-side`
52
+ // Called when a table row is clicked, with the corresponding entry
53
+ on_entry_click?: (entry: ConvexHullEntry) => void
54
+ // Entry ID to highlight in the table (e.g. current material on detail page)
55
+ highlighted_entry_id?: string
56
+ // Minimum number of elements filter for table (bindable for URL sync)
57
+ min_n_elements?: number
58
+ // Generate URL for an entry (makes ID column a clickable link)
59
+ entry_href?: (entry: ConvexHullEntry) => string | null
60
+ } = $props()
62
61
 
63
- let copied_items = new SvelteSet<string>()
62
+ const { copied, copy } = create_clipboard_feedback()
64
63
  let view_mode = $state<`stats` | `table`>(`stats`)
65
64
  // Formula filter: when set, table shows only entries with this reduced formula
66
65
  let formula_filter = $state(``)
67
- const table_scroll_height =
68
- `var(--hull-stats-table-height, calc(var(--hull-stats-table-row-height, 2.35rem) * 10 + var(--hull-stats-table-header-height, 3.5rem)))`
69
- const table_scroll_style = $derived(layout === `side-by-side`
70
- ? `flex: 1 1 0; height: ${table_scroll_height}; min-height: ${table_scroll_height}; max-width: 100%; overflow: auto`
71
- : `height: ${table_scroll_height}; min-height: ${table_scroll_height}; max-height: var(--hull-stats-max-height, 70vh); max-width: 100%; overflow: auto`
66
+ const table_scroll_height = `var(--hull-stats-table-height, calc(var(--hull-stats-table-row-height, 2.35rem) * 10 + var(--hull-stats-table-header-height, 3.5rem)))`
67
+ const table_scroll_style = $derived(
68
+ layout === `side-by-side`
69
+ ? `flex: 1 1 0; height: ${table_scroll_height}; min-height: ${table_scroll_height}; max-width: 100%; overflow: auto`
70
+ : `height: ${table_scroll_height}; min-height: ${table_scroll_height}; max-height: var(--hull-stats-max-height, 70vh); max-width: 100%; overflow: auto`,
72
71
  )
73
- const table_root_style = $derived(layout === `side-by-side`
74
- ? `flex: 1 1 0; min-height: ${table_scroll_height}; margin-inline: 0`
75
- : `min-width: 0; margin-inline: 0`
72
+ const table_root_style = $derived(
73
+ layout === `side-by-side`
74
+ ? `flex: 1 1 0; min-height: ${table_scroll_height}; margin-inline: 0`
75
+ : `min-width: 0; margin-inline: 0`,
76
76
  )
77
77
 
78
- async function copy_to_clipboard(label: string, value: string, key: string) {
79
- try {
80
- await navigator.clipboard.writeText(`${label}: ${value}`)
81
- copied_items.add(key)
82
- setTimeout(() => copied_items.delete(key), 1000)
83
- } catch (error) {
84
- console.error(`Failed to copy to clipboard:`, error)
85
- }
86
- }
78
+ const copy_to_clipboard = (label: string, value: string, key: string): Promise<void> =>
79
+ copy(`${label}: ${value}`, key)
87
80
  function handle_copy_keydown(
88
81
  event: KeyboardEvent,
89
82
  label: string,
@@ -99,13 +92,15 @@
99
92
  let all_entries = $derived([...stable_entries, ...unstable_entries])
100
93
  // show_stable/show_unstable respect the caller's partition; pass show flags as true
101
94
  // so filter_visible only applies the category filter on top
102
- let shown_entries = $derived(filter_visible(
103
- [...(show_stable ? stable_entries : []), ...(show_unstable ? unstable_entries : [])],
104
- true,
105
- true,
106
- entry_category,
107
- hidden_categories,
108
- ))
95
+ let shown_entries = $derived(
96
+ filter_visible(
97
+ [...(show_stable ? stable_entries : []), ...(show_unstable ? unstable_entries : [])],
98
+ true,
99
+ true,
100
+ entry_category,
101
+ hidden_categories,
102
+ ),
103
+ )
109
104
 
110
105
  // Static arity labels for phase breakdown display
111
106
  const arity_types: [string, PhaseArityField, number][] = [
@@ -126,21 +121,25 @@
126
121
  } as const
127
122
 
128
123
  // Prepare histogram data for formation energies and hull distances
129
- let e_form_data = $derived([{
130
- x: [] as number[],
131
- y: all_entries
132
- .map((entry) => entry.e_form_per_atom ?? entry.energy_per_atom)
133
- .filter((val): val is number => val !== undefined && isFinite(val)),
134
- label: `Formation Energy`,
135
- }])
124
+ let e_form_data = $derived([
125
+ {
126
+ x: [] as number[],
127
+ y: all_entries
128
+ .map((entry) => entry.e_form_per_atom ?? entry.energy_per_atom)
129
+ .filter((val): val is number => val !== undefined && isFinite(val)),
130
+ label: `Formation Energy`,
131
+ },
132
+ ])
136
133
 
137
- let hull_distance_data = $derived([{
138
- x: [] as number[],
139
- y: all_entries
140
- .map((entry) => entry.e_above_hull)
141
- .filter((val): val is number => val !== undefined && isFinite(val)),
142
- label: `E above hull`,
143
- }])
134
+ let hull_distance_data = $derived([
135
+ {
136
+ x: [] as number[],
137
+ y: all_entries
138
+ .map((entry) => entry.e_above_hull)
139
+ .filter((val): val is number => val !== undefined && isFinite(val)),
140
+ label: `E above hull`,
141
+ },
142
+ ])
144
143
 
145
144
  let pane_data = $derived.by(() => {
146
145
  if (!phase_stats) return []
@@ -160,8 +159,8 @@
160
159
  // Only show phase types that exist or are within the max_arity
161
160
  // used when computing stats (respects zeroed-out counts)
162
161
  ...arity_types
163
- .filter(([, field, arity]) =>
164
- phase_stats[field] > 0 || phase_stats.max_arity >= arity
162
+ .filter(
163
+ ([, field, arity]) => phase_stats[field] > 0 || phase_stats.max_arity >= arity,
165
164
  )
166
165
  .map(([display, field]) => ({
167
166
  label: `${display} phases`,
@@ -180,34 +179,38 @@
180
179
  },
181
180
  {
182
181
  label: `Unstable phases`,
183
- value: `${format_num(phase_stats.unstable)} (${
184
- pct(phase_stats.unstable)
185
- })`,
182
+ value: `${format_num(phase_stats.unstable)} (${pct(phase_stats.unstable)})`,
186
183
  key: `unstable-phases`,
187
184
  },
188
185
  ],
189
186
  },
190
187
  {
191
188
  title: `E<sub>form</sub> distribution`,
192
- items: [{
193
- label: `Min / avg / max (eV/atom)`,
194
- value: [
195
- phase_stats.energy_range.min,
196
- phase_stats.energy_range.avg,
197
- phase_stats.energy_range.max,
198
- ]
199
- .map((val) => format_num(val, `.3f`)).join(` / `),
200
- key: `formation-energy`,
201
- }],
189
+ items: [
190
+ {
191
+ label: `Min / avg / max (eV/atom)`,
192
+ value: [
193
+ phase_stats.energy_range.min,
194
+ phase_stats.energy_range.avg,
195
+ phase_stats.energy_range.max,
196
+ ]
197
+ .map((val) => format_num(val, `.3f`))
198
+ .join(` / `),
199
+ key: `formation-energy`,
200
+ },
201
+ ],
202
202
  },
203
203
  {
204
204
  title: `E<sub>above hull</sub> distribution`,
205
- items: [{
206
- label: `Max / avg (eV/atom)`,
207
- value: [phase_stats.hull_distance.max, phase_stats.hull_distance.avg]
208
- .map((val) => format_num(val, `.3f`)).join(` / `),
209
- key: `hull-distance`,
210
- }],
205
+ items: [
206
+ {
207
+ label: `Max / avg (eV/atom)`,
208
+ value: [phase_stats.hull_distance.max, phase_stats.hull_distance.avg]
209
+ .map((val) => format_num(val, `.3f`))
210
+ .join(` / `),
211
+ key: `hull-distance`,
212
+ },
213
+ ],
211
214
  },
212
215
  ]
213
216
  })
@@ -220,9 +223,9 @@
220
223
  // Count entries containing each pair
221
224
  const pair_counts = new SvelteMap<string, number>()
222
225
  for (const entry of all_entries) {
223
- const active =
224
- (Object.keys(entry.composition) as (keyof typeof entry.composition)[])
225
- .filter((el) => (entry.composition[el] ?? 0) > 0)
226
+ const active = (
227
+ Object.keys(entry.composition) as (keyof typeof entry.composition)[]
228
+ ).filter((el) => (entry.composition[el] ?? 0) > 0)
226
229
  // Count all pairs present in this entry
227
230
  for (let idx_a = 0; idx_a < active.length; idx_a++) {
228
231
  for (let idx_b = idx_a + 1; idx_b < active.length; idx_b++) {
@@ -236,12 +239,11 @@
236
239
  elements.slice(idx_a + 1).map((el_b) => {
237
240
  const key = [el_a, el_b].sort().join(`-`)
238
241
  return { pair: key, count: pair_counts.get(key) ?? 0 }
239
- })
242
+ }),
240
243
  )
241
244
  })
242
245
  let subsystem_coverage_summary = $derived(
243
- subsystem_coverage?.map(({ pair, count }) => `${pair}: ${count}`).join(` | `) ??
244
- null,
246
+ subsystem_coverage?.map(({ pair, count }) => `${pair}: ${count}`).join(` | `) ?? null,
245
247
  )
246
248
 
247
249
  // Table view: visible entries filtered by min element count and formula
@@ -251,13 +253,12 @@
251
253
  if (
252
254
  active_formula_filter &&
253
255
  composition_key(entry.composition) !== active_formula_filter
254
- ) return false
256
+ )
257
+ return false
255
258
  return true
256
259
  }),
257
260
  )
258
- let has_raw = $derived(
259
- visible_entries.some((entry) => entry.energy_per_atom !== undefined),
260
- )
261
+ let has_raw = $derived(visible_entries.some((entry) => entry.energy_per_atom !== undefined))
261
262
  let has_ids = $derived(visible_entries.some((entry) => entry.entry_id))
262
263
  let max_n_el = $derived(
263
264
  all_entries.reduce((max, entry) => Math.max(max, get_arity(entry)), 1),
@@ -285,7 +286,7 @@
285
286
  // stoichiometric input before parsing/reordering.
286
287
  const normalize_formula_markup = (formula: string): string =>
287
288
  unescape_html(formula)
288
- .replaceAll(/<sub>\s*([^<]+?)\s*<\/sub>/gi, `$1`)
289
+ .replaceAll(/<sub>\s*(?<content>[^<]+?)\s*<\/sub>/gi, `$1`)
289
290
  .replaceAll(/<[^>]+>/g, ``)
290
291
  .replaceAll(/\s+/g, ``)
291
292
  const sanitize_href = (href: string | null | undefined): string | null => {
@@ -317,9 +318,7 @@
317
318
  let has_polymorphs = $derived(poly_formulas.length > 0)
318
319
  let active_formula_filter = $derived.by(() => {
319
320
  if (!formula_filter || !has_polymorphs) return ``
320
- return poly_formulas.some(([formula]) => formula === formula_filter)
321
- ? formula_filter
322
- : ``
321
+ return poly_formulas.some(([formula]) => formula === formula_filter) ? formula_filter : ``
323
322
  })
324
323
  $effect(() => {
325
324
  if (formula_filter && formula_filter !== active_formula_filter) {
@@ -331,12 +330,11 @@
331
330
  let { table_data, entry_by_row } = $derived.by(() => {
332
331
  const map = new WeakMap<RowData, ConvexHullEntry>()
333
332
  const rows = visible_entries.map((entry, idx) => {
334
- const n_atoms = Object.values(entry.composition).reduce(
335
- (sum, count) => sum + count,
336
- 0,
337
- )
333
+ const n_atoms = Object.values(entry.composition).reduce((sum, count) => sum + count, 0)
338
334
  const on_hull = is_on_hull(entry)
339
- const formula_source = entry.reduced_formula ?? entry.name ??
335
+ const formula_source =
336
+ entry.reduced_formula ??
337
+ entry.name ??
340
338
  get_alphabetical_formula(entry.composition, true, ``)
341
339
  const normalized_formula = normalize_formula_markup(formula_source)
342
340
  const formatted_formula = get_electro_neg_formula(normalized_formula)
@@ -344,11 +342,12 @@
344
342
  // Match by entry_id or common data fields (mat_id, structure_id)
345
343
  // since entry_id may be wrapped in HTML (e.g. <a> tags)
346
344
  const entry_data = entry.data as Record<string, unknown> | undefined
347
- const is_highlighted = Boolean(highlighted_entry_id && (
348
- entry.entry_id === highlighted_entry_id ||
349
- entry_data?.mat_id === highlighted_entry_id ||
350
- entry_data?.structure_id === highlighted_entry_id
351
- ))
345
+ const is_highlighted = Boolean(
346
+ highlighted_entry_id &&
347
+ (entry.entry_id === highlighted_entry_id ||
348
+ entry_data?.mat_id === highlighted_entry_id ||
349
+ entry_data?.structure_id === highlighted_entry_id),
350
+ )
352
351
  const row: RowData = {
353
352
  '#': sort_span(idx + 1, `${idx + 1}`),
354
353
  Formula: on_hull ? `<strong>${formula_html}</strong>` : formula_html,
@@ -359,11 +358,12 @@
359
358
  if (has_ids) {
360
359
  const safe_href = sanitize_href(entry_href?.(entry))
361
360
  const safe_id = entry.entry_id ? escape_html(entry.entry_id) : undefined
362
- row.ID = safe_href && safe_id
363
- ? `<a href="${
364
- escape_html(safe_href)
365
- }" target="_blank" rel="noopener">${safe_id}</a>`
366
- : safe_id
361
+ row.ID =
362
+ safe_href && safe_id
363
+ ? `<a href="${escape_html(
364
+ safe_href,
365
+ )}" target="_blank" rel="noopener">${safe_id}</a>`
366
+ : safe_id
367
367
  }
368
368
  if (has_polymorphs) {
369
369
  const comp_key = composition_key(entry.composition)
@@ -374,8 +374,7 @@
374
374
  row[`N<sub>at</sub>`] = n_atoms
375
375
  // Highlight row for current material
376
376
  if (is_highlighted) {
377
- row.style =
378
- `background: color-mix(in srgb, var(--hull-stable-color, #22c55e) 15%, transparent)`
377
+ row.style = `background: color-mix(in srgb, var(--hull-stable-color, #22c55e) 15%, transparent)`
379
378
  }
380
379
  map.set(row, entry)
381
380
  return row
@@ -388,60 +387,59 @@
388
387
  if (entry) on_entry_click?.(entry)
389
388
  }
390
389
 
391
- let table_columns: Label[] = $derived(
392
- [
393
- { label: `#`, color_scale: null, description: `Row number` },
394
- { label: `Formula`, color_scale: null },
395
- {
396
- label: `E<sub>hull</sub>`,
397
- better: `lower`,
398
- color_scale: `interpolateRdYlGn`,
399
- format: `.4f`,
400
- description: `Energy above convex hull (eV/atom)`,
401
- },
402
- {
403
- label: `E<sub>form</sub>`,
404
- better: `lower`,
405
- color_scale: `interpolateBlues`,
406
- format: `.4f`,
407
- description: `Formation energy (eV/atom)`,
408
- },
409
- ...(has_raw
410
- ? [{
411
- label: `E<sub>raw</sub>`,
412
- color_scale: `interpolateCool` as const,
413
- format: `.4f`,
414
- description: `Raw energy per atom (eV/atom)`,
415
- }]
416
- : []),
417
- ...(has_ids
418
- ? [{ label: `ID`, color_scale: null, description: `Entry identifier` }]
419
- : []),
420
- ...(has_polymorphs
421
- ? [{
422
- label: `Poly`,
423
- color_scale: null,
424
- description: `Number of polymorphs (same reduced formula)`,
425
- }]
426
- : []),
427
- {
428
- label: `N<sub>el</sub>`,
429
- color_scale: null,
430
- description: `Number of elements`,
431
- },
432
- {
433
- label: `N<sub>at</sub>`,
434
- color_scale: null,
435
- format: `d`,
436
- description: `Number of atoms in unit cell`,
437
- },
438
- ] satisfies Label[],
439
- )
390
+ let table_columns: Label[] = $derived([
391
+ { label: `#`, color_scale: null, description: `Row number` },
392
+ { label: `Formula`, color_scale: null },
393
+ {
394
+ label: `E<sub>hull</sub>`,
395
+ better: `lower`,
396
+ color_scale: `interpolateRdYlGn`,
397
+ format: `.4f`,
398
+ description: `Energy above convex hull (eV/atom)`,
399
+ },
400
+ {
401
+ label: `E<sub>form</sub>`,
402
+ better: `lower`,
403
+ color_scale: `interpolateBlues`,
404
+ format: `.4f`,
405
+ description: `Formation energy (eV/atom)`,
406
+ },
407
+ ...(has_raw
408
+ ? [
409
+ {
410
+ label: `E<sub>raw</sub>`,
411
+ color_scale: `interpolateCool` as const,
412
+ format: `.4f`,
413
+ description: `Raw energy per atom (eV/atom)`,
414
+ },
415
+ ]
416
+ : []),
417
+ ...(has_ids ? [{ label: `ID`, color_scale: null, description: `Entry identifier` }] : []),
418
+ ...(has_polymorphs
419
+ ? [
420
+ {
421
+ label: `Poly`,
422
+ color_scale: null,
423
+ description: `Number of polymorphs (same reduced formula)`,
424
+ },
425
+ ]
426
+ : []),
427
+ {
428
+ label: `N<sub>el</sub>`,
429
+ color_scale: null,
430
+ description: `Number of elements`,
431
+ },
432
+ {
433
+ label: `N<sub>at</sub>`,
434
+ color_scale: null,
435
+ format: `d`,
436
+ description: `Number of atoms in unit cell`,
437
+ },
438
+ ] satisfies Label[])
440
439
 
441
440
  // Filename for HeatmapTable's built-in CSV/JSON export
442
441
  const export_filename = $derived(
443
- phase_stats?.chemical_system?.toLowerCase().replaceAll(/\s+/g, `-`) ??
444
- `convex-hull-stats`,
442
+ phase_stats?.chemical_system?.toLowerCase().replaceAll(/\s+/g, `-`) ?? `convex-hull-stats`,
445
443
  )
446
444
  </script>
447
445
 
@@ -462,16 +460,11 @@
462
460
  role="button"
463
461
  tabindex="0"
464
462
  onkeydown={(event) =>
465
- handle_copy_keydown(
466
- event,
467
- item.label,
468
- String(item.value),
469
- key ?? item.label,
470
- )}
463
+ handle_copy_keydown(event, item.label, String(item.value), key ?? item.label)}
471
464
  >
472
465
  <span>{@html sanitize_html(label)}:</span>
473
466
  <span>{@html sanitize_html(value)}</span>
474
- {#if key && copied_items.has(key)}
467
+ {#if key && copied.has(key)}
475
468
  <Icon
476
469
  icon="Check"
477
470
  style="color: var(--success-color, #10b981); width: 12px; height: 12px"
@@ -487,23 +480,24 @@
487
480
  data-testid="pd-binary-subsystem-coverage"
488
481
  title="Click to copy: Binary subsystem coverage: {subsystem_coverage_summary ?? ``}"
489
482
  onclick={() =>
490
- copy_to_clipboard(
491
- `Binary subsystem coverage`,
492
- subsystem_coverage_summary ?? ``,
493
- `binary-subsystem-coverage`,
494
- )}
483
+ copy_to_clipboard(
484
+ `Binary subsystem coverage`,
485
+ subsystem_coverage_summary ?? ``,
486
+ `binary-subsystem-coverage`,
487
+ )}
495
488
  role="button"
496
489
  tabindex="0"
497
490
  onkeydown={(event) =>
498
- handle_copy_keydown(
499
- event,
500
- `Binary subsystem coverage`,
501
- subsystem_coverage_summary ?? ``,
502
- `binary-subsystem-coverage`,
503
- )}
491
+ handle_copy_keydown(
492
+ event,
493
+ `Binary subsystem coverage`,
494
+ subsystem_coverage_summary ?? ``,
495
+ `binary-subsystem-coverage`,
496
+ )}
504
497
  >
505
498
  <span class="subsystem-label"
506
- >Binary subsystem coverage ({subsystem_coverage.length} pairs)</span>
499
+ >Binary subsystem coverage ({subsystem_coverage.length} pairs)</span
500
+ >
507
501
  <span class="subsystem-chips">
508
502
  {#each subsystem_coverage as { pair, count } (pair)}
509
503
  <span class="subsystem-chip" class:has-entries={count > 0}>
@@ -512,7 +506,7 @@
512
506
  </span>
513
507
  {/each}
514
508
  </span>
515
- {#if copied_items.has(`binary-subsystem-coverage`)}
509
+ {#if copied.has(`binary-subsystem-coverage`)}
516
510
  <Icon
517
511
  icon="Check"
518
512
  style="color: var(--success-color, #10b981); width: 12px; height: 12px"
@@ -522,8 +516,7 @@
522
516
  </div>
523
517
  {/if}
524
518
 
525
- {#if section.title === `E<sub>form</sub> distribution` &&
526
- e_form_data[0].y.length > 0}
519
+ {#if section.title === `E<sub>form</sub> distribution` && e_form_data[0].y.length > 0}
527
520
  <Histogram
528
521
  {...histogram_props}
529
522
  series={e_form_data}
@@ -532,8 +525,7 @@
532
525
  />
533
526
  {/if}
534
527
 
535
- {#if section.title === `E<sub>above hull</sub> distribution` &&
536
- hull_distance_data[0].y.length > 0}
528
+ {#if section.title === `E<sub>above hull</sub> distribution` && hull_distance_data[0].y.length > 0}
537
529
  <Histogram
538
530
  {...histogram_props}
539
531
  series={hull_distance_data}
@@ -583,7 +575,7 @@
583
575
  {/snippet}
584
576
 
585
577
  {#if layout === `side-by-side`}
586
- <div {...rest} class="convex-hull-stats side-by-side {rest.class ?? ``}">
578
+ <div {...rest} class={[`convex-hull-stats side-by-side`, rest.class]}>
587
579
  <div class="stats-pane">
588
580
  {@render stats_panel()}
589
581
  </div>
@@ -592,12 +584,12 @@
592
584
  </div>
593
585
  </div>
594
586
  {:else}
595
- <div {...rest} class="convex-hull-stats {rest.class ?? ``}">
587
+ <div {...rest} class={[`convex-hull-stats`, rest.class]}>
596
588
  <div class="view-toggle">
597
- <button class:active={view_mode === `stats`} onclick={() => view_mode = `stats`}>
589
+ <button class:active={view_mode === `stats`} onclick={() => (view_mode = `stats`)}>
598
590
  Stats
599
591
  </button>
600
- <button class:active={view_mode === `table`} onclick={() => view_mode = `table`}>
592
+ <button class:active={view_mode === `table`} onclick={() => (view_mode = `table`)}>
601
593
  Table
602
594
  </button>
603
595
  </div>
@@ -635,7 +627,13 @@
635
627
  .table-pane {
636
628
  flex: 1 1 0;
637
629
  max-width: 100%;
638
- min-height: var(--hull-stats-table-height, calc(var(--hull-stats-table-row-height, 2.35rem) * 10 + var(--hull-stats-table-header-height, 3.5rem)));
630
+ min-height: var(
631
+ --hull-stats-table-height,
632
+ calc(
633
+ var(--hull-stats-table-row-height, 2.35rem) * 10 +
634
+ var(--hull-stats-table-header-height, 3.5rem)
635
+ )
636
+ );
639
637
  min-width: 0;
640
638
  overflow: auto;
641
639
  display: flex;
@@ -29,15 +29,11 @@
29
29
 
30
30
  const is_element = $derived(is_unary_entry(entry))
31
31
  const elem_symbol = $derived(
32
- is_element
33
- ? (Object.entries(entry.composition).find(([, n]) => n > 0)?.[0] ?? ``)
34
- : ``,
32
+ is_element ? (Object.entries(entry.composition).find(([, n]) => n > 0)?.[0] ?? ``) : ``,
35
33
  ) as ElementSymbol | ``
36
34
  const elem_name = $derived(elem_symbol && ELEM_SYMBOL_TO_NAME[elem_symbol])
37
35
  const polymorph_stats = $derived(
38
- entry.entry_id && polymorph_stats_map
39
- ? polymorph_stats_map.get(entry.entry_id)
40
- : null,
36
+ entry.entry_id && polymorph_stats_map ? polymorph_stats_map.get(entry.entry_id) : null,
41
37
  )
42
38
  const category_value = $derived(get_entry_category(entry, entry_category))
43
39
  </script>
@@ -80,14 +76,11 @@
80
76
  {/if}
81
77
 
82
78
  {#if show_fractional && !is_element}
83
- {@const total = Object.values(entry.composition).reduce(
84
- (sum, amt) => sum + amt,
85
- 0,
86
- )}
79
+ {@const total = Object.values(entry.composition).reduce((sum, amt) => sum + amt, 0)}
87
80
  {#if total > 0}
88
81
  {@const fractions = Object.entries(entry.composition)
89
- .filter(([, amt]) => amt > 0)
90
- .map(([el, amt]) => `${el}<sub>${format_num(amt / total, `.2~`)}</sub>`)}
82
+ .filter(([, amt]) => amt > 0)
83
+ .map(([el, amt]) => `${el}<sub>${format_num(amt / total, `.2~`)}</sub>`)}
91
84
  {#if fractions.length > 1}
92
85
  <div>Fractional: {@html sanitize_html(fractions.join(` `))}</div>
93
86
  {/if}