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
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { DEFAULTS } from '../settings'
2
+ import { DEFAULTS } from '../../../settings'
3
3
  import { extent, min } from 'd3-array'
4
4
  import { interpolatePath } from 'd3-interpolate-path'
5
5
  import { curveMonotoneX, line } from 'd3-shape'
@@ -34,12 +34,20 @@
34
34
  .y((point) => point[1])
35
35
  .curve(curveMonotoneX)
36
36
 
37
+ // Only compute/render/tween the area fill when it is actually visible. Most line
38
+ // plots (e.g. every ScatterPlot line) pass a transparent area, so skipping it
39
+ // avoids a second expensive interpolatePath tween per line.
40
+ let show_area = $derived(
41
+ (Boolean(area_color) && area_color !== `transparent` && area_color !== `none`) ||
42
+ Boolean(area_stroke),
43
+ )
44
+
37
45
  let [x_min, x_max] = $derived(extent(points.map((point) => point[0])))
38
46
  let line_path = $derived(lineGenerator(points) ?? ``)
39
47
  let ymin = $derived(origin[1] ?? min(points.map((point) => point[1])))
40
48
  // Guard against NaN/Infinity in area_path coords (can happen during scale transitions)
41
49
  let area_path = $derived(
42
- line_path && isFinite(x_min ?? NaN) && isFinite(x_max ?? NaN) &&
50
+ show_area && line_path && isFinite(x_min ?? NaN) && isFinite(x_max ?? NaN) &&
43
51
  isFinite(ymin ?? NaN)
44
52
  ? `${line_path}L${x_max},${ymin}L${x_min},${ymin}Z`
45
53
  : ``,
@@ -50,32 +58,41 @@
50
58
  easing: linear,
51
59
  interpolate: interpolatePath,
52
60
  }
61
+ // Path morphing via interpolatePath is costly (parse + resample + re-serialize
62
+ // every frame, per line). When the tween is disabled (duration <= 0) bind the
63
+ // path directly and skip the Tween entirely for zero per-frame cost.
64
+ let tween_disabled = $derived.by(() => {
65
+ const duration = line_tween.duration ?? default_tween.duration
66
+ return typeof duration === `number` && duration <= 0
67
+ })
68
+
53
69
  // Tween objects are stateful - create once, update target via effect
54
70
  // untrack() explicitly captures initial tween config (intentional - config set once at mount)
55
- const tweened_line = new Tween(
56
- ``,
57
- untrack(() => ({ ...default_tween, ...line_tween })),
58
- )
59
- const tweened_area = new Tween(
60
- ``,
61
- untrack(() => ({ ...default_tween, ...line_tween })),
62
- )
71
+ const tween_opts = untrack(() => ({ ...default_tween, ...line_tween }))
72
+ const tweened_line = new Tween(``, tween_opts)
73
+ const tweened_area = new Tween(``, tween_opts)
63
74
 
64
75
  $effect.pre(() => {
76
+ if (tween_disabled) return // paths bind line_path/area_path directly below
65
77
  tweened_line.target = line_path
66
- tweened_area.target = area_path
78
+ if (show_area) tweened_area.target = area_path
67
79
  })
80
+
81
+ let line_d = $derived(tween_disabled ? line_path : tweened_line.current)
82
+ let area_d = $derived(
83
+ show_area ? (tween_disabled ? area_path : tweened_area.current) : ``,
84
+ )
68
85
  </script>
69
86
 
70
87
  <path
71
- d={tweened_line.current}
88
+ d={line_d}
72
89
  stroke={line_color}
73
90
  stroke-width={line_width}
74
91
  stroke-dasharray={line_dash && line_dash !== `solid` ? line_dash : null}
75
92
  fill="none"
76
93
  {...rest}
77
94
  />
78
- <path d={tweened_area.current} fill={area_color} stroke={area_stroke} {...rest} />
95
+ <path d={area_d} fill={area_color} stroke={area_stroke} {...rest} />
79
96
 
80
97
  <style>
