matterviz 0.3.7 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) 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 +8 -3
  6. package/dist/brillouin/BrillouinZone.svelte.d.ts +2 -1
  7. package/dist/brillouin/BrillouinZoneScene.svelte +52 -6
  8. package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +1 -0
  9. package/dist/brillouin/BrillouinZoneTooltip.svelte +16 -25
  10. package/dist/brillouin/compute.js +10 -14
  11. package/dist/chempot-diagram/ChemPotDiagram.svelte +14 -13
  12. package/dist/chempot-diagram/ChemPotDiagram2D.svelte +12 -15
  13. package/dist/chempot-diagram/ChemPotDiagram3D.svelte +8 -10
  14. package/dist/chempot-diagram/async-compute.svelte.js +3 -1
  15. package/dist/chempot-diagram/chempot-worker.js +2 -1
  16. package/dist/chempot-diagram/compute.d.ts +1 -1
  17. package/dist/chempot-diagram/compute.js +17 -19
  18. package/dist/colors/index.js +6 -5
  19. package/dist/composition/FormulaFilter.svelte +12 -6
  20. package/dist/composition/PieChart.svelte +6 -5
  21. package/dist/composition/chem-sys.d.ts +8 -0
  22. package/dist/composition/chem-sys.js +85 -0
  23. package/dist/composition/format.js +4 -2
  24. package/dist/composition/index.d.ts +1 -0
  25. package/dist/composition/index.js +1 -0
  26. package/dist/composition/parse.js +25 -13
  27. package/dist/convex-hull/ConvexHull2D.svelte +12 -10
  28. package/dist/convex-hull/ConvexHull3D.svelte +5 -5
  29. package/dist/convex-hull/ConvexHull4D.svelte +5 -9
  30. package/dist/convex-hull/ConvexHullStats.svelte +12 -12
  31. package/dist/convex-hull/GasPressureControls.svelte +4 -4
  32. package/dist/convex-hull/TemperatureSlider.svelte +2 -2
  33. package/dist/convex-hull/demo-temperature.d.ts +1 -1
  34. package/dist/convex-hull/demo-temperature.js +20 -22
  35. package/dist/convex-hull/gas-thermodynamics.d.ts +2 -2
  36. package/dist/convex-hull/gas-thermodynamics.js +22 -30
  37. package/dist/convex-hull/helpers.d.ts +3 -0
  38. package/dist/convex-hull/helpers.js +17 -9
  39. package/dist/convex-hull/index.d.ts +1 -1
  40. package/dist/convex-hull/thermodynamics.js +83 -78
  41. package/dist/convex-hull/types.d.ts +1 -1
  42. package/dist/coordination/CoordinationBarPlot.svelte +23 -23
  43. package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
  44. package/dist/element/ElementTile.svelte.d.ts +1 -1
  45. package/dist/fermi-surface/FermiSlice.svelte +13 -5
  46. package/dist/fermi-surface/FermiSurface.svelte +11 -5
  47. package/dist/fermi-surface/FermiSurface.svelte.d.ts +1 -1
  48. package/dist/fermi-surface/FermiSurfaceControls.svelte +1 -1
  49. package/dist/fermi-surface/FermiSurfaceScene.svelte +3 -0
  50. package/dist/fermi-surface/FermiSurfaceTooltip.svelte +8 -34
  51. package/dist/fermi-surface/compute.js +59 -59
  52. package/dist/fermi-surface/export.js +3 -2
  53. package/dist/fermi-surface/parse.js +7 -4
  54. package/dist/fermi-surface/types.d.ts +1 -0
  55. package/dist/heatmap-matrix/HeatmapMatrix.svelte +23 -21
  56. package/dist/heatmap-matrix/index.js +1 -1
  57. package/dist/io/decompress.js +4 -2
  58. package/dist/io/export.d.ts +4 -4
  59. package/dist/io/export.js +47 -25
  60. package/dist/io/fetch.js +5 -1
  61. package/dist/io/file-drop.d.ts +1 -1
  62. package/dist/io/file-drop.js +35 -36
  63. package/dist/io/url-drop.js +64 -33
  64. package/dist/isosurface/parse.js +6 -7
  65. package/dist/isosurface/slice.js +5 -4
  66. package/dist/isosurface/types.js +1 -1
  67. package/dist/keyboard.d.ts +3 -0
  68. package/dist/keyboard.js +23 -0
  69. package/dist/labels.d.ts +1 -1
  70. package/dist/labels.js +8 -7
  71. package/dist/layout/PropertyFilter.svelte +3 -2
  72. package/dist/layout/SettingsSection.svelte +1 -1
  73. package/dist/layout/json-tree/JsonNode.svelte +1 -1
  74. package/dist/layout/json-tree/JsonTree.svelte +2 -2
  75. package/dist/layout/json-tree/utils.js +5 -4
  76. package/dist/marching-cubes.js +8 -13
  77. package/dist/math.d.ts +5 -1
  78. package/dist/math.js +24 -9
  79. package/dist/overlays/DraggablePane.svelte +4 -4
  80. package/dist/periodic-table/PeriodicTable.svelte +20 -9
  81. package/dist/periodic-table/PropertySelect.svelte +1 -0
  82. package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +9 -3
  83. package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +1 -1
  84. package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +1 -1
  85. package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +2 -1
  86. package/dist/phase-diagram/PhaseDiagramTooltip.svelte +1 -1
  87. package/dist/phase-diagram/build-diagram.js +2 -2
  88. package/dist/phase-diagram/parse.js +6 -5
  89. package/dist/phase-diagram/types.d.ts +1 -1
  90. package/dist/phase-diagram/utils.d.ts +3 -3
  91. package/dist/phase-diagram/utils.js +8 -12
  92. package/dist/plot/{BarPlot.svelte → bar/BarPlot.svelte} +229 -587
  93. package/dist/plot/{BarPlot.svelte.d.ts → bar/BarPlot.svelte.d.ts} +5 -5
  94. package/dist/plot/{BarPlotControls.svelte → bar/BarPlotControls.svelte} +6 -5
  95. package/dist/plot/{BarPlotControls.svelte.d.ts → bar/BarPlotControls.svelte.d.ts} +3 -3
  96. package/dist/plot/{SpacegroupBarPlot.svelte → bar/SpacegroupBarPlot.svelte} +6 -6
  97. package/dist/plot/{SpacegroupBarPlot.svelte.d.ts → bar/SpacegroupBarPlot.svelte.d.ts} +1 -1
  98. package/dist/plot/bar/data.d.ts +40 -0
  99. package/dist/plot/bar/data.js +154 -0
  100. package/dist/plot/bar/geometry.d.ts +39 -0
  101. package/dist/plot/bar/geometry.js +60 -0
  102. package/dist/plot/bar/index.d.ts +3 -0
  103. package/dist/plot/bar/index.js +3 -0
  104. package/dist/plot/box/BoxPlot.svelte +1462 -0
  105. package/dist/plot/box/BoxPlot.svelte.d.ts +94 -0
  106. package/dist/plot/box/BoxPlotControls.svelte +109 -0
  107. package/dist/plot/box/BoxPlotControls.svelte.d.ts +19 -0
  108. package/dist/plot/box/Violin.svelte +14 -0
  109. package/dist/plot/box/Violin.svelte.d.ts +70 -0
  110. package/dist/plot/box/box-plot.d.ts +55 -0
  111. package/dist/plot/box/box-plot.js +126 -0
  112. package/dist/plot/box/index.d.ts +5 -0
  113. package/dist/plot/box/index.js +5 -0
  114. package/dist/plot/box/kde.d.ts +16 -0
  115. package/dist/plot/box/kde.js +160 -0
  116. package/dist/plot/box/quantile.d.ts +3 -0
  117. package/dist/plot/box/quantile.js +53 -0
  118. package/dist/plot/{auto-place.js → core/auto-place.js} +2 -2
  119. package/dist/plot/core/axis-utils.d.ts +46 -0
  120. package/dist/plot/core/axis-utils.js +110 -0
  121. package/dist/plot/{AxisLabel.svelte → core/components/AxisLabel.svelte} +2 -2
  122. package/dist/plot/{AxisLabel.svelte.d.ts → core/components/AxisLabel.svelte.d.ts} +1 -1
  123. package/dist/plot/{ColorBar.svelte → core/components/ColorBar.svelte} +36 -33
  124. package/dist/plot/{ColorBar.svelte.d.ts → core/components/ColorBar.svelte.d.ts} +2 -2
  125. package/dist/plot/{ColorScaleSelect.svelte → core/components/ColorScaleSelect.svelte} +4 -3
  126. package/dist/plot/{ColorScaleSelect.svelte.d.ts → core/components/ColorScaleSelect.svelte.d.ts} +2 -2
  127. package/dist/plot/core/components/ControlPane.svelte +46 -0
  128. package/dist/plot/core/components/ControlPane.svelte.d.ts +13 -0
  129. package/dist/plot/{FillArea.svelte → core/components/FillArea.svelte} +17 -6
  130. package/dist/plot/{FillArea.svelte.d.ts → core/components/FillArea.svelte.d.ts} +1 -1
  131. package/dist/plot/{InteractiveAxisLabel.svelte → core/components/InteractiveAxisLabel.svelte} +3 -3
  132. package/dist/plot/{InteractiveAxisLabel.svelte.d.ts → core/components/InteractiveAxisLabel.svelte.d.ts} +2 -2
  133. package/dist/plot/{Line.svelte → core/components/Line.svelte} +30 -13
  134. package/dist/plot/{PlotAxis.svelte → core/components/PlotAxis.svelte} +7 -5
  135. package/dist/plot/{PlotAxis.svelte.d.ts → core/components/PlotAxis.svelte.d.ts} +3 -2
  136. package/dist/plot/{PlotControls.svelte → core/components/PlotControls.svelte} +17 -29
  137. package/dist/plot/core/components/PlotControls.svelte.d.ts +4 -0
  138. package/dist/plot/{PlotLegend.svelte → core/components/PlotLegend.svelte} +21 -10
  139. package/dist/plot/{PlotLegend.svelte.d.ts → core/components/PlotLegend.svelte.d.ts} +3 -2
  140. package/dist/plot/{PlotTooltip.svelte → core/components/PlotTooltip.svelte} +17 -1
  141. package/dist/plot/{PlotTooltip.svelte.d.ts → core/components/PlotTooltip.svelte.d.ts} +8 -0
  142. package/dist/plot/{PortalSelect.svelte → core/components/PortalSelect.svelte} +11 -7
  143. package/dist/plot/{ReferenceLine.svelte → core/components/ReferenceLine.svelte} +3 -3
  144. package/dist/plot/{ReferenceLine.svelte.d.ts → core/components/ReferenceLine.svelte.d.ts} +1 -1
  145. package/dist/plot/{ReferenceLine3D.svelte → core/components/ReferenceLine3D.svelte} +4 -4
  146. package/dist/plot/{ReferenceLine3D.svelte.d.ts → core/components/ReferenceLine3D.svelte.d.ts} +2 -2
  147. package/dist/plot/{ReferencePlane.svelte → core/components/ReferencePlane.svelte} +7 -7
  148. package/dist/plot/{ReferencePlane.svelte.d.ts → core/components/ReferencePlane.svelte.d.ts} +2 -2
  149. package/dist/plot/{ZeroLines.svelte → core/components/ZeroLines.svelte} +3 -3
  150. package/dist/plot/{ZeroLines.svelte.d.ts → core/components/ZeroLines.svelte.d.ts} +3 -3
  151. package/dist/plot/{ZoomRect.svelte → core/components/ZoomRect.svelte} +1 -1
  152. package/dist/plot/{ZoomRect.svelte.d.ts → core/components/ZoomRect.svelte.d.ts} +1 -1
  153. package/dist/plot/core/components/index.d.ts +17 -0
  154. package/dist/plot/core/components/index.js +17 -0
  155. package/dist/plot/{data-cleaning.d.ts → core/data-cleaning.d.ts} +71 -1
  156. package/dist/plot/{data-cleaning.js → core/data-cleaning.js} +3 -5
  157. package/dist/plot/{data-transform.d.ts → core/data-transform.d.ts} +2 -2
  158. package/dist/plot/{data-transform.js → core/data-transform.js} +3 -3
  159. package/dist/plot/core/fill-utils.d.ts +33 -0
  160. package/dist/plot/core/fill-utils.js +388 -0
  161. package/dist/plot/{hover-lock.svelte.js → core/hover-lock.svelte.js} +5 -6
  162. package/dist/plot/core/index.d.ts +10 -0
  163. package/dist/plot/core/index.js +11 -0
  164. package/dist/plot/core/interactions.d.ts +35 -0
  165. package/dist/plot/core/interactions.js +195 -0
  166. package/dist/plot/{layout.d.ts → core/layout.d.ts} +1 -0
  167. package/dist/plot/{layout.js → core/layout.js} +16 -8
  168. package/dist/plot/{reference-line.d.ts → core/reference-line.d.ts} +1 -1
  169. package/dist/plot/{reference-line.js → core/reference-line.js} +23 -36
  170. package/dist/plot/{scales.d.ts → core/scales.d.ts} +2 -2
  171. package/dist/plot/{scales.js → core/scales.js} +84 -85
  172. package/dist/plot/core/svg.d.ts +2 -0
  173. package/dist/plot/core/svg.js +41 -0
  174. package/dist/plot/{types.d.ts → core/types.d.ts} +19 -79
  175. package/dist/plot/{types.js → core/types.js} +1 -1
  176. package/dist/plot/{utils → core/utils}/label-placement.d.ts +2 -2
  177. package/dist/plot/core/utils/series-visibility.d.ts +26 -0
  178. package/dist/plot/{utils → core/utils}/series-visibility.js +29 -2
  179. package/dist/plot/core/utils.d.ts +11 -0
  180. package/dist/plot/core/utils.js +27 -0
  181. package/dist/plot/{Histogram.svelte → histogram/Histogram.svelte} +154 -294
  182. package/dist/plot/{Histogram.svelte.d.ts → histogram/Histogram.svelte.d.ts} +2 -2
  183. package/dist/plot/{HistogramControls.svelte → histogram/HistogramControls.svelte} +6 -6
  184. package/dist/plot/{HistogramControls.svelte.d.ts → histogram/HistogramControls.svelte.d.ts} +4 -4
  185. package/dist/plot/histogram/index.d.ts +2 -0
  186. package/dist/plot/histogram/index.js +2 -0
  187. package/dist/plot/index.d.ts +8 -41
  188. package/dist/plot/index.js +10 -39
  189. package/dist/plot/sankey/Sankey.svelte +700 -0
  190. package/dist/plot/sankey/Sankey.svelte.d.ts +74 -0
  191. package/dist/plot/sankey/SankeyControls.svelte +98 -0
  192. package/dist/plot/sankey/SankeyControls.svelte.d.ts +19 -0
  193. package/dist/plot/sankey/index.d.ts +4 -0
  194. package/dist/plot/sankey/index.js +3 -0
  195. package/dist/plot/sankey/sankey-types.d.ts +42 -0
  196. package/dist/plot/sankey/sankey-types.js +4 -0
  197. package/dist/plot/sankey/sankey.d.ts +52 -0
  198. package/dist/plot/sankey/sankey.js +187 -0
  199. package/dist/plot/{BinnedScatterPlot.svelte → scatter/BinnedScatterPlot.svelte} +61 -59
  200. package/dist/plot/{BinnedScatterPlot.svelte.d.ts → scatter/BinnedScatterPlot.svelte.d.ts} +4 -4
  201. package/dist/plot/{ElementScatter.svelte → scatter/ElementScatter.svelte} +6 -6
  202. package/dist/plot/{ElementScatter.svelte.d.ts → scatter/ElementScatter.svelte.d.ts} +2 -2
  203. package/dist/plot/{ScatterPlot.svelte → scatter/ScatterPlot.svelte} +221 -642
  204. package/dist/plot/{ScatterPlot.svelte.d.ts → scatter/ScatterPlot.svelte.d.ts} +7 -7
  205. package/dist/plot/{ScatterPlotControls.svelte → scatter/ScatterPlotControls.svelte} +6 -5
  206. package/dist/plot/{ScatterPlotControls.svelte.d.ts → scatter/ScatterPlotControls.svelte.d.ts} +1 -1
  207. package/dist/plot/{ScatterPoint.svelte → scatter/ScatterPoint.svelte} +7 -7
  208. package/dist/plot/{ScatterPoint.svelte.d.ts → scatter/ScatterPoint.svelte.d.ts} +3 -3
  209. package/dist/plot/{adaptive-density.d.ts → scatter/adaptive-density.d.ts} +14 -4
  210. package/dist/plot/{adaptive-density.js → scatter/adaptive-density.js} +46 -20
  211. package/dist/plot/{binned-scatter-types.d.ts → scatter/binned-scatter-types.d.ts} +3 -3
  212. package/dist/plot/scatter/index.d.ts +7 -0
  213. package/dist/plot/scatter/index.js +5 -0
  214. package/dist/plot/scatter/scatter-data.d.ts +19 -0
  215. package/dist/plot/scatter/scatter-data.js +212 -0
  216. package/dist/plot/{ScatterPlot3D.svelte → scatter-3d/ScatterPlot3D.svelte} +12 -10
  217. package/dist/plot/{ScatterPlot3D.svelte.d.ts → scatter-3d/ScatterPlot3D.svelte.d.ts} +7 -7
  218. package/dist/plot/{ScatterPlot3DControls.svelte → scatter-3d/ScatterPlot3DControls.svelte} +5 -4
  219. package/dist/plot/{ScatterPlot3DControls.svelte.d.ts → scatter-3d/ScatterPlot3DControls.svelte.d.ts} +2 -2
  220. package/dist/plot/{ScatterPlot3DScene.svelte → scatter-3d/ScatterPlot3DScene.svelte} +11 -11
  221. package/dist/plot/{ScatterPlot3DScene.svelte.d.ts → scatter-3d/ScatterPlot3DScene.svelte.d.ts} +3 -3
  222. package/dist/plot/{Surface3D.svelte → scatter-3d/Surface3D.svelte} +1 -1
  223. package/dist/plot/{Surface3D.svelte.d.ts → scatter-3d/Surface3D.svelte.d.ts} +1 -1
  224. package/dist/plot/scatter-3d/index.d.ts +4 -0
  225. package/dist/plot/scatter-3d/index.js +4 -0
  226. package/dist/plot/sunburst/Sunburst.svelte +1045 -0
  227. package/dist/plot/sunburst/Sunburst.svelte.d.ts +96 -0
  228. package/dist/plot/sunburst/SunburstControls.svelte +200 -0
  229. package/dist/plot/sunburst/SunburstControls.svelte.d.ts +26 -0
  230. package/dist/plot/sunburst/index.d.ts +4 -0
  231. package/dist/plot/sunburst/index.js +4 -0
  232. package/dist/plot/sunburst/render.d.ts +34 -0
  233. package/dist/plot/sunburst/render.js +122 -0
  234. package/dist/plot/sunburst/sunburst.d.ts +62 -0
  235. package/dist/plot/sunburst/sunburst.js +266 -0
  236. package/dist/rdf/RdfPlot.svelte +2 -1
  237. package/dist/rdf/calc-rdf.js +11 -24
  238. package/dist/sanitize.js +1 -1
  239. package/dist/settings.d.ts +65 -1
  240. package/dist/settings.js +262 -0
  241. package/dist/spectral/Bands.svelte +39 -29
  242. package/dist/spectral/Bands.svelte.d.ts +3 -4
  243. package/dist/spectral/BandsAndDos.svelte +1 -1
  244. package/dist/spectral/BrillouinBandsDos.svelte +39 -27
  245. package/dist/spectral/Dos.svelte +10 -19
  246. package/dist/spectral/Dos.svelte.d.ts +2 -2
  247. package/dist/spectral/helpers.d.ts +3 -1
  248. package/dist/spectral/helpers.js +95 -29
  249. package/dist/structure/AtomLegend.svelte +8 -9
  250. package/dist/structure/CellSelect.svelte +1 -2
  251. package/dist/structure/Cylinder.svelte +12 -8
  252. package/dist/structure/Cylinder.svelte.d.ts +4 -1
  253. package/dist/structure/Structure.svelte +78 -72
  254. package/dist/structure/Structure.svelte.d.ts +1 -1
  255. package/dist/structure/StructureInfoPane.svelte +5 -6
  256. package/dist/structure/StructureScene.svelte +11 -10
  257. package/dist/structure/atom-properties.js +6 -6
  258. package/dist/structure/bond-order-perception.js +1 -1
  259. package/dist/structure/bonding.d.ts +1 -0
  260. package/dist/structure/bonding.js +43 -15
  261. package/dist/structure/export.js +27 -23
  262. package/dist/structure/index.d.ts +2 -4
  263. package/dist/structure/index.js +1 -3
  264. package/dist/structure/label-placement.js +4 -4
  265. package/dist/structure/measure.d.ts +3 -2
  266. package/dist/structure/measure.js +6 -5
  267. package/dist/structure/parse.js +121 -103
  268. package/dist/structure/pbc.js +4 -0
  269. package/dist/symmetry/SymmetryStats.svelte +2 -2
  270. package/dist/symmetry/index.d.ts +1 -1
  271. package/dist/symmetry/index.js +22 -24
  272. package/dist/symmetry/spacegroups.d.ts +7 -0
  273. package/dist/symmetry/spacegroups.js +48 -13
  274. package/dist/table/HeatmapTable.svelte +63 -11
  275. package/dist/table/HeatmapTable.svelte.d.ts +1 -1
  276. package/dist/table/index.d.ts +1 -3
  277. package/dist/table/index.js +1 -1
  278. package/dist/theme/index.js +8 -8
  279. package/dist/tooltip/KCoords.svelte +45 -0
  280. package/dist/tooltip/KCoords.svelte.d.ts +8 -0
  281. package/dist/tooltip/index.d.ts +1 -0
  282. package/dist/tooltip/index.js +1 -0
  283. package/dist/trajectory/Trajectory.svelte +66 -40
  284. package/dist/trajectory/Trajectory.svelte.d.ts +2 -1
  285. package/dist/trajectory/TrajectoryExportPane.svelte +2 -1
  286. package/dist/trajectory/TrajectoryInfoPane.svelte +2 -1
  287. package/dist/trajectory/format-detect.d.ts +1 -0
  288. package/dist/trajectory/format-detect.js +25 -11
  289. package/dist/trajectory/frame-reader.js +17 -50
  290. package/dist/trajectory/helpers.js +1 -1
  291. package/dist/trajectory/index.js +1 -1
  292. package/dist/trajectory/parse/hdf5.js +1 -1
  293. package/dist/trajectory/parse/index.js +14 -6
  294. package/dist/trajectory/parse/vasp.js +36 -17
  295. package/dist/trajectory/parse/xyz.d.ts +24 -0
  296. package/dist/trajectory/parse/xyz.js +102 -89
  297. package/dist/trajectory/plotting.d.ts +1 -1
  298. package/dist/trajectory/plotting.js +15 -15
  299. package/dist/utils.d.ts +1 -0
  300. package/dist/utils.js +6 -4
  301. package/dist/xrd/XrdPlot.svelte +2 -1
  302. package/dist/xrd/calc-xrd.js +15 -12
  303. package/dist/xrd/parse.js +2 -2
  304. package/package.json +22 -18
  305. package/dist/plot/PlotControls.svelte.d.ts +0 -4
  306. package/dist/plot/axis-utils.d.ts +0 -19
  307. package/dist/plot/axis-utils.js +0 -78
  308. package/dist/plot/defaults.d.ts +0 -19
  309. package/dist/plot/defaults.js +0 -9
  310. package/dist/plot/fill-utils.d.ts +0 -46
  311. package/dist/plot/fill-utils.js +0 -322
  312. package/dist/plot/interactions.d.ts +0 -12
  313. package/dist/plot/interactions.js +0 -101
  314. package/dist/plot/svg.d.ts +0 -1
  315. package/dist/plot/svg.js +0 -11
  316. package/dist/plot/utils/series-visibility.d.ts +0 -15
  317. package/dist/plot/utils.d.ts +0 -1
  318. package/dist/plot/utils.js +0 -14
  319. /package/dist/plot/{auto-place.d.ts → core/auto-place.d.ts} +0 -0
  320. /package/dist/plot/{Line.svelte.d.ts → core/components/Line.svelte.d.ts} +0 -0
  321. /package/dist/plot/{PortalSelect.svelte.d.ts → core/components/PortalSelect.svelte.d.ts} +0 -0
  322. /package/dist/plot/{hover-lock.svelte.d.ts → core/hover-lock.svelte.d.ts} +0 -0
  323. /package/dist/plot/{utils → core/utils}/label-placement.js +0 -0
  324. /package/dist/plot/{binned-scatter-types.js → scatter/binned-scatter-types.js} +0 -0
