matterviz 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/dist/FilePicker.svelte +37 -20
  2. package/dist/Icon.svelte +2 -2
  3. package/dist/MillerIndexInput.svelte +60 -0
  4. package/dist/MillerIndexInput.svelte.d.ts +7 -0
  5. package/dist/app.css +38 -2
  6. package/dist/brillouin/BrillouinZone.svelte +20 -62
  7. package/dist/brillouin/BrillouinZone.svelte.d.ts +1 -1
  8. package/dist/brillouin/BrillouinZoneExportPane.svelte +12 -20
  9. package/dist/brillouin/BrillouinZoneScene.svelte +2 -2
  10. package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +1 -1
  11. package/dist/chempot-diagram/ChemPotDiagram.svelte +192 -0
  12. package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +13 -0
  13. package/dist/chempot-diagram/ChemPotDiagram2D.svelte +677 -0
  14. package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +16 -0
  15. package/dist/chempot-diagram/ChemPotDiagram3D.svelte +2688 -0
  16. package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +16 -0
  17. package/dist/chempot-diagram/ChemPotScene3D.svelte +8 -0
  18. package/dist/chempot-diagram/ChemPotScene3D.svelte.d.ts +7 -0
  19. package/dist/chempot-diagram/color.d.ts +10 -0
  20. package/dist/chempot-diagram/color.js +33 -0
  21. package/dist/chempot-diagram/compute.d.ts +38 -0
  22. package/dist/chempot-diagram/compute.js +650 -0
  23. package/dist/chempot-diagram/index.d.ts +5 -0
  24. package/dist/chempot-diagram/index.js +5 -0
  25. package/dist/chempot-diagram/pointer.d.ts +16 -0
  26. package/dist/chempot-diagram/pointer.js +40 -0
  27. package/dist/chempot-diagram/temperature.d.ts +15 -0
  28. package/dist/chempot-diagram/temperature.js +37 -0
  29. package/dist/chempot-diagram/types.d.ts +83 -0
  30. package/dist/chempot-diagram/types.js +27 -0
  31. package/dist/colors/index.d.ts +3 -1
  32. package/dist/colors/index.js +4 -0
  33. package/dist/composition/BarChart.svelte +13 -22
  34. package/dist/composition/BubbleChart.svelte +5 -3
  35. package/dist/composition/FormulaFilter.svelte +770 -90
  36. package/dist/composition/FormulaFilter.svelte.d.ts +37 -1
  37. package/dist/composition/PieChart.svelte +43 -18
  38. package/dist/composition/PieChart.svelte.d.ts +1 -1
  39. package/dist/constants.d.ts +1 -0
  40. package/dist/constants.js +2 -0
  41. package/dist/convex-hull/ConvexHull.svelte +14 -1
  42. package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -1
  43. package/dist/convex-hull/ConvexHull2D.svelte +14 -45
  44. package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
  45. package/dist/convex-hull/ConvexHull3D.svelte +396 -134
  46. package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
  47. package/dist/convex-hull/ConvexHull4D.svelte +93 -42
  48. package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
  49. package/dist/convex-hull/ConvexHullControls.svelte +94 -31
  50. package/dist/convex-hull/ConvexHullControls.svelte.d.ts +4 -2
  51. package/dist/convex-hull/ConvexHullStats.svelte +697 -128
  52. package/dist/convex-hull/ConvexHullStats.svelte.d.ts +6 -1
  53. package/dist/convex-hull/ConvexHullTooltip.svelte +1 -0
  54. package/dist/convex-hull/GasPressureControls.svelte +72 -38
  55. package/dist/convex-hull/GasPressureControls.svelte.d.ts +2 -1
  56. package/dist/convex-hull/TemperatureSlider.svelte +46 -19
  57. package/dist/convex-hull/TemperatureSlider.svelte.d.ts +2 -1
  58. package/dist/convex-hull/demo-temperature.d.ts +6 -0
  59. package/dist/convex-hull/demo-temperature.js +36 -0
  60. package/dist/convex-hull/gas-thermodynamics.js +16 -5
  61. package/dist/convex-hull/helpers.d.ts +7 -1
  62. package/dist/convex-hull/helpers.js +45 -15
  63. package/dist/convex-hull/index.d.ts +15 -1
  64. package/dist/convex-hull/index.js +1 -0
  65. package/dist/convex-hull/thermodynamics.d.ts +8 -21
  66. package/dist/convex-hull/thermodynamics.js +106 -17
  67. package/dist/convex-hull/types.d.ts +7 -0
  68. package/dist/convex-hull/types.js +11 -0
  69. package/dist/coordination/CoordinationBarPlot.svelte +29 -46
  70. package/dist/element/BohrAtom.svelte +1 -1
  71. package/dist/element/data.js +2 -14
  72. package/dist/element/data.json.gz +0 -0
  73. package/dist/element/index.d.ts +1 -1
  74. package/dist/element/index.js +1 -0
  75. package/dist/element/types.d.ts +1 -0
  76. package/dist/fermi-surface/FermiSurface.svelte +21 -65
  77. package/dist/fermi-surface/FermiSurface.svelte.d.ts +1 -1
  78. package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
  79. package/dist/fermi-surface/FermiSurfaceScene.svelte +1 -1
  80. package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +1 -1
  81. package/dist/fermi-surface/compute.js +1 -21
  82. package/dist/fermi-surface/marching-cubes.d.ts +2 -13
  83. package/dist/fermi-surface/marching-cubes.js +2 -519
  84. package/dist/fermi-surface/parse.js +17 -23
  85. package/dist/heatmap-matrix/HeatmapMatrix.svelte +1273 -0
  86. package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +110 -0
  87. package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +171 -0
  88. package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +31 -0
  89. package/dist/heatmap-matrix/index.d.ts +53 -0
  90. package/dist/heatmap-matrix/index.js +100 -0
  91. package/dist/heatmap-matrix/shared.d.ts +2 -0
  92. package/dist/heatmap-matrix/shared.js +4 -0
  93. package/dist/icons.d.ts +119 -0
  94. package/dist/icons.js +119 -0
  95. package/dist/index.d.ts +6 -1
  96. package/dist/index.js +6 -1
  97. package/dist/io/export.js +15 -3
  98. package/dist/io/file-drop.d.ts +7 -0
  99. package/dist/io/file-drop.js +43 -0
  100. package/dist/io/index.d.ts +2 -2
  101. package/dist/io/index.js +2 -112
  102. package/dist/io/types.d.ts +1 -0
  103. package/dist/io/url-drop.d.ts +2 -0
  104. package/dist/io/url-drop.js +118 -0
  105. package/dist/isosurface/Isosurface.svelte +231 -0
  106. package/dist/isosurface/Isosurface.svelte.d.ts +8 -0
  107. package/dist/isosurface/IsosurfaceControls.svelte +273 -0
  108. package/dist/isosurface/IsosurfaceControls.svelte.d.ts +9 -0
  109. package/dist/isosurface/index.d.ts +5 -0
  110. package/dist/isosurface/index.js +6 -0
  111. package/dist/isosurface/parse.d.ts +6 -0
  112. package/dist/isosurface/parse.js +548 -0
  113. package/dist/isosurface/slice.d.ts +11 -0
  114. package/dist/isosurface/slice.js +145 -0
  115. package/dist/isosurface/types.d.ts +55 -0
  116. package/dist/isosurface/types.js +178 -0
  117. package/dist/labels.d.ts +2 -1
  118. package/dist/labels.js +1 -0
  119. package/dist/layout/InfoTag.svelte +62 -62
  120. package/dist/layout/SubpageGrid.svelte +74 -0
  121. package/dist/layout/SubpageGrid.svelte.d.ts +14 -0
  122. package/dist/layout/index.d.ts +1 -0
  123. package/dist/layout/index.js +1 -0
  124. package/dist/layout/json-tree/JsonNode.svelte +226 -53
  125. package/dist/layout/json-tree/JsonTree.svelte +425 -51
  126. package/dist/layout/json-tree/JsonTree.svelte.d.ts +1 -1
  127. package/dist/layout/json-tree/JsonValue.svelte +218 -97
  128. package/dist/layout/json-tree/types.d.ts +27 -2
  129. package/dist/layout/json-tree/utils.d.ts +14 -1
  130. package/dist/layout/json-tree/utils.js +254 -0
  131. package/dist/marching-cubes.d.ts +14 -0
  132. package/dist/marching-cubes.js +519 -0
  133. package/dist/math.d.ts +8 -0
  134. package/dist/math.js +374 -7
  135. package/dist/overlays/ContextMenu.svelte +3 -2
  136. package/dist/overlays/DraggablePane.svelte +163 -58
  137. package/dist/overlays/DraggablePane.svelte.d.ts +2 -0
  138. package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +232 -77
  139. package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +6 -2
  140. package/dist/phase-diagram/PhaseDiagramControls.svelte +32 -11
  141. package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +3 -2
  142. package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +103 -0
  143. package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +15 -0
  144. package/dist/phase-diagram/PhaseDiagramExportPane.svelte +102 -95
  145. package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +7 -0
  146. package/dist/phase-diagram/PhaseDiagramTooltip.svelte +100 -26
  147. package/dist/phase-diagram/PhaseDiagramTooltip.svelte.d.ts +6 -3
  148. package/dist/phase-diagram/index.d.ts +2 -0
  149. package/dist/phase-diagram/index.js +2 -0
  150. package/dist/phase-diagram/svg-to-diagram.d.ts +2 -0
  151. package/dist/phase-diagram/svg-to-diagram.js +865 -0
  152. package/dist/phase-diagram/types.d.ts +10 -0
  153. package/dist/phase-diagram/utils.d.ts +7 -4
  154. package/dist/phase-diagram/utils.js +149 -59
  155. package/dist/plot/AxisLabel.svelte +26 -0
  156. package/dist/plot/AxisLabel.svelte.d.ts +16 -0
  157. package/dist/plot/BarPlot.svelte +473 -228
  158. package/dist/plot/BarPlot.svelte.d.ts +3 -3
  159. package/dist/plot/BarPlotControls.svelte +3 -2
  160. package/dist/plot/BarPlotControls.svelte.d.ts +1 -1
  161. package/dist/plot/ColorBar.svelte +54 -54
  162. package/dist/plot/ColorBar.svelte.d.ts +1 -1
  163. package/dist/plot/ElementScatter.svelte +4 -3
  164. package/dist/plot/FillArea.svelte +4 -1
  165. package/dist/plot/Histogram.svelte +320 -230
  166. package/dist/plot/Histogram.svelte.d.ts +2 -2
  167. package/dist/plot/HistogramControls.svelte +29 -10
  168. package/dist/plot/HistogramControls.svelte.d.ts +6 -2
  169. package/dist/plot/InteractiveAxisLabel.svelte.d.ts +2 -2
  170. package/dist/plot/PlotControls.svelte +109 -27
  171. package/dist/plot/PlotControls.svelte.d.ts +1 -1
  172. package/dist/plot/PlotLegend.svelte +1 -1
  173. package/dist/plot/PortalSelect.svelte +2 -1
  174. package/dist/plot/ReferenceLine.svelte +2 -1
  175. package/dist/plot/ReferenceLine.svelte.d.ts +1 -0
  176. package/dist/plot/ReferencePlane.svelte +1 -3
  177. package/dist/plot/ScatterPlot.svelte +343 -209
  178. package/dist/plot/ScatterPlot.svelte.d.ts +3 -3
  179. package/dist/plot/ScatterPlot3D.svelte.d.ts +2 -2
  180. package/dist/plot/ScatterPlot3DControls.svelte +203 -250
  181. package/dist/plot/ScatterPlot3DScene.svelte +4 -7
  182. package/dist/plot/ScatterPlot3DScene.svelte.d.ts +2 -2
  183. package/dist/plot/ScatterPlotControls.svelte +95 -55
  184. package/dist/plot/ScatterPlotControls.svelte.d.ts +1 -1
  185. package/dist/plot/ZeroLines.svelte +44 -0
  186. package/dist/plot/ZeroLines.svelte.d.ts +32 -0
  187. package/dist/plot/ZoomRect.svelte +21 -0
  188. package/dist/plot/ZoomRect.svelte.d.ts +8 -0
  189. package/dist/plot/axis-utils.d.ts +1 -1
  190. package/dist/plot/data-cleaning.js +1 -5
  191. package/dist/plot/index.d.ts +6 -2
  192. package/dist/plot/index.js +6 -2
  193. package/dist/plot/interactions.d.ts +8 -10
  194. package/dist/plot/interactions.js +10 -19
  195. package/dist/plot/layout.d.ts +7 -1
  196. package/dist/plot/layout.js +12 -4
  197. package/dist/plot/reference-line.d.ts +4 -21
  198. package/dist/plot/reference-line.js +7 -81
  199. package/dist/plot/types.d.ts +42 -17
  200. package/dist/plot/types.js +10 -0
  201. package/dist/plot/utils/label-placement.js +14 -11
  202. package/dist/plot/utils.d.ts +1 -0
  203. package/dist/plot/utils.js +14 -0
  204. package/dist/rdf/RdfPlot.svelte +55 -66
  205. package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
  206. package/dist/rdf/index.d.ts +1 -1
  207. package/dist/rdf/index.js +1 -1
  208. package/dist/settings.d.ts +5 -0
  209. package/dist/settings.js +37 -3
  210. package/dist/spectral/Bands.svelte +515 -143
  211. package/dist/spectral/Bands.svelte.d.ts +22 -2
  212. package/dist/spectral/helpers.d.ts +23 -1
  213. package/dist/spectral/helpers.js +65 -9
  214. package/dist/spectral/types.d.ts +2 -0
  215. package/dist/structure/AtomLegend.svelte +31 -10
  216. package/dist/structure/AtomLegend.svelte.d.ts +1 -1
  217. package/dist/structure/CellSelect.svelte +92 -22
  218. package/dist/structure/Lattice.svelte +2 -0
  219. package/dist/structure/Structure.svelte +716 -173
  220. package/dist/structure/Structure.svelte.d.ts +7 -2
  221. package/dist/structure/StructureControls.svelte +26 -14
  222. package/dist/structure/StructureControls.svelte.d.ts +5 -1
  223. package/dist/structure/StructureInfoPane.svelte +7 -1
  224. package/dist/structure/StructureScene.svelte +386 -95
  225. package/dist/structure/StructureScene.svelte.d.ts +15 -4
  226. package/dist/structure/atom-properties.d.ts +6 -2
  227. package/dist/structure/atom-properties.js +38 -25
  228. package/dist/structure/export.js +10 -7
  229. package/dist/structure/ferrox-wasm-types.d.ts +3 -2
  230. package/dist/structure/ferrox-wasm-types.js +0 -3
  231. package/dist/structure/ferrox-wasm.d.ts +3 -2
  232. package/dist/structure/ferrox-wasm.js +1 -2
  233. package/dist/structure/index.d.ts +7 -0
  234. package/dist/structure/index.js +22 -0
  235. package/dist/structure/parse.js +19 -16
  236. package/dist/structure/partial-occupancy.d.ts +25 -0
  237. package/dist/structure/partial-occupancy.js +102 -0
  238. package/dist/structure/validation.js +6 -3
  239. package/dist/symmetry/SymmetryStats.svelte +18 -4
  240. package/dist/symmetry/WyckoffTable.svelte +18 -10
  241. package/dist/symmetry/index.d.ts +7 -4
  242. package/dist/symmetry/index.js +83 -18
  243. package/dist/table/HeatmapTable.svelte +468 -69
  244. package/dist/table/HeatmapTable.svelte.d.ts +13 -1
  245. package/dist/table/ToggleMenu.svelte +291 -44
  246. package/dist/table/ToggleMenu.svelte.d.ts +4 -1
  247. package/dist/table/index.d.ts +3 -0
  248. package/dist/tooltip/index.d.ts +1 -1
  249. package/dist/tooltip/index.js +1 -0
  250. package/dist/trajectory/Trajectory.svelte +147 -145
  251. package/dist/trajectory/TrajectoryExportPane.svelte +13 -9
  252. package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +1 -1
  253. package/dist/trajectory/constants.d.ts +6 -0
  254. package/dist/trajectory/constants.js +7 -0
  255. package/dist/trajectory/extract.js +3 -5
  256. package/dist/trajectory/format-detect.d.ts +9 -0
  257. package/dist/trajectory/format-detect.js +76 -0
  258. package/dist/trajectory/frame-reader.d.ts +17 -0
  259. package/dist/trajectory/frame-reader.js +339 -0
  260. package/dist/trajectory/helpers.d.ts +15 -0
  261. package/dist/trajectory/helpers.js +187 -0
  262. package/dist/trajectory/index.d.ts +1 -0
  263. package/dist/trajectory/index.js +11 -4
  264. package/dist/trajectory/parse/ase.d.ts +2 -0
  265. package/dist/trajectory/parse/ase.js +76 -0
  266. package/dist/trajectory/parse/hdf5.d.ts +2 -0
  267. package/dist/trajectory/parse/hdf5.js +121 -0
  268. package/dist/trajectory/parse/index.d.ts +12 -0
  269. package/dist/trajectory/parse/index.js +304 -0
  270. package/dist/trajectory/parse/lammps.d.ts +5 -0
  271. package/dist/trajectory/parse/lammps.js +169 -0
  272. package/dist/trajectory/parse/vasp.d.ts +2 -0
  273. package/dist/trajectory/parse/vasp.js +65 -0
  274. package/dist/trajectory/parse/xyz.d.ts +2 -0
  275. package/dist/trajectory/parse/xyz.js +109 -0
  276. package/dist/trajectory/types.d.ts +11 -0
  277. package/dist/trajectory/types.js +1 -0
  278. package/dist/utils.d.ts +2 -0
  279. package/dist/utils.js +4 -0
  280. package/dist/xrd/XrdPlot.svelte +6 -4
  281. package/dist/xrd/calc-xrd.js +0 -1
  282. package/package.json +33 -23
  283. package/readme.md +4 -4
  284. package/dist/trajectory/parse.d.ts +0 -42
  285. package/dist/trajectory/parse.js +0 -1267
  286. /package/dist/element/{data.json.d.ts → data.json.gz.d.ts} +0 -0
