matterviz 0.3.7 → 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 (486) hide show
  1. package/dist/Icon.svelte +7 -4
  2. package/dist/MillerIndexInput.svelte +1 -1
  3. package/dist/api/optimade.js +32 -26
  4. package/dist/app.css +0 -3
  5. package/dist/brillouin/BrillouinZone.svelte +76 -148
  6. package/dist/brillouin/BrillouinZone.svelte.d.ts +6 -14
  7. package/dist/brillouin/BrillouinZoneExportPane.svelte +43 -96
  8. package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
  9. package/dist/brillouin/BrillouinZoneInfoPane.svelte +9 -32
  10. package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +2 -3
  11. package/dist/brillouin/BrillouinZoneScene.svelte +97 -205
  12. package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +4 -23
  13. package/dist/brillouin/BrillouinZoneTooltip.svelte +16 -25
  14. package/dist/brillouin/ReciprocalVectors.svelte +39 -0
  15. package/dist/brillouin/ReciprocalVectors.svelte.d.ts +9 -0
  16. package/dist/brillouin/compute.d.ts +2 -0
  17. package/dist/brillouin/compute.js +89 -90
  18. package/dist/brillouin/geometry.d.ts +8 -0
  19. package/dist/brillouin/geometry.js +57 -0
  20. package/dist/brillouin/index.d.ts +2 -0
  21. package/dist/brillouin/index.js +2 -0
  22. package/dist/brillouin/types.d.ts +2 -2
  23. package/dist/chempot-diagram/ChemPotDiagram.svelte +14 -13
  24. package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +1 -1
  25. package/dist/chempot-diagram/ChemPotDiagram2D.svelte +109 -203
  26. package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +4 -1
  27. package/dist/chempot-diagram/ChemPotDiagram3D.svelte +180 -470
  28. package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +7 -1
  29. package/dist/chempot-diagram/async-compute.svelte.js +3 -1
  30. package/dist/chempot-diagram/chempot-worker.js +2 -1
  31. package/dist/chempot-diagram/color.d.ts +3 -6
  32. package/dist/chempot-diagram/color.js +5 -5
  33. package/dist/chempot-diagram/compute.d.ts +4 -4
  34. package/dist/chempot-diagram/compute.js +20 -20
  35. package/dist/chempot-diagram/controls-state.svelte.d.ts +10 -0
  36. package/dist/chempot-diagram/controls-state.svelte.js +42 -0
  37. package/dist/chempot-diagram/export.d.ts +47 -0
  38. package/dist/chempot-diagram/export.js +133 -0
  39. package/dist/chempot-diagram/index.d.ts +1 -0
  40. package/dist/chempot-diagram/index.js +1 -0
  41. package/dist/chempot-diagram/pointer.d.ts +0 -10
  42. package/dist/chempot-diagram/pointer.js +4 -4
  43. package/dist/chempot-diagram/types.d.ts +3 -3
  44. package/dist/colors/index.js +8 -7
  45. package/dist/composition/FormulaFilter.svelte +18 -11
  46. package/dist/composition/PieChart.svelte +11 -10
  47. package/dist/composition/chem-sys.d.ts +8 -0
  48. package/dist/composition/chem-sys.js +86 -0
  49. package/dist/composition/format.js +7 -4
  50. package/dist/composition/index.d.ts +1 -0
  51. package/dist/composition/index.js +1 -0
  52. package/dist/composition/parse.d.ts +0 -1
  53. package/dist/composition/parse.js +41 -31
  54. package/dist/controls.d.ts +1 -0
  55. package/dist/controls.js +0 -1
  56. package/dist/convex-hull/ConvexHull.svelte +8 -10
  57. package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -4
  58. package/dist/convex-hull/ConvexHull2D.svelte +106 -185
  59. package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
  60. package/dist/convex-hull/ConvexHull3D.svelte +179 -683
  61. package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
  62. package/dist/convex-hull/ConvexHull4D.svelte +183 -687
  63. package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
  64. package/dist/convex-hull/ConvexHullChrome.svelte +268 -0
  65. package/dist/convex-hull/ConvexHullChrome.svelte.d.ts +30 -0
  66. package/dist/convex-hull/ConvexHullControls.svelte +88 -7
  67. package/dist/convex-hull/ConvexHullControls.svelte.d.ts +7 -6
  68. package/dist/convex-hull/ConvexHullInfoPane.svelte +18 -5
  69. package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +6 -5
  70. package/dist/convex-hull/ConvexHullStats.svelte +36 -175
  71. package/dist/convex-hull/ConvexHullStats.svelte.d.ts +3 -1
  72. package/dist/convex-hull/ConvexHullTooltip.svelte +11 -2
  73. package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +2 -1
  74. package/dist/convex-hull/GasPressureControls.svelte +4 -4
  75. package/dist/convex-hull/TemperatureSlider.svelte +2 -2
  76. package/dist/convex-hull/barycentric-coords.d.ts +2 -4
  77. package/dist/convex-hull/barycentric-coords.js +6 -33
  78. package/dist/convex-hull/canvas-interactions.svelte.d.ts +79 -0
  79. package/dist/convex-hull/canvas-interactions.svelte.js +278 -0
  80. package/dist/convex-hull/demo-temperature.d.ts +1 -1
  81. package/dist/convex-hull/demo-temperature.js +20 -22
  82. package/dist/convex-hull/gas-thermodynamics.d.ts +2 -2
  83. package/dist/convex-hull/gas-thermodynamics.js +22 -30
  84. package/dist/convex-hull/helpers.d.ts +42 -7
  85. package/dist/convex-hull/helpers.js +171 -78
  86. package/dist/convex-hull/hull-state.svelte.d.ts +44 -0
  87. package/dist/convex-hull/hull-state.svelte.js +124 -0
  88. package/dist/convex-hull/index.d.ts +10 -8
  89. package/dist/convex-hull/index.js +7 -2
  90. package/dist/convex-hull/thermodynamics.js +136 -960
  91. package/dist/convex-hull/types.d.ts +13 -5
  92. package/dist/convex-hull/types.js +12 -0
  93. package/dist/coordination/CoordinationBarPlot.svelte +27 -34
  94. package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
  95. package/dist/element/BohrAtom.svelte +2 -1
  96. package/dist/element/index.d.ts +4 -0
  97. package/dist/element/index.js +18 -0
  98. package/dist/feedback/DragOverlay.svelte +3 -1
  99. package/dist/feedback/DragOverlay.svelte.d.ts +1 -0
  100. package/dist/feedback/StatusMessage.svelte +13 -3
  101. package/dist/fermi-surface/FermiSlice.svelte +13 -5
  102. package/dist/fermi-surface/FermiSurface.svelte +78 -151
  103. package/dist/fermi-surface/FermiSurface.svelte.d.ts +5 -14
  104. package/dist/fermi-surface/FermiSurfaceControls.svelte +1 -1
  105. package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
  106. package/dist/fermi-surface/FermiSurfaceScene.svelte +72 -221
  107. package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +3 -23
  108. package/dist/fermi-surface/FermiSurfaceTooltip.svelte +8 -34
  109. package/dist/fermi-surface/compute.js +67 -66
  110. package/dist/fermi-surface/export.js +6 -16
  111. package/dist/fermi-surface/index.d.ts +0 -1
  112. package/dist/fermi-surface/index.js +0 -1
  113. package/dist/fermi-surface/parse.d.ts +1 -1
  114. package/dist/fermi-surface/parse.js +71 -79
  115. package/dist/fermi-surface/types.d.ts +3 -2
  116. package/dist/heatmap-matrix/HeatmapMatrix.svelte +69 -52
  117. package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +4 -3
  118. package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +3 -2
  119. package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +5 -5
  120. package/dist/heatmap-matrix/index.d.ts +3 -2
  121. package/dist/heatmap-matrix/index.js +1 -1
  122. package/dist/index.d.ts +1 -0
  123. package/dist/index.js +1 -0
  124. package/dist/io/ExportPane.svelte +166 -0
  125. package/dist/io/ExportPane.svelte.d.ts +17 -0
  126. package/dist/io/decompress.js +5 -4
  127. package/dist/io/export.d.ts +9 -5
  128. package/dist/io/export.js +77 -51
  129. package/dist/io/fetch.d.ts +2 -1
  130. package/dist/io/fetch.js +5 -1
  131. package/dist/io/file-drop.d.ts +8 -1
  132. package/dist/io/file-drop.js +48 -36
  133. package/dist/io/index.d.ts +2 -0
  134. package/dist/io/index.js +10 -0
  135. package/dist/io/types.d.ts +13 -0
  136. package/dist/io/url-drop.js +64 -33
  137. package/dist/isosurface/parse.js +52 -51
  138. package/dist/isosurface/slice.js +5 -4
  139. package/dist/isosurface/types.js +1 -1
  140. package/dist/keyboard.d.ts +3 -0
  141. package/dist/keyboard.js +23 -0
  142. package/dist/labels.d.ts +1 -1
  143. package/dist/labels.js +9 -8
  144. package/dist/layout/FullscreenButton.svelte +33 -0
  145. package/dist/layout/FullscreenButton.svelte.d.ts +10 -0
  146. package/dist/layout/FullscreenToggle.svelte +8 -14
  147. package/dist/layout/PropertyFilter.svelte +3 -2
  148. package/dist/layout/SettingsSection.svelte +1 -1
  149. package/dist/layout/ViewerChrome.svelte +116 -0
  150. package/dist/layout/ViewerChrome.svelte.d.ts +17 -0
  151. package/dist/layout/fullscreen.d.ts +4 -0
  152. package/dist/layout/fullscreen.svelte.d.ts +8 -0
  153. package/dist/layout/fullscreen.svelte.js +37 -0
  154. package/dist/layout/index.d.ts +3 -0
  155. package/dist/layout/index.js +3 -0
  156. package/dist/layout/json-tree/JsonNode.svelte +1 -1
  157. package/dist/layout/json-tree/JsonTree.svelte +2 -2
  158. package/dist/layout/json-tree/utils.js +5 -4
  159. package/dist/marching-cubes.js +8 -13
  160. package/dist/math.d.ts +12 -4
  161. package/dist/math.js +42 -30
  162. package/dist/overlays/DraggablePane.svelte +4 -4
  163. package/dist/overlays/index.d.ts +4 -0
  164. package/dist/periodic-table/PeriodicTable.svelte +27 -15
  165. package/dist/periodic-table/PropertySelect.svelte +1 -0
  166. package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +9 -3
  167. package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +1 -1
  168. package/dist/phase-diagram/PhaseDiagramControls.svelte +3 -2
  169. package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +4 -3
  170. package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +4 -2
  171. package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +2 -3
  172. package/dist/phase-diagram/PhaseDiagramExportPane.svelte +47 -132
  173. package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +3 -4
  174. package/dist/phase-diagram/PhaseDiagramTooltip.svelte +1 -1
  175. package/dist/phase-diagram/build-diagram.js +2 -2
  176. package/dist/phase-diagram/colors.js +1 -1
  177. package/dist/phase-diagram/parse.d.ts +2 -1
  178. package/dist/phase-diagram/parse.js +6 -5
  179. package/dist/phase-diagram/types.d.ts +1 -1
  180. package/dist/phase-diagram/utils.d.ts +3 -3
  181. package/dist/phase-diagram/utils.js +8 -12
  182. package/dist/plot/{BarPlot.svelte → bar/BarPlot.svelte} +246 -841
  183. package/dist/plot/{BarPlot.svelte.d.ts → bar/BarPlot.svelte.d.ts} +8 -16
  184. package/dist/plot/{BarPlotControls.svelte → bar/BarPlotControls.svelte} +6 -5
  185. package/dist/plot/{BarPlotControls.svelte.d.ts → bar/BarPlotControls.svelte.d.ts} +3 -3
  186. package/dist/plot/{SpacegroupBarPlot.svelte → bar/SpacegroupBarPlot.svelte} +8 -7
  187. package/dist/plot/{SpacegroupBarPlot.svelte.d.ts → bar/SpacegroupBarPlot.svelte.d.ts} +1 -1
  188. package/dist/plot/bar/data.d.ts +40 -0
  189. package/dist/plot/bar/data.js +154 -0
  190. package/dist/plot/bar/geometry.d.ts +39 -0
  191. package/dist/plot/bar/geometry.js +60 -0
  192. package/dist/plot/bar/index.d.ts +3 -0
  193. package/dist/plot/bar/index.js +3 -0
  194. package/dist/plot/box/BoxPlot.svelte +1292 -0
  195. package/dist/plot/box/BoxPlot.svelte.d.ts +95 -0
  196. package/dist/plot/box/BoxPlotControls.svelte +109 -0
  197. package/dist/plot/box/BoxPlotControls.svelte.d.ts +19 -0
  198. package/dist/plot/box/Violin.svelte +14 -0
  199. package/dist/plot/box/Violin.svelte.d.ts +70 -0
  200. package/dist/plot/box/box-plot.d.ts +56 -0
  201. package/dist/plot/box/box-plot.js +129 -0
  202. package/dist/plot/box/index.d.ts +5 -0
  203. package/dist/plot/box/index.js +5 -0
  204. package/dist/plot/box/kde.d.ts +17 -0
  205. package/dist/plot/box/kde.js +160 -0
  206. package/dist/plot/box/quantile.d.ts +3 -0
  207. package/dist/plot/box/quantile.js +53 -0
  208. package/dist/plot/{auto-place.d.ts → core/auto-place.d.ts} +1 -1
  209. package/dist/plot/{auto-place.js → core/auto-place.js} +6 -3
  210. package/dist/plot/core/axis-utils.d.ts +46 -0
  211. package/dist/plot/core/axis-utils.js +110 -0
  212. package/dist/plot/{AxisLabel.svelte → core/components/AxisLabel.svelte} +2 -2
  213. package/dist/plot/{AxisLabel.svelte.d.ts → core/components/AxisLabel.svelte.d.ts} +1 -1
  214. package/dist/plot/{ColorBar.svelte → core/components/ColorBar.svelte} +41 -38
  215. package/dist/plot/{ColorBar.svelte.d.ts → core/components/ColorBar.svelte.d.ts} +7 -6
  216. package/dist/plot/{ColorScaleSelect.svelte → core/components/ColorScaleSelect.svelte} +4 -3
  217. package/dist/plot/{ColorScaleSelect.svelte.d.ts → core/components/ColorScaleSelect.svelte.d.ts} +2 -2
  218. package/dist/plot/core/components/ControlPane.svelte +46 -0
  219. package/dist/plot/core/components/ControlPane.svelte.d.ts +13 -0
  220. package/dist/plot/{FillArea.svelte → core/components/FillArea.svelte} +17 -6
  221. package/dist/plot/{FillArea.svelte.d.ts → core/components/FillArea.svelte.d.ts} +1 -1
  222. package/dist/plot/{InteractiveAxisLabel.svelte → core/components/InteractiveAxisLabel.svelte} +3 -3
  223. package/dist/plot/{InteractiveAxisLabel.svelte.d.ts → core/components/InteractiveAxisLabel.svelte.d.ts} +2 -2
  224. package/dist/plot/{Line.svelte → core/components/Line.svelte} +33 -15
  225. package/dist/plot/{Line.svelte.d.ts → core/components/Line.svelte.d.ts} +3 -2
  226. package/dist/plot/{PlotAxis.svelte → core/components/PlotAxis.svelte} +9 -6
  227. package/dist/plot/{PlotAxis.svelte.d.ts → core/components/PlotAxis.svelte.d.ts} +5 -3
  228. package/dist/plot/{PlotControls.svelte → core/components/PlotControls.svelte} +17 -29
  229. package/dist/plot/core/components/PlotControls.svelte.d.ts +4 -0
  230. package/dist/plot/{PlotLegend.svelte → core/components/PlotLegend.svelte} +21 -10
  231. package/dist/plot/{PlotLegend.svelte.d.ts → core/components/PlotLegend.svelte.d.ts} +3 -2
  232. package/dist/plot/{PlotTooltip.svelte → core/components/PlotTooltip.svelte} +17 -1
  233. package/dist/plot/{PlotTooltip.svelte.d.ts → core/components/PlotTooltip.svelte.d.ts} +8 -0
  234. package/dist/plot/{PortalSelect.svelte → core/components/PortalSelect.svelte} +11 -7
  235. package/dist/plot/{ReferenceLine.svelte → core/components/ReferenceLine.svelte} +3 -3
  236. package/dist/plot/{ReferenceLine.svelte.d.ts → core/components/ReferenceLine.svelte.d.ts} +1 -1
  237. package/dist/plot/{ReferenceLine3D.svelte → core/components/ReferenceLine3D.svelte} +5 -5
  238. package/dist/plot/{ReferenceLine3D.svelte.d.ts → core/components/ReferenceLine3D.svelte.d.ts} +5 -5
  239. package/dist/plot/{ReferencePlane.svelte → core/components/ReferencePlane.svelte} +8 -8
  240. package/dist/plot/{ReferencePlane.svelte.d.ts → core/components/ReferencePlane.svelte.d.ts} +5 -5
  241. package/dist/plot/{ZeroLines.svelte → core/components/ZeroLines.svelte} +3 -3
  242. package/dist/plot/{ZeroLines.svelte.d.ts → core/components/ZeroLines.svelte.d.ts} +3 -3
  243. package/dist/plot/{ZoomRect.svelte → core/components/ZoomRect.svelte} +1 -1
  244. package/dist/plot/{ZoomRect.svelte.d.ts → core/components/ZoomRect.svelte.d.ts} +1 -1
  245. package/dist/plot/core/components/index.d.ts +17 -0
  246. package/dist/plot/core/components/index.js +17 -0
  247. package/dist/plot/{data-cleaning.d.ts → core/data-cleaning.d.ts} +71 -1
  248. package/dist/plot/{data-cleaning.js → core/data-cleaning.js} +21 -23
  249. package/dist/plot/{data-transform.d.ts → core/data-transform.d.ts} +2 -2
  250. package/dist/plot/{data-transform.js → core/data-transform.js} +3 -3
  251. package/dist/plot/core/fill-utils.d.ts +34 -0
  252. package/dist/plot/core/fill-utils.js +391 -0
  253. package/dist/plot/core/index.d.ts +10 -0
  254. package/dist/plot/core/index.js +11 -0
  255. package/dist/plot/core/interactions.d.ts +39 -0
  256. package/dist/plot/core/interactions.js +209 -0
  257. package/dist/plot/{layout.d.ts → core/layout.d.ts} +1 -0
  258. package/dist/plot/{layout.js → core/layout.js} +16 -8
  259. package/dist/plot/core/pan-zoom.svelte.d.ts +35 -0
  260. package/dist/plot/core/pan-zoom.svelte.js +221 -0
  261. package/dist/plot/core/placed-tween.svelte.d.ts +21 -0
  262. package/dist/plot/core/placed-tween.svelte.js +68 -0
  263. package/dist/plot/{reference-line.d.ts → core/reference-line.d.ts} +11 -11
  264. package/dist/plot/{reference-line.js → core/reference-line.js} +29 -42
  265. package/dist/plot/core/scales.d.ts +40 -0
  266. package/dist/plot/{scales.js → core/scales.js} +94 -93
  267. package/dist/plot/core/svg.d.ts +3 -0
  268. package/dist/plot/core/svg.js +41 -0
  269. package/dist/plot/{types.d.ts → core/types.d.ts} +36 -85
  270. package/dist/plot/{types.js → core/types.js} +1 -1
  271. package/dist/plot/{utils → core/utils}/label-placement.d.ts +3 -3
  272. package/dist/plot/{utils → core/utils}/label-placement.js +3 -3
  273. package/dist/plot/core/utils/series-visibility.d.ts +26 -0
  274. package/dist/plot/{utils → core/utils}/series-visibility.js +29 -2
  275. package/dist/plot/core/utils.d.ts +12 -0
  276. package/dist/plot/core/utils.js +27 -0
  277. package/dist/plot/{Histogram.svelte → histogram/Histogram.svelte} +174 -551
  278. package/dist/plot/{Histogram.svelte.d.ts → histogram/Histogram.svelte.d.ts} +2 -2
  279. package/dist/plot/{HistogramControls.svelte → histogram/HistogramControls.svelte} +6 -6
  280. package/dist/plot/{HistogramControls.svelte.d.ts → histogram/HistogramControls.svelte.d.ts} +4 -4
  281. package/dist/plot/histogram/index.d.ts +2 -0
  282. package/dist/plot/histogram/index.js +2 -0
  283. package/dist/plot/index.d.ts +8 -41
  284. package/dist/plot/index.js +10 -39
  285. package/dist/plot/sankey/Sankey.svelte +697 -0
  286. package/dist/plot/sankey/Sankey.svelte.d.ts +74 -0
  287. package/dist/plot/sankey/SankeyControls.svelte +98 -0
  288. package/dist/plot/sankey/SankeyControls.svelte.d.ts +19 -0
  289. package/dist/plot/sankey/index.d.ts +4 -0
  290. package/dist/plot/sankey/index.js +3 -0
  291. package/dist/plot/sankey/sankey-types.d.ts +42 -0
  292. package/dist/plot/sankey/sankey-types.js +4 -0
  293. package/dist/plot/sankey/sankey.d.ts +52 -0
  294. package/dist/plot/sankey/sankey.js +189 -0
  295. package/dist/plot/{BinnedScatterPlot.svelte → scatter/BinnedScatterPlot.svelte} +64 -64
  296. package/dist/plot/{BinnedScatterPlot.svelte.d.ts → scatter/BinnedScatterPlot.svelte.d.ts} +6 -6
  297. package/dist/plot/{ElementScatter.svelte → scatter/ElementScatter.svelte} +6 -6
  298. package/dist/plot/{ElementScatter.svelte.d.ts → scatter/ElementScatter.svelte.d.ts} +2 -2
  299. package/dist/plot/{ScatterPlot.svelte → scatter/ScatterPlot.svelte} +297 -1008
  300. package/dist/plot/{ScatterPlot.svelte.d.ts → scatter/ScatterPlot.svelte.d.ts} +10 -18
  301. package/dist/plot/{ScatterPlotControls.svelte → scatter/ScatterPlotControls.svelte} +6 -5
  302. package/dist/plot/{ScatterPlotControls.svelte.d.ts → scatter/ScatterPlotControls.svelte.d.ts} +2 -2
  303. package/dist/plot/{ScatterPoint.svelte → scatter/ScatterPoint.svelte} +7 -7
  304. package/dist/plot/{ScatterPoint.svelte.d.ts → scatter/ScatterPoint.svelte.d.ts} +3 -3
  305. package/dist/plot/{adaptive-density.d.ts → scatter/adaptive-density.d.ts} +14 -4
  306. package/dist/plot/{adaptive-density.js → scatter/adaptive-density.js} +46 -20
  307. package/dist/plot/{binned-scatter-types.d.ts → scatter/binned-scatter-types.d.ts} +5 -12
  308. package/dist/plot/scatter/index.d.ts +7 -0
  309. package/dist/plot/scatter/index.js +5 -0
  310. package/dist/plot/scatter/scatter-data.d.ts +19 -0
  311. package/dist/plot/scatter/scatter-data.js +212 -0
  312. package/dist/plot/{ScatterPlot3D.svelte → scatter-3d/ScatterPlot3D.svelte} +25 -34
  313. package/dist/plot/{ScatterPlot3D.svelte.d.ts → scatter-3d/ScatterPlot3D.svelte.d.ts} +9 -17
  314. package/dist/plot/{ScatterPlot3DControls.svelte → scatter-3d/ScatterPlot3DControls.svelte} +14 -14
  315. package/dist/plot/{ScatterPlot3DControls.svelte.d.ts → scatter-3d/ScatterPlot3DControls.svelte.d.ts} +6 -6
  316. package/dist/plot/{ScatterPlot3DScene.svelte → scatter-3d/ScatterPlot3DScene.svelte} +129 -128
  317. package/dist/plot/{ScatterPlot3DScene.svelte.d.ts → scatter-3d/ScatterPlot3DScene.svelte.d.ts} +6 -15
  318. package/dist/plot/{Surface3D.svelte → scatter-3d/Surface3D.svelte} +7 -6
  319. package/dist/plot/{Surface3D.svelte.d.ts → scatter-3d/Surface3D.svelte.d.ts} +5 -4
  320. package/dist/plot/scatter-3d/index.d.ts +4 -0
  321. package/dist/plot/scatter-3d/index.js +4 -0
  322. package/dist/plot/sunburst/Sunburst.svelte +1041 -0
  323. package/dist/plot/sunburst/Sunburst.svelte.d.ts +97 -0
  324. package/dist/plot/sunburst/SunburstControls.svelte +200 -0
  325. package/dist/plot/sunburst/SunburstControls.svelte.d.ts +26 -0
  326. package/dist/plot/sunburst/index.d.ts +4 -0
  327. package/dist/plot/sunburst/index.js +4 -0
  328. package/dist/plot/sunburst/render.d.ts +34 -0
  329. package/dist/plot/sunburst/render.js +122 -0
  330. package/dist/plot/sunburst/sunburst.d.ts +62 -0
  331. package/dist/plot/sunburst/sunburst.js +269 -0
  332. package/dist/rdf/RdfPlot.svelte +2 -1
  333. package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
  334. package/dist/rdf/calc-rdf.js +11 -24
  335. package/dist/sanitize.js +14 -3
  336. package/dist/scene/SceneCamera.svelte +62 -0
  337. package/dist/scene/SceneCamera.svelte.d.ts +19 -0
  338. package/dist/scene/bind-renderer.svelte.d.ts +2 -0
  339. package/dist/scene/bind-renderer.svelte.js +14 -0
  340. package/dist/scene/index.d.ts +4 -0
  341. package/dist/scene/index.js +5 -0
  342. package/dist/scene/props.js +52 -0
  343. package/dist/scene/types.d.ts +26 -0
  344. package/dist/scene/types.js +1 -0
  345. package/dist/settings.d.ts +79 -3
  346. package/dist/settings.js +321 -1
  347. package/dist/spectral/Bands.svelte +47 -36
  348. package/dist/spectral/Bands.svelte.d.ts +6 -6
  349. package/dist/spectral/BandsAndDos.svelte +23 -25
  350. package/dist/spectral/BrillouinBandsDos.svelte +42 -30
  351. package/dist/spectral/Dos.svelte +15 -23
  352. package/dist/spectral/Dos.svelte.d.ts +4 -3
  353. package/dist/spectral/helpers.d.ts +8 -6
  354. package/dist/spectral/helpers.js +137 -65
  355. package/dist/state.svelte.d.ts +0 -7
  356. package/dist/state.svelte.js +0 -6
  357. package/dist/structure/Arrow.svelte +2 -4
  358. package/dist/structure/AtomLegend.svelte +8 -9
  359. package/dist/structure/AtomLegend.svelte.d.ts +1 -1
  360. package/dist/structure/CanvasTooltip.svelte +1 -0
  361. package/dist/structure/CellSelect.svelte +12 -5
  362. package/dist/structure/CellSelect.svelte.d.ts +2 -1
  363. package/dist/structure/Cylinder.svelte +12 -8
  364. package/dist/structure/Cylinder.svelte.d.ts +4 -1
  365. package/dist/structure/Lattice.svelte +2 -2
  366. package/dist/structure/Structure.svelte +365 -423
  367. package/dist/structure/Structure.svelte.d.ts +5 -15
  368. package/dist/structure/StructureControls.svelte +217 -2
  369. package/dist/structure/StructureControls.svelte.d.ts +5 -3
  370. package/dist/structure/StructureExportPane.svelte +54 -156
  371. package/dist/structure/StructureExportPane.svelte.d.ts +4 -5
  372. package/dist/structure/StructureInfoPane.svelte +10 -9
  373. package/dist/structure/StructureInfoPane.svelte.d.ts +5 -5
  374. package/dist/structure/StructureScene.svelte +376 -208
  375. package/dist/structure/StructureScene.svelte.d.ts +22 -20
  376. package/dist/structure/{label-placement.d.ts → atom-label-placement.d.ts} +3 -3
  377. package/dist/structure/{label-placement.js → atom-label-placement.js} +15 -5
  378. package/dist/structure/atom-properties.d.ts +1 -1
  379. package/dist/structure/atom-properties.js +17 -22
  380. package/dist/structure/bond-order-perception.js +3 -5
  381. package/dist/structure/bonding.d.ts +4 -0
  382. package/dist/structure/bonding.js +134 -63
  383. package/dist/structure/export.d.ts +24 -4
  384. package/dist/structure/export.js +89 -143
  385. package/dist/structure/index.d.ts +4 -4
  386. package/dist/structure/index.js +3 -3
  387. package/dist/structure/measure.d.ts +3 -2
  388. package/dist/structure/measure.js +6 -5
  389. package/dist/structure/parse.d.ts +3 -2
  390. package/dist/structure/parse.js +419 -438
  391. package/dist/structure/partial-occupancy.d.ts +0 -1
  392. package/dist/structure/partial-occupancy.js +1 -1
  393. package/dist/structure/pbc.d.ts +1 -1
  394. package/dist/structure/pbc.js +190 -13
  395. package/dist/structure/polyhedra.d.ts +41 -0
  396. package/dist/structure/polyhedra.js +602 -0
  397. package/dist/structure/site.d.ts +4 -0
  398. package/dist/structure/site.js +1 -0
  399. package/dist/structure/supercell.js +3 -2
  400. package/dist/structure/validation.js +5 -6
  401. package/dist/symmetry/SymmetryElementControls.svelte +69 -0
  402. package/dist/symmetry/SymmetryElementControls.svelte.d.ts +9 -0
  403. package/dist/symmetry/SymmetryElements.svelte +354 -0
  404. package/dist/symmetry/SymmetryElements.svelte.d.ts +24 -0
  405. package/dist/symmetry/SymmetryStats.svelte +113 -8
  406. package/dist/symmetry/WyckoffTable.svelte +68 -7
  407. package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -0
  408. package/dist/symmetry/cell-transform.js +7 -14
  409. package/dist/symmetry/index.d.ts +14 -4
  410. package/dist/symmetry/index.js +291 -72
  411. package/dist/symmetry/spacegroups.d.ts +12 -1
  412. package/dist/symmetry/spacegroups.js +63 -14
  413. package/dist/symmetry/symmetry-elements.d.ts +33 -0
  414. package/dist/symmetry/symmetry-elements.js +521 -0
  415. package/dist/symmetry/wyckoff-db.d.ts +9 -0
  416. package/dist/symmetry/wyckoff-db.js +87 -0
  417. package/dist/table/HeatmapTable.svelte +66 -25
  418. package/dist/table/HeatmapTable.svelte.d.ts +1 -1
  419. package/dist/table/index.d.ts +1 -3
  420. package/dist/table/index.js +1 -1
  421. package/dist/theme/index.js +8 -8
  422. package/dist/tooltip/KCoords.svelte +45 -0
  423. package/dist/tooltip/KCoords.svelte.d.ts +8 -0
  424. package/dist/tooltip/index.d.ts +1 -0
  425. package/dist/tooltip/index.js +1 -0
  426. package/dist/trajectory/Trajectory.svelte +123 -100
  427. package/dist/trajectory/Trajectory.svelte.d.ts +11 -22
  428. package/dist/trajectory/TrajectoryExportPane.svelte +17 -25
  429. package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +4 -5
  430. package/dist/trajectory/TrajectoryInfoPane.svelte +5 -3
  431. package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -2
  432. package/dist/trajectory/constants.js +6 -2
  433. package/dist/trajectory/extract.js +17 -37
  434. package/dist/trajectory/format-detect.d.ts +1 -1
  435. package/dist/trajectory/format-detect.js +27 -19
  436. package/dist/trajectory/frame-reader.d.ts +0 -1
  437. package/dist/trajectory/frame-reader.js +63 -162
  438. package/dist/trajectory/helpers.d.ts +10 -2
  439. package/dist/trajectory/helpers.js +56 -36
  440. package/dist/trajectory/index.js +1 -1
  441. package/dist/trajectory/parse/ase.d.ts +9 -1
  442. package/dist/trajectory/parse/ase.js +47 -32
  443. package/dist/trajectory/parse/diagnostics.d.ts +3 -0
  444. package/dist/trajectory/parse/diagnostics.js +14 -0
  445. package/dist/trajectory/parse/hdf5.js +1 -1
  446. package/dist/trajectory/parse/index.d.ts +1 -1
  447. package/dist/trajectory/parse/index.js +65 -105
  448. package/dist/trajectory/parse/lammps.d.ts +0 -2
  449. package/dist/trajectory/parse/lammps.js +8 -6
  450. package/dist/trajectory/parse/pymatgen.d.ts +2 -0
  451. package/dist/trajectory/parse/pymatgen.js +74 -0
  452. package/dist/trajectory/parse/vasp.js +38 -18
  453. package/dist/trajectory/parse/xyz.d.ts +13 -1
  454. package/dist/trajectory/parse/xyz.js +102 -94
  455. package/dist/trajectory/plotting.d.ts +1 -2
  456. package/dist/trajectory/plotting.js +16 -113
  457. package/dist/utils.d.ts +2 -0
  458. package/dist/utils.js +7 -5
  459. package/dist/xrd/XrdPlot.svelte +16 -30
  460. package/dist/xrd/broadening.d.ts +2 -1
  461. package/dist/xrd/calc-xrd.js +18 -20
  462. package/dist/xrd/index.d.ts +2 -2
  463. package/dist/xrd/parse.js +2 -2
  464. package/package.json +43 -26
  465. package/dist/element/data.json +0 -11864
  466. package/dist/fermi-surface/marching-cubes.d.ts +0 -2
  467. package/dist/fermi-surface/marching-cubes.js +0 -2
  468. package/dist/plot/PlotControls.svelte.d.ts +0 -4
  469. package/dist/plot/axis-utils.d.ts +0 -19
  470. package/dist/plot/axis-utils.js +0 -78
  471. package/dist/plot/defaults.d.ts +0 -19
  472. package/dist/plot/defaults.js +0 -9
  473. package/dist/plot/fill-utils.d.ts +0 -46
  474. package/dist/plot/fill-utils.js +0 -322
  475. package/dist/plot/hover-lock.svelte.d.ts +0 -14
  476. package/dist/plot/hover-lock.svelte.js +0 -46
  477. package/dist/plot/interactions.d.ts +0 -12
  478. package/dist/plot/interactions.js +0 -101
  479. package/dist/plot/scales.d.ts +0 -48
  480. package/dist/plot/svg.d.ts +0 -1
  481. package/dist/plot/svg.js +0 -11
  482. package/dist/plot/utils/series-visibility.d.ts +0 -15
  483. package/dist/plot/utils.d.ts +0 -1
  484. package/dist/plot/utils.js +0 -14
  485. /package/dist/plot/{PortalSelect.svelte.d.ts → core/components/PortalSelect.svelte.d.ts} +0 -0
  486. /package/dist/plot/{binned-scatter-types.js → scatter/binned-scatter-types.js} +0 -0