package/dist/settings.js CHANGED
@@ -622,6 +622,264 @@ export const SETTINGS_CONFIG = {
622
622
  },
623
623
  display: DISPLAY_CONFIG,
624
624
  },
625
+ // Box plot specific
626
+ box: {
627
+ whisker_mode: {
628
+ value: `tukey`,
629
+ description: `How whiskers are computed: 'tukey' (1.5*IQR), 'minmax' (data extremes), 'percentile' (5th/95th), or 'std' (mean ± std)`,
630
+ enum: {
631
+ tukey: `Tukey (1.5·IQR)`,
632
+ minmax: `Min/Max`,
633
+ percentile: `Percentile`,
634
+ std: `Std Dev`,
635
+ },
636
+ },
637
+ box_width: {
638
+ value: 0.8,
639
+ description: `Box width as a fraction of the category slot`,
640
+ minimum: 0.1,
641
+ maximum: 1,
642
+ },
643
+ show_outliers: {
644
+ value: true,
645
+ description: `Show outlier points beyond the whiskers`,
646
+ },
647
+ show_mean: {
648
+ value: false,
649
+ description: `Show the mean marker inside each box`,
650
+ },
651
+ kind: {
652
+ value: `box`,
653
+ description: `Glyph to draw per series: box, violin (KDE density), or both`,
654
+ enum: { box: `Box`, violin: `Violin`, 'violin+box': `Violin + Box` },
655
+ },
656
+ side: {
657
+ value: `both`,
658
+ description: `Which half of the slot a violin occupies (one-sided / split violins)`,
659
+ enum: { both: `Both`, positive: `Positive`, negative: `Negative` },
660
+ },
661
+ bandwidth: {
662
+ value: `silverman`,
663
+ description: `KDE bandwidth rule for violins`,
664
+ enum: { silverman: `Silverman`, scott: `Scott` },
665
+ },
666
+ violin_width: {
667
+ value: 0.9,
668
+ description: `Violin width as a fraction of the category slot`,
669
+ minimum: 0.1,
670
+ maximum: 1,
671
+ },
672
+ violin_box_width: {
673
+ value: 0.2,
674
+ description: `Inner box width (fraction of slot) when a box is drawn inside a violin`,
675
+ minimum: 0.05,
676
+ maximum: 1,
677
+ },
678
+ box: {
679
+ color: {
680
+ value: `#4A9EFF`,
681
+ description: `Box fill color`,
682
+ },
683
+ opacity: {
684
+ value: 0.6,
685
+ description: `Box fill opacity`,
686
+ minimum: 0,
687
+ maximum: 1,
688
+ },
689
+ stroke_width: {
690
+ value: 0.5,
691
+ description: `Box outline width`,
692
+ minimum: 0,
693
+ maximum: 5,
694
+ },
695
+ stroke_color: {
696
+ value: `#000000`,
697
+ description: `Box outline color`,
698
+ },
699
+ border_radius: {
700
+ value: 0,
701
+ description: `Corner radius for boxes (px)`,
702
+ minimum: 0,
703
+ maximum: 10,
704
+ },
705
+ },
706
+ whisker: {
707
+ width: {
708
+ value: 1,
709
+ description: `Whisker line width`,
710
+ minimum: 0.5,
711
+ maximum: 5,
712
+ },
713
+ color: {
714
+ value: `#000000`,
715
+ description: `Whisker line color`,
716
+ },
717
+ cap_fraction: {
718
+ value: 0.3,
719
+ description: `Whisker cap width as a fraction of the box width`,
720
+ minimum: 0,
721
+ maximum: 1,
722
+ },
723
+ },
724
+ median: {
725
+ width: {
726
+ value: 1.5,
727
+ description: `Median line width`,
728
+ minimum: 0.5,
729
+ maximum: 6,
730
+ },
731
+ color: {
732
+ value: `#000000`,
733
+ description: `Median line color`,
734
+ },
735
+ },
736
+ outlier: {
737
+ radius: {
738
+ value: 2.5,
739
+ description: `Outlier point radius (px)`,
740
+ minimum: 0.5,
741
+ maximum: 10,
742
+ },
743
+ opacity: {
744
+ value: 0.6,
745
+ description: `Outlier point opacity`,
746
+ minimum: 0,
747
+ maximum: 1,
748
+ },
749
+ stroke_width: {
750
+ value: 0,
751
+ description: `Outlier point stroke width`,
752
+ minimum: 0,
753
+ maximum: 3,
754
+ },
755
+ },
756
+ violin: {
757
+ opacity: {
758
+ value: 0.5,
759
+ description: `Violin fill opacity`,
760
+ minimum: 0,
761
+ maximum: 1,
762
+ },
763
+ stroke_width: {
764
+ value: 1,
765
+ description: `Violin outline width`,
766
+ minimum: 0,
767
+ maximum: 5,
768
+ },
769
+ },
770
+ display: DISPLAY_CONFIG,
771
+ },
772
+ // Sankey diagram specific
773
+ sankey: {
774
+ orientation: {
775
+ value: `horizontal`,
776
+ description: `Flow direction of the Sankey diagram`,
777
+ enum: { horizontal: `Horizontal`, vertical: `Vertical` },
778
+ },
779
+ node_align: {
780
+ value: `justify`,
781
+ description: `How nodes are aligned across columns (maps to d3-sankey alignment)`,
782
+ enum: { justify: `Justify`, left: `Left`, right: `Right`, center: `Center` },
783
+ },
784
+ node_width: {
785
+ value: 24,
786
+ description: `Node thickness in pixels`,
787
+ minimum: 4,
788
+ maximum: 60,
789
+ },
790
+ node_padding: {
791
+ value: 12,
792
+ description: `Vertical gap in pixels between nodes sharing a column`,
793
+ minimum: 0,
794
+ maximum: 40,
795
+ },
796
+ link_opacity: {
797
+ value: 0.5,
798
+ description: `Opacity of link ribbons`,
799
+ minimum: 0.05,
800
+ maximum: 1,
801
+ },
802
+ show_node_labels: {
803
+ value: true,
804
+ description: `Show node labels next to each node`,
805
+ },
806
+ iterations: {
807
+ value: 6,
808
+ description: `Number of d3-sankey relaxation iterations for node positioning`,
809
+ minimum: 0,
810
+ maximum: 64,
811
+ },
812
+ },
813
+ // Sunburst chart specific
814
+ sunburst: {
815
+ shape: {
816
+ value: `sunburst`,
817
+ description: `Chart geometry: polar rings (sunburst) or stacked rows (icicle)`,
818
+ enum: { sunburst: `Sunburst`, icicle: `Icicle` },
819
+ },
820
+ value_mode: {
821
+ value: `leaf-sum`,
822
+ 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`,
823
+ enum: { 'leaf-sum': `Leaf sum`, total: `Total`, remainder: `Remainder` },
824
+ },
825
+ max_depth: {
826
+ value: 0,
827
+ description: `Number of rings shown below the current zoom root (0 = all)`,
828
+ minimum: 0,
829
+ maximum: 10,
830
+ },
831
+ inner_radius: {
832
+ value: 0.25,
833
+ description: `Center hole size as fraction of the outer radius`,
834
+ minimum: 0,
835
+ maximum: 0.8,
836
+ },
837
+ pad_angle: {
838
+ value: 0.1,
839
+ description: `Angular gap in degrees between sibling arcs`,
840
+ minimum: 0,
841
+ maximum: 4,
842
+ },
843
+ min_fraction: {
844
+ value: 0,
845
+ description: `Group sibling arcs smaller than this fraction of the total into one 'Other' slice per parent (0 = off)`,
846
+ minimum: 0,
847
+ maximum: 0.2,
848
+ },
849
+ show_labels: {
850
+ value: true,
851
+ description: `Show labels on arcs large enough to fit them`,
852
+ },
853
+ label_rotation: {
854
+ value: `auto`,
855
+ description: `Arc label orientation (auto picks radial/tangential per arc)`,
856
+ enum: {
857
+ auto: `Auto`,
858
+ radial: `Radial`,
859
+ tangential: `Tangential`,
860
+ horizontal: `Horizontal`,
861
+ },
862
+ },
863
+ label_text: {
864
+ value: `label`,
865
+ description: `What arc labels display (percent is of the root total)`,
866
+ enum: {
867
+ label: `Label`,
868
+ value: `Value`,
869
+ percent: `Percent`,
870
+ 'label+value': `Label + value`,
871
+ 'label+percent': `Label + percent`,
872
+ },
873
+ },
874
+ zoom_on_click: {
875
+ value: true,
876
+ description: `Clicking a branch arc zooms into that subtree (center circle zooms out)`,
877
+ },
878
+ show_breadcrumbs: {
879
+ value: true,
880
+ description: `Show a clickable trail of ancestors when zoomed into a subtree`,
881
+ },
882
+ },
625
883
  // Composition specific
626
884
  composition: {
627
885
  display_mode: {
@@ -1121,6 +1379,7 @@ export const DEFAULTS = extract_values(SETTINGS_CONFIG);
1121
1379
  export const merge = (user) => ({
1122
1380
  ...DEFAULTS,
1123
1381
  ...user,
1382
+ symmetry: merge_nested(DEFAULTS.symmetry, user?.symmetry),
1124
1383
  structure: merge_nested(DEFAULTS.structure, user?.structure),
1125
1384
  trajectory: merge_nested(DEFAULTS.trajectory, user?.trajectory),
1126
1385
  composition: merge_nested(DEFAULTS.composition, user?.composition),
@@ -1128,5 +1387,8 @@ export const merge = (user) => ({
1128
1387
  scatter: merge_nested(DEFAULTS.scatter, user?.scatter),
1129
1388
  histogram: merge_nested(DEFAULTS.histogram, user?.histogram),
1130
1389
  bar: merge_nested(DEFAULTS.bar, user?.bar),
1390
+ box: merge_nested(DEFAULTS.box, user?.box),
1391
+ sankey: merge_nested(DEFAULTS.sankey, user?.sankey),
1392
+ sunburst: merge_nested(DEFAULTS.sunburst, user?.sunburst),
1131
1393
  convex_hull: merge_nested(DEFAULTS.convex_hull, user?.convex_hull),
1132
1394
  });
@@ -5,8 +5,8 @@
5
5
  import { sanitize_html } from '../sanitize'
6
6
  import { SettingsSection } from '../layout'
7
7
  import type { Vec2 } from '../math'
8
- import ScatterPlot from '../plot/ScatterPlot.svelte'
9
- import type { AxisConfig, DataSeries, FillRegion } from '../plot/types'
8
+ import ScatterPlot from '../plot/scatter/ScatterPlot.svelte'
9
+ import type { AxisConfig, DataSeries, FillRegion } from '../plot/core/types'
10
10
  import * as helpers from './helpers'
11
11
  import type {
12
12
  BandsSpinMode,
@@ -32,6 +32,7 @@
32
32
  y_axis = $bindable({}),
33
33
  x_positions = $bindable(),
34
34
  reference_frequency = null,
35
+ highlighted_qpoint_index = null,
35
36
  ribbon_config = {},
36
37
  fermi_level = undefined,
37
38
  units = $bindable(`THz`),
@@ -45,8 +46,6 @@
45
46
  show_spin_control = true,
46
47
  show_annotation_controls = true,
47
48
  id = undefined,
48
- class: class_name = undefined,
49
- style = undefined,
50
49
  'data-testid': data_testid = undefined,
51
50
  ...rest
52
51
  }: ComponentProps<typeof ScatterPlot> & {
@@ -59,6 +58,8 @@
59
58
  show_legend?: boolean
60
59
  x_positions?: Record<string, [number, number]>
61
60
  reference_frequency?: number | null
61
+ // Q-point index to highlight with a vertical line (synced from BZ k-path hover)
62
+ highlighted_qpoint_index?: number | null
62
63
  ribbon_config?: RibbonConfig | Record<string, RibbonConfig>
63
64
  fermi_level?: number // Fermi level for electronic bands (auto-detected if not provided)
64
65
  units?: FrequencyUnit // Phonon frequency display units (electronic always eV)
@@ -78,8 +79,6 @@
78
79
  show_spin_control?: boolean
79
80
  show_annotation_controls?: boolean
80
81
  id?: string
81
- class?: string
82
- style?: string
83
82
  'data-testid'?: string
84
83
  } = $props()
85
84
 
@@ -258,7 +257,8 @@
258
257
  const attrs: Record<string, Dom_attr_value> = {}
259
258
  for (const [attr_name, attr_value] of Object.entries(rest)) {
260
259
  if (
261
- (attr_name === `role` || attr_name.startsWith(`aria-`)) &&
260
+ (attr_name === `class` || attr_name === `style` || attr_name === `role` ||
261
+ attr_name.startsWith(`aria-`)) &&
262
262
  is_dom_attr_value(attr_value)
263
263
  ) {
264
264
  attrs[attr_name] = attr_value
@@ -590,9 +590,9 @@
590
590
  const display_values = detected_band_type === `phonon`
591
591
  ? convert_band_values(all_freqs)
592
592
  : all_freqs
593
- if (!display_values.length) return undefined
593
+ if (display_values.length === 0) return undefined
594
594
  const finite = display_values.filter(Number.isFinite)
595
- if (!finite.length) return undefined
595
+ if (finite.length === 0) return undefined
596
596
  let min_val = Math.min(...finite), max_val = Math.max(...finite)
597
597
  if (
598
598
  // clamp phonon min to 0 if negatives are noise
@@ -617,22 +617,12 @@
617
617
  // Sync zoom changes from ScatterPlot back to parent via bindable y_axis
618
618
  // Also clears parent range when internal range becomes invalid (auto-range reset)
619
619
  $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
- }
620
+ const next = helpers.sync_axis_range(y_axis, internal_y_axis.range)
621
+ if (next !== y_axis) y_axis = next
632
622
  })
633
623
 
634
624
  let has_series = $derived(series_data.length > 0)
635
- let is_strict_path_error = $derived(path_mode === `strict` && !!strict_path_error)
625
+ let is_strict_path_error = $derived(path_mode === `strict` && Boolean(strict_path_error))
636
626
 
637
627
  let imaginary_mode_region = $derived.by((): FillRegion[] => {
638
628
  if (
@@ -685,7 +675,7 @@
685
675
  )
686
676
  const occupied = all_energies.filter((energy) => energy <= effective_fermi_level)
687
677
  const unoccupied = all_energies.filter((energy) => energy > effective_fermi_level)
688
- if (!occupied.length || !unoccupied.length) return null
678
+ if (occupied.length === 0 || unoccupied.length === 0) return null
689
679
  const vbm = Math.max(...occupied)
690
680
  const cbm = Math.min(...unoccupied)
691
681
  const gap = cbm - vbm
@@ -693,7 +683,7 @@
693
683
  return { vbm, cbm, gap }
694
684
  })
695
685
 
696
- let empty_state_message = $derived.by(() => {
686
+ let empty_state_msg = $derived.by(() => {
697
687
  if (is_strict_path_error) {
698
688
  return strict_path_error ?? `Path mismatch in strict mode.`
699
689
  }
@@ -706,13 +696,18 @@
706
696
  return `No valid band structure data to display.`
707
697
  })
708
698
 
699
+ // X-position of the externally hovered q-point (from BZ k-path), for the highlight line
700
+ let highlight_x = $derived.by(() => {
701
+ if (highlighted_qpoint_index == null) return null
702
+ const bs = Object.values(band_structs_dict)[0]
703
+ return bs ? helpers.qpoint_x_position(bs, highlighted_qpoint_index, x_positions ?? {}) : null
704
+ })
705
+
709
706
  let display = $state({ x_grid: false, y_grid: true, y_zero_line: true })
710
707
  </script>
711
708
  {#if has_series && !is_strict_path_error}
712
709
  <ScatterPlot
713
710
  {id}
714
- class={class_name}
715
- {style}
716
711
  data-testid={data_testid}
717
712
  series={series_data}
718
713
  {fill_regions}
@@ -900,6 +895,23 @@
900
895
  />
901
896
  {/each}
902
897
 
898
+ <!-- Hovered q-point vertical line (synced from Brillouin zone k-path hover) -->
899
+ {#if highlight_x != null}
900
+ {@const hover_x = x_scale_fn(highlight_x)}
901
+ {#if Number.isFinite(hover_x)}
902
+ <line
903
+ x1={hover_x}
904
+ x2={hover_x}
905
+ y1={pad.t}
906
+ y2={height - pad.b}
907
+ stroke="var(--bands-hover-line-color, #ff6b35)"
908
+ stroke-width="var(--bands-hover-line-width, 2)"
909
+ opacity="var(--bands-hover-line-opacity, 0.85)"
910
+ pointer-events="none"
911
+ />
912
+ {/if}
913
+ {/if}
914
+
903
915
  <!-- Shared geometry for Fermi level and gap annotations -->
904
916
  {@const fermi_y = effective_fermi_level !== undefined
905
917
  ? y_scale_fn(effective_fermi_level)
@@ -1007,11 +1019,9 @@
1007
1019
  {:else}
1008
1020
  <EmptyState
1009
1021
  {id}
1010
- class={class_name}
1011
- {style}
1012
1022
  data-testid={data_testid}
1013
1023
  {...empty_state_attrs}
1014
- message={empty_state_message}
1024
+ message={empty_state_msg}
1015
1025
  />
1016
1026
  {/if}
1017
1027
 
@@ -1,5 +1,5 @@
1
- import ScatterPlot from '../plot/ScatterPlot.svelte';
2
- import type { AxisConfig } from '../plot/types';
1
+ import ScatterPlot from '../plot/scatter/ScatterPlot.svelte';
2
+ import type { AxisConfig } from '../plot/core/types';
3
3
  import type { BandsSpinMode, BandStructureType, BaseBandStructure, FrequencyUnit, LineKwargs, PathMode, RibbonConfig } from './types';
4
4
  import type { ComponentProps } from 'svelte';
5
5
  type $$ComponentProps = ComponentProps<typeof ScatterPlot> & {
@@ -12,6 +12,7 @@ type $$ComponentProps = ComponentProps<typeof ScatterPlot> & {
12
12
  show_legend?: boolean;
13
13
  x_positions?: Record<string, [number, number]>;
14
14
  reference_frequency?: number | null;
15
+ highlighted_qpoint_index?: number | null;
15
16
  ribbon_config?: RibbonConfig | Record<string, RibbonConfig>;
16
17
  fermi_level?: number;
17
18
  units?: FrequencyUnit;
@@ -31,8 +32,6 @@ type $$ComponentProps = ComponentProps<typeof ScatterPlot> & {
31
32
  show_spin_control?: boolean;
32
33
  show_annotation_controls?: boolean;
33
34
  id?: string;
34
- class?: string;
35
- style?: string;
36
35
  'data-testid'?: string;
37
36
  };
38
37
  declare const Bands: import("svelte").Component<$$ComponentProps, {}, "y_axis" | "units" | "x_positions" | "band_spin_mode">;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import type { Vec2 } from '../math'
3
- import type { AxisConfig } from '../plot/types'
3
+ import type { AxisConfig } from '../plot/core/types'
4
4
  import type { ComponentProps, Snippet } from 'svelte'
5
5
  import { untrack } from 'svelte'
6
6
  import type { HTMLAttributes } from 'svelte/elements'
@@ -2,7 +2,7 @@
2
2
  import { BrillouinZone, reciprocal_lattice } from '../brillouin'
3
3
  import type { Vec2, Vec3 } from '../math'
4
4
  import type { InternalPoint, ScatterHandlerEvent } from '../plot'
5
- import type { AxisConfig } from '../plot/types'
5
+ import type { AxisConfig } from '../plot/core/types'
6
6
  import type { Crystal } from '../structure'
7
7
  import type { ComponentProps, Snippet } from 'svelte'
8
8
  import { untrack } from 'svelte'
@@ -84,9 +84,13 @@
84
84
  )
85
85
  : null,
86
86
  )
87
+ // Q-point hovered directly on the BZ k-path (reverse direction: BZ -> bands/DOS)
88
+ let bz_hovered_qpoint_index = $state<number | null>(null)
89
+ // Unified hovered q-point: a band-point hover takes priority, else a BZ k-path hover
90
+ let active_qpoint_index = $derived(hovered_qpoint_index ?? bz_hovered_qpoint_index)
87
91
  let hovered_k_point = $derived(
88
- hovered_qpoint_index !== null
89
- ? (k_path_points[hovered_qpoint_index] as Vec3)
92
+ active_qpoint_index !== null
93
+ ? (k_path_points[active_qpoint_index] as Vec3)
90
94
  : null,
91
95
  )
92
96
  const [desktop_width, tablet_width] = [1200, 600]
@@ -132,32 +136,34 @@
132
136
  if (result !== undefined) synced_zoom_range = result
133
137
  })
134
138
 
135
- // Propagate synced range to bands y-axis (untrack current to avoid overwriting child zoom)
136
- $effect(() => {
139
+ // Compute the y-axis a plot should adopt when propagating the synced range, or
140
+ // undefined to leave it untouched. A valid child range is either already at base
141
+ // or a live zoom we must not clobber, so we only push base when the child has
142
+ // reset to auto-range (invalid). base_range is read unconditionally to keep the
143
+ // effect subscribed to synced_zoom_range/shared_frequency_range; current_range is
144
+ // read via untrack() at the call site to avoid overwriting child zoom.
145
+ const propagate_synced_range = (
146
+ current_range: Vec2 | undefined,
147
+ make_axis: (range?: Vec2) => AxisConfig,
148
+ ): AxisConfig | undefined => {
137
149
  const base_range = synced_zoom_range ?? shared_frequency_range
138
- const current_range = untrack(() => bands_y_axis.range) as Vec2 | undefined
139
- // Skip if current range already matches base, or is valid but differs (child zoom in progress)
140
- if (helpers.ranges_equal(current_range, base_range)) return
141
- if (
142
- helpers.is_valid_range(current_range) &&
143
- !helpers.ranges_equal(current_range, base_range)
144
- ) return
145
- // Only include range if it's valid (don't override child's auto-range with undefined)
146
- bands_y_axis = bands_default_axis(base_range)
150
+ return helpers.is_valid_range(current_range) ? undefined : make_axis(base_range)
151
+ }
152
+
153
+ $effect(() => {
154
+ const next = propagate_synced_range(
155
+ untrack(() => bands_y_axis.range) as Vec2 | undefined,
156
+ bands_default_axis,
157
+ )
158
+ if (next) bands_y_axis = next
147
159
  })
148
160
 
149
- // Propagate synced range to DOS y-axis (untrack current to avoid overwriting child zoom)
150
161
  $effect(() => {
151
- const base_range = synced_zoom_range ?? shared_frequency_range
152
- const current_range = untrack(() => dos_y_axis.range) as Vec2 | undefined
153
- // Skip if current range already matches base, or is valid but differs (child zoom in progress)
154
- if (helpers.ranges_equal(current_range, base_range)) return
155
- if (
156
- helpers.is_valid_range(current_range) &&
157
- !helpers.ranges_equal(current_range, base_range)
158
- ) return
159
- // Only include range if it's valid (don't override child's auto-range with undefined)
160
- dos_y_axis = dos_default_axis(base_range)
162
+ const next = propagate_synced_range(
163
+ untrack(() => dos_y_axis.range) as Vec2 | undefined,
164
+ dos_default_axis,
165
+ )
166
+ if (next) dos_y_axis = next
161
167
  })
162
168
 
163
169
  let hovered_frequency = $state<number | null>(null)
@@ -168,7 +174,11 @@
168
174
  class="bands-dos-brillouin {screen_class} {rest.class ?? ``}"
169
175
  bind:clientWidth
170
176
  >
171
- {@render children?.({ hovered_frequency, hovered_band_point, hovered_qpoint_index })}
177
+ {@render children?.({
178
+ hovered_frequency,
179
+ hovered_band_point,
180
+ hovered_qpoint_index: active_qpoint_index,
181
+ })}
172
182
  <Bands
173
183
  style="grid-area: bands; min-width: 0; min-height: 0; overflow: hidden"
174
184
  {band_structs}
@@ -178,6 +188,7 @@
178
188
  bind:y_axis={bands_y_axis}
179
189
  bind:x_positions={bands_x_positions}
180
190
  reference_frequency={hovered_frequency}
191
+ highlighted_qpoint_index={active_qpoint_index}
181
192
  on_point_hover={(event: ScatterHandlerEvent | null) => {
182
193
  hovered_band_point = event?.point ?? null
183
194
  bands_props.on_point_hover?.(event)
@@ -197,7 +208,8 @@
197
208
  : []
198
209
  ) ?? []}
199
210
  {hovered_k_point}
200
- {hovered_qpoint_index}
211
+ hovered_qpoint_index={active_qpoint_index}
212
+ on_kpath_hover={(idx) => (bz_hovered_qpoint_index = idx)}
201
213
  {...bz_props}
202
214
  />
203
215
 
@@ -2,8 +2,8 @@
2
2
  import { PLOT_COLORS } from '../colors'
3
3
  import EmptyState from '../EmptyState.svelte'
4
4
  import { SettingsSection } from '../layout'
5
- import ScatterPlot from '../plot/ScatterPlot.svelte'
6
- import type { AxisConfig, DataSeries } from '../plot/types'
5
+ import ScatterPlot from '../plot/scatter/ScatterPlot.svelte'
6
+ import type { AxisConfig, DataSeries } from '../plot/core/types'
7
7
  import type { ComponentProps } from 'svelte'
8
8
  import { tooltip as attach_tooltip } from 'svelte-multiselect/attachments'
9
9
  import {
@@ -16,12 +16,12 @@
16
16
  format_sigma,
17
17
  FREQUENCY_UNITS,
18
18
  IMAGINARY_MODE_NOISE_THRESHOLD,
19
- is_valid_range,
20
19
  negative_fraction,
21
20
  NORMALIZATION_MODES,
22
21
  normalize_densities,
23
22
  normalize_dos,
24
23
  SPIN_MODES,
24
+ sync_axis_range,
25
25
  validate_sigma_range,
26
26
  } from './helpers'
27
27
  import type {
@@ -308,7 +308,7 @@
308
308
  )
309
309
 
310
310
  let x_range = $derived.by((): [number, number] | undefined => {
311
- if (!series_data.length) return undefined
311
+ if (series_data.length === 0) return undefined
312
312
  const all_x = series_data.flatMap((srs) => srs.x)
313
313
  const min_x = Math.min(...all_x), max_x = Math.max(...all_x)
314
314
  // For horizontal orientation with mirror mode, allow negative values (mirrored densities)
@@ -318,7 +318,7 @@
318
318
  })
319
319
 
320
320
  let y_range = $derived.by((): [number, number] | undefined => {
321
- if (!series_data.length) return undefined
321
+ if (series_data.length === 0) return undefined
322
322
  const all_y = series_data.flatMap((srs) => srs.y)
323
323
  const min_y = Math.min(...all_y), max_y = Math.max(...all_y)
324
324
  // For vertical orientation with mirror mode, allow negative values (mirrored densities)
@@ -346,7 +346,8 @@
346
346
  label: x_label,
347
347
  format: `.2f`,
348
348
  range: x_range,
349
- label_shift: { x: 0, y: -48 }, // Increase standoff from tick labels
349
+ // Keep label standoff identical to Bands' x-axis so the side-by-side
350
+ // "Density of States" and "Wave Vector" labels align (ScatterPlot default y: -40)
350
351
  ...(is_horizontal && { ticks: 4 }),
351
352
  ...x_axis,
352
353
  })
@@ -361,18 +362,8 @@
361
362
  // Sync zoom changes from ScatterPlot back to parent via bindable y_axis
362
363
  // Also clears parent range when internal range becomes invalid (auto-range reset)
363
364
  $effect(() => {
364
- const range = internal_y_axis.range
365
- if (is_valid_range(range)) {
366
- if (y_axis.range?.[0] !== range[0] || y_axis.range?.[1] !== range[1]) {
367
- y_axis = { ...y_axis, range }
368
- }
369
- return
370
- }
371
- // Range became invalid - clear parent's range to propagate reset
372
- if (`range` in y_axis) {
373
- const { range: _omit, ...axis_without_range } = y_axis
374
- y_axis = axis_without_range
375
- }
365
+ const next = sync_axis_range(y_axis, internal_y_axis.range)
366
+ if (next !== y_axis) y_axis = next
376
367
  })
377
368
 
378
369
  let display = $state({
@@ -388,7 +379,7 @@
388
379
  // Auto-detect sigma range based on frequency/energy range
389
380
  let effective_sigma_range = $derived.by((): [number, number] => {
390
381
  if (sigma_range) return sigma_range
391
- if (!all_freqs.length) return [0, 1]
382
+ if (all_freqs.length === 0) return [0, 1]
392
383
  const freq_range = Math.max(...all_freqs) - Math.min(...all_freqs)
393
384
  // Reasonable sigma range: 0 to ~5% of total range
394
385
  const max_sigma = Math.max(0.1, freq_range * 0.05)
@@ -1,5 +1,5 @@
1
- import ScatterPlot from '../plot/ScatterPlot.svelte';
2
- import type { AxisConfig } from '../plot/types';
1
+ import ScatterPlot from '../plot/scatter/ScatterPlot.svelte';
2
+ import type { AxisConfig } from '../plot/core/types';
3
3
  import type { ComponentProps } from 'svelte';
4
4
  import type { DosInput, FrequencyUnit, NormalizationMode, PdosType, SpinMode } from './types';
5
5
  type $$ComponentProps = ComponentProps<typeof ScatterPlot> & {