matterviz 0.3.7 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Icon.svelte +7 -4
- package/dist/MillerIndexInput.svelte +1 -1
- package/dist/api/optimade.js +32 -26
- package/dist/app.css +0 -3
- package/dist/brillouin/BrillouinZone.svelte +76 -148
- package/dist/brillouin/BrillouinZone.svelte.d.ts +6 -14
- package/dist/brillouin/BrillouinZoneExportPane.svelte +43 -96
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +9 -32
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +2 -3
- package/dist/brillouin/BrillouinZoneScene.svelte +97 -205
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +4 -23
- package/dist/brillouin/BrillouinZoneTooltip.svelte +16 -25
- package/dist/brillouin/ReciprocalVectors.svelte +39 -0
- package/dist/brillouin/ReciprocalVectors.svelte.d.ts +9 -0
- package/dist/brillouin/compute.d.ts +2 -0
- package/dist/brillouin/compute.js +89 -90
- package/dist/brillouin/geometry.d.ts +8 -0
- package/dist/brillouin/geometry.js +57 -0
- package/dist/brillouin/index.d.ts +2 -0
- package/dist/brillouin/index.js +2 -0
- package/dist/brillouin/types.d.ts +2 -2
- package/dist/chempot-diagram/ChemPotDiagram.svelte +14 -13
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +109 -203
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +4 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +180 -470
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +7 -1
- package/dist/chempot-diagram/async-compute.svelte.js +3 -1
- package/dist/chempot-diagram/chempot-worker.js +2 -1
- package/dist/chempot-diagram/color.d.ts +3 -6
- package/dist/chempot-diagram/color.js +5 -5
- package/dist/chempot-diagram/compute.d.ts +4 -4
- package/dist/chempot-diagram/compute.js +20 -20
- package/dist/chempot-diagram/controls-state.svelte.d.ts +10 -0
- package/dist/chempot-diagram/controls-state.svelte.js +42 -0
- package/dist/chempot-diagram/export.d.ts +47 -0
- package/dist/chempot-diagram/export.js +133 -0
- package/dist/chempot-diagram/index.d.ts +1 -0
- package/dist/chempot-diagram/index.js +1 -0
- package/dist/chempot-diagram/pointer.d.ts +0 -10
- package/dist/chempot-diagram/pointer.js +4 -4
- package/dist/chempot-diagram/types.d.ts +3 -3
- package/dist/colors/index.js +8 -7
- package/dist/composition/FormulaFilter.svelte +18 -11
- package/dist/composition/PieChart.svelte +11 -10
- package/dist/composition/chem-sys.d.ts +8 -0
- package/dist/composition/chem-sys.js +86 -0
- package/dist/composition/format.js +7 -4
- package/dist/composition/index.d.ts +1 -0
- package/dist/composition/index.js +1 -0
- package/dist/composition/parse.d.ts +0 -1
- package/dist/composition/parse.js +41 -31
- package/dist/controls.d.ts +1 -0
- package/dist/controls.js +0 -1
- package/dist/convex-hull/ConvexHull.svelte +8 -10
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -4
- package/dist/convex-hull/ConvexHull2D.svelte +106 -185
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +179 -683
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +183 -687
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +268 -0
- package/dist/convex-hull/ConvexHullChrome.svelte.d.ts +30 -0
- package/dist/convex-hull/ConvexHullControls.svelte +88 -7
- package/dist/convex-hull/ConvexHullControls.svelte.d.ts +7 -6
- package/dist/convex-hull/ConvexHullInfoPane.svelte +18 -5
- package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +6 -5
- package/dist/convex-hull/ConvexHullStats.svelte +36 -175
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +3 -1
- package/dist/convex-hull/ConvexHullTooltip.svelte +11 -2
- package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +2 -1
- package/dist/convex-hull/GasPressureControls.svelte +4 -4
- package/dist/convex-hull/TemperatureSlider.svelte +2 -2
- package/dist/convex-hull/barycentric-coords.d.ts +2 -4
- package/dist/convex-hull/barycentric-coords.js +6 -33
- package/dist/convex-hull/canvas-interactions.svelte.d.ts +79 -0
- package/dist/convex-hull/canvas-interactions.svelte.js +278 -0
- package/dist/convex-hull/demo-temperature.d.ts +1 -1
- package/dist/convex-hull/demo-temperature.js +20 -22
- package/dist/convex-hull/gas-thermodynamics.d.ts +2 -2
- package/dist/convex-hull/gas-thermodynamics.js +22 -30
- package/dist/convex-hull/helpers.d.ts +42 -7
- package/dist/convex-hull/helpers.js +171 -78
- package/dist/convex-hull/hull-state.svelte.d.ts +44 -0
- package/dist/convex-hull/hull-state.svelte.js +124 -0
- package/dist/convex-hull/index.d.ts +10 -8
- package/dist/convex-hull/index.js +7 -2
- package/dist/convex-hull/thermodynamics.js +136 -960
- package/dist/convex-hull/types.d.ts +13 -5
- package/dist/convex-hull/types.js +12 -0
- package/dist/coordination/CoordinationBarPlot.svelte +27 -34
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
- package/dist/element/BohrAtom.svelte +2 -1
- package/dist/element/index.d.ts +4 -0
- package/dist/element/index.js +18 -0
- package/dist/feedback/DragOverlay.svelte +3 -1
- package/dist/feedback/DragOverlay.svelte.d.ts +1 -0
- package/dist/feedback/StatusMessage.svelte +13 -3
- package/dist/fermi-surface/FermiSlice.svelte +13 -5
- package/dist/fermi-surface/FermiSurface.svelte +78 -151
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +5 -14
- package/dist/fermi-surface/FermiSurfaceControls.svelte +1 -1
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +72 -221
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +3 -23
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +8 -34
- package/dist/fermi-surface/compute.js +67 -66
- package/dist/fermi-surface/export.js +6 -16
- package/dist/fermi-surface/index.d.ts +0 -1
- package/dist/fermi-surface/index.js +0 -1
- package/dist/fermi-surface/parse.d.ts +1 -1
- package/dist/fermi-surface/parse.js +71 -79
- package/dist/fermi-surface/types.d.ts +3 -2
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +69 -52
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +4 -3
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +3 -2
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +5 -5
- package/dist/heatmap-matrix/index.d.ts +3 -2
- package/dist/heatmap-matrix/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/io/ExportPane.svelte +166 -0
- package/dist/io/ExportPane.svelte.d.ts +17 -0
- package/dist/io/decompress.js +5 -4
- package/dist/io/export.d.ts +9 -5
- package/dist/io/export.js +77 -51
- package/dist/io/fetch.d.ts +2 -1
- package/dist/io/fetch.js +5 -1
- package/dist/io/file-drop.d.ts +8 -1
- package/dist/io/file-drop.js +48 -36
- package/dist/io/index.d.ts +2 -0
- package/dist/io/index.js +10 -0
- package/dist/io/types.d.ts +13 -0
- package/dist/io/url-drop.js +64 -33
- package/dist/isosurface/parse.js +52 -51
- package/dist/isosurface/slice.js +5 -4
- package/dist/isosurface/types.js +1 -1
- package/dist/keyboard.d.ts +3 -0
- package/dist/keyboard.js +23 -0
- package/dist/labels.d.ts +1 -1
- package/dist/labels.js +9 -8
- package/dist/layout/FullscreenButton.svelte +33 -0
- package/dist/layout/FullscreenButton.svelte.d.ts +10 -0
- package/dist/layout/FullscreenToggle.svelte +8 -14
- package/dist/layout/PropertyFilter.svelte +3 -2
- package/dist/layout/SettingsSection.svelte +1 -1
- package/dist/layout/ViewerChrome.svelte +116 -0
- package/dist/layout/ViewerChrome.svelte.d.ts +17 -0
- package/dist/layout/fullscreen.d.ts +4 -0
- package/dist/layout/fullscreen.svelte.d.ts +8 -0
- package/dist/layout/fullscreen.svelte.js +37 -0
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.js +3 -0
- package/dist/layout/json-tree/JsonNode.svelte +1 -1
- package/dist/layout/json-tree/JsonTree.svelte +2 -2
- package/dist/layout/json-tree/utils.js +5 -4
- package/dist/marching-cubes.js +8 -13
- package/dist/math.d.ts +12 -4
- package/dist/math.js +42 -30
- package/dist/overlays/DraggablePane.svelte +4 -4
- package/dist/overlays/index.d.ts +4 -0
- package/dist/periodic-table/PeriodicTable.svelte +27 -15
- package/dist/periodic-table/PropertySelect.svelte +1 -0
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +9 -3
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramControls.svelte +3 -2
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +4 -3
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +4 -2
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +2 -3
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +47 -132
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +3 -4
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +1 -1
- package/dist/phase-diagram/build-diagram.js +2 -2
- package/dist/phase-diagram/colors.js +1 -1
- package/dist/phase-diagram/parse.d.ts +2 -1
- package/dist/phase-diagram/parse.js +6 -5
- package/dist/phase-diagram/types.d.ts +1 -1
- package/dist/phase-diagram/utils.d.ts +3 -3
- package/dist/phase-diagram/utils.js +8 -12
- package/dist/plot/{BarPlot.svelte → bar/BarPlot.svelte} +246 -841
- package/dist/plot/{BarPlot.svelte.d.ts → bar/BarPlot.svelte.d.ts} +8 -16
- package/dist/plot/{BarPlotControls.svelte → bar/BarPlotControls.svelte} +6 -5
- package/dist/plot/{BarPlotControls.svelte.d.ts → bar/BarPlotControls.svelte.d.ts} +3 -3
- package/dist/plot/{SpacegroupBarPlot.svelte → bar/SpacegroupBarPlot.svelte} +8 -7
- package/dist/plot/{SpacegroupBarPlot.svelte.d.ts → bar/SpacegroupBarPlot.svelte.d.ts} +1 -1
- package/dist/plot/bar/data.d.ts +40 -0
- package/dist/plot/bar/data.js +154 -0
- package/dist/plot/bar/geometry.d.ts +39 -0
- package/dist/plot/bar/geometry.js +60 -0
- package/dist/plot/bar/index.d.ts +3 -0
- package/dist/plot/bar/index.js +3 -0
- package/dist/plot/box/BoxPlot.svelte +1292 -0
- package/dist/plot/box/BoxPlot.svelte.d.ts +95 -0
- package/dist/plot/box/BoxPlotControls.svelte +109 -0
- package/dist/plot/box/BoxPlotControls.svelte.d.ts +19 -0
- package/dist/plot/box/Violin.svelte +14 -0
- package/dist/plot/box/Violin.svelte.d.ts +70 -0
- package/dist/plot/box/box-plot.d.ts +56 -0
- package/dist/plot/box/box-plot.js +129 -0
- package/dist/plot/box/index.d.ts +5 -0
- package/dist/plot/box/index.js +5 -0
- package/dist/plot/box/kde.d.ts +17 -0
- package/dist/plot/box/kde.js +160 -0
- package/dist/plot/box/quantile.d.ts +3 -0
- package/dist/plot/box/quantile.js +53 -0
- package/dist/plot/{auto-place.d.ts → core/auto-place.d.ts} +1 -1
- package/dist/plot/{auto-place.js → core/auto-place.js} +6 -3
- package/dist/plot/core/axis-utils.d.ts +46 -0
- package/dist/plot/core/axis-utils.js +110 -0
- package/dist/plot/{AxisLabel.svelte → core/components/AxisLabel.svelte} +2 -2
- package/dist/plot/{AxisLabel.svelte.d.ts → core/components/AxisLabel.svelte.d.ts} +1 -1
- package/dist/plot/{ColorBar.svelte → core/components/ColorBar.svelte} +41 -38
- package/dist/plot/{ColorBar.svelte.d.ts → core/components/ColorBar.svelte.d.ts} +7 -6
- package/dist/plot/{ColorScaleSelect.svelte → core/components/ColorScaleSelect.svelte} +4 -3
- package/dist/plot/{ColorScaleSelect.svelte.d.ts → core/components/ColorScaleSelect.svelte.d.ts} +2 -2
- package/dist/plot/core/components/ControlPane.svelte +46 -0
- package/dist/plot/core/components/ControlPane.svelte.d.ts +13 -0
- package/dist/plot/{FillArea.svelte → core/components/FillArea.svelte} +17 -6
- package/dist/plot/{FillArea.svelte.d.ts → core/components/FillArea.svelte.d.ts} +1 -1
- package/dist/plot/{InteractiveAxisLabel.svelte → core/components/InteractiveAxisLabel.svelte} +3 -3
- package/dist/plot/{InteractiveAxisLabel.svelte.d.ts → core/components/InteractiveAxisLabel.svelte.d.ts} +2 -2
- package/dist/plot/{Line.svelte → core/components/Line.svelte} +33 -15
- package/dist/plot/{Line.svelte.d.ts → core/components/Line.svelte.d.ts} +3 -2
- package/dist/plot/{PlotAxis.svelte → core/components/PlotAxis.svelte} +9 -6
- package/dist/plot/{PlotAxis.svelte.d.ts → core/components/PlotAxis.svelte.d.ts} +5 -3
- package/dist/plot/{PlotControls.svelte → core/components/PlotControls.svelte} +17 -29
- package/dist/plot/core/components/PlotControls.svelte.d.ts +4 -0
- package/dist/plot/{PlotLegend.svelte → core/components/PlotLegend.svelte} +21 -10
- package/dist/plot/{PlotLegend.svelte.d.ts → core/components/PlotLegend.svelte.d.ts} +3 -2
- package/dist/plot/{PlotTooltip.svelte → core/components/PlotTooltip.svelte} +17 -1
- package/dist/plot/{PlotTooltip.svelte.d.ts → core/components/PlotTooltip.svelte.d.ts} +8 -0
- package/dist/plot/{PortalSelect.svelte → core/components/PortalSelect.svelte} +11 -7
- package/dist/plot/{ReferenceLine.svelte → core/components/ReferenceLine.svelte} +3 -3
- package/dist/plot/{ReferenceLine.svelte.d.ts → core/components/ReferenceLine.svelte.d.ts} +1 -1
- package/dist/plot/{ReferenceLine3D.svelte → core/components/ReferenceLine3D.svelte} +5 -5
- package/dist/plot/{ReferenceLine3D.svelte.d.ts → core/components/ReferenceLine3D.svelte.d.ts} +5 -5
- package/dist/plot/{ReferencePlane.svelte → core/components/ReferencePlane.svelte} +8 -8
- package/dist/plot/{ReferencePlane.svelte.d.ts → core/components/ReferencePlane.svelte.d.ts} +5 -5
- package/dist/plot/{ZeroLines.svelte → core/components/ZeroLines.svelte} +3 -3
- package/dist/plot/{ZeroLines.svelte.d.ts → core/components/ZeroLines.svelte.d.ts} +3 -3
- package/dist/plot/{ZoomRect.svelte → core/components/ZoomRect.svelte} +1 -1
- package/dist/plot/{ZoomRect.svelte.d.ts → core/components/ZoomRect.svelte.d.ts} +1 -1
- package/dist/plot/core/components/index.d.ts +17 -0
- package/dist/plot/core/components/index.js +17 -0
- package/dist/plot/{data-cleaning.d.ts → core/data-cleaning.d.ts} +71 -1
- package/dist/plot/{data-cleaning.js → core/data-cleaning.js} +21 -23
- package/dist/plot/{data-transform.d.ts → core/data-transform.d.ts} +2 -2
- package/dist/plot/{data-transform.js → core/data-transform.js} +3 -3
- package/dist/plot/core/fill-utils.d.ts +34 -0
- package/dist/plot/core/fill-utils.js +391 -0
- package/dist/plot/core/index.d.ts +10 -0
- package/dist/plot/core/index.js +11 -0
- package/dist/plot/core/interactions.d.ts +39 -0
- package/dist/plot/core/interactions.js +209 -0
- package/dist/plot/{layout.d.ts → core/layout.d.ts} +1 -0
- package/dist/plot/{layout.js → core/layout.js} +16 -8
- package/dist/plot/core/pan-zoom.svelte.d.ts +35 -0
- package/dist/plot/core/pan-zoom.svelte.js +221 -0
- package/dist/plot/core/placed-tween.svelte.d.ts +21 -0
- package/dist/plot/core/placed-tween.svelte.js +68 -0
- package/dist/plot/{reference-line.d.ts → core/reference-line.d.ts} +11 -11
- package/dist/plot/{reference-line.js → core/reference-line.js} +29 -42
- package/dist/plot/core/scales.d.ts +40 -0
- package/dist/plot/{scales.js → core/scales.js} +94 -93
- package/dist/plot/core/svg.d.ts +3 -0
- package/dist/plot/core/svg.js +41 -0
- package/dist/plot/{types.d.ts → core/types.d.ts} +36 -85
- package/dist/plot/{types.js → core/types.js} +1 -1
- package/dist/plot/{utils → core/utils}/label-placement.d.ts +3 -3
- package/dist/plot/{utils → core/utils}/label-placement.js +3 -3
- package/dist/plot/core/utils/series-visibility.d.ts +26 -0
- package/dist/plot/{utils → core/utils}/series-visibility.js +29 -2
- package/dist/plot/core/utils.d.ts +12 -0
- package/dist/plot/core/utils.js +27 -0
- package/dist/plot/{Histogram.svelte → histogram/Histogram.svelte} +174 -551
- package/dist/plot/{Histogram.svelte.d.ts → histogram/Histogram.svelte.d.ts} +2 -2
- package/dist/plot/{HistogramControls.svelte → histogram/HistogramControls.svelte} +6 -6
- package/dist/plot/{HistogramControls.svelte.d.ts → histogram/HistogramControls.svelte.d.ts} +4 -4
- package/dist/plot/histogram/index.d.ts +2 -0
- package/dist/plot/histogram/index.js +2 -0
- package/dist/plot/index.d.ts +8 -41
- package/dist/plot/index.js +10 -39
- package/dist/plot/sankey/Sankey.svelte +697 -0
- package/dist/plot/sankey/Sankey.svelte.d.ts +74 -0
- package/dist/plot/sankey/SankeyControls.svelte +98 -0
- package/dist/plot/sankey/SankeyControls.svelte.d.ts +19 -0
- package/dist/plot/sankey/index.d.ts +4 -0
- package/dist/plot/sankey/index.js +3 -0
- package/dist/plot/sankey/sankey-types.d.ts +42 -0
- package/dist/plot/sankey/sankey-types.js +4 -0
- package/dist/plot/sankey/sankey.d.ts +52 -0
- package/dist/plot/sankey/sankey.js +189 -0
- package/dist/plot/{BinnedScatterPlot.svelte → scatter/BinnedScatterPlot.svelte} +64 -64
- package/dist/plot/{BinnedScatterPlot.svelte.d.ts → scatter/BinnedScatterPlot.svelte.d.ts} +6 -6
- package/dist/plot/{ElementScatter.svelte → scatter/ElementScatter.svelte} +6 -6
- package/dist/plot/{ElementScatter.svelte.d.ts → scatter/ElementScatter.svelte.d.ts} +2 -2
- package/dist/plot/{ScatterPlot.svelte → scatter/ScatterPlot.svelte} +297 -1008
- package/dist/plot/{ScatterPlot.svelte.d.ts → scatter/ScatterPlot.svelte.d.ts} +10 -18
- package/dist/plot/{ScatterPlotControls.svelte → scatter/ScatterPlotControls.svelte} +6 -5
- package/dist/plot/{ScatterPlotControls.svelte.d.ts → scatter/ScatterPlotControls.svelte.d.ts} +2 -2
- package/dist/plot/{ScatterPoint.svelte → scatter/ScatterPoint.svelte} +7 -7
- package/dist/plot/{ScatterPoint.svelte.d.ts → scatter/ScatterPoint.svelte.d.ts} +3 -3
- package/dist/plot/{adaptive-density.d.ts → scatter/adaptive-density.d.ts} +14 -4
- package/dist/plot/{adaptive-density.js → scatter/adaptive-density.js} +46 -20
- package/dist/plot/{binned-scatter-types.d.ts → scatter/binned-scatter-types.d.ts} +5 -12
- package/dist/plot/scatter/index.d.ts +7 -0
- package/dist/plot/scatter/index.js +5 -0
- package/dist/plot/scatter/scatter-data.d.ts +19 -0
- package/dist/plot/scatter/scatter-data.js +212 -0
- package/dist/plot/{ScatterPlot3D.svelte → scatter-3d/ScatterPlot3D.svelte} +25 -34
- package/dist/plot/{ScatterPlot3D.svelte.d.ts → scatter-3d/ScatterPlot3D.svelte.d.ts} +9 -17
- package/dist/plot/{ScatterPlot3DControls.svelte → scatter-3d/ScatterPlot3DControls.svelte} +14 -14
- package/dist/plot/{ScatterPlot3DControls.svelte.d.ts → scatter-3d/ScatterPlot3DControls.svelte.d.ts} +6 -6
- package/dist/plot/{ScatterPlot3DScene.svelte → scatter-3d/ScatterPlot3DScene.svelte} +129 -128
- package/dist/plot/{ScatterPlot3DScene.svelte.d.ts → scatter-3d/ScatterPlot3DScene.svelte.d.ts} +6 -15
- package/dist/plot/{Surface3D.svelte → scatter-3d/Surface3D.svelte} +7 -6
- package/dist/plot/{Surface3D.svelte.d.ts → scatter-3d/Surface3D.svelte.d.ts} +5 -4
- package/dist/plot/scatter-3d/index.d.ts +4 -0
- package/dist/plot/scatter-3d/index.js +4 -0
- package/dist/plot/sunburst/Sunburst.svelte +1041 -0
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +97 -0
- package/dist/plot/sunburst/SunburstControls.svelte +200 -0
- package/dist/plot/sunburst/SunburstControls.svelte.d.ts +26 -0
- package/dist/plot/sunburst/index.d.ts +4 -0
- package/dist/plot/sunburst/index.js +4 -0
- package/dist/plot/sunburst/render.d.ts +34 -0
- package/dist/plot/sunburst/render.js +122 -0
- package/dist/plot/sunburst/sunburst.d.ts +62 -0
- package/dist/plot/sunburst/sunburst.js +269 -0
- package/dist/rdf/RdfPlot.svelte +2 -1
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/calc-rdf.js +11 -24
- package/dist/sanitize.js +14 -3
- package/dist/scene/SceneCamera.svelte +62 -0
- package/dist/scene/SceneCamera.svelte.d.ts +19 -0
- package/dist/scene/bind-renderer.svelte.d.ts +2 -0
- package/dist/scene/bind-renderer.svelte.js +14 -0
- package/dist/scene/index.d.ts +4 -0
- package/dist/scene/index.js +5 -0
- package/dist/scene/props.js +52 -0
- package/dist/scene/types.d.ts +26 -0
- package/dist/scene/types.js +1 -0
- package/dist/settings.d.ts +79 -3
- package/dist/settings.js +321 -1
- package/dist/spectral/Bands.svelte +47 -36
- package/dist/spectral/Bands.svelte.d.ts +6 -6
- package/dist/spectral/BandsAndDos.svelte +23 -25
- package/dist/spectral/BrillouinBandsDos.svelte +42 -30
- package/dist/spectral/Dos.svelte +15 -23
- package/dist/spectral/Dos.svelte.d.ts +4 -3
- package/dist/spectral/helpers.d.ts +8 -6
- package/dist/spectral/helpers.js +137 -65
- package/dist/state.svelte.d.ts +0 -7
- package/dist/state.svelte.js +0 -6
- package/dist/structure/Arrow.svelte +2 -4
- package/dist/structure/AtomLegend.svelte +8 -9
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/CanvasTooltip.svelte +1 -0
- package/dist/structure/CellSelect.svelte +12 -5
- package/dist/structure/CellSelect.svelte.d.ts +2 -1
- package/dist/structure/Cylinder.svelte +12 -8
- package/dist/structure/Cylinder.svelte.d.ts +4 -1
- package/dist/structure/Lattice.svelte +2 -2
- package/dist/structure/Structure.svelte +365 -423
- package/dist/structure/Structure.svelte.d.ts +5 -15
- package/dist/structure/StructureControls.svelte +217 -2
- package/dist/structure/StructureControls.svelte.d.ts +5 -3
- package/dist/structure/StructureExportPane.svelte +54 -156
- package/dist/structure/StructureExportPane.svelte.d.ts +4 -5
- package/dist/structure/StructureInfoPane.svelte +10 -9
- package/dist/structure/StructureInfoPane.svelte.d.ts +5 -5
- package/dist/structure/StructureScene.svelte +376 -208
- package/dist/structure/StructureScene.svelte.d.ts +22 -20
- package/dist/structure/{label-placement.d.ts → atom-label-placement.d.ts} +3 -3
- package/dist/structure/{label-placement.js → atom-label-placement.js} +15 -5
- package/dist/structure/atom-properties.d.ts +1 -1
- package/dist/structure/atom-properties.js +17 -22
- package/dist/structure/bond-order-perception.js +3 -5
- package/dist/structure/bonding.d.ts +4 -0
- package/dist/structure/bonding.js +134 -63
- package/dist/structure/export.d.ts +24 -4
- package/dist/structure/export.js +89 -143
- package/dist/structure/index.d.ts +4 -4
- package/dist/structure/index.js +3 -3
- package/dist/structure/measure.d.ts +3 -2
- package/dist/structure/measure.js +6 -5
- package/dist/structure/parse.d.ts +3 -2
- package/dist/structure/parse.js +419 -438
- package/dist/structure/partial-occupancy.d.ts +0 -1
- package/dist/structure/partial-occupancy.js +1 -1
- package/dist/structure/pbc.d.ts +1 -1
- package/dist/structure/pbc.js +190 -13
- package/dist/structure/polyhedra.d.ts +41 -0
- package/dist/structure/polyhedra.js +602 -0
- package/dist/structure/site.d.ts +4 -0
- package/dist/structure/site.js +1 -0
- package/dist/structure/supercell.js +3 -2
- package/dist/structure/validation.js +5 -6
- package/dist/symmetry/SymmetryElementControls.svelte +69 -0
- package/dist/symmetry/SymmetryElementControls.svelte.d.ts +9 -0
- package/dist/symmetry/SymmetryElements.svelte +354 -0
- package/dist/symmetry/SymmetryElements.svelte.d.ts +24 -0
- package/dist/symmetry/SymmetryStats.svelte +113 -8
- package/dist/symmetry/WyckoffTable.svelte +68 -7
- package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -0
- package/dist/symmetry/cell-transform.js +7 -14
- package/dist/symmetry/index.d.ts +14 -4
- package/dist/symmetry/index.js +291 -72
- package/dist/symmetry/spacegroups.d.ts +12 -1
- package/dist/symmetry/spacegroups.js +63 -14
- package/dist/symmetry/symmetry-elements.d.ts +33 -0
- package/dist/symmetry/symmetry-elements.js +521 -0
- package/dist/symmetry/wyckoff-db.d.ts +9 -0
- package/dist/symmetry/wyckoff-db.js +87 -0
- package/dist/table/HeatmapTable.svelte +66 -25
- package/dist/table/HeatmapTable.svelte.d.ts +1 -1
- package/dist/table/index.d.ts +1 -3
- package/dist/table/index.js +1 -1
- package/dist/theme/index.js +8 -8
- package/dist/tooltip/KCoords.svelte +45 -0
- package/dist/tooltip/KCoords.svelte.d.ts +8 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/trajectory/Trajectory.svelte +123 -100
- package/dist/trajectory/Trajectory.svelte.d.ts +11 -22
- package/dist/trajectory/TrajectoryExportPane.svelte +17 -25
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +4 -5
- package/dist/trajectory/TrajectoryInfoPane.svelte +5 -3
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -2
- package/dist/trajectory/constants.js +6 -2
- package/dist/trajectory/extract.js +17 -37
- package/dist/trajectory/format-detect.d.ts +1 -1
- package/dist/trajectory/format-detect.js +27 -19
- package/dist/trajectory/frame-reader.d.ts +0 -1
- package/dist/trajectory/frame-reader.js +63 -162
- package/dist/trajectory/helpers.d.ts +10 -2
- package/dist/trajectory/helpers.js +56 -36
- package/dist/trajectory/index.js +1 -1
- package/dist/trajectory/parse/ase.d.ts +9 -1
- package/dist/trajectory/parse/ase.js +47 -32
- package/dist/trajectory/parse/diagnostics.d.ts +3 -0
- package/dist/trajectory/parse/diagnostics.js +14 -0
- package/dist/trajectory/parse/hdf5.js +1 -1
- package/dist/trajectory/parse/index.d.ts +1 -1
- package/dist/trajectory/parse/index.js +65 -105
- package/dist/trajectory/parse/lammps.d.ts +0 -2
- package/dist/trajectory/parse/lammps.js +8 -6
- package/dist/trajectory/parse/pymatgen.d.ts +2 -0
- package/dist/trajectory/parse/pymatgen.js +74 -0
- package/dist/trajectory/parse/vasp.js +38 -18
- package/dist/trajectory/parse/xyz.d.ts +13 -1
- package/dist/trajectory/parse/xyz.js +102 -94
- package/dist/trajectory/plotting.d.ts +1 -2
- package/dist/trajectory/plotting.js +16 -113
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +7 -5
- package/dist/xrd/XrdPlot.svelte +16 -30
- package/dist/xrd/broadening.d.ts +2 -1
- package/dist/xrd/calc-xrd.js +18 -20
- package/dist/xrd/index.d.ts +2 -2
- package/dist/xrd/parse.js +2 -2
- package/package.json +43 -26
- package/dist/element/data.json +0 -11864
- package/dist/fermi-surface/marching-cubes.d.ts +0 -2
- package/dist/fermi-surface/marching-cubes.js +0 -2
- package/dist/plot/PlotControls.svelte.d.ts +0 -4
- package/dist/plot/axis-utils.d.ts +0 -19
- package/dist/plot/axis-utils.js +0 -78
- package/dist/plot/defaults.d.ts +0 -19
- package/dist/plot/defaults.js +0 -9
- package/dist/plot/fill-utils.d.ts +0 -46
- package/dist/plot/fill-utils.js +0 -322
- package/dist/plot/hover-lock.svelte.d.ts +0 -14
- package/dist/plot/hover-lock.svelte.js +0 -46
- package/dist/plot/interactions.d.ts +0 -12
- package/dist/plot/interactions.js +0 -101
- package/dist/plot/scales.d.ts +0 -48
- package/dist/plot/svg.d.ts +0 -1
- package/dist/plot/svg.js +0 -11
- package/dist/plot/utils/series-visibility.d.ts +0 -15
- package/dist/plot/utils.d.ts +0 -1
- package/dist/plot/utils.js +0 -14
- /package/dist/plot/{PortalSelect.svelte.d.ts → core/components/PortalSelect.svelte.d.ts} +0 -0
- /package/dist/plot/{binned-scatter-types.js → scatter/binned-scatter-types.js} +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
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 '
|
|
4
|
+
import type { Point3D, Vec2, 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 '
|
|
11
|
-
import type { RefLine3D } from '
|
|
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
|
|
15
15
|
scene_size?: Vec3
|
|
16
|
-
ranges: { x:
|
|
16
|
+
ranges: { x: Vec2; y: Vec2; z: Vec2 }
|
|
17
17
|
} = $props()
|
|
18
18
|
|
|
19
19
|
const { size } = useThrelte()
|
|
@@ -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:
|
|
105
|
+
dashed: Boolean(ref_line.style?.dash),
|
|
106
106
|
})
|
|
107
107
|
|
|
108
108
|
// Create Line2 with LineGeometry and LineMaterial for proper variable-width lines
|
package/dist/plot/{ReferenceLine3D.svelte.d.ts → core/components/ReferenceLine3D.svelte.d.ts}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Vec3 } from '
|
|
2
|
-
import type { RefLine3D } from '
|
|
1
|
+
import type { Vec2, Vec3 } from '../../../math';
|
|
2
|
+
import type { RefLine3D } from '../types';
|
|
3
3
|
type $$ComponentProps = {
|
|
4
4
|
ref_line: RefLine3D;
|
|
5
5
|
scene_size?: Vec3;
|
|
6
6
|
ranges: {
|
|
7
|
-
x:
|
|
8
|
-
y:
|
|
9
|
-
z:
|
|
7
|
+
x: Vec2;
|
|
8
|
+
y: Vec2;
|
|
9
|
+
z: Vec2;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
declare const ReferenceLine3D: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
// ReferencePlane: 3D reference planes (axis-aligned, normal-defined, or point-defined)
|
|
3
|
-
import type { Vec3 } from '
|
|
4
|
-
import { cross_3d,
|
|
3
|
+
import type { Vec2, 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 '
|
|
8
|
-
import type { RefPlane } from '
|
|
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
|
|
12
12
|
scene_size?: Vec3
|
|
13
|
-
ranges: { x:
|
|
13
|
+
ranges: { x: Vec2; y: Vec2; z: Vec2 }
|
|
14
14
|
} = $props()
|
|
15
15
|
|
|
16
16
|
let [scene_x, scene_y, scene_z] = $derived(scene_size)
|
|
@@ -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(
|
|
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 =
|
|
114
|
+
const normalized = normalize_vec(normal)
|
|
115
115
|
// Pick u perpendicular to normal (use axis least aligned with normal)
|
|
116
|
-
const u_dir =
|
|
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,12 +1,12 @@
|
|
|
1
|
-
import type { Vec3 } from '
|
|
2
|
-
import type { RefPlane } from '
|
|
1
|
+
import type { Vec2, Vec3 } from '../../../math';
|
|
2
|
+
import type { RefPlane } from '../types';
|
|
3
3
|
type $$ComponentProps = {
|
|
4
4
|
ref_plane: RefPlane;
|
|
5
5
|
scene_size?: Vec3;
|
|
6
6
|
ranges: {
|
|
7
|
-
x:
|
|
8
|
-
y:
|
|
9
|
-
z:
|
|
7
|
+
x: Vec2;
|
|
8
|
+
y: Vec2;
|
|
9
|
+
z: Vec2;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
declare const ReferencePlane: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { Vec2 } from '
|
|
3
|
-
import type { Sides } from '
|
|
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 '
|
|
2
|
-
import type { Sides } from '
|
|
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;
|
|
@@ -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';
|
|
@@ -1,4 +1,74 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Vec2 } from '../../math';
|
|
2
|
+
import type { DataSeries } from './types';
|
|
3
|
+
export interface OscillationWeights {
|
|
4
|
+
derivative_variance?: number;
|
|
5
|
+
amplitude_growth?: number;
|
|
6
|
+
sign_changes?: number;
|
|
7
|
+
}
|
|
8
|
+
export type InvalidValueMode = `remove` | `propagate` | `interpolate`;
|
|
9
|
+
export type TruncationMode = `hard_cut` | `mark_unstable`;
|
|
10
|
+
export interface PhysicalBounds {
|
|
11
|
+
min?: number | ((x: number) => number);
|
|
12
|
+
max?: number | ((x: number) => number);
|
|
13
|
+
mode?: `clamp` | `filter` | `null`;
|
|
14
|
+
}
|
|
15
|
+
export type SmoothingConfig = {
|
|
16
|
+
type: `moving_avg`;
|
|
17
|
+
window: number;
|
|
18
|
+
} | {
|
|
19
|
+
type: `savgol`;
|
|
20
|
+
window: number;
|
|
21
|
+
polynomial_order?: number;
|
|
22
|
+
} | {
|
|
23
|
+
type: `gaussian`;
|
|
24
|
+
sigma: number;
|
|
25
|
+
};
|
|
26
|
+
export interface LocalOutlierConfig {
|
|
27
|
+
window_half?: number;
|
|
28
|
+
mad_threshold?: number;
|
|
29
|
+
max_iterations?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface LocalOutlierResult {
|
|
32
|
+
kept_indices: number[];
|
|
33
|
+
removed_indices: number[];
|
|
34
|
+
iterations_used: number;
|
|
35
|
+
}
|
|
36
|
+
export interface CleaningConfig {
|
|
37
|
+
oscillation_threshold?: number;
|
|
38
|
+
oscillation_weights?: OscillationWeights;
|
|
39
|
+
window_size?: number;
|
|
40
|
+
invalid_values?: InvalidValueMode;
|
|
41
|
+
bounds?: PhysicalBounds;
|
|
42
|
+
smooth?: SmoothingConfig;
|
|
43
|
+
local_outliers?: LocalOutlierConfig;
|
|
44
|
+
truncation_mode?: TruncationMode;
|
|
45
|
+
in_place?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface CleaningQuality {
|
|
48
|
+
points_removed: number;
|
|
49
|
+
invalid_values_found: number;
|
|
50
|
+
oscillation_detected: boolean;
|
|
51
|
+
oscillation_score?: number;
|
|
52
|
+
bounds_violations: number;
|
|
53
|
+
outliers_removed?: number;
|
|
54
|
+
stable_range?: Vec2;
|
|
55
|
+
truncated_at_x?: number;
|
|
56
|
+
}
|
|
57
|
+
export interface CleaningResult<T = DataSeries> {
|
|
58
|
+
series: T;
|
|
59
|
+
quality: CleaningQuality;
|
|
60
|
+
}
|
|
61
|
+
export interface InstabilityResult {
|
|
62
|
+
detected: boolean;
|
|
63
|
+
onset_index: number;
|
|
64
|
+
onset_x: number;
|
|
65
|
+
combined_score: number;
|
|
66
|
+
method_scores: {
|
|
67
|
+
derivative_variance: number;
|
|
68
|
+
amplitude_growth: number;
|
|
69
|
+
sign_changes: number;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
2
72
|
export declare function compute_local_variance(values: number[], window_size: number): number[];
|
|
3
73
|
export declare function detect_instability(x_values: readonly number[], y_values: readonly number[], config?: Pick<CleaningConfig, `oscillation_weights` | `oscillation_threshold` | `window_size`>): InstabilityResult;
|
|
4
74
|
export declare function smooth_moving_average(values: number[], window: number): number[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Data cleaning utilities for plot data
|
|
2
2
|
// Detects oscillations, enforces physical bounds, and handles multi-dimensional datasets
|
|
3
|
-
import { apply_gaussian_smearing } from '
|
|
3
|
+
import { apply_gaussian_smearing } from '../../spectral/helpers';
|
|
4
4
|
// Default configuration values
|
|
5
5
|
const DEFAULT_WINDOW_SIZE = 5;
|
|
6
6
|
const DEFAULT_OSCILLATION_THRESHOLD = 3.0;
|
|
@@ -243,7 +243,7 @@ function compute_savgol_coefficients(window, order) {
|
|
|
243
243
|
for (let idx = -half; idx <= half; idx++) {
|
|
244
244
|
const row = [];
|
|
245
245
|
for (let power = 0; power <= order; power++) {
|
|
246
|
-
row.push(
|
|
246
|
+
row.push(idx ** power);
|
|
247
247
|
}
|
|
248
248
|
vandermonde.push(row);
|
|
249
249
|
}
|
|
@@ -274,7 +274,7 @@ export function smooth_savitzky_golay(values, window, polynomial_order = DEFAULT
|
|
|
274
274
|
const half = Math.floor(actual_window / 2);
|
|
275
275
|
const result = Array(values.length);
|
|
276
276
|
// Cache coefficient sum to avoid O(n × window) redundant reductions in loop
|
|
277
|
-
const coeffs_sum = coeffs.reduce((
|
|
277
|
+
const coeffs_sum = coeffs.reduce((sum, coeff) => sum + coeff, 0);
|
|
278
278
|
for (let idx = 0; idx < values.length; idx++) {
|
|
279
279
|
let [sum, weight_sum] = [0, 0];
|
|
280
280
|
for (let jdx = 0; jdx < actual_window; jdx++) {
|
|
@@ -437,8 +437,8 @@ export function handle_invalid_values(values, mode) {
|
|
|
437
437
|
}
|
|
438
438
|
if (left_idx >= 0 && right_idx < cleaned.length) {
|
|
439
439
|
// Linear interpolation
|
|
440
|
-
const
|
|
441
|
-
cleaned[idx] = cleaned[left_idx] +
|
|
440
|
+
const frac = (idx - left_idx) / (right_idx - left_idx);
|
|
441
|
+
cleaned[idx] = cleaned[left_idx] + frac * (cleaned[right_idx] - cleaned[left_idx]);
|
|
442
442
|
}
|
|
443
443
|
else if (left_idx >= 0) {
|
|
444
444
|
cleaned[idx] = cleaned[left_idx];
|
|
@@ -496,9 +496,7 @@ export function sync_metadata(metadata, kept_indices) {
|
|
|
496
496
|
return kept_indices.map((idx) => metadata[idx]);
|
|
497
497
|
}
|
|
498
498
|
// Filter arrays by kept indices
|
|
499
|
-
|
|
500
|
-
return kept_indices.map((idx) => arr[idx]);
|
|
501
|
-
}
|
|
499
|
+
const filter_by_indices = (arr, kept_indices) => kept_indices.map((idx) => arr[idx]);
|
|
502
500
|
// Check if value is within bounds (static or x-dependent)
|
|
503
501
|
function is_in_bounds(val, x_val, bounds) {
|
|
504
502
|
const min = typeof bounds.min === `function` ? bounds.min(x_val) : bounds.min;
|
|
@@ -799,34 +797,34 @@ function transpose(matrix) {
|
|
|
799
797
|
}
|
|
800
798
|
return result;
|
|
801
799
|
}
|
|
802
|
-
function multiply_matrices(
|
|
803
|
-
const rows_a =
|
|
804
|
-
const cols_a =
|
|
805
|
-
const cols_b =
|
|
800
|
+
function multiply_matrices(matrix_a, matrix_b) {
|
|
801
|
+
const rows_a = matrix_a.length;
|
|
802
|
+
const cols_a = matrix_a[0]?.length ?? 0;
|
|
803
|
+
const cols_b = matrix_b[0]?.length ?? 0;
|
|
806
804
|
const result = Array.from({ length: rows_a }, () => Array(cols_b).fill(0));
|
|
807
805
|
for (let row = 0; row < rows_a; row++) {
|
|
808
806
|
for (let col = 0; col < cols_b; col++) {
|
|
809
|
-
for (let
|
|
810
|
-
result[row][col] +=
|
|
807
|
+
for (let idx_k = 0; idx_k < cols_a; idx_k++) {
|
|
808
|
+
result[row][col] += matrix_a[row][idx_k] * matrix_b[idx_k][col];
|
|
811
809
|
}
|
|
812
810
|
}
|
|
813
811
|
}
|
|
814
812
|
return result;
|
|
815
813
|
}
|
|
816
814
|
function invert_matrix(matrix) {
|
|
817
|
-
const
|
|
818
|
-
if (
|
|
815
|
+
const size = matrix.length;
|
|
816
|
+
if (size === 0 || matrix[0].length !== size)
|
|
819
817
|
return null;
|
|
820
818
|
// Create augmented matrix [A | I]
|
|
821
819
|
const aug = matrix.map((row, idx) => [
|
|
822
820
|
...row,
|
|
823
|
-
...Array.from({ length:
|
|
821
|
+
...Array.from({ length: size }, (_, jdx) => (idx === jdx ? 1 : 0)),
|
|
824
822
|
]);
|
|
825
823
|
// Gaussian elimination with partial pivoting
|
|
826
|
-
for (let col = 0; col <
|
|
824
|
+
for (let col = 0; col < size; col++) {
|
|
827
825
|
// Find pivot
|
|
828
826
|
let max_row = col;
|
|
829
|
-
for (let row = col + 1; row <
|
|
827
|
+
for (let row = col + 1; row < size; row++) {
|
|
830
828
|
if (Math.abs(aug[row][col]) > Math.abs(aug[max_row][col])) {
|
|
831
829
|
max_row = row;
|
|
832
830
|
}
|
|
@@ -838,18 +836,18 @@ function invert_matrix(matrix) {
|
|
|
838
836
|
[aug[col], aug[max_row]] = [aug[max_row], aug[col]];
|
|
839
837
|
// Eliminate column
|
|
840
838
|
const pivot = aug[col][col];
|
|
841
|
-
for (let jdx = 0; jdx < 2 *
|
|
839
|
+
for (let jdx = 0; jdx < 2 * size; jdx++) {
|
|
842
840
|
aug[col][jdx] /= pivot;
|
|
843
841
|
}
|
|
844
|
-
for (let row = 0; row <
|
|
842
|
+
for (let row = 0; row < size; row++) {
|
|
845
843
|
if (row !== col) {
|
|
846
844
|
const factor = aug[row][col];
|
|
847
|
-
for (let jdx = 0; jdx < 2 *
|
|
845
|
+
for (let jdx = 0; jdx < 2 * size; jdx++) {
|
|
848
846
|
aug[row][jdx] -= factor * aug[col][jdx];
|
|
849
847
|
}
|
|
850
848
|
}
|
|
851
849
|
}
|
|
852
850
|
}
|
|
853
851
|
// Extract inverse
|
|
854
|
-
return aug.map((row) => row.slice(
|
|
852
|
+
return aug.map((row) => row.slice(size));
|
|
855
853
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { D3SymbolName } from '
|
|
2
|
-
import type { DataSeries, Point } from '
|
|
1
|
+
import type { D3SymbolName } from '../../labels';
|
|
2
|
+
import type { DataSeries, Point } from '..';
|
|
3
3
|
export declare const get_series_color: (series_idx: number) => string;
|
|
4
4
|
export declare const get_series_symbol: (series_idx: number) => D3SymbolName;
|
|
5
5
|
export declare const extract_series_color: (series_data: DataSeries) => string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { DEFAULT_SERIES_COLORS, DEFAULT_SERIES_SYMBOLS } from './types';
|
|
2
|
-
import { DEFAULTS } from '
|
|
2
|
+
import { DEFAULTS } from '../../settings';
|
|
3
3
|
// Get auto-cycling color for series at given index (wraps every 10)
|
|
4
4
|
export const get_series_color = (series_idx) => DEFAULT_SERIES_COLORS[series_idx % DEFAULT_SERIES_COLORS.length];
|
|
5
5
|
// Get auto-cycling symbol for series at given index (wraps every 7)
|
|
6
6
|
export const get_series_symbol = (series_idx) => DEFAULT_SERIES_SYMBOLS[series_idx % DEFAULT_SERIES_SYMBOLS.length];
|
|
7
7
|
// Extract the primary color from a series data object.
|
|
8
8
|
// Checks line stroke, then point fill (handling arrays), with fallback to default blue.
|
|
9
|
-
export const extract_series_color = (series_data) => series_data.line_style?.stroke
|
|
9
|
+
export const extract_series_color = (series_data) => (series_data.line_style?.stroke ??
|
|
10
10
|
(Array.isArray(series_data.point_style)
|
|
11
11
|
? series_data.point_style[0]?.fill
|
|
12
|
-
: series_data.point_style?.fill) ||
|
|
12
|
+
: series_data.point_style?.fill)) || // oxlint-disable-line @typescript-eslint/prefer-nullish-coalescing -- empty fill should use default color
|
|
13
13
|
`#4A9EFF`;
|
|
14
14
|
// Prepare legend data from series array
|
|
15
15
|
export const prepare_legend_data = (series) => series.map((series_data, series_idx) => ({
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Vec2 } from '../../math';
|
|
2
|
+
import type { DataSeries, ErrorBand, FillBoundary, FillCurveType, FillGradient, FillRegion } from './types';
|
|
3
|
+
export declare const LOG_EPSILON = 1e-10;
|
|
4
|
+
export interface Pt {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ResolvedBoundary {
|
|
9
|
+
points: Pt[];
|
|
10
|
+
curve: FillCurveType;
|
|
11
|
+
}
|
|
12
|
+
export interface FillSegment {
|
|
13
|
+
upper: Pt[];
|
|
14
|
+
lower: Pt[];
|
|
15
|
+
upper_curve: FillCurveType;
|
|
16
|
+
lower_curve: FillCurveType;
|
|
17
|
+
}
|
|
18
|
+
export declare function resolve_series_ref(ref: {
|
|
19
|
+
type: `series`;
|
|
20
|
+
series_idx?: number;
|
|
21
|
+
series_id?: string | number;
|
|
22
|
+
}, series: readonly DataSeries[]): DataSeries | null;
|
|
23
|
+
export declare function monotone_interpolate(xs: readonly number[], ys: readonly number[], x: number, tangents?: readonly number[]): number;
|
|
24
|
+
interface DomainContext {
|
|
25
|
+
x_domain: Vec2;
|
|
26
|
+
y_domain: Vec2;
|
|
27
|
+
y2_domain?: Vec2;
|
|
28
|
+
}
|
|
29
|
+
export declare function resolve_boundary_points(boundary: FillBoundary, series: readonly DataSeries[], domains: DomainContext, companion?: Pt[] | null): ResolvedBoundary | null;
|
|
30
|
+
export declare function compute_fill_segments(region: FillRegion, series: readonly DataSeries[], domains: DomainContext): FillSegment[];
|
|
31
|
+
export declare function generate_fill_path(upper: readonly Pt[], lower: readonly Pt[], upper_curve?: FillCurveType, lower_curve?: FillCurveType): string;
|
|
32
|
+
export declare function convert_error_band_to_fill_region(error_band: ErrorBand, series: readonly DataSeries[], default_color?: string): FillRegion | null;
|
|
33
|
+
export declare const is_fill_gradient: (fill: string | FillGradient | undefined) => fill is FillGradient;
|
|
34
|
+
export {};
|