81
98
  path {
@@ -1,9 +1,9 @@
1
1
  <script lang="ts">
2
- import { format_value } from '../labels'
2
+ import { format_value } from '../../../labels'
3
3
  import AxisLabel from './AxisLabel.svelte'
4
- import type { Sides } from './layout'
5
- import type { AxisConfig } from './types'
6
- import { DEFAULT_GRID_STYLE } from './types'
4
+ import type { Sides } from '../layout'
5
+ import type { AxisConfig } from '../types'
6
+ import { DEFAULT_GRID_STYLE } from '../types'
7
7
 
8
8
  type Side = `x` | `x2` | `y` | `y2`
9
9
 
@@ -21,6 +21,7 @@
21
21
  show_grid = false,
22
22
  show_baseline = true,
23
23
  tick_label,
24
+ tick_color,
24
25
  domain,
25
26
  unit_on_first_tick = false,
26
27
  label_x,
@@ -38,6 +39,7 @@
38
39
  show_grid?: boolean
39
40
  show_baseline?: boolean // axis spine line (ScatterPlot omits it)
40
41
  tick_label?: (tick: number) => string | null | undefined // custom/categorical label
42
+ tick_color?: (tick: number) => string | undefined // per-tick label color (else axis.color)
41
43
  domain?: [number, number] // when set, cull off-plot ticks and hide out-of-domain labels
42
44
  unit_on_first_tick?: boolean // append axis.unit after the first tick label (ScatterPlot)
43
45
  label_x?: number
@@ -136,7 +138,7 @@
136
138
  y={text_y}
137
139
  text-anchor={text_anchor}
138
140
  dominant-baseline={text_baseline}
139
- fill={text_fill}
141
+ fill={tick_color?.(tick) ?? text_fill}
140
142
  transform={text_transform}
141
143
  >
142
144
  {tick_text(tick)}{#if unit_on_first_tick && idx === 0 && axis.unit}&zwnj;&ensp;{axis
@@ -1,5 +1,5 @@
1
- import type { Sides } from './layout';
2
- import type { AxisConfig } from './types';
1
+ import type { Sides } from '../layout';
2
+ import type { AxisConfig } from '../types';
3
3
  type Side = `x` | `x2` | `y` | `y2`;
4
4
  type $$ComponentProps = {
5
5
  side: Side;
@@ -12,6 +12,7 @@ type $$ComponentProps = {
12
12
  show_grid?: boolean;
13
13
  show_baseline?: boolean;
14
14
  tick_label?: (tick: number) => string | null | undefined;
15
+ tick_color?: (tick: number) => string | undefined;
15
16
  domain?: [number, number];
16
17
  unit_on_first_tick?: boolean;
17
18
  label_x?: number;
@@ -2,16 +2,16 @@
2
2
  // NOTE: Axis config objects (x_axis, x2_axis, y_axis, y2_axis) must be reassigned (not mutated)
3
3
  // to trigger $bindable reactivity propagation to parent components.
4
4
  // Pattern: `x_axis = { ...x_axis, prop: value }` instead of `x_axis.prop = value`
5
- import SettingsSection from '../layout/SettingsSection.svelte'
6
- import DraggablePane from '../overlays/DraggablePane.svelte'
7
- import { DEFAULTS } from '../settings'
5
+ import SettingsSection from '../../../layout/SettingsSection.svelte'
6
+ import ControlPane from './ControlPane.svelte'
7
+ import { DEFAULTS } from '../../../settings'
8
8
  import { format } from 'd3-format'
9
9
  import { timeFormat } from 'd3-time-format'
10
10
  import { tooltip } from 'svelte-multiselect/attachments'
11
- import type { Vec2 } from '../math'
12
- import type { AxisKey, PlotControlsProps } from './index'
13
- import { normalize_y2_sync } from './interactions'
14
- import { get_scale_type_name, is_scale_type_name, is_y2_sync_mode } from './types'
11
+ import type { Vec2 } from '../../../math'
12
+ import type { AxisKey, PlotControlsProps } from '../types'
13
+ import { normalize_y2_sync } from '../interactions'
14
+ import { get_scale_type_name, is_scale_type_name, is_y2_sync_mode } from '../types'
15
15
 
16
16
  let {
17
17
  show_controls = $bindable(false),
@@ -31,7 +31,7 @@
31
31
  has_y2_points = false,
32
32
  show_ticks = false,
33
33
  controls_title = `plot`,
34
- controls_class = ``,
34
+ controls_class = `plot`,
35
35
  toggle_props = {},
36
36
  pane_props = {},
37
37
  }: PlotControlsProps = $props()
@@ -80,10 +80,9 @@
80
80
  if (format_string.startsWith(`%`)) {
81
81
  timeFormat(format_string)(new Date())
82
82
  return true
83
- } else {
84
- format(format_string)(123.456)
85
- return true
86
83
  }
84
+ format(format_string)(123.456)
85
+ return true
87
86
  } catch {
88
87
  return false
89
88
  }
@@ -148,23 +147,12 @@
148
147
  </script>
149
148
 
150
149
  {#if show_controls}
151
- <DraggablePane
152
- bind:show={controls_open}
153
- closed_icon="Settings"
154
- open_icon="Cross"
155
- toggle_props={{
156
- title: `${controls_open ? `Close` : `Open`} ${controls_title} controls`,
157
- ...toggle_props,
158
- class: `${controls_class}-controls-toggle ${toggle_props?.class ?? ``}`,
159
- style:
160
- `position: absolute; top: var(--ctrl-btn-top, 5pt); right: var(--ctrl-btn-right, 1ex);` +
161
- (toggle_props?.style ?? ``),
162
- }}
163
- pane_props={{
164
- ...pane_props,
165
- class: `${controls_class}-controls-pane ${pane_props?.class ?? ``}`,
166
- style: `--pane-padding: 12px; --pane-gap: 4px; ${pane_props?.style ?? ``}`,
167
- }}
150
+ <ControlPane
151
+ bind:controls_open
152
+ controls_class={controls_class}
153
+ title={controls_title}
154
+ {toggle_props}
155
+ {pane_props}
168
156
  >
169
157
  {@render children?.(ctrl_state)}
170
158
 
@@ -533,5 +521,5 @@
533
521
 
534
522
  <!-- Custom controls after base controls -->
535
523
  {@render post_children?.(ctrl_state)}
536
- </DraggablePane>
524
+ </ControlPane>
537
525
  {/if}
@@ -0,0 +1,4 @@
1
+ import type { PlotControlsProps } from '../types';
2
+ declare const PlotControls: import("svelte").Component<PlotControlsProps, {}, "display" | "show_controls" | "controls_open" | "x_axis" | "y_axis" | "x2_axis" | "y2_axis">;
3
+ type PlotControls = ReturnType<typeof PlotControls>;
4
+ export default PlotControls;
@@ -1,13 +1,15 @@
1
1
  <script lang="ts">
2
- import type { LegendItem, Orientation } from './'
3
- import { sanitize_html } from '../sanitize'
4
- import { strip_html } from '../table'
2
+ import { add_alpha } from '../../../colors'
3
+ import type { LegendItem, Orientation } from '../..'
4
+ import { unique_id } from '../utils'
5
+ import { sanitize_html } from '../../../sanitize'
6
+ import { strip_html } from '../../../table'
5
7
  import { onDestroy } from 'svelte'
6
8
  import type { HTMLAttributes } from 'svelte/elements'
7
9
  import { SvelteMap, SvelteSet } from 'svelte/reactivity'
8
10
 
9
11
  // Unique instance ID to prevent gradient ID collisions when multiple legends render on the same page
10
- const instance_id = crypto.randomUUID().slice(0, 8)
12
+ const instance_id = unique_id()
11
13
 
12
14
  let {
13
15
  series_data = [],
@@ -28,6 +30,7 @@
28
30
  on_hover_change,
29
31
  on_item_hover,
30
32
  active_series_idx = null,
33
+ active_fill_idx = null,
31
34
  filterable = true,
32
35
  filter_threshold = 12,
33
36
  draggable = true,
@@ -58,8 +61,9 @@
58
61
  on_drag_end?: (event: MouseEvent) => void
59
62
  // Callback when hover state changes (for placement stability)
60
63
  on_hover_change?: (is_hovered: boolean) => void
61
- on_item_hover?: (series_idx: number | null) => void
64
+ on_item_hover?: (item: LegendItem | null) => void
62
65
  active_series_idx?: number | null
66
+ active_fill_idx?: number | null // highlight the fill legend item with this fill_idx
63
67
  filterable?: boolean
64
68
  filter_threshold?: number
65
69
  draggable?: boolean
@@ -214,10 +218,13 @@
214
218
 
215
219
  {#snippet legend_item(series: LegendItem, indent: boolean = false)}
216
220
  {@const is_fill_item = series.item_type === `fill`}
221
+ {@const is_active = is_fill_item
222
+ ? active_fill_idx === series.fill_idx
223
+ : active_series_idx === series.series_idx}
217
224
  <div
218
225
  class="legend-item"
219
226
  class:hidden={!series.visible}
220
- class:active={active_series_idx === series.series_idx}
227
+ class:active={is_active}
221
228
  class:indented={indent}
222
229
  class:fill-item={is_fill_item}
223
230
  style={item_style}
@@ -237,9 +244,9 @@
237
244
  toggle_item(series)
238
245
  }
239
246
  }}
240
- onmouseenter={() => on_item_hover?.(series.series_idx)}
247
+ onmouseenter={() => on_item_hover?.(series)}
241
248
  onmouseleave={() => on_item_hover?.(null)}
242
- onfocus={() => on_item_hover?.(series.series_idx)}
249
+ onfocus={() => on_item_hover?.(series)}
243
250
  onblur={() => on_item_hover?.(null)}
244
251
  role="button"
245
252
  tabindex="0"
@@ -286,8 +293,8 @@
286
293
  rx="2"
287
294
  fill={gradient
288
295
  ? `url(#${gradient_id})`
289
- : (series.display_style.fill_color ?? `steelblue`)}
290
- fill-opacity={series.display_style.fill_opacity ?? 0.3}
296
+ : add_alpha(series.display_style.fill_color ?? `steelblue`, 1)}
297
+ fill-opacity="0.7"
291
298
  stroke={series.display_style.edge_color ?? `none`}
292
299
  stroke-width="1"
293
300
  />
@@ -454,6 +461,10 @@
454
461
  font-size: var(--plot-legend-font-size, 0.8em);
455
462
  max-width: var(--plot-legend-max-width);
456
463
  width: fit-content;
464
+ /* cap height so legends with many series don't overflow the plot; scroll the rest.
465
+ % resolves against the (position: relative) plot wrapper's height. */
466
+ max-height: var(--plot-legend-max-height, 80%);
467
+ overflow-y: auto;
457
468
  z-index: var(--plot-legend-z-index, 2);
458
469
  box-sizing: border-box;
459
470
  }
@@ -1,4 +1,4 @@
1
- import type { LegendItem, Orientation } from './';
1
+ import type { LegendItem, Orientation } from '../..';
2
2
  import type { HTMLAttributes } from 'svelte/elements';
3
3
  type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `style`> & {
4
4
  series_data: LegendItem[];
@@ -17,8 +17,9 @@ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `style`> & {
17
17
  on_drag?: (event: MouseEvent) => void;
18
18
  on_drag_end?: (event: MouseEvent) => void;
19
19
  on_hover_change?: (is_hovered: boolean) => void;
20
- on_item_hover?: (series_idx: number | null) => void;
20
+ on_item_hover?: (item: LegendItem | null) => void;
21
21
  active_series_idx?: number | null;
22
+ active_fill_idx?: number | null;
22
23
  filterable?: boolean;
23
24
  filter_threshold?: number;
24
25
  draggable?: boolean;
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
- import { luminance } from '../colors'
2
+ import { luminance } from '../../../colors'
3
+ import { constrain_tooltip_position } from '../layout'
3
4
  import type { Snippet } from 'svelte'
4
5
  import type { HTMLAttributes } from 'svelte/elements'
5
6
 
@@ -9,6 +10,8 @@
9
10
  bg_color,
10
11
  offset = { x: 6, y: 0 },
11
12
  fixed = false,
13
+ constrain_to,
14
+ fallback_size,
12
15
  wrapper = $bindable(),
13
16
  children,
14
17
  ...rest
@@ -18,6 +21,8 @@
18
21
  bg_color?: string | null
19
22
  offset?: { x: number; y: number }
20
23
  fixed?: boolean // Use position: fixed (for viewport coords) vs absolute
24
+ constrain_to?: { width: number; height: number } // flip/clamp within these bounds (offset consumed by constraining)
25
+ fallback_size?: { width: number; height: number } // size estimate before first measure
21
26
  wrapper?: HTMLDivElement // Bindable reference for measuring tooltip size
22
27
  children: Snippet
23
28
  } = $props()
@@ -29,6 +34,17 @@
29
34
 
30
35
  // For fixed positioning (viewport coords), flip to opposite side when near viewport edges
31
36
  const pos = $derived.by(() => {
37
+ if (constrain_to) {
38
+ return constrain_tooltip_position(
39
+ x,
40
+ y,
41
+ wrapper?.offsetWidth ?? fallback_size?.width ?? 0,
42
+ wrapper?.offsetHeight ?? fallback_size?.height ?? 0,
43
+ constrain_to.width,
44
+ constrain_to.height,
45
+ { offset_x: offset.x, offset_y: offset.y },
46
+ )
47
+ }
32
48
  const raw_x = x + offset.x
33
49
  const raw_y = y + offset.y
34
50
  if (!fixed) return { x: raw_x, y: raw_y }
@@ -9,6 +9,14 @@ type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
9
9
  y: number;
10
10
  };
11
11
  fixed?: boolean;
12
+ constrain_to?: {
13
+ width: number;
14
+ height: number;
15
+ };
16
+ fallback_size?: {
17
+ width: number;
18
+ height: number;
19
+ };
12
20
  wrapper?: HTMLDivElement;
13
21
  children: Snippet;
14
22
  };
@@ -4,7 +4,7 @@
4
4
  </script>
5
5
 
6
6
  <script lang="ts">
7
- import { sanitize_html } from '../sanitize'
7
+ import { sanitize_html } from '../../../sanitize'
8
8
  import type { HTMLButtonAttributes } from 'svelte/elements'
9
9
 
10
10
  type Option = { key: string; label: string; unit?: string }
@@ -115,12 +115,12 @@
115
115
  btn.setAttribute(`aria-selected`, `true`)
116
116
  selected_btn = btn
117
117
  }
118
- li.appendChild(btn)
119
- ul.appendChild(li)
118
+ li.append(btn)
119
+ ul.append(li)
120
120
  }