@@ -3,6 +3,6 @@ import type { ConvexHullEntry, HighlightStyle } from './types';
3
3
  type $$ComponentProps = BaseConvexHullProps<ConvexHullEntry> & Hull3DProps & {
4
4
  highlight_style?: HighlightStyle;
5
5
  };
6
- declare const ConvexHull4D: import("svelte").Component<$$ComponentProps, {}, "temperature" | "fullscreen" | "show_hull_faces" | "hull_face_opacity" | "hull_face_color_mode" | "color_mode" | "color_scale" | "show_stable" | "show_unstable" | "show_stable_labels" | "show_unstable_labels" | "max_hull_dist_show_phases" | "max_hull_dist_show_labels" | "info_pane_open" | "legend_pane_open" | "wrapper" | "energy_source_mode" | "stable_entries" | "unstable_entries" | "phase_stats" | "highlighted_entries" | "selected_entry" | "gas_pressures">;
6
+ declare const ConvexHull4D: import("svelte").Component<$$ComponentProps, {}, "temperature" | "fullscreen" | "wrapper" | "controls_open" | "color_scale" | "info_pane_open" | "show_hull_faces" | "hull_face_opacity" | "hull_face_color_mode" | "color_mode" | "show_stable" | "show_unstable" | "show_stable_labels" | "show_unstable_labels" | "max_hull_dist_show_phases" | "max_hull_dist_show_labels" | "hidden_categories" | "energy_source_mode" | "stable_entries" | "unstable_entries" | "phase_stats" | "highlighted_entries" | "selected_entry" | "gas_pressures">;
7
7
  type ConvexHull4D = ReturnType<typeof ConvexHull4D>;
