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
@@ -1,9 +1,10 @@
1
1
  import type { ColorScaleType, D3InterpolateName } from './colors';
2
2
  import type { HullFaceColorMode } from './convex-hull/types';
3
3
  import type { D3SymbolName } from './labels';
4
- import type { Vec3 } from './math';
5
- import type { Orientation } from './plot';
4
+ import type { Vec2, Vec3 } from './math';
5
+ import type { BandwidthOption, Orientation, SankeyNodeAlign, SankeyOrientation, SunburstLabelRotation, SunburstLabelText, SunburstShape, SunburstValueMode, ViolinKind, ViolinSide, WhiskerMode } from './plot';
6
6
  import type { BondingStrategy } from './structure/bonding';
7
+ import type { PolyhedraColorMode } from './structure/polyhedra';
7
8
  export interface SettingType<T = unknown> {
8
9
  value: T;
9
10
  description: string;
@@ -63,6 +64,31 @@ type SimpleLineStyleType = {
63
64
  width: SettingType<number>;
64
65
  color: SettingType<string>;
65
66
  };
67
+ type BoxStyleType = {
68
+ color: SettingType<string>;
69
+ opacity: SettingType<number>;
70
+ stroke_width: SettingType<number>;
71
+ stroke_color: SettingType<string>;
72
+ border_radius: SettingType<number>;
73
+ };
74
+ type BoxWhiskerStyleType = {
75
+ width: SettingType<number>;
76
+ color: SettingType<string>;
77
+ cap_fraction: SettingType<number>;
78
+ };
79
+ type BoxLineStyleType = {
80
+ width: SettingType<number>;
81
+ color: SettingType<string>;
82
+ };
83
+ type BoxOutlierStyleType = {
84
+ radius: SettingType<number>;
85
+ opacity: SettingType<number>;
86
+ stroke_width: SettingType<number>;
87
+ };
88
+ type BoxViolinStyleType = {
89
+ opacity: SettingType<number>;
90
+ stroke_width: SettingType<number>;
91
+ };
66
92
  type ConvexHullCommonType = {
67
93
  camera_zoom: SettingType<number>;
68
94
  camera_center_x: SettingType<number>;
@@ -105,6 +131,17 @@ export interface SettingsConfig {
105
131
  show_bonds: SettingType<ShowBonds>;
106
132
  bond_color: SettingType<string>;
107
133
  bonding_strategy: SettingType<BondingStrategy>;
134
+ show_polyhedra: SettingType<ShowBonds>;
135
+ polyhedra_opacity: SettingType<number>;
136
+ polyhedra_show_edges: SettingType<boolean>;
137
+ polyhedra_edge_color: SettingType<string>;
138
+ polyhedra_color_mode: SettingType<PolyhedraColorMode>;
139
+ polyhedra_color: SettingType<string>;
140
+ polyhedra_hide_center_atoms: SettingType<boolean>;
141
+ polyhedra_min_neighbors: SettingType<number>;
142
+ polyhedra_max_neighbors: SettingType<number>;
143
+ polyhedra_excluded_elements: SettingType<readonly string[]>;
144
+ polyhedra_included_elements: SettingType<readonly string[]>;
108
145
  atom_color_mode: SettingType<AtomColorMode>;
109
146
  atom_color_scale: SettingType<D3InterpolateName>;
110
147
  atom_color_scale_type: SettingType<ColorScaleType>;
@@ -154,7 +191,7 @@ export interface SettingsConfig {
154
191
  trajectory: {
155
192
  auto_play: SettingType<boolean>;
156
193
  fps: SettingType<number>;
157
- fps_range: SettingType<[number, number]>;
194
+ fps_range: SettingType<Vec2>;
158
195
  display_mode: SettingType<`structure+scatter` | `structure` | `scatter` | `histogram` | `structure+histogram`>;
159
196
  show_controls: SettingType<boolean>;
160
197
  fullscreen_toggle: SettingType<boolean>;
@@ -226,6 +263,45 @@ export interface SettingsConfig {
226
263
  bar: SimpleBarStyleType;
227
264
  line: SimpleLineStyleType;
228
265
  };
266
+ box: {
267
+ whisker_mode: SettingType<WhiskerMode>;
268
+ box_width: SettingType<number>;
269
+ show_outliers: SettingType<boolean>;
270
+ show_mean: SettingType<boolean>;
271
+ kind: SettingType<ViolinKind>;
272
+ side: SettingType<ViolinSide>;
273
+ bandwidth: SettingType<Exclude<BandwidthOption, number>>;
274
+ violin_width: SettingType<number>;
275
+ violin_box_width: SettingType<number>;
276
+ box: BoxStyleType;
277
+ whisker: BoxWhiskerStyleType;
278
+ median: BoxLineStyleType;
279
+ outlier: BoxOutlierStyleType;
280
+ violin: BoxViolinStyleType;
281
+ display: DisplayConfigType;
282
+ };
283
+ sankey: {
284
+ orientation: SettingType<SankeyOrientation>;
285
+ node_align: SettingType<SankeyNodeAlign>;
286
+ node_width: SettingType<number>;
287
+ node_padding: SettingType<number>;
288
+ link_opacity: SettingType<number>;
289
+ show_node_labels: SettingType<boolean>;
290
+ iterations: SettingType<number>;
291
+ };
292
+ sunburst: {
293
+ shape: SettingType<SunburstShape>;
294
+ value_mode: SettingType<SunburstValueMode>;
295
+ max_depth: SettingType<number>;
296
+ inner_radius: SettingType<number>;
297
+ pad_angle: SettingType<number>;
298
+ min_fraction: SettingType<number>;
299
+ show_labels: SettingType<boolean>;
300
+ label_rotation: SettingType<SunburstLabelRotation>;
301
+ label_text: SettingType<SunburstLabelText>;
302
+ zoom_on_click: SettingType<boolean>;
303
+ show_breadcrumbs: SettingType<boolean>;
304
+ };
229
305
  composition: {
230
306
  display_mode: SettingType<`pie` | `bubble` | `bar`>;
231
307
  color_scheme: SettingType<string>;
package/dist/settings.js CHANGED
@@ -3,6 +3,8 @@
3
3
  import { symbol_names } from './labels';
4
4
  import { merge_nested } from './utils';
5
5
  export const SHOW_BONDS_OPTIONS = [`never`, `always`, `crystals`, `molecules`];
6
+ // Shared enum labels for never|always|crystals|molecules settings (bonds, polyhedra)
7
+ const SHOW_BONDS_ENUM = Object.fromEntries(SHOW_BONDS_OPTIONS.map((key) => [key, key[0].toUpperCase() + key.slice(1)]));
6
8
  export const VECTOR_COLOR_MODES = [
7
9
  `auto`,
8
10
  `element`,
@@ -122,7 +124,7 @@ export const SETTINGS_CONFIG = {
122
124
  show_bonds: {
123
125
  value: `always`,
124
126
  description: `When to display bonds between atoms`,
125
- enum: Object.fromEntries(SHOW_BONDS_OPTIONS.map((key) => [key, key[0].toUpperCase() + key.slice(1)])),
127
+ enum: SHOW_BONDS_ENUM,
126
128
  },
127
129
  bond_color: {
128
130
  value: `#666666`,
@@ -136,6 +138,62 @@ export const SETTINGS_CONFIG = {
136
138
  solid_angle: `Solid Angle`,
137
139
  },
138
140
  },
141
+ show_polyhedra: {
142
+ value: `crystals`,
143
+ description: `When to render coordination polyhedra around cation-like centers`,
144
+ enum: SHOW_BONDS_ENUM,
145
+ },
146
+ polyhedra_opacity: {
147
+ value: 0.2,
148
+ description: `Opacity of coordination polyhedra faces`,
149
+ minimum: 0,
150
+ maximum: 1,
151
+ },
152
+ polyhedra_show_edges: {
153
+ value: true,
154
+ description: `Draw outlines along coordination polyhedra edges`,
155
+ },
156
+ polyhedra_edge_color: {
157
+ value: `#222222`,
158
+ description: `Color of coordination polyhedra edge lines`,
159
+ },
160
+ polyhedra_color_mode: {
161
+ value: `vertex`,
162
+ description: `Color polyhedra by the atoms at their corners, the center atom, or a single custom color`,
163
+ enum: {
164
+ vertex: `Vertex Atoms`,
165
+ center: `Center Atom`,
166
+ uniform: `Custom Color`,
167
+ },
168
+ },
169
+ polyhedra_color: {
170
+ value: `#4a90d9`,
171
+ description: `Custom polyhedra color (used when color mode is Custom Color)`,
172
+ },
173
+ polyhedra_hide_center_atoms: {
174
+ value: false,
175
+ description: `Hide the central atom of each rendered polyhedron`,
176
+ },
177
+ polyhedra_min_neighbors: {
178
+ value: 4,
179
+ description: `Minimum number of bonded neighbors (coordination number) to form a polyhedron`,
180
+ minimum: 4, // hulls of <4 points are degenerate and render nothing
181
+ maximum: 12,
182
+ },
183
+ polyhedra_max_neighbors: {
184
+ value: 8,
185
+ description: `Maximum number of bonded neighbors for a polyhedron (skips e.g. CN-12 cuboctahedra around large A-site cations)`,
186
+ minimum: 4,
187
+ maximum: 16,
188
+ },
189
+ polyhedra_excluded_elements: {
190
+ value: [],
191
+ description: `Elements excluded from acting as polyhedra centers`,
192
+ },
193
+ polyhedra_included_elements: {
194
+ value: [],
195
+ description: `Elements always allowed as polyhedra centers (overrides automatic hiding of spectator cations like alkali metals and the max neighbors cap)`,
196
+ },
139
197
  atom_color_mode: {
140
198
  value: `element`,
141
199
  description: `Property to use for atom coloring`,
@@ -622,6 +680,264 @@ export const SETTINGS_CONFIG = {
622
680
  },
623
681
  display: DISPLAY_CONFIG,
624
682
  },
683
+ // Box plot specific
684
+ box: {
685
+ whisker_mode: {
686
+ value: `tukey`,
687
+ description: `How whiskers are computed: 'tukey' (1.5*IQR), 'minmax' (data extremes), 'percentile' (5th/95th), or 'std' (mean ± std)`,
688
+ enum: {
689
+ tukey: `Tukey (1.5·IQR)`,
690
+ minmax: `Min/Max`,
691
+ percentile: `Percentile`,
692
+ std: `Std Dev`,
693
+ },
694
+ },
695
+ box_width: {
696
+ value: 0.8,
697
+ description: `Box width as a fraction of the category slot`,
698
+ minimum: 0.1,
699
+ maximum: 1,
700
+ },
701
+ show_outliers: {
702
+ value: true,
703
+ description: `Show outlier points beyond the whiskers`,
704
+ },
705
+ show_mean: {
706
+ value: false,
707
+ description: `Show the mean marker inside each box`,
708
+ },
709
+ kind: {
710
+ value: `box`,
711
+ description: `Glyph to draw per series: box, violin (KDE density), or both`,
712
+ enum: { box: `Box`, violin: `Violin`, 'violin+box': `Violin + Box` },
713
+ },
714
+ side: {
715
+ value: `both`,
716
+ description: `Which half of the slot a violin occupies (one-sided / split violins)`,
717
+ enum: { both: `Both`, positive: `Positive`, negative: `Negative` },
718
+ },
719
+ bandwidth: {
720
+ value: `silverman`,
721
+ description: `KDE bandwidth rule for violins`,
722
+ enum: { silverman: `Silverman`, scott: `Scott` },
723
+ },
724
+ violin_width: {
725
+ value: 0.9,
726
+ description: `Violin width as a fraction of the category slot`,
727
+ minimum: 0.1,
728
+ maximum: 1,
729
+ },
730
+ violin_box_width: {
731
+ value: 0.2,
732
+ description: `Inner box width (fraction of slot) when a box is drawn inside a violin`,
733
+ minimum: 0.05,
734
+ maximum: 1,
735
+ },
736
+ box: {
737
+ color: {
738
+ value: `#4A9EFF`,
739
+ description: `Box fill color`,
740
+ },
741
+ opacity: {
742
+ value: 0.6,
743
+ description: `Box fill opacity`,
744
+ minimum: 0,
745
+ maximum: 1,
746
+ },
747
+ stroke_width: {
748
+ value: 0.5,
749
+ description: `Box outline width`,
750
+ minimum: 0,
751
+ maximum: 5,
752
+ },
753
+ stroke_color: {
754
+ value: `#000000`,
755
+ description: `Box outline color`,
756
+ },
757
+ border_radius: {
758
+ value: 0,
759
+ description: `Corner radius for boxes (px)`,
760
+ minimum: 0,
761
+ maximum: 10,
762
+ },
763
+ },
764
+ whisker: {
765
+ width: {
766
+ value: 1,
767
+ description: `Whisker line width`,
768
+ minimum: 0.5,
769
+ maximum: 5,
770
+ },
771
+ color: {
772
+ value: `#000000`,
773
+ description: `Whisker line color`,
774
+ },
775
+ cap_fraction: {
776
+ value: 0.3,
777
+ description: `Whisker cap width as a fraction of the box width`,
778
+ minimum: 0,
779
+ maximum: 1,
780
+ },
781
+ },
782
+ median: {
783
+ width: {
784
+ value: 1.5,
785
+ description: `Median line width`,
786
+ minimum: 0.5,
787
+ maximum: 6,
788
+ },
789
+ color: {
790
+ value: `#000000`,
791
+ description: `Median line color`,
792
+ },
793
+ },
794
+ outlier: {
795
+ radius: {
796
+ value: 2.5,
797
+ description: `Outlier point radius (px)`,
798
+ minimum: 0.5,
799
+ maximum: 10,
800
+ },
801
+ opacity: {
802
+ value: 0.6,
803
+ description: `Outlier point opacity`,
804
+ minimum: 0,
805
+ maximum: 1,
806
+ },
807
+ stroke_width: {
808
+ value: 0,
809
+ description: `Outlier point stroke width`,
810
+ minimum: 0,
811
+ maximum: 3,
812
+ },
813
+ },
814
+ violin: {
815
+ opacity: {
816
+ value: 0.5,
817
+ description: `Violin fill opacity`,
818
+ minimum: 0,
819
+ maximum: 1,
820
+ },
821
+ stroke_width: {
822
+ value: 1,
823
+ description: `Violin outline width`,
824
+ minimum: 0,
825
+ maximum: 5,
826
+ },
827
+ },
828
+ display: DISPLAY_CONFIG,
829
+ },
830
+ // Sankey diagram specific
831
+ sankey: {
832
+ orientation: {
833
+ value: `horizontal`,
834
+ description: `Flow direction of the Sankey diagram`,
835
+ enum: { horizontal: `Horizontal`, vertical: `Vertical` },
836
+ },
837
+ node_align: {
838
+ value: `justify`,
839
+ description: `How nodes are aligned across columns (maps to d3-sankey alignment)`,
840
+ enum: { justify: `Justify`, left: `Left`, right: `Right`, center: `Center` },
841
+ },
842
+ node_width: {
843
+ value: 24,
844
+ description: `Node thickness in pixels`,
845
+ minimum: 4,
846
+ maximum: 60,
847
+ },
848
+ node_padding: {
849
+ value: 12,
850
+ description: `Vertical gap in pixels between nodes sharing a column`,
851
+ minimum: 0,
852
+ maximum: 40,
853
+ },
854
+ link_opacity: {
855
+ value: 0.5,
856
+ description: `Opacity of link ribbons`,
857
+ minimum: 0.05,
858
+ maximum: 1,
859
+ },
860
+ show_node_labels: {
861
+ value: true,
862
+ description: `Show node labels next to each node`,
863
+ },
864
+ iterations: {
865
+ value: 6,
866
+ description: `Number of d3-sankey relaxation iterations for node positioning`,
867
+ minimum: 0,
868
+ maximum: 64,
869
+ },
870
+ },
871
+ // Sunburst chart specific
872
+ sunburst: {
873
+ shape: {
874
+ value: `sunburst`,
875
+ description: `Chart geometry: polar rings (sunburst) or stacked rows (icicle)`,
876
+ enum: { sunburst: `Sunburst`, icicle: `Icicle` },
877
+ },
878
+ value_mode: {
879
+ value: `leaf-sum`,
880
+ description: `How node values are interpreted (plotly branchvalues semantics): leaf-sum ignores parent values, total treats every value as authoritative, remainder adds a node's own value on top of its children`,
881
+ enum: { 'leaf-sum': `Leaf sum`, total: `Total`, remainder: `Remainder` },
882
+ },
883
+ max_depth: {
884
+ value: 0,
885
+ description: `Number of rings shown below the current zoom root (0 = all)`,
886
+ minimum: 0,
887
+ maximum: 10,
888
+ },
889
+ inner_radius: {
890
+ value: 0.25,
891
+ description: `Center hole size as fraction of the outer radius`,
892
+ minimum: 0,
893
+ maximum: 0.8,
894
+ },
895
+ pad_angle: {
896
+ value: 0.1,
897
+ description: `Angular gap in degrees between sibling arcs`,
898
+ minimum: 0,
899
+ maximum: 4,
900
+ },
901
+ min_fraction: {
902
+ value: 0,
903
+ description: `Group sibling arcs smaller than this fraction of the total into one 'Other' slice per parent (0 = off)`,
904
+ minimum: 0,
905
+ maximum: 0.2,
906
+ },
907
+ show_labels: {
908
+ value: true,
909
+ description: `Show labels on arcs large enough to fit them`,
910
+ },
911
+ label_rotation: {
912
+ value: `auto`,
913
+ description: `Arc label orientation (auto picks radial/tangential per arc)`,
914
+ enum: {
915
+ auto: `Auto`,
916
+ radial: `Radial`,
917
+ tangential: `Tangential`,
918
+ horizontal: `Horizontal`,
919
+ },
920
+ },
921
+ label_text: {
922
+ value: `label`,
923
+ description: `What arc labels display (percent is of the root total)`,
924
+ enum: {
925
+ label: `Label`,
926
+ value: `Value`,
927
+ percent: `Percent`,
928
+ 'label+value': `Label + value`,
929
+ 'label+percent': `Label + percent`,
930
+ },
931
+ },
932
+ zoom_on_click: {
933
+ value: true,
934
+ description: `Clicking a branch arc zooms into that subtree (center circle zooms out)`,
935
+ },
936
+ show_breadcrumbs: {
937
+ value: true,
938
+ description: `Show a clickable trail of ancestors when zoomed into a subtree`,
939
+ },
940
+ },
625
941
  // Composition specific
626
942
  composition: {
627
943
  display_mode: {
@@ -1121,6 +1437,7 @@ export const DEFAULTS = extract_values(SETTINGS_CONFIG);
1121
1437
  export const merge = (user) => ({
1122
1438
  ...DEFAULTS,
1123
1439
  ...user,
1440
+ symmetry: merge_nested(DEFAULTS.symmetry, user?.symmetry),
1124
1441
  structure: merge_nested(DEFAULTS.structure, user?.structure),
1125
1442
  trajectory: merge_nested(DEFAULTS.trajectory, user?.trajectory),
1126
1443
  composition: merge_nested(DEFAULTS.composition, user?.composition),
@@ -1128,5 +1445,8 @@ export const merge = (user) => ({
1128
1445
  scatter: merge_nested(DEFAULTS.scatter, user?.scatter),
1129
1446
  histogram: merge_nested(DEFAULTS.histogram, user?.histogram),
1130
1447
  bar: merge_nested(DEFAULTS.bar, user?.bar),
1448
+ box: merge_nested(DEFAULTS.box, user?.box),
1449
+ sankey: merge_nested(DEFAULTS.sankey, user?.sankey),
1450
+ sunburst: merge_nested(DEFAULTS.sunburst, user?.sunburst),
1131
1451
  convex_hull: merge_nested(DEFAULTS.convex_hull, user?.convex_hull),
1132
1452
  });
@@ -3,10 +3,11 @@
3
3
  import EmptyState from '../EmptyState.svelte'
4
4
  import { format_num } from '../labels'
5
5
  import { sanitize_html } from '../sanitize'
6
+ import { is_plain_object } from '../utils'
6
7
  import { SettingsSection } from '../layout'
7
8
  import type { Vec2 } from '../math'
8
- import ScatterPlot from '../plot/ScatterPlot.svelte'
9
- import type { AxisConfig, DataSeries, FillRegion } from '../plot/types'
9
+ import ScatterPlot from '../plot/scatter/ScatterPlot.svelte'
10
+ import type { AxisConfig, DataSeries, FillRegion } from '../plot/core/types'
10
11
  import * as helpers from './helpers'
11
12
  import type {
12
13
  BandsSpinMode,
@@ -32,6 +33,7 @@
32
33
  y_axis = $bindable({}),
33
34
  x_positions = $bindable(),
34
35
  reference_frequency = null,
36
+ highlighted_qpoint_index = null,
35
37
  ribbon_config = {},
36
38
  fermi_level = undefined,
37
39
  units = $bindable(`THz`),
@@ -45,8 +47,6 @@
45
47
  show_spin_control = true,
46
48
  show_annotation_controls = true,
47
49
  id = undefined,
48
- class: class_name = undefined,
49
- style = undefined,
50
50
  'data-testid': data_testid = undefined,
51
51
  ...rest
52
52
  }: ComponentProps<typeof ScatterPlot> & {
@@ -57,8 +57,10 @@
57
57
  path_mode?: PathMode
58
58
  band_type?: BandStructureType
59
59
  show_legend?: boolean
60
- x_positions?: Record<string, [number, number]>
60
+ x_positions?: Record<string, Vec2>
61
61
  reference_frequency?: number | null
62
+ // Q-point index to highlight with a vertical line (synced from BZ k-path hover)
63
+ highlighted_qpoint_index?: number | null
62
64
  ribbon_config?: RibbonConfig | Record<string, RibbonConfig>
63
65
  fermi_level?: number // Fermi level for electronic bands (auto-detected if not provided)
64
66
  units?: FrequencyUnit // Phonon frequency display units (electronic always eV)
@@ -78,8 +80,6 @@
78
80
  show_spin_control?: boolean
79
81
  show_annotation_controls?: boolean
80
82
  id?: string
81
- class?: string
82
- style?: string
83
83
  'data-testid'?: string
84
84
  } = $props()
85
85
 
@@ -105,12 +105,12 @@
105
105
  }
106
106
  }
107
107
 
108
- if (typeof line_kwargs === `object` && line_kwargs !== null) {
108
+ if (is_plain_object(line_kwargs)) {
109
109
  const mode_key = is_acoustic ? `acoustic` : `optical`
110
- const mode_kwargs = (line_kwargs as Record<string, unknown>)[mode_key] as
111
- | Record<string, unknown>
112
- | undefined
113
- const source = (mode_kwargs ?? line_kwargs) as Record<string, unknown>
110
+ const mode_kwargs = line_kwargs[mode_key]
111
+ const source: Record<string, unknown> = is_plain_object(mode_kwargs)
112
+ ? mode_kwargs
113
+ : line_kwargs
114
114
  return {
115
115
  stroke: (source.stroke as string) ?? defaults.stroke,
116
116
  stroke_width: (source.stroke_width as number) ?? defaults.stroke_width,
@@ -258,7 +258,8 @@
258
258
  const attrs: Record<string, Dom_attr_value> = {}
259
259
  for (const [attr_name, attr_value] of Object.entries(rest)) {
260
260
  if (
261
- (attr_name === `role` || attr_name.startsWith(`aria-`)) &&
261
+ (attr_name === `class` || attr_name === `style` || attr_name === `role` ||
262
+ attr_name.startsWith(`aria-`)) &&
262
263
  is_dom_attr_value(attr_value)
263
264
  ) {
264
265
  attrs[attr_name] = attr_value
@@ -287,7 +288,7 @@
287
288
  x_positions = {}
288
289
  return
289
290
  }
290
- const positions: Record<string, [number, number]> = {}
291
+ const positions: Record<string, Vec2> = {}
291
292
  let current_x = 0
292
293
 
293
294
  // Preserve physical path order using the first available structure
@@ -590,9 +591,9 @@
590
591
  const display_values = detected_band_type === `phonon`
591
592
  ? convert_band_values(all_freqs)
592
593
  : all_freqs
593
- if (!display_values.length) return undefined
594
+ if (display_values.length === 0) return undefined
594
595
  const finite = display_values.filter(Number.isFinite)
595
- if (!finite.length) return undefined
596
+ if (finite.length === 0) return undefined
596
597
  let min_val = Math.min(...finite), max_val = Math.max(...finite)
597
598
  if (
598
599
  // clamp phonon min to 0 if negatives are noise
@@ -617,22 +618,12 @@
617
618
  // Sync zoom changes from ScatterPlot back to parent via bindable y_axis
618
619
  // Also clears parent range when internal range becomes invalid (auto-range reset)
619
620
  $effect(() => {
620
- const range = internal_y_axis.range
621
- if (helpers.is_valid_range(range)) {
622
- if (y_axis.range?.[0] !== range[0] || y_axis.range?.[1] !== range[1]) {
623
- y_axis = { ...y_axis, range }
624
- }
625
- return
626
- }
627
- // Range became invalid - clear parent's range to propagate reset
628
- if (`range` in y_axis) {
629
- const { range: _omit, ...axis_without_range } = y_axis
630
- y_axis = axis_without_range
631
- }
621
+ const next = helpers.sync_axis_range(y_axis, internal_y_axis.range)
622
+ if (next !== y_axis) y_axis = next
632
623
  })
633
624
 
634
625
  let has_series = $derived(series_data.length > 0)
635
- let is_strict_path_error = $derived(path_mode === `strict` && !!strict_path_error)
626
+ let is_strict_path_error = $derived(path_mode === `strict` && Boolean(strict_path_error))
636
627
 
637
628
  let imaginary_mode_region = $derived.by((): FillRegion[] => {
638
629
  if (
@@ -685,7 +676,7 @@
685
676
  )
686
677
  const occupied = all_energies.filter((energy) => energy <= effective_fermi_level)
687
678
  const unoccupied = all_energies.filter((energy) => energy > effective_fermi_level)
688
- if (!occupied.length || !unoccupied.length) return null
679
+ if (occupied.length === 0 || unoccupied.length === 0) return null
689
680
  const vbm = Math.max(...occupied)
690
681
  const cbm = Math.min(...unoccupied)
691
682
  const gap = cbm - vbm
@@ -693,7 +684,7 @@
693
684
  return { vbm, cbm, gap }
694
685
  })
695
686
 
696
- let empty_state_message = $derived.by(() => {
687
+ let empty_state_msg = $derived.by(() => {
697
688
  if (is_strict_path_error) {
698
689
  return strict_path_error ?? `Path mismatch in strict mode.`
699
690
  }
@@ -706,13 +697,18 @@
706
697
  return `No valid band structure data to display.`
707
698
  })
708
699
 
700
+ // X-position of the externally hovered q-point (from BZ k-path), for the highlight line
701
+ let highlight_x = $derived.by(() => {
702
+ if (highlighted_qpoint_index == null) return null
703
+ const bs = Object.values(band_structs_dict)[0]
704
+ return bs ? helpers.qpoint_x_position(bs, highlighted_qpoint_index, x_positions ?? {}) : null
705
+ })
706
+
709
707
  let display = $state({ x_grid: false, y_grid: true, y_zero_line: true })
710
708
  </script>
711
709
  {#if has_series && !is_strict_path_error}
712
710
  <ScatterPlot
713
711
  {id}
714
- class={class_name}
715
- {style}
716
712
  data-testid={data_testid}
717
713
  series={series_data}
718
714
  {fill_regions}
@@ -900,6 +896,23 @@
900
896
  />
901
897
  {/each}
902
898
 
899
+ <!-- Hovered q-point vertical line (synced from Brillouin zone k-path hover) -->
900
+ {#if highlight_x != null}
901
+ {@const hover_x = x_scale_fn(highlight_x)}
902
+ {#if Number.isFinite(hover_x)}
903
+ <line
904
+ x1={hover_x}
905
+ x2={hover_x}
906
+ y1={pad.t}
907
+ y2={height - pad.b}
908
+ stroke="var(--bands-hover-line-color, #ff6b35)"
909
+ stroke-width="var(--bands-hover-line-width, 2)"
910
+ opacity="var(--bands-hover-line-opacity, 0.85)"
911
+ pointer-events="none"
912
+ />
913
+ {/if}
914
+ {/if}
915
+
903
916
  <!-- Shared geometry for Fermi level and gap annotations -->
904
917
  {@const fermi_y = effective_fermi_level !== undefined
905
918
  ? y_scale_fn(effective_fermi_level)
@@ -1007,11 +1020,9 @@
1007
1020
  {:else}
1008
1021
  <EmptyState
1009
1022
  {id}
1010
- class={class_name}
1011
- {style}
1012
1023
  data-testid={data_testid}
1013
1024
  {...empty_state_attrs}
1014
- message={empty_state_message}
1025
+ message={empty_state_msg}
1015
1026
  />
1016
1027
  {/if}
1017
1028