121
121
 
122
- portal_el.appendChild(ul)
123
- document.body.appendChild(portal_el)
122
+ portal_el.append(ul)
123
+ document.body.append(portal_el)
124
124
  update_position()
125
125
  dropdown_open = true
126
126
  active_close_fn = close_dropdown
@@ -181,8 +181,8 @@
181
181
  buttons[(idx + 1) % len]?.focus()
182
182
  } else if (evt.key === `ArrowUp`) {
183
183
  evt.preventDefault()
184
- buttons[idx < 0 ? len - 1 : (idx - 1 + len) % len]?.focus()
185
- } else if (evt.key === `Enter` && idx >= 0) {
184
+ buttons[idx === -1 ? len - 1 : (idx - 1 + len) % len]?.focus()
185
+ } else if (evt.key === `Enter` && idx !== -1) {
186
186
  evt.preventDefault()
187
187
  buttons[idx].click()
188
188
  }
@@ -223,6 +223,8 @@
223
223
  border-radius: 3px;
224
224
  padding: 2px 4px;
225
225
  font: inherit;
226
+ /* hug the text: `font: inherit` pulls in the page's loose line-height, inflating the hover bg */
227
+ line-height: 1.2;
226
228
  color: inherit;
227
229
  cursor: pointer;
228
230
  }