8
8
  export default ConvexHull4D;
@@ -0,0 +1,268 @@
1
+ <script lang="ts">
2
+ import type { ShowControlsState } from '../controls'
3
+ // Shared ConvexHull3D/4D chrome: control-buttons toolbar (reset, info pane, fullscreen,
4
+ // legend controls) plus the hover tooltip, copy feedback, drag overlay and structure
5
+ // popup driven by the shared canvas-interactions scaffold
6
+ import { ClickFeedback, DragOverlay } from '../feedback'
7
+ import Icon from '../Icon.svelte'
8
+ import { FullscreenButton, type FullscreenToggleProp } from '../layout'
9
+ import { PlotTooltip } from '../plot'
10
+ import type { ComponentProps, Snippet } from 'svelte'
11
+ import type { create_canvas_interactions } from './canvas-interactions.svelte'
12
+ import ConvexHullControls from './ConvexHullControls.svelte'
13
+ import ConvexHullInfoPane from './ConvexHullInfoPane.svelte'
14
+ import ConvexHullTooltip from './ConvexHullTooltip.svelte'
15
+ import type { create_hull_data_pipeline } from './hull-state.svelte'
16
+ import type { ConvexHullTooltipProp } from './index'
17
+ import { CONVEX_HULL_STYLE } from './index'
18
+ import StructurePopup from './StructurePopup.svelte'
19
+ import type { ConvexHullEntry, HighlightStyle, HullFaceColorMode } from './types'
20
+ import { MAGNETIC_ORDERING_CATEGORY } from './types'
21
+
22
+ type ControlsProps = ComponentProps<typeof ConvexHullControls>
23
+
24
+ let {
25
+ interactions, // canvas-interactions scaffold: hover/drag/popup/copy-feedback state
26
+ hull_data, // hull-state pipeline: energy-mode flags, polymorph stats, thresholds
27
+ controls_config,
28
+ reset_all,
29
+ reset_title,
30
+ enable_info_pane = true,
31
+ phase_stats,
32
+ label_threshold,
33
+ fullscreen = false,
34
+ fullscreen_toggle = true,
35
+ wrapper = undefined,
36
+ camera,
37
+ merged_controls,
38
+ stable_entries,
39
+ unstable_entries,
40
+ get_point_color,
41
+ merged_highlight_style,
42
+ is_highlighted,
43
+ tooltip = undefined,
44
+ selected_entry,
45
+ show_hull_faces = $bindable(),
46
+ hull_face_color = $bindable(),
47
+ hull_face_opacity = $bindable(),
48
+ hull_face_color_mode = $bindable(),
49
+ info_pane_open = $bindable(false),
50
+ controls_open = $bindable(false),
51
+ color_mode = $bindable(`stability`),
52
+ color_scale = $bindable(`interpolateViridis`),
53
+ show_stable = $bindable(true),
54
+ show_unstable = $bindable(true),
55
+ entry_category = MAGNETIC_ORDERING_CATEGORY,
56
+ hidden_categories = $bindable([]),
57
+ show_stable_labels = $bindable(true),
58
+ show_unstable_labels = $bindable(false),
59
+ max_hull_dist_show_phases = $bindable(0),
60
+ max_hull_dist_show_labels = $bindable(0.1),
61
+ energy_source_mode = $bindable(`precomputed`),
62
+ }:
63
+ & Pick<
64
+ ControlsProps,
65
+ | `camera`
66
+ | `merged_controls`
67
+ | `stable_entries`
68
+ | `unstable_entries`
69
+ | `color_mode`
70
+ | `color_scale`
71
+ | `show_stable`
72
+ | `show_unstable`
73
+ | `entry_category`
74
+ | `hidden_categories`
75
+ | `show_stable_labels`
76
+ | `show_unstable_labels`
77
+ | `max_hull_dist_show_phases`
78
+ | `max_hull_dist_show_labels`
79
+ | `energy_source_mode`
80
+ | `controls_open`
81
+ | `show_hull_faces`
82
+ | `hull_face_color`
83
+ | `hull_face_opacity`
84
+ | `hull_face_color_mode`
85
+ >
86
+ & Pick<ComponentProps<typeof ConvexHullInfoPane>, `phase_stats` | `label_threshold`>
87
+ & {
88
+ interactions: ReturnType<typeof create_canvas_interactions>
89
+ hull_data: ReturnType<typeof create_hull_data_pipeline<ConvexHullEntry>>
90
+ controls_config: ShowControlsState
91
+ reset_all: () => void
92
+ reset_title: string
93
+ enable_info_pane?: boolean
94
+ fullscreen?: boolean
95
+ fullscreen_toggle?: FullscreenToggleProp
96
+ wrapper?: HTMLDivElement
97
+ get_point_color: (entry: ConvexHullEntry) => string
98
+ merged_highlight_style: HighlightStyle
99
+ is_highlighted: (entry: ConvexHullEntry) => boolean
100
+ tooltip?: ConvexHullTooltipProp<ConvexHullEntry>
101
+ selected_entry: ConvexHullEntry | null
102
+ info_pane_open?: boolean
103
+ } = $props()
104
+ </script>
105
+
106
+ <!-- Control buttons (top-right corner) -->
107
+ {#if controls_config.mode !== `never`}
108
+ <section class="control-buttons {controls_config.class}">
109
+ {#if controls_config.visible(`reset`)}
110
+ <button
111
+ type="button"
112
+ onclick={reset_all}
113
+ title={reset_title}
114
+ class="reset-camera-btn"
115
+ >
116
+ <Icon icon="Reset" />
117
+ </button>
118
+ {/if}
119
+
120
+ {#if enable_info_pane && phase_stats && controls_config.visible(`info-pane`)}
121
+ <ConvexHullInfoPane
122
+ bind:pane_open={info_pane_open}
123
+ {phase_stats}
124
+ {stable_entries}
125
+ {unstable_entries}
126
+ {show_stable}
127
+ {show_unstable}
128
+ {entry_category}
129
+ {hidden_categories}
130
+ {max_hull_dist_show_phases}
131
+ {max_hull_dist_show_labels}
132
+ {label_threshold}
133
+ toggle_props={{ class: `info-btn` }}
134
+ />
135
+ {/if}
136
+
137
+ {#if fullscreen_toggle && controls_config.visible(`fullscreen`)}
138
+ <FullscreenButton {fullscreen} toggle={fullscreen_toggle} {wrapper} />
139
+ {/if}
140
+
141
+ <!-- Legend controls pane -->
142
+ {#if controls_config.visible(`controls`)}
143
+ <ConvexHullControls
144
+ bind:controls_open
145
+ bind:color_mode
146
+ bind:color_scale
147
+ bind:show_stable
148
+ bind:show_unstable
149
+ {entry_category}
150
+ bind:hidden_categories
151
+ bind:show_stable_labels
152
+ bind:show_unstable_labels
153
+ bind:max_hull_dist_show_phases
154
+ bind:max_hull_dist_show_labels
155
+ max_hull_dist_in_data={hull_data.max_hull_dist_in_data}
156
+ {stable_entries}
157
+ {unstable_entries}
158
+ {camera}
159
+ {merged_controls}
160
+ toggle_props={{ class: `legend-controls-btn` }}
161
+ {show_hull_faces}
162
+ on_hull_faces_change={(value: boolean) => show_hull_faces = value}
163
+ {hull_face_color}
164
+ on_hull_face_color_change={(value: string) => hull_face_color = value}
165
+ {hull_face_opacity}
166
+ on_hull_face_opacity_change={(value: number) => hull_face_opacity = value}
167
+ {hull_face_color_mode}
168
+ on_hull_face_color_mode_change={(value: HullFaceColorMode) =>
169
+ hull_face_color_mode = value}
170
+ bind:energy_source_mode
171
+ has_precomputed_e_form={hull_data.has_precomputed_e_form}
172
+ can_compute_e_form={hull_data.can_compute_e_form}
173
+ has_precomputed_hull={hull_data.has_precomputed_hull}
174
+ can_compute_hull={hull_data.can_compute_hull}
175
+ />
176
+ {/if}
177
+ </section>
178
+ {/if}
179
+
180
+ <!-- Hover tooltip -->
181
+ {#if interactions.hover_data}
182
+ {@const { entry, position } = interactions.hover_data}
183
+ {@const entry_highlight = is_highlighted(entry) ? merged_highlight_style : undefined}
184
+ {@const tooltip_style =
185
+ `z-index: ${CONVEX_HULL_STYLE.z_index.tooltip}; backdrop-filter: blur(4px);
186
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);`}
187
+ <PlotTooltip
188
+ x={position.x}
189
+ y={position.y}
190
+ offset={{ x: 10, y: -10 }}
191
+ bg_color={get_point_color(entry)}
192
+ fixed
193
+ style={tooltip_style}
194
+ >
195
+ <ConvexHullTooltip
196
+ {entry}
197
+ polymorph_stats_map={hull_data.polymorph_stats_map}
198
+ highlight_style={entry_highlight}
199
+ {entry_category}
200
+ {tooltip}
201
+ />
202
+ </PlotTooltip>
203
+ {/if}
204
+
205
+ <!-- Copy-to-clipboard feedback (double-click on point) -->
206
+ <ClickFeedback
207
+ bind:visible={interactions.copy_feedback.visible}
208
+ position={interactions.copy_feedback.position}
209
+ />
210
+
211
+ <!-- z-index 1: above auto-stacked siblings after the chrome (3D gizmo, gas controls), below z-2 sliders -->
212
+ <DragOverlay visible={interactions.drag_over} style="z-index: 1" />
213
+
214
+ {#if interactions.modal_open && interactions.selected_structure}
215
+ <StructurePopup
216
+ structure={interactions.selected_structure}
217
+ place_right={interactions.modal_place_right}
218
+ stats={{
219
+ id: selected_entry?.entry_id,
220
+ e_above_hull: selected_entry?.e_above_hull,
221
+ e_form: selected_entry?.e_form_per_atom,
222
+ }}
223
+ onclose={interactions.close_structure_popup}
224
+ />
225
+ {/if}
226
+
227
+ <style>
228
+ .control-buttons {
229
+ position: absolute;
230
+ top: 1ex;
231
+ right: 1ex;
232
+ display: flex;
233
+ gap: 8px;
234
+ transition: opacity 0.2s ease-in-out;
235
+ }
236
+ .control-buttons.hover-visible {
237
+ opacity: 0;
238
+ pointer-events: none;
239
+ }
240
+ :global(.convex-hull-3d:hover) > .control-buttons.hover-visible,
241
+ :global(.convex-hull-3d:focus-within) > .control-buttons.hover-visible,
242
+ :global(.convex-hull-4d:hover) > .control-buttons.hover-visible,
243
+ :global(.convex-hull-4d:focus-within) > .control-buttons.hover-visible {
244
+ opacity: 1;
245
+ pointer-events: auto;
246
+ }
247
+ .control-buttons.always-visible {
248
+ opacity: 1;
249
+ pointer-events: auto;
250
+ }
251
+ .control-buttons :global(.draggable-pane) {
252
+ z-index: 1001 !important;
253
+ }
254
+ .control-buttons :global(button) {
255
+ background: transparent;
256
+ border: none;
257
+ padding: 4px;
258
+ cursor: pointer;
259
+ border-radius: 3px;
260
+ color: var(--text-color, currentColor);
261
+ transition: background-color 0.2s;
262
+ display: flex;
263
+ font-size: clamp(0.85em, 2cqmin, 1.3em);
264
+ }
265
+ .control-buttons :global(button):hover {
266
+ background-color: color-mix(in srgb, currentColor 8%, transparent);
267
+ }
268
+ </style>
@@ -0,0 +1,30 @@
1
+ import type { ShowControlsState } from '../controls';
2
+ import { type FullscreenToggleProp } from '../layout';
3
+ import type { ComponentProps } from 'svelte';
4
+ import type { create_canvas_interactions } from './canvas-interactions.svelte';
5
+ import ConvexHullControls from './ConvexHullControls.svelte';
6
+ import ConvexHullInfoPane from './ConvexHullInfoPane.svelte';
7
+ import type { create_hull_data_pipeline } from './hull-state.svelte';
8
+ import type { ConvexHullTooltipProp } from './index';
9
+ import type { ConvexHullEntry, HighlightStyle } from './types';
10
+ type ControlsProps = ComponentProps<typeof ConvexHullControls>;
11
+ type $$ComponentProps = Pick<ControlsProps, `camera` | `merged_controls` | `stable_entries` | `unstable_entries` | `color_mode` | `color_scale` | `show_stable` | `show_unstable` | `entry_category` | `hidden_categories` | `show_stable_labels` | `show_unstable_labels` | `max_hull_dist_show_phases` | `max_hull_dist_show_labels` | `energy_source_mode` | `controls_open` | `show_hull_faces` | `hull_face_color` | `hull_face_opacity` | `hull_face_color_mode`> & Pick<ComponentProps<typeof ConvexHullInfoPane>, `phase_stats` | `label_threshold`> & {
12
+ interactions: ReturnType<typeof create_canvas_interactions>;
13
+ hull_data: ReturnType<typeof create_hull_data_pipeline<ConvexHullEntry>>;
14
+ controls_config: ShowControlsState;
15
+ reset_all: () => void;
16
+ reset_title: string;
17
+ enable_info_pane?: boolean;
18
+ fullscreen?: boolean;
19
+ fullscreen_toggle?: FullscreenToggleProp;
20
+ wrapper?: HTMLDivElement;
21
+ get_point_color: (entry: ConvexHullEntry) => string;
22
+ merged_highlight_style: HighlightStyle;
23
+ is_highlighted: (entry: ConvexHullEntry) => boolean;
24
+ tooltip?: ConvexHullTooltipProp<ConvexHullEntry>;
25
+ selected_entry: ConvexHullEntry | null;
26
+ info_pane_open?: boolean;
27
+ };
28
+ declare const ConvexHullChrome: import("svelte").Component<$$ComponentProps, {}, "controls_open" | "color_scale" | "info_pane_open" | "show_hull_faces" | "hull_face_color" | "hull_face_opacity" | "hull_face_color_mode" | "color_mode" | "show_stable" | "show_unstable" | "show_stable_labels" | "show_unstable_labels" | "max_hull_dist_show_phases" | "max_hull_dist_show_labels" | "hidden_categories" | "energy_source_mode">;
29
+ type ConvexHullChrome = ReturnType<typeof ConvexHullChrome>;
30
+ export default ConvexHullChrome;
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import type { PaneProps, PaneToggleProps } from '../overlays'
2
3
  import type { D3InterpolateName } from '../colors'
3
4
  import { format_num } from '../labels'
4
5
  import DraggablePane from '../overlays/DraggablePane.svelte'
@@ -7,12 +8,14 @@
7
8
  import type { ComponentProps } from 'svelte'
8
9
  import { tooltip } from 'svelte-multiselect/attachments'
9
10
  import type { HTMLAttributes } from 'svelte/elements'
11
+ import { get_entry_category, marker_path_data } from './helpers'
10
12
  import type {
11
13
  ConvexHullControlsType,
12
14
  ConvexHullEntry,
15
+ EntryCategoryConfig,
13
16
  HullFaceColorMode,
14
17
  } from './types'
15
- import { HULL_FACE_COLOR_MODES } from './types'
18
+ import { HULL_FACE_COLOR_MODES, MAGNETIC_ORDERING_CATEGORY } from './types'
16
19
 
17
20
  interface CameraState {
18
21
  elevation?: number // Elevation angle in degrees (for ternary)
@@ -44,6 +47,8 @@
44
47
  color_scale = $bindable(`interpolateViridis`),
45
48
  show_stable = $bindable(true),
46
49
  show_unstable = $bindable(true),
50
+ entry_category = MAGNETIC_ORDERING_CATEGORY,
51
+ hidden_categories = $bindable([]),
47
52
  show_stable_labels = $bindable(true),
48
53
  show_unstable_labels = $bindable(false),
49
54
  show_hull_faces = undefined,
@@ -76,6 +81,9 @@
76
81
  color_scale?: D3InterpolateName
77
82
  show_stable?: boolean
78
83
  show_unstable?: boolean
84
+ // Categorical classification rendered as filter toggles (null disables the row)
85
+ entry_category?: EntryCategoryConfig | null
86
+ hidden_categories?: string[]
79
87
  show_stable_labels?: boolean
80
88
  show_unstable_labels?: boolean
81
89
  // 3D specific controls
@@ -105,8 +113,8 @@
105
113
  merged_controls: ConvexHullControlsType
106
114
  // Pane state
107
115
  controls_open?: boolean
108
- toggle_props?: ComponentProps<typeof DraggablePane>[`toggle_props`]
109
- pane_props?: ComponentProps<typeof DraggablePane>[`pane_props`]
116
+ toggle_props?: PaneToggleProps
117
+ pane_props?: PaneProps
110
118
  } = $props()
111
119
 
112
120
  // Focus the multiselect input next to the "Color scale" label
@@ -115,6 +123,33 @@
115
123
  ): void {
116
124
  evt.currentTarget.nextElementSibling?.querySelector<HTMLInputElement>(`input`)?.focus()
117
125
  }
126
+
127
+ // Category filters: only show category values present in the (threshold-filtered) data
128
+ const category_counts = $derived.by(() => {
129
+ const counts: Record<string, number> = {}
130
+ for (const entry of [...stable_entries, ...unstable_entries]) {
131
+ const value = get_entry_category(entry, entry_category)
132
+ if (value) counts[value] = (counts[value] ?? 0) + 1
133
+ }
134
+ return counts
135
+ })
136
+ const category_values_in_data = $derived(
137
+ Object.keys(entry_category?.markers ?? {}).filter(
138
+ (value) => (category_counts[value] ?? 0) > 0,
139
+ ),
140
+ )
141
+ const toggle_category = (value: string) => {
142
+ hidden_categories = hidden_categories.includes(value)
143
+ ? hidden_categories.filter((hidden) => hidden !== value)
144
+ : [...hidden_categories, value]
145
+ }
146
+ const SWATCH_RADIUS = 4.4 // marker swatch radius, sized to fit the 12x12 viewBox
147
+ // Keyboard activation for legend toggles (preventDefault stops Space scrolling the page)
148
+ const legend_keydown = (action: () => void) => (evt: KeyboardEvent) => {
149
+ if (![`Enter`, ` `].includes(evt.key)) return
150
+ evt.preventDefault()
151
+ action()
152
+ }
118
153
  </script>
119
154
 
120
155
  <DraggablePane
@@ -219,10 +254,10 @@
219
254
  <div
220
255
  class="legend-item clickable {show_stable ? `active` : `inactive`}"
221
256
  onclick={() => show_stable = !show_stable}
222
- onkeydown={(evt) =>
223
- [`Enter`, ` `].includes(evt.key) && (show_stable = !show_stable)}
257
+ onkeydown={legend_keydown(() => show_stable = !show_stable)}
224
258
  role="button"
225
259
  tabindex="0"
260
+ aria-pressed={show_stable}
226
261
  {@attach tooltip({ content: `Toggle visibility of stable points` })}
227
262
  >
228
263
  <div class="marker stable"></div>
@@ -233,10 +268,10 @@
233
268
  <div
234
269
  class="legend-item clickable {show_unstable ? `active` : `inactive`}"
235
270
  onclick={() => show_unstable = !show_unstable}
236
- onkeydown={(evt) =>
237
- [`Enter`, ` `].includes(evt.key) && (show_unstable = !show_unstable)}
271
+ onkeydown={legend_keydown(() => show_unstable = !show_unstable)}
238
272
  role="button"
239
273
  tabindex="0"
274
+ aria-pressed={show_unstable}
240
275
  {@attach tooltip({ content: `Toggle visibility of above-hull points` })}
241
276
  >
242
277
  <div class="marker unstable"></div>
@@ -270,6 +305,43 @@
270
305
  </div>
271
306
  {/if}
272
307
 
308
+ <!-- Category filters (only when entries carry recognized category data,
309
+ e.g. magnetic orderings with the default MAGNETIC_ORDERING_CATEGORY) -->
310
+ {#if entry_category && category_values_in_data.length > 0}
311
+ <div class="control-row">
312
+ <span class="control-label">{entry_category.label}</span>
313
+ <div class="legend-items-container category-filters">
314
+ {#each category_values_in_data as value (value)}
315
+ {@const hidden = hidden_categories.includes(value)}
316
+ {@const count = category_counts[value] ?? 0}
317
+ {@const long_name = entry_category.labels?.[value]}
318
+ <div
319
+ class="legend-item clickable {hidden ? `inactive` : `active`}"
320
+ onclick={() => toggle_category(value)}
321
+ onkeydown={legend_keydown(() => toggle_category(value))}
322
+ role="button"
323
+ tabindex="0"
324
+ aria-pressed={!hidden}
325
+ {@attach tooltip({
326
+ content: `Toggle visibility of ${
327
+ long_name ? `${long_name.toLowerCase()} (${value})` : value
328
+ } entries`,
329
+ })}
330
+ >
331
+ <svg viewBox="-6 -6 12 12" width="12" height="12" aria-hidden="true">
332
+ <path d={marker_path_data(SWATCH_RADIUS, entry_category.markers[value]) ?? ``} />
333
+ </svg>
334
+ <span>{value}{
335
+ merged_controls.show_counts
336
+ ? ` (${hidden ? `0/${count}` : count})`
337
+ : ``
338
+ }</span>
339
+ </div>
340
+ {/each}
341
+ </div>
342
+ </div>
343
+ {/if}
344
+
273
345
  {#if merged_controls.show_label_controls}
274
346
  <div class="control-row">
275
347
  <span class="control-label">Labels</span>
@@ -490,6 +562,15 @@
490
562
  .legend-item.inactive {
491
563
  opacity: 0.5;
492
564
  }
565
+ .category-filters {
566
+ flex-wrap: wrap;
567
+ gap: 8px;
568
+ }
569
+ .legend-item svg {
570
+ margin-right: 4px;
571
+ flex-shrink: 0;
572
+ fill: currentColor;
573
+ }
493
574
  .marker {
494
575
  width: 12px;
495
576
  height: 12px;
@@ -1,8 +1,7 @@
1
+ import type { PaneProps, PaneToggleProps } from '../overlays';
1
2
  import type { D3InterpolateName } from '../colors';
2
- import DraggablePane from '../overlays/DraggablePane.svelte';
3
- import type { ComponentProps } from 'svelte';
4
3
  import type { HTMLAttributes } from 'svelte/elements';
5
- import type { ConvexHullControlsType, ConvexHullEntry, HullFaceColorMode } from './types';
4
+ import type { ConvexHullControlsType, ConvexHullEntry, EntryCategoryConfig, HullFaceColorMode } from './types';
6
5
  interface CameraState {
7
6
  elevation?: number;
8
7
  azimuth?: number;
@@ -17,6 +16,8 @@ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `onclose`> & {
17
16
  color_scale?: D3InterpolateName;
18
17
  show_stable?: boolean;
19
18
  show_unstable?: boolean;
19
+ entry_category?: EntryCategoryConfig | null;
20
+ hidden_categories?: string[];
20
21
  show_stable_labels?: boolean;
21
22
  show_unstable_labels?: boolean;
22
23
  show_hull_faces?: boolean;
@@ -40,9 +41,9 @@ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `onclose`> & {
40
41
  camera?: CameraState;
41
42
  merged_controls: ConvexHullControlsType;
42
43
  controls_open?: boolean;
43
- toggle_props?: ComponentProps<typeof DraggablePane>[`toggle_props`];
44
- pane_props?: ComponentProps<typeof DraggablePane>[`pane_props`];
44
+ toggle_props?: PaneToggleProps;
45
+ pane_props?: PaneProps;
45
46
  };
46
- declare const ConvexHullControls: import("svelte").Component<$$ComponentProps, {}, "controls_open" | "hull_face_opacity" | "color_mode" | "color_scale" | "show_stable" | "show_unstable" | "show_stable_labels" | "show_unstable_labels" | "max_hull_dist_show_phases" | "max_hull_dist_show_labels" | "energy_source_mode">;
47
+ declare const ConvexHullControls: import("svelte").Component<$$ComponentProps, {}, "controls_open" | "color_scale" | "hull_face_opacity" | "color_mode" | "show_stable" | "show_unstable" | "show_stable_labels" | "show_unstable_labels" | "max_hull_dist_show_phases" | "max_hull_dist_show_labels" | "hidden_categories" | "energy_source_mode">;
47
48
  type ConvexHullControls = ReturnType<typeof ConvexHullControls>;
48
49
  export default ConvexHullControls;
@@ -1,11 +1,14 @@
1
1
  <script lang="ts">
2
+ import type { PaneProps, PaneToggleProps } from '../overlays'
2
3
  import InfoPaneCards from '../overlays/InfoPaneCards.svelte'
3
4
  import DraggablePane from '../overlays/DraggablePane.svelte'
4
5
  import { format_num } from '../labels'
5
6
  import type { ComponentProps } from 'svelte'
6
7
  import type { HTMLAttributes } from 'svelte/elements'
7
8
  import ConvexHullStats from './ConvexHullStats.svelte'
8
- import type { ConvexHullEntry, PhaseStats } from './types'
9
+ import { visible_entries as filter_visible } from './helpers'
10
+ import type { ConvexHullEntry, EntryCategoryConfig, PhaseStats } from './types'
11
+ import { MAGNETIC_ORDERING_CATEGORY } from './types'
9
12
 
10
13
  const usage_tips = [
11
14
  { label: `Single click`, value: `Select point`, key: `tip-click` },
@@ -25,6 +28,8 @@
25
28
  unstable_entries,
26
29
  show_stable = true,
27
30
  show_unstable = true,
31
+ entry_category = MAGNETIC_ORDERING_CATEGORY,
32
+ hidden_categories = [],
28
33
  max_hull_dist_show_phases,
29
34
  max_hull_dist_show_labels,
30
35
  label_threshold,
@@ -38,23 +43,29 @@
38
43
  unstable_entries: ConvexHullEntry[]
39
44
  show_stable?: boolean
40
45
  show_unstable?: boolean
46
+ entry_category?: EntryCategoryConfig | null
47
+ hidden_categories?: string[]
41
48
  max_hull_dist_show_phases: number
42
49
  max_hull_dist_show_labels: number
43
50
  label_threshold: number
44
51
  pane_open?: boolean
45
- toggle_props?: ComponentProps<typeof DraggablePane>[`toggle_props`]
46
- pane_props?: ComponentProps<typeof DraggablePane>[`pane_props`]
52
+ toggle_props?: PaneToggleProps
53
+ pane_props?: PaneProps
47
54
  } = $props()
48
55
 
56
+ // Show flags true: filter_visible only applies the category filter here
57
+ const count_visible = (entries: ConvexHullEntry[], shown: boolean): number =>
58
+ shown ? filter_visible(entries, true, true, entry_category, hidden_categories).length : 0
59
+
49
60
  let settings_rows = $derived([
50
61
  {
51
62
  label: `Visible stable`,
52
- value: `${show_stable ? stable_entries.length : 0} / ${stable_entries.length}`,
63
+ value: `${count_visible(stable_entries, show_stable)} / ${stable_entries.length}`,
53
64
  key: `hull-visible-stable`,
54
65
  },
55
66
  {
56
67
  label: `Visible unstable`,
57
- value: `${show_unstable ? unstable_entries.length : 0} / ${unstable_entries.length}`,
68
+ value: `${count_visible(unstable_entries, show_unstable)} / ${unstable_entries.length}`,
58
69
  key: `hull-visible-unstable`,
59
70
  },
60
71
  {
@@ -111,6 +122,8 @@
111
122
  {unstable_entries}
112
123
  {show_stable}
113
124
  {show_unstable}
125
+ {entry_category}
126
+ {hidden_categories}
114
127
  style="padding: 3pt; background: var(--pane-bg); --hull-stats-table-height: 30rem"
115
128
  />
116
129
 
@@ -1,19 +1,20 @@
1
- import DraggablePane from '../overlays/DraggablePane.svelte';
2
- import type { ComponentProps } from 'svelte';
1
+ import type { PaneProps, PaneToggleProps } from '../overlays';
3
2
  import type { HTMLAttributes } from 'svelte/elements';
4
- import type { ConvexHullEntry, PhaseStats } from './types';
3
+ import type { ConvexHullEntry, EntryCategoryConfig, PhaseStats } from './types';
5
4
  type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `onclose`> & {
6
5
  phase_stats: PhaseStats | null;
7
6
  stable_entries: ConvexHullEntry[];
8
7
  unstable_entries: ConvexHullEntry[];
9
8
  show_stable?: boolean;
10
9
  show_unstable?: boolean;
10
+ entry_category?: EntryCategoryConfig | null;
11
+ hidden_categories?: string[];
11
12
  max_hull_dist_show_phases: number;
12
13
  max_hull_dist_show_labels: number;
13
14
  label_threshold: number;
14
15
  pane_open?: boolean;
15
- toggle_props?: ComponentProps<typeof DraggablePane>[`toggle_props`];
16
- pane_props?: ComponentProps<typeof DraggablePane>[`pane_props`];
16
+ toggle_props?: PaneToggleProps;
17
+ pane_props?: PaneProps;
17
18
  };
18
19
  declare const ConvexHullInfoPane: import("svelte").Component<$$ComponentProps, {}, "pane_open">;
19
20
  type ConvexHullInfoPane = ReturnType<typeof ConvexHullInfoPane>;