@@ -4,8 +4,16 @@ import { DEFAULTS } from '../settings';
4
4
  import { tooltip } from 'svelte-multiselect/attachments';
5
5
  // Unique ID prefix to avoid conflicts when multiple instances on same page
6
6
  const uid = crypto.randomUUID().slice(0, 8);
7
- let { series = [], x_axis = $bindable({}), y_axis = $bindable({}), y2_axis = $bindable({}), display = $bindable({}), styles = $bindable({}), selected_series_idx = $bindable(0), on_touch, children, ...rest } = $props();
8
- let has_multiple_series = $derived(series.filter(Boolean).length > 1);
7
+ let { series = [], x_axis = $bindable({}), x2_axis = $bindable({}), y_axis = $bindable({}), y2_axis = $bindable({}), display = $bindable({}), styles = $bindable({}), selected_series_idx = $bindable(0), on_touch, children, ...rest } = $props();
8
+ let non_null_series = $derived(series.filter((srs) => srs != null));
9
+ let visible_series = $derived(non_null_series.filter((srs) => (srs.visible ?? true)));
10
+ let has_multiple_series = $derived(non_null_series.length > 1);
11
+ // Derive what marker types are present, and whether color/size are data-driven
12
+ const markers_include = (mode) => visible_series.some((srs) => (srs?.markers ?? `line+points`).includes(mode));
13
+ let has_any_lines = $derived(markers_include(`line`));
14
+ let has_any_points = $derived(markers_include(`points`));
15
+ let has_color_data = $derived(visible_series.some((srs) => srs?.color_values?.some((val) => val != null)));
16
+ let has_size_data = $derived(visible_series.some((srs) => srs?.size_values?.some((val) => val != null)));
9
17
  $effect(() => {
10
18
  styles.show_points ??= DEFAULTS.scatter.show_points;
11
19
  styles.show_lines ??= DEFAULTS.scatter.show_lines;
@@ -17,30 +25,52 @@ const touch = ({ target }) => {
17
25
  };
18
26
  </script>
19
27
 
20
- <PlotControls bind:x_axis bind:y_axis bind:y2_axis bind:display show_controls {...rest}>
21
- {@render children?.({ x_axis, y_axis, y2_axis, display, styles, selected_series_idx })}
22
- <SettingsSection
23
- title="Markers"
24
- current_values={{ show_points: styles.show_points, show_lines: styles.show_lines }}
25
- on_reset={() => {
26
- styles.show_points = DEFAULTS.scatter.show_points
27
- styles.show_lines = DEFAULTS.scatter.show_lines
28
- }}
29
- style="display: flex; flex-wrap: wrap; gap: 1ex"
30
- >
31
- <label
32
- {@attach tooltip({ content: `Toggle visibility of data points in the scatter plot` })}
28
+ <PlotControls
29
+ bind:x_axis
30
+ bind:x2_axis
31
+ bind:y_axis
32
+ bind:y2_axis
33
+ bind:display
34
+ show_controls
35
+ {...rest}
36
+ >
37
+ {@render children?.({
38
+ x_axis,
39
+ x2_axis,
40
+ y_axis,
41
+ y2_axis,
42
+ display,
43
+ styles,
44
+ selected_series_idx,
45
+ })}
46
+ {#if has_any_points || has_any_lines}
47
+ <SettingsSection
48
+ title="Markers"
49
+ current_values={{ show_points: styles.show_points, show_lines: styles.show_lines }}
50
+ on_reset={() => {
51
+ styles.show_points = DEFAULTS.scatter.show_points
52
+ styles.show_lines = DEFAULTS.scatter.show_lines
53
+ }}
54
+ style="display: flex; flex-wrap: wrap; gap: 1ex"
33
55
  >
34
- <input type="checkbox" bind:checked={styles.show_points} /> Show points
35
- </label>
36
- <label
37
- {@attach tooltip({
38
- content: `Toggle visibility of connecting lines between data points`,
39
- })}
40
- >
41
- <input type="checkbox" bind:checked={styles.show_lines} /> Show lines
42
- </label>
43
- </SettingsSection>
56
+ {#if has_any_points}
57
+ <label
58
+ {@attach tooltip({ content: `Toggle visibility of data points in the scatter plot` })}
59
+ >
60
+ <input type="checkbox" bind:checked={styles.show_points} /> Show points
61
+ </label>
62
+ {/if}
63
+ {#if has_any_lines}
64
+ <label
65
+ {@attach tooltip({
66
+ content: `Toggle visibility of connecting lines between data points`,
67
+ })}
68
+ >
69
+ <input type="checkbox" bind:checked={styles.show_lines} /> Show lines
70
+ </label>
71
+ {/if}
72
+ </SettingsSection>
73
+ {/if}
44
74
 
45
75
  {#snippet post_children()}
46
76
  <!-- Series Selection (for multi-series style controls) -->
@@ -59,8 +89,8 @@ const touch = ({ target }) => {
59
89
  </div>
60
90
  {/if}
61
91
 
62
- <!-- Point Style Controls -->
63
- {#if styles.show_points}
92
+ <!-- Point Style Controls: only when points exist and are visible -->
93
+ {#if has_any_points && styles.show_points}
64
94
  <SettingsSection
65
95
  title="Point Style"
66
96
  current_values={styles.point ?? {}}
@@ -71,28 +101,36 @@ const touch = ({ target }) => {
71
101
  oninput={touch}
72
102
  >
73
103
  {#if styles.point}
74
- <div class="pane-row" data-key="point.size">
75
- <label for="{uid}-point-size">Size:</label>
76
- <input
77
- id="{uid}-point-size"
78
- type="range"
79
- min="1"
80
- max="20"
81
- step="0.5"
82
- bind:value={styles.point.size}
83
- />
84
- <input
85
- type="number"
86
- min="1"
87
- max="20"
88
- step="0.5"
89
- bind:value={styles.point.size}
90
- />
91
- </div>
92
- <div class="pane-row" data-key="point.color">
93
- <label for="{uid}-point-color">Color:</label>
94
- <input id="{uid}-point-color" type="color" bind:value={styles.point.color} />
95
- </div>
104
+ {#if !has_size_data}
105
+ <div class="pane-row" data-key="point.size">
106
+ <label for="{uid}-point-size">Size:</label>
107
+ <input
108
+ id="{uid}-point-size"
109
+ type="range"
110
+ min="1"
111
+ max="20"
112
+ step="0.5"
113
+ bind:value={styles.point.size}
114
+ />
115
+ <input
116
+ type="number"
117
+ min="1"
118
+ max="20"
119
+ step="0.5"
120
+ bind:value={styles.point.size}
121
+ />
122
+ </div>
123
+ {/if}
124
+ {#if !has_color_data}
125
+ <div class="pane-row" data-key="point.color">
126
+ <label for="{uid}-point-color">Color:</label>
127
+ <input
128
+ id="{uid}-point-color"
129
+ type="color"
130
+ bind:value={styles.point.color}
131
+ />
132
+ </div>
133
+ {/if}
96
134
  <div class="pane-row" data-key="point.opacity">
97
135
  <label for="{uid}-point-opacity">Opacity:</label>
98
136
  <input
@@ -159,8 +197,8 @@ const touch = ({ target }) => {
159
197
  </SettingsSection>
160
198
  {/if}
161
199
 
162
- <!-- Line Style Controls -->
163
- {#if styles.show_lines}
200
+ <!-- Line Style Controls: only when lines exist and are visible -->
201
+ {#if has_any_lines && styles.show_lines}
164
202
  <SettingsSection
165
203
  title="Line Style"
166
204
  current_values={styles.line ?? {}}
@@ -189,10 +227,12 @@ const touch = ({ target }) => {
189
227
  bind:value={styles.line.width}
190
228
  />
191
229
  </div>
192
- <div class="pane-row" data-key="line.color">
193
- <label for="{uid}-line-color">Color:</label>
194
- <input id="{uid}-line-color" type="color" bind:value={styles.line.color} />
195
- </div>
230
+ {#if !has_color_data}
231
+ <div class="pane-row" data-key="line.color">
232
+ <label for="{uid}-line-color">Color:</label>
233
+ <input id="{uid}-line-color" type="color" bind:value={styles.line.color} />
234
+ </div>
235
+ {/if}
196
236
  <div class="pane-row" data-key="line.opacity">
197
237
  <label for="{uid}-line-opacity">Opacity:</label>
198
238
  <input
@@ -12,6 +12,6 @@ type $$ComponentProps = Omit<PlotControlsProps, `children` | `post_children`> &
12
12
  } & Required<PlotConfig>
13
13
  ]>;
14
14
  };
15
- declare const ScatterPlotControls: import("svelte").Component<$$ComponentProps, {}, "display" | "x_axis" | "y_axis" | "y2_axis" | "selected_series_idx" | "styles">;
15
+ declare const ScatterPlotControls: import("svelte").Component<$$ComponentProps, {}, "display" | "x_axis" | "x2_axis" | "y_axis" | "y2_axis" | "selected_series_idx" | "styles">;
16
16
  type ScatterPlotControls = ReturnType<typeof ScatterPlotControls>;
17
17
  export default ScatterPlotControls;
@@ -0,0 +1,44 @@
1
+ <script lang="ts">import { get_scale_type_name } from './';
2
+ let { display, x_scale_fn, x2_scale_fn, y_scale_fn, y2_scale_fn, x_range, x2_range, y_range, y2_range, x_scale_type, x2_scale_type, y_scale_type, y2_scale_type, x_is_time = false, x2_is_time = false, has_x2 = false, has_y2 = false, width, height, pad, } = $props();
3
+ const spans_zero = (range) => Math.min(range[0], range[1]) <= 0 && Math.max(range[0], range[1]) >= 0;
4
+ </script>
5
+
6
+ {#if display.x_zero_line && get_scale_type_name(x_scale_type) !== `log` &&
7
+ !x_is_time && spans_zero(x_range)}
8
+ {@const zero_x = x_scale_fn(0)}
9
+ {#if isFinite(zero_x)}
10
+ <line class="zero-line" x1={zero_x} x2={zero_x} y1={pad.t} y2={height - pad.b} />
11
+ {/if}
12
+ {/if}
13
+
14
+ {#if display.x2_zero_line && has_x2 && x2_scale_fn && x2_range &&
15
+ get_scale_type_name(x2_scale_type) !== `log` && !x2_is_time && spans_zero(x2_range)}
16
+ {@const zero_x2 = x2_scale_fn(0)}
17
+ {#if isFinite(zero_x2)}
18
+ <line class="zero-line" x1={zero_x2} x2={zero_x2} y1={pad.t} y2={height - pad.b} />
19
+ {/if}
20
+ {/if}
21
+
22
+ {#if display.y_zero_line && get_scale_type_name(y_scale_type) !== `log` &&
23
+ spans_zero(y_range)}
24
+ {@const zero_y = y_scale_fn(0)}
25
+ {#if isFinite(zero_y)}
26
+ <line class="zero-line" x1={pad.l} x2={width - pad.r} y1={zero_y} y2={zero_y} />
27
+ {/if}
28
+ {/if}
29
+
30
+ {#if display.y2_zero_line && has_y2 && y2_scale_fn && y2_range &&
31
+ get_scale_type_name(y2_scale_type) !== `log` && spans_zero(y2_range)}
32
+ {@const zero_y2 = y2_scale_fn(0)}
33
+ {#if isFinite(zero_y2)}
34
+ <line class="zero-line" x1={pad.l} x2={width - pad.r} y1={zero_y2} y2={zero_y2} />
35
+ {/if}
36
+ {/if}
37
+
38
+ <style>
39
+ .zero-line {
40
+ stroke: var(--plot-zero-line-color, light-dark(black, white));
41
+ stroke-width: var(--plot-zero-line-width, 1);
42
+ opacity: var(--plot-zero-line-opacity, 0.3);
43
+ }
44
+ </style>
@@ -0,0 +1,32 @@
1
+ import type { Vec2 } from '../math';
2
+ import { type ScaleType, type Sides } from './';
3
+ type $$ComponentProps = {
4
+ display: {
5
+ x_zero_line?: boolean;
6
+ x2_zero_line?: boolean;
7
+ y_zero_line?: boolean;
8
+ y2_zero_line?: boolean;
9
+ };
10
+ x_scale_fn: (val: number) => number;
11
+ x2_scale_fn?: (val: number) => number;
12
+ y_scale_fn: (val: number) => number;
13
+ y2_scale_fn?: (val: number) => number;
14
+ x_range: Vec2;
15
+ x2_range?: Vec2;
16
+ y_range: Vec2;
17
+ y2_range?: Vec2;
18
+ x_scale_type?: ScaleType;
19
+ x2_scale_type?: ScaleType;
20
+ y_scale_type?: ScaleType;
21
+ y2_scale_type?: ScaleType;
22
+ x_is_time?: boolean;
23
+ x2_is_time?: boolean;
24
+ has_x2?: boolean;
25
+ has_y2?: boolean;
26
+ width: number;
27
+ height: number;
28
+ pad: Required<Sides>;
29
+ };
30
+ declare const ZeroLines: import("svelte").Component<$$ComponentProps, {}, "">;
31
+ type ZeroLines = ReturnType<typeof ZeroLines>;
32
+ export default ZeroLines;
@@ -0,0 +1,21 @@
1
+ <script lang="ts">let { start, current } = $props();
2
+ export {};
3
+ </script>
4
+
5
+ {#if start && current && isFinite(start.x) && isFinite(start.y) &&
6
+ isFinite(current.x) && isFinite(current.y)}
7
+ {@const x = Math.min(start.x, current.x)}
8
+ {@const y = Math.min(start.y, current.y)}
9
+ {@const rect_width = Math.abs(start.x - current.x)}
10
+ {@const rect_height = Math.abs(start.y - current.y)}
11
+ <rect class="zoom-rect" {x} {y} width={rect_width} height={rect_height} />
12
+ {/if}
13
+
14
+ <style>
15
+ .zoom-rect {
16
+ fill: var(--plot-zoom-rect-fill, rgba(100, 100, 255, 0.2));
17
+ stroke: var(--plot-zoom-rect-stroke, rgba(100, 100, 255, 0.8));
18
+ stroke-width: var(--plot-zoom-rect-stroke-width, 1);
19
+ pointer-events: none;
20
+ }
21
+ </style>
@@ -0,0 +1,8 @@
1
+ import type { XyObj } from './';
2
+ type $$ComponentProps = {
3
+ start: XyObj | null;
4
+ current: XyObj | null;
5
+ };
6
+ declare const ZoomRect: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type ZoomRect = ReturnType<typeof ZoomRect>;
8
+ export default ZoomRect;
@@ -1,5 +1,5 @@
1
1
  import type { AxisConfig, AxisLoadError, BarSeries, DataLoaderFn, DataSeries } from './types';
2
- type AxisType = `x` | `y` | `y2`;
2
+ type AxisType = `x` | `x2` | `y` | `y2`;
3
3
  export declare function merge_series_state<T extends DataSeries | BarSeries>(old_series: T[], new_series: T[]): T[];
4
4
  export interface AxisChangeState<T extends DataSeries | BarSeries> {
5
5
  get_axis: (axis: AxisType) => AxisConfig;
@@ -264,7 +264,7 @@ function compute_savgol_coefficients(window, order) {
264
264
  }
265
265
  // Compute (V^T V)^-1 V^T using simple pseudoinverse
266
266
  // For smoothing, we only need the first row (constant term coefficients)
267
- const vtv = multiply_transpose(vandermonde, vandermonde);
267
+ const vtv = multiply_matrices(transpose(vandermonde), vandermonde);
268
268
  const vtv_inv = invert_matrix(vtv);
269
269
  if (!vtv_inv) {
270
270
  // Fallback to uniform weights
@@ -815,10 +815,6 @@ function transpose(matrix) {
815
815
  }
816
816
  return result;
817
817
  }
818
- function multiply_transpose(a, b) {
819
- const at = transpose(a);
820
- return multiply_matrices(at, b);
821
- }
822
818
  function multiply_matrices(a, b) {
823
819
  const rows_a = a.length;
824
820
  const cols_a = a[0]?.length ?? 0;
@@ -4,17 +4,19 @@ export interface TweenedOptions<T> {
4
4
  easing?: (t: number) => number;
5
5
  interpolate?: (a: T, b: T) => (t: number) => T;
6
6
  }
7
+ export { default as AxisLabel } from './AxisLabel.svelte';
7
8
  export { default as BarPlot } from './BarPlot.svelte';
8
9
  export { default as BarPlotControls } from './BarPlotControls.svelte';
9
10
  export { default as ColorBar } from './ColorBar.svelte';
10
11
  export { default as ColorScaleSelect } from './ColorScaleSelect.svelte';
12
+ export * from './data-cleaning';
11
13
  export { default as ElementScatter } from './ElementScatter.svelte';
12
14
  export * from './fill-utils';
13
15
  export { default as FillArea } from './FillArea.svelte';
14
16
  export { default as Histogram } from './Histogram.svelte';
15
17
  export { default as HistogramControls } from './HistogramControls.svelte';
16
- export { default as InteractiveAxisLabel } from './InteractiveAxisLabel.svelte';
17
18
  export * from './interactions';
19
+ export { default as InteractiveAxisLabel } from './InteractiveAxisLabel.svelte';
18
20
  export * from './layout';
19
21
  export { default as Line } from './Line.svelte';
20
22
  export { default as PlotControls } from './PlotControls.svelte';
@@ -36,4 +38,6 @@ export { default as SpacegroupBarPlot } from './SpacegroupBarPlot.svelte';
36
38
  export { default as Surface3D } from './Surface3D.svelte';
37
39
  export * from './svg';
38
40
  export * from './types';
39
- export * from './data-cleaning';
41
+ export * from './utils';
42
+ export { default as ZeroLines } from './ZeroLines.svelte';
43
+ export { default as ZoomRect } from './ZoomRect.svelte';
@@ -1,14 +1,16 @@
1
+ export { default as AxisLabel } from './AxisLabel.svelte';
1
2
  export { default as BarPlot } from './BarPlot.svelte';
2
3
  export { default as BarPlotControls } from './BarPlotControls.svelte';
3
4
  export { default as ColorBar } from './ColorBar.svelte';
4
5
  export { default as ColorScaleSelect } from './ColorScaleSelect.svelte';
6
+ export * from './data-cleaning';
5
7
  export { default as ElementScatter } from './ElementScatter.svelte';
6
8
  export * from './fill-utils';
7
9
  export { default as FillArea } from './FillArea.svelte';
8
10
  export { default as Histogram } from './Histogram.svelte';
9
11
  export { default as HistogramControls } from './HistogramControls.svelte';
10
- export { default as InteractiveAxisLabel } from './InteractiveAxisLabel.svelte';
11
12
  export * from './interactions';
13
+ export { default as InteractiveAxisLabel } from './InteractiveAxisLabel.svelte';
12
14
  export * from './layout';
13
15
  export { default as Line } from './Line.svelte';
14
16
  export { default as PlotControls } from './PlotControls.svelte';
@@ -30,4 +32,6 @@ export { default as SpacegroupBarPlot } from './SpacegroupBarPlot.svelte';
30
32
  export { default as Surface3D } from './Surface3D.svelte';
31
33
  export * from './svg';
32
34
  export * from './types';
33
- export * from './data-cleaning';
35
+ export * from './utils';
36
+ export { default as ZeroLines } from './ZeroLines.svelte';
37
+ export { default as ZoomRect } from './ZoomRect.svelte';
@@ -1,14 +1,12 @@
1
- import type { Y2SyncConfig, Y2SyncMode } from './types';
2
- export declare function get_relative_coords(evt: MouseEvent): {
3
- x: number;
4
- y: number;
5
- } | null;
1
+ import type { Vec2 } from '../math';
2
+ import type { XyObj, Y2SyncConfig, Y2SyncMode } from './types';
3
+ export declare function get_relative_coords(evt: MouseEvent): XyObj | null;
6
4
  export declare function normalize_y2_sync(sync: Y2SyncConfig | Y2SyncMode | undefined): Y2SyncConfig;
7
- export declare function sync_y2_range(y1_range: [number, number], y2_base_range: [number, number], sync: Y2SyncConfig): [number, number];
8
- export declare function pan_range(current: [number, number], delta: number): [number, number];
9
- export declare function pixels_to_data_delta(pixel_delta: number, data_range: [number, number], pixel_range: number): number;
5
+ export declare function sync_y2_range(y1_range: Vec2, y2_base_range: Vec2, sync: Y2SyncConfig): Vec2;
6
+ export declare function pan_range(current: Vec2, delta: number): Vec2;
7
+ export declare function pixels_to_data_delta(pixel_delta: number, data_range: Vec2, pixel_range: number): number;
10
8
  export declare const PINCH_ZOOM_THRESHOLD = 0.1;
11
- export declare function expand_range_if_needed(current: [number, number], new_range: [number, number]): {
12
- range: [number, number];
9
+ export declare function expand_range_if_needed(current: Vec2, new_range: Vec2): {
10
+ range: Vec2;
13
11
  changed: boolean;
14
12
  };
@@ -1,9 +1,8 @@
1
1
  // Get relative coordinates from a mouse event
2
2
  export function get_relative_coords(evt) {
3
3
  const current_target = evt.currentTarget;
4
- if (!current_target || typeof current_target.getBoundingClientRect !== `function`) {
4
+ if (!(current_target instanceof SVGElement))
5
5
  return null;
6
- }
7
6
  const svg_box = current_target.getBoundingClientRect();
8
7
  if (!svg_box)
9
8
  return null;
@@ -27,7 +26,7 @@ export function sync_y2_range(y1_range, y2_base_range, sync) {
27
26
  return y2_base_range;
28
27
  // Synced: Y2 has exact same range as Y1
29
28
  if (sync.mode === `synced`) {
30
- return [...y1_range];
29
+ return [y1_range[0], y1_range[1]];
31
30
  }
32
31
  // Align: Position so align_val (default 0) is at same relative position on both axes
33
32
  // Y2 range expands as needed to show all data while maintaining alignment
@@ -77,8 +76,7 @@ export const PINCH_ZOOM_THRESHOLD = 0.1;
77
76
  // Helper to check if range is the default [0, 1] sentinel (no data)
78
77
  // Note: min === 0 handles -0 correctly since -0 === 0 in JavaScript
79
78
  const is_default_range = ([min, max]) => min === 0 && max === 1;
80
- // Lazy range expansion: only expand when new data exceeds current bounds.
81
- // Never shrink when data is hidden (preserves user's view context).
79
+ // Adopt the new data range, unless all series were hidden (sentinel [0, 1] fallback).
82
80
  // NOTE: [0, 1] is the "no data" sentinel - when all series are hidden, auto ranges
83
81
  // fall back to [0, 1]. Actual data spanning exactly [0, 1] is a rare edge case.
84
82
  export function expand_range_if_needed(current, new_range) {
@@ -91,19 +89,12 @@ export function expand_range_if_needed(current, new_range) {
91
89
  return { range: current, changed: false };
92
90
  if (!current_valid)
93
91
  return { range: new_range, changed: true };
94
- const current_is_default = is_default_range(current);
95
- const new_is_default = is_default_range(new_range);
96
- // Adopt new range if transitioning from default, keep current if data was hidden
97
- if (current_is_default !== new_is_default) {
98
- return current_is_default
99
- ? { range: new_range, changed: true }
100
- : { range: current, changed: false };
92
+ // When all series are hidden, auto ranges fall back to [0, 1] sentinel.
93
+ // Don't shrink to that — preserve the current view so it doesn't jump.
94
+ if (!is_default_range(current) && is_default_range(new_range)) {
95
+ return { range: current, changed: false };
101
96
  }
102
- // Both default or neither - expand only (take min of mins, max of maxes)
103
- const expanded = [
104
- Math.min(current[0], new_range[0]),
105
- Math.max(current[1], new_range[1]),
106
- ];
107
- const changed = expanded[0] !== current[0] || expanded[1] !== current[1];
108
- return { range: expanded, changed };
97
+ // Otherwise adopt the new range directly (both expand and shrink)
98
+ const changed = new_range[0] !== current[0] || new_range[1] !== current[1];
99
+ return { range: new_range, changed };
109
100
  }
@@ -5,6 +5,9 @@ export declare function measure_text_width(text: string, font?: string): number;
5
5
  export interface AutoPaddingConfig {
6
6
  padding: Partial<Sides>;
7
7
  default_padding: Required<Sides>;
8
+ x2_axis?: AxisConfig & {
9
+ tick_values?: (string | number)[];
10
+ };
8
11
  y_axis?: AxisConfig & {
9
12
  tick_values?: (string | number)[];
10
13
  };
@@ -13,7 +16,10 @@ export interface AutoPaddingConfig {
13
16
  };
14
17
  label_gap?: number;
15
18
  }
16
- export declare const calc_auto_padding: ({ padding, default_padding, y_axis, y2_axis, label_gap, }: AutoPaddingConfig) => Required<Sides>;
19
+ export declare const measure_max_tick_width: (ticks: (string | number)[], format?: string) => number;
20
+ export declare const TICK_LABEL_HEIGHT = 16;
21
+ export declare const AXIS_LABEL_HEIGHT = 20;
22
+ export declare const calc_auto_padding: ({ padding, default_padding, x2_axis, y_axis, y2_axis, label_gap, }: AutoPaddingConfig) => Required<Sides>;
17
23
  export declare function constrain_tooltip_position(cursor_x: number, cursor_y: number, tooltip_width: number, tooltip_height: number, viewport_width: number, viewport_height: number, options?: {
18
24
  offset?: number;
19
25
  offset_x?: number;
@@ -22,18 +22,26 @@ export function measure_text_width(text, font = `12px sans-serif`) {
22
22
  ctx.font = font;
23
23
  return ctx.measureText(text).width;
24
24
  }
25
- // Helper to measure max tick width
26
- const measure_max_tick_width = (ticks, format = ``) => ticks.length === 0 ? 0 : Math.max(...ticks.map((tick) => {
25
+ // Measure the widest formatted tick label. Used for auto-padding and label placement.
26
+ export const measure_max_tick_width = (ticks, format = ``) => ticks.length === 0 ? 0 : Math.max(...ticks.map((tick) => {
27
27
  const label = typeof tick === `string` ? tick : format_value(tick, format);
28
28
  return measure_text_width(label, `12px sans-serif`);
29
29
  }));
30
- export const calc_auto_padding = ({ padding, default_padding, y_axis = {}, y2_axis = {}, label_gap = LABEL_GAP_DEFAULT, }) => {
30
+ // Estimated height of a single tick label line (font-size 0.8em 12px + leading)
31
+ export const TICK_LABEL_HEIGHT = 16;
32
+ // Estimated height of an axis label (font-size ~14px + margin)
33
+ export const AXIS_LABEL_HEIGHT = 20;
34
+ export const calc_auto_padding = ({ padding, default_padding, x2_axis = {}, y_axis = {}, y2_axis = {}, label_gap = LABEL_GAP_DEFAULT, }) => {
35
+ const x2_ticks = x2_axis.tick_values ?? [];
31
36
  const y_ticks = y_axis.tick_values ?? [];
32
37
  const y_format = y_axis.format ?? ``;
33
38
  const y2_ticks = y2_axis.tick_values ?? [];
34
39
  const y2_format = y2_axis.format ?? ``;
35
40
  return {
36
- t: padding.t ?? default_padding.t,
41
+ t: padding.t ??
42
+ (x2_ticks.length > 0
43
+ ? Math.max(default_padding.t, TICK_LABEL_HEIGHT + label_gap + (x2_axis.label ? AXIS_LABEL_HEIGHT : 0))
44
+ : default_padding.t),
37
45
  b: padding.b ?? default_padding.b,
38
46
  l: padding.l ??
39
47
  Math.max(default_padding.l, measure_max_tick_width(y_ticks, y_format) + label_gap),
@@ -1,5 +1,4 @@
1
- import type { Vec3 } from '../math';
2
- import type { RefLine, RefLine3D, RefLine3DBase, RefLineBase, RefLineValue, RefPlane, RefPlaneBase } from './types';
1
+ import type { RefLine, RefLineValue } from './types';
3
2
  export type IndexedRefLine = RefLine & {
4
3
  idx: number;
5
4
  };
@@ -12,31 +11,15 @@ export interface RefLinesByZIndex {
12
11
  }
13
12
  export declare function group_ref_lines_by_z(lines: IndexedRefLine[]): RefLinesByZIndex;
14
13
  export declare function normalize_value(value: RefLineValue): number;
15
- export declare function normalize_point(point: [RefLineValue, RefLineValue]): [number, number];
16
- export declare function horizontal_line(y_value: RefLineValue, opts?: Partial<RefLineBase>): RefLine;
17
- export declare function vertical_line(x_value: RefLineValue, opts?: Partial<RefLineBase>): RefLine;
18
- export declare function diagonal_line(slope: number, intercept: number, opts?: Partial<RefLineBase>): RefLine;
19
- export declare function line_segment(p1: [RefLineValue, RefLineValue], p2: [RefLineValue, RefLineValue], opts?: Partial<RefLineBase>): RefLine;
20
- export declare function line_through(p1: [RefLineValue, RefLineValue], p2: [RefLineValue, RefLineValue], opts?: Partial<RefLineBase>): RefLine;
21
- export declare function horizontal_lines(values: RefLineValue[], opts?: Partial<RefLineBase>): RefLine[];
22
- export declare function vertical_lines(values: RefLineValue[], opts?: Partial<RefLineBase>): RefLine[];
23
- export declare function plane_xy(z_value: number, opts?: Partial<RefPlaneBase>): RefPlane;
24
- export declare function plane_xz(y_value: number, opts?: Partial<RefPlaneBase>): RefPlane;
25
- export declare function plane_yz(x_value: number, opts?: Partial<RefPlaneBase>): RefPlane;
26
- export declare function plane_normal(normal: Vec3, point: Vec3, opts?: Partial<RefPlaneBase>): RefPlane;
27
- export declare function plane_through_points(p1: Vec3, p2: Vec3, p3: Vec3, opts?: Partial<RefPlaneBase>): RefPlane;
28
- export declare function line_x_axis(y_value: number, z_value: number, opts?: Partial<RefLine3DBase>): RefLine3D;
29
- export declare function line_y_axis(x_value: number, z_value: number, opts?: Partial<RefLine3DBase>): RefLine3D;
30
- export declare function line_z_axis(x_value: number, y_value: number, opts?: Partial<RefLine3DBase>): RefLine3D;
31
- export declare function line_segment_3d(p1: [number, number, number], p2: [number, number, number], opts?: Partial<RefLine3DBase>): RefLine3D;
32
- export declare function line_through_3d(p1: [number, number, number], p2: [number, number, number], opts?: Partial<RefLine3DBase>): RefLine3D;
14
+ export declare const normalize_point: (point: [RefLineValue, RefLineValue]) => [number, number];
33
15
  export declare function resolve_line_endpoints(ref_line: RefLine, { x_min, x_max, y_min, y_max }: {
34
16
  x_min: number;
35
17
  x_max: number;
36
18
  y_min: number;
37
19
  y_max: number;
38
- }, { x_scale, y_scale, y2_scale }: {
20
+ }, { x_scale, x2_scale, y_scale, y2_scale }: {
39
21
  x_scale: (val: number) => number;
22
+ x2_scale?: (val: number) => number;
40
23
  y_scale: (val: number) => number;
41
24
  y2_scale?: (val: number) => number;
42
25
  }): [number, number, number, number] | null;