@@ -235,6 +237,8 @@
235
237
  }
236
238
  .arrow {
237
239
  font-size: 1.4em;
240
+ /* keep the larger glyph from inflating the trigger height (and thus the hover bg) */
241
+ line-height: 1;
238
242
  opacity: 0.8;
239
243
  }
240
244
  .portal-select-trigger :global(:is(sub, sup)) {
@@ -3,9 +3,9 @@
3
3
  import {
4
4
  calculate_annotation_position,
5
5
  resolve_line_endpoints,
6
- } from './reference-line'
7
- import type { RefLine, RefLineEvent, RefLineStyle } from './types'
8
- import { REF_LINE_STYLE_DEFAULTS } from './types'
6
+ } from '../reference-line'
7
+ import type { RefLine, RefLineEvent, RefLineStyle } from '../types'
8
+ import { REF_LINE_STYLE_DEFAULTS } from '../types'
9
9
 
10
10
  let {
11
11
  ref_line,
@@ -1,4 +1,4 @@
1
- import type { RefLine, RefLineEvent } from './types';
1
+ import type { RefLine, RefLineEvent } from '../types';
2
2
  type $$ComponentProps = {
3
3
  ref_line: RefLine;
4
4
  line_idx: number;
@@ -1,14 +1,14 @@
1
1
  <script lang="ts">
2
2
  // ReferenceLine3D: 3D reference lines for axis-parallel, segments, and extended lines
3
3
  // Uses Line2 for proper variable-width lines (WebGL ignores linewidth on basic lines)
4
- import type { Point3D, Vec3 } from '../math'
4
+ import type { Point3D, Vec3 } from '../../../math'
5
5
  import { T, useThrelte } from '@threlte/core'
6
6
  import * as THREE from 'three'
7
7
  import { Line2 } from 'three/examples/jsm/lines/Line2.js'
8
8
  import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry.js'
9
9
  import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial.js'
10
- import { create_to_threejs, span_or } from './reference-line'
11
- import type { RefLine3D } from './types'
10
+ import { create_to_threejs, span_or } from '../reference-line'
11
+ import type { RefLine3D } from '../types'
12
12
 
13
13
  let { ref_line, scene_size = [10, 10, 5], ranges }: {
14
14
  ref_line: RefLine3D
@@ -102,7 +102,7 @@
102
102
  color: ref_line.style?.color ?? `white`,
103
103
  opacity: ref_line.style?.opacity ?? 1,
104
104
  width: ref_line.style?.width ?? 2,
105
- dashed: !!ref_line.style?.dash,
105
+ dashed: Boolean(ref_line.style?.dash),
106
106
  })
107
107
 
108
108
  // Create Line2 with LineGeometry and LineMaterial for proper variable-width lines
@@ -1,5 +1,5 @@
1
- import type { Vec3 } from '../math';
2
- import type { RefLine3D } from './types';
1
+ import type { Vec3 } from '../../../math';
2
+ import type { RefLine3D } from '../types';
3
3
  type $$ComponentProps = {
4
4
  ref_line: RefLine3D;
5
5
  scene_size?: Vec3;
@@ -1,11 +1,11 @@
1
1
  <script lang="ts">
2
2
  // ReferencePlane: 3D reference planes (axis-aligned, normal-defined, or point-defined)
3
- import type { Vec3 } from '../math'
4
- import { cross_3d, normalize_vec3 } from '../math'
3
+ import type { Vec3 } from '../../../math'
4
+ import { cross_3d, normalize_vec } from '../../../math'
5
5
  import { T } from '@threlte/core'
6
6
  import * as THREE from 'three'
7
- import { create_to_threejs, span_or } from './reference-line'
8
- import type { RefPlane } from './types'
7
+ import { create_to_threejs, span_or } from '../reference-line'
8
+ import type { RefPlane } from '../types'
9
9
 
10
10
  let { ref_plane, scene_size = [10, 10, 5], ranges }: {
11
11
  ref_plane: RefPlane
@@ -82,7 +82,7 @@
82
82
  const v2: Vec3 = [p3[0] - p1[0], p3[1] - p1[1], p3[2] - p1[2]]
83
83
  const cross = cross_3d(v1, v2)
84
84
  if (Math.hypot(...cross) < 1e-9) return null // collinear points
85
- return create_plane_from_normal(normalize_vec3(cross), p1)
85
+ return create_plane_from_normal(normalize_vec(cross), p1)
86
86
  }
87
87
  return null
88
88
  }
@@ -111,9 +111,9 @@
111
111
 
112
112
  // Create plane from normal and point, scaled to cover bounding box
113
113
  function create_plane_from_normal(normal: Vec3, point: Vec3): THREE.BufferGeometry {
114
- const normalized = normalize_vec3(normal)
114
+ const normalized = normalize_vec(normal)
115
115
  // Pick u perpendicular to normal (use axis least aligned with normal)
116
- const u_dir = normalize_vec3(
116
+ const u_dir = normalize_vec(
117
117
  cross_3d(normalized, Math.abs(normalized[0]) < 0.9 ? [1, 0, 0] : [0, 1, 0]),
118
118
  )
119
119
  const v_dir = cross_3d(normalized, u_dir)
@@ -1,5 +1,5 @@
1
- import type { Vec3 } from '../math';
2
- import type { RefPlane } from './types';
1
+ import type { Vec3 } from '../../../math';
2
+ import type { RefPlane } from '../types';
3
3
  type $$ComponentProps = {
4
4
  ref_plane: RefPlane;
5
5
  scene_size?: Vec3;
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
- import type { Vec2 } from '../math'
3
- import type { Sides } from './layout'
4
- import { get_scale_type_name, type ScaleType } from './'
2
+ import type { Vec2 } from '../../../math'
3
+ import type { Sides } from '../layout'
4
+ import { get_scale_type_name, type ScaleType } from '../..'
5
5
 
6
6
  let {
7
7
  display,
@@ -1,6 +1,6 @@
1
- import type { Vec2 } from '../math';
2
- import type { Sides } from './layout';
3
- import { type ScaleType } from './';
1
+ import type { Vec2 } from '../../../math';
2
+ import type { Sides } from '../layout';
3
+ import { type ScaleType } from '../..';
4
4
  type $$ComponentProps = {
5
5
  display: {
6
6
  x_zero_line?: boolean;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import type { Point2D } from '../math'
2
+ import type { Point2D } from '../../../math'
3
3
 
4
4
  let { start, current }: { start: Point2D | null; current: Point2D | null } = $props()
5
5
  </script>
@@ -1,4 +1,4 @@
1
- import type { Point2D } from '../math';
1
+ import type { Point2D } from '../../../math';
2
2
  type $$ComponentProps = {
3
3
  start: Point2D | null;
4
4
  current: Point2D | null;
@@ -0,0 +1,17 @@
1
+ export { default as AxisLabel } from './AxisLabel.svelte';
2
+ export { default as ColorBar } from './ColorBar.svelte';
3
+ export { default as ColorScaleSelect } from './ColorScaleSelect.svelte';
4
+ export { default as ControlPane } from './ControlPane.svelte';
5
+ export { default as FillArea } from './FillArea.svelte';
6
+ export { default as InteractiveAxisLabel } from './InteractiveAxisLabel.svelte';
7
+ export { default as Line } from './Line.svelte';
8
+ export { default as PlotAxis } from './PlotAxis.svelte';
9
+ export { default as PlotControls } from './PlotControls.svelte';
10
+ export { default as PlotLegend } from './PlotLegend.svelte';
11
+ export { default as PlotTooltip } from './PlotTooltip.svelte';
12
+ export { default as PortalSelect } from './PortalSelect.svelte';
13
+ export { default as ReferenceLine } from './ReferenceLine.svelte';
14
+ export { default as ReferenceLine3D } from './ReferenceLine3D.svelte';
15
+ export { default as ReferencePlane } from './ReferencePlane.svelte';
16
+ export { default as ZeroLines } from './ZeroLines.svelte';
17
+ export { default as ZoomRect } from './ZoomRect.svelte';
@@ -0,0 +1,17 @@
1
+ export { default as AxisLabel } from './AxisLabel.svelte';
2
+ export { default as ColorBar } from './ColorBar.svelte';
3
+ export { default as ColorScaleSelect } from './ColorScaleSelect.svelte';
4
+ export { default as ControlPane } from './ControlPane.svelte';
5
+ export { default as FillArea } from './FillArea.svelte';
6
+ export { default as InteractiveAxisLabel } from './InteractiveAxisLabel.svelte';
7
+ export { default as Line } from './Line.svelte';
8
+ export { default as PlotAxis } from './PlotAxis.svelte';
9
+ export { default as PlotControls } from './PlotControls.svelte';
10
+ export { default as PlotLegend } from './PlotLegend.svelte';
11
+ export { default as PlotTooltip } from './PlotTooltip.svelte';
12
+ export { default as PortalSelect } from './PortalSelect.svelte';
13
+ export { default as ReferenceLine } from './ReferenceLine.svelte';
14
+ export { default as ReferenceLine3D } from './ReferenceLine3D.svelte';
15
+ export { default as ReferencePlane } from './ReferencePlane.svelte';
16
+ export { default as ZeroLines } from './ZeroLines.svelte';
17
+ export { default as ZoomRect } from './ZoomRect.svelte';