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
package/dist/xrd/XrdPlot.svelte
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
decompress_data_binary,
|
|
7
7
|
decompress_file,
|
|
8
8
|
detect_compression_format,
|
|
9
|
+
drag_over_handlers,
|
|
9
10
|
handle_url_drop,
|
|
10
11
|
} from '../io'
|
|
11
12
|
import { format_value } from '../labels'
|
|
@@ -26,16 +27,17 @@
|
|
|
26
27
|
import type { BroadeningParams } from './broadening'
|
|
27
28
|
import { compute_broadened_pattern, DEFAULT_BROADENING } from './broadening'
|
|
28
29
|
import type { Hkl, HklFormat, PatternEntry, XrdPattern } from './index'
|
|
30
|
+
import { to_error } from '../utils'
|
|
29
31
|
|
|
30
32
|
function is_xrd_pattern(obj: unknown): obj is XrdPattern {
|
|
31
33
|
if (!obj || typeof obj !== `object`) return false
|
|
32
34
|
const pattern_obj = obj as { x?: unknown; y?: unknown }
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
+
const x_vals = pattern_obj.x
|
|
36
|
+
const y_vals = pattern_obj.y
|
|
35
37
|
return (
|
|
36
|
-
Array.isArray(
|
|
37
|
-
Array.isArray(
|
|
38
|
-
|
|
38
|
+
Array.isArray(x_vals) &&
|
|
39
|
+
Array.isArray(y_vals) &&
|
|
40
|
+
x_vals.length === y_vals.length
|
|
39
41
|
)
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -137,7 +139,7 @@
|
|
|
137
139
|
const global_max_intensity = $derived.by(() => {
|
|
138
140
|
let max_val = 0
|
|
139
141
|
for (const entry of pattern_entries) {
|
|
140
|
-
for (const
|
|
142
|
+
for (const intensity of entry.pattern.y) if (intensity > max_val) max_val = intensity
|
|
141
143
|
}
|
|
142
144
|
return max_val || 1
|
|
143
145
|
})
|
|
@@ -158,7 +160,7 @@
|
|
|
158
160
|
})
|
|
159
161
|
|
|
160
162
|
// Scaled intensities are normalized to 0..100, add 10% top padding for peak labels
|
|
161
|
-
const intensity_range:
|
|
163
|
+
const intensity_range: Vec2 = [0, 110]
|
|
162
164
|
|
|
163
165
|
// Build BarPlot series from entries (for Discrete/Stick view)
|
|
164
166
|
const bar_series = $derived.by<BarSeries[]>(() => {
|
|
@@ -167,7 +169,7 @@
|
|
|
167
169
|
const include_name = pattern_entries.length > 1
|
|
168
170
|
// Add transparency when multiple series overlap
|
|
169
171
|
const alpha = pattern_entries.length > 1 ? 0.6 : 1
|
|
170
|
-
const scale = (
|
|
172
|
+
const scale = (y_val: number) => (y_val / global_max_intensity) * 100
|
|
171
173
|
return pattern_entries.map((entry, entry_idx) => {
|
|
172
174
|
const xs = entry.pattern.x
|
|
173
175
|
const ys = entry.pattern.y.map((val) => scale(val || 0))
|
|
@@ -279,7 +281,7 @@
|
|
|
279
281
|
const all_ys = all_processed.flatMap((processed) => processed.broadened.y)
|
|
280
282
|
const max_y = Math.max(...all_ys, 1) // Avoid div by zero
|
|
281
283
|
|
|
282
|
-
const scale = (
|
|
284
|
+
const scale = (y_val: number) => (y_val / max_y) * 100
|
|
283
285
|
const base_color = entry.color ?? PLOT_COLORS[entry_idx % PLOT_COLORS.length]
|
|
284
286
|
// Add transparency when multiple series overlap
|
|
285
287
|
const alpha = all_processed.length > 1 ? 0.6 : 1
|
|
@@ -352,7 +354,7 @@
|
|
|
352
354
|
}
|
|
353
355
|
} catch (exc) {
|
|
354
356
|
error_msg = `Failed to load file ${file.name}: ${
|
|
355
|
-
exc
|
|
357
|
+
to_error(exc).message
|
|
356
358
|
}`
|
|
357
359
|
}
|
|
358
360
|
}
|
|
@@ -473,15 +475,7 @@
|
|
|
473
475
|
}}
|
|
474
476
|
{tooltip}
|
|
475
477
|
ondrop={handle_file_drop}
|
|
476
|
-
|
|
477
|
-
event.preventDefault()
|
|
478
|
-
if (!allow_file_drop) return
|
|
479
|
-
dragover = true
|
|
480
|
-
}}
|
|
481
|
-
ondragleave={(event) => {
|
|
482
|
-
event.preventDefault()
|
|
483
|
-
dragover = false
|
|
484
|
-
}}
|
|
478
|
+
{...drag_over_handlers({ allow: () => allow_file_drop, set_dragover: (over) => dragover = over })}
|
|
485
479
|
class={(rest.class ?? ``) + (dragover ? ` dragover` : ``)}
|
|
486
480
|
style={`overflow: visible; ${rest.style ?? ``}`}
|
|
487
481
|
{controls}
|
|
@@ -495,11 +489,11 @@
|
|
|
495
489
|
{@const angle_text = `${format_value(info.x, `.2f`)}°`}
|
|
496
490
|
{@const intensity_text = `${format_value(info.y, `.1f`)}`}
|
|
497
491
|
{@const hkls = info.metadata?.hkls}
|
|
498
|
-
{@const
|
|
492
|
+
{@const d_spacing = info.metadata?.d}
|
|
499
493
|
{@const hkl_text = hkls && hkl_format
|
|
500
494
|
? hkls.map((hkl: Hkl) => format_hkl(hkl, hkl_format)).join(`, `)
|
|
501
495
|
: ``}
|
|
502
|
-
{@const d_text =
|
|
496
|
+
{@const d_text = d_spacing != null ? `${format_value(d_spacing, `.3f`)} Å` : ``}
|
|
503
497
|
{@html sanitize_html(info.metadata?.label ?? ``)}<br />
|
|
504
498
|
2θ: {angle_text}<br />
|
|
505
499
|
Intensity: {intensity_text}
|
|
@@ -532,15 +526,7 @@
|
|
|
532
526
|
}}
|
|
533
527
|
{tooltip}
|
|
534
528
|
ondrop={handle_file_drop}
|
|
535
|
-
|
|
536
|
-
event.preventDefault()
|
|
537
|
-
if (!allow_file_drop) return
|
|
538
|
-
dragover = true
|
|
539
|
-
}}
|
|
540
|
-
ondragleave={(event) => {
|
|
541
|
-
event.preventDefault()
|
|
542
|
-
dragover = false
|
|
543
|
-
}}
|
|
529
|
+
{...drag_over_handlers({ allow: () => allow_file_drop, set_dragover: (over) => dragover = over })}
|
|
544
530
|
class={(rest.class ?? ``) + (dragover ? ` dragover` : ``)}
|
|
545
531
|
style={`overflow: visible; ${rest.style ?? ``}`}
|
|
546
532
|
show_controls={controls.show}
|
package/dist/xrd/broadening.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Vec2 } from '../math';
|
|
1
2
|
import type { XrdPattern } from './index';
|
|
2
3
|
export type BroadeningParams = {
|
|
3
4
|
U: number;
|
|
@@ -16,5 +17,5 @@ fwhm: number, // Full Width at Half Maximum
|
|
|
16
17
|
eta: number): number;
|
|
17
18
|
export declare function compute_broadened_pattern(pattern: XrdPattern, // Discrete XRD pattern (peaks)
|
|
18
19
|
params: BroadeningParams, // Broadening parameters (U, V, W, shape_factor)
|
|
19
|
-
range:
|
|
20
|
+
range: Vec2, // Angular range [min, max] in degrees
|
|
20
21
|
step_size?: number): XrdPattern;
|
package/dist/xrd/calc-xrd.js
CHANGED
|
@@ -5,6 +5,7 @@ import { is_crystal } from '../structure/validation';
|
|
|
5
5
|
// Single source of truth for atomic scattering params
|
|
6
6
|
import ATOMIC_SCATTERING_PARAMS from './atomic_scattering_params.json' with { type: 'json' };
|
|
7
7
|
import { is_xrd_data_file, parse_xrd_file } from './parse';
|
|
8
|
+
import { to_error } from '../utils';
|
|
8
9
|
// XRD wavelengths in Angstrom (Å)
|
|
9
10
|
export const WAVELENGTHS = {
|
|
10
11
|
CuKa: 1.54184,
|
|
@@ -66,23 +67,13 @@ function get_unique_families(hkls) {
|
|
|
66
67
|
}
|
|
67
68
|
return family_map;
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
-
// For row-wise lattice matrix A (rows are a, b, c), reciprocal rows are inv(A)^T
|
|
71
|
-
const direct = structure.lattice.matrix;
|
|
72
|
-
const inv = math.matrix_inverse_3x3(direct);
|
|
73
|
-
const recip = math.transpose_3x3_matrix(inv);
|
|
74
|
-
return recip;
|
|
75
|
-
}
|
|
76
|
-
function enumerate_reciprocal_points(recip_rows, max_radius, min_radius) {
|
|
70
|
+
function enumerate_reciprocal_points(recip_rows, direct_rows, max_radius, min_radius) {
|
|
77
71
|
const recip_b1 = recip_rows[0];
|
|
78
72
|
const recip_b2 = recip_rows[1];
|
|
79
73
|
const recip_b3 = recip_rows[2];
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
const h_max = Math.ceil(max_radius / n1 + 2);
|
|
84
|
-
const k_max = Math.ceil(max_radius / n2 + 2);
|
|
85
|
-
const l_max = Math.ceil(max_radius / n3 + 2);
|
|
74
|
+
// Exact index bound: |h_i| = |g·a_i| ≤ R·|a_i| (since a_i·b_j = δ_ij). Bounds from
|
|
75
|
+
// reciprocal-row norms (R/|b_i| + 2) undercount for skewed cells, dropping reflections.
|
|
76
|
+
const [h_max, k_max, l_max] = direct_rows.map((row) => Math.ceil(max_radius * Math.hypot(...row)) + 1);
|
|
86
77
|
// Safety cap to avoid pathological enumeration volume
|
|
87
78
|
const CAP = 512;
|
|
88
79
|
if (Math.max(h_max, k_max, l_max) > CAP) {
|
|
@@ -133,7 +124,8 @@ export function compute_xrd_pattern(structure, options = {}) {
|
|
|
133
124
|
// Symmetry refinement (symprec > 0) is not implemented in TS version.
|
|
134
125
|
// Option retained for API parity.
|
|
135
126
|
// const symprec = options.symprec ?? 0
|
|
136
|
-
|
|
127
|
+
// For row-wise lattice matrix A (rows are a, b, c), reciprocal rows are inv(A)^T
|
|
128
|
+
const recip_rows = math.transpose_3x3_matrix(math.matrix_inverse_3x3(structure.lattice.matrix));
|
|
137
129
|
// Bragg condition bounds: reciprocal vector length r = 2 sin(theta) / lambda
|
|
138
130
|
const two_theta_range = options.two_theta_range === null ? null : (options.two_theta_range ?? [0, 180]);
|
|
139
131
|
const [min_radius, max_radius] = two_theta_range === null
|
|
@@ -143,7 +135,7 @@ export function compute_xrd_pattern(structure, options = {}) {
|
|
|
143
135
|
const r_max = (2 * Math.sin((t_max / 2) * (Math.PI / 180))) / wavelength;
|
|
144
136
|
return [r_min, r_max];
|
|
145
137
|
})(two_theta_range);
|
|
146
|
-
const recip_points = enumerate_reciprocal_points(recip_rows, max_radius, min_radius);
|
|
138
|
+
const recip_points = enumerate_reciprocal_points(recip_rows, structure.lattice.matrix, max_radius, min_radius);
|
|
147
139
|
const coeffs = [];
|
|
148
140
|
const frac_coords = [];
|
|
149
141
|
const occus = [];
|
|
@@ -163,7 +155,7 @@ export function compute_xrd_pattern(structure, options = {}) {
|
|
|
163
155
|
if (Array.isArray(raw_coeff)) {
|
|
164
156
|
const a_arr = raw_coeff.map(([a]) => a);
|
|
165
157
|
const b_arr = raw_coeff.map(([_, b]) => b);
|
|
166
|
-
coeff_entry = { a: a_arr, b: b_arr };
|
|
158
|
+
coeff_entry = { a: a_arr, b: b_arr, z: ELEMENT_Z[element_symbol] };
|
|
167
159
|
}
|
|
168
160
|
else {
|
|
169
161
|
coeff_entry = { a: raw_coeff.a.slice(), b: raw_coeff.b.slice(), c: raw_coeff.c };
|
|
@@ -194,11 +186,15 @@ export function compute_xrd_pattern(structure, options = {}) {
|
|
|
194
186
|
const g_dot_r_all = frac_coords.map((frac_coord) => math.dot(frac_coord, hkl));
|
|
195
187
|
// Atomic scattering factors (vectorized style)
|
|
196
188
|
const f_scattering = coeffs.map((coeff_entry) => {
|
|
197
|
-
const { a: a_arr, b: b_arr } = coeff_entry;
|
|
189
|
+
const { a: a_arr, b: b_arr, z: atomic_number } = coeff_entry;
|
|
198
190
|
const num_terms = Math.min(a_arr.length, b_arr.length);
|
|
199
191
|
const sum_terms = a_arr
|
|
200
192
|
.slice(0, num_terms)
|
|
201
193
|
.reduce((sum, a_i, term_idx) => sum + a_i * Math.exp(-b_arr[term_idx] * sin_theta_over_lambda_sq), 0);
|
|
194
|
+
// pymatgen-style fitted params: f = Z − 41.78214·s²·Σ aᵢ·exp(−bᵢ·s²)
|
|
195
|
+
if (atomic_number !== undefined) {
|
|
196
|
+
return atomic_number - 41.78214 * sin_theta_over_lambda_sq * sum_terms;
|
|
197
|
+
}
|
|
202
198
|
return sum_terms + (coeff_entry.c ?? 0);
|
|
203
199
|
});
|
|
204
200
|
const dw_corr = dw_factors.map((dw_b) => Math.exp(-dw_b * sin_theta_over_lambda_sq));
|
|
@@ -303,7 +299,9 @@ wavelength) {
|
|
|
303
299
|
}
|
|
304
300
|
// Get base extension (strip .gz if present) for error message
|
|
305
301
|
const base_name = filename.toLowerCase().replace(/\.gz$/, ``);
|
|
306
|
-
|
|
302
|
+
// truthiness (not ??) so an empty extension (filename ending in `.`) falls back to XRD
|
|
303
|
+
const last_part = base_name.split(`.`).pop();
|
|
304
|
+
const ext = last_part ? last_part.toUpperCase() : `XRD`;
|
|
307
305
|
const format_hints = {
|
|
308
306
|
XY: `Expected 2-column format: "2theta intensity" (space/tab/comma separated)`,
|
|
309
307
|
XYE: `Expected 3-column format: "2theta intensity error" (space/tab/comma separated)`,
|
|
@@ -329,7 +327,7 @@ wavelength) {
|
|
|
329
327
|
}
|
|
330
328
|
catch (exc) {
|
|
331
329
|
return {
|
|
332
|
-
error: `Failed to compute XRD pattern: ${exc
|
|
330
|
+
error: `Failed to compute XRD pattern: ${to_error(exc).message}`,
|
|
333
331
|
};
|
|
334
332
|
}
|
|
335
333
|
}
|
package/dist/xrd/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CompositionType } from '../composition';
|
|
2
|
-
import type { Vec3 } from '../math';
|
|
2
|
+
import type { Vec2, Vec3 } from '../math';
|
|
3
3
|
import type { RadiationKey } from './calc-xrd';
|
|
4
4
|
export * from './broadening';
|
|
5
5
|
export * from './calc-xrd';
|
|
@@ -26,7 +26,7 @@ export type XrdOptions = {
|
|
|
26
26
|
symprec?: number;
|
|
27
27
|
debye_waller_factors?: CompositionType;
|
|
28
28
|
scaled?: boolean;
|
|
29
|
-
two_theta_range?:
|
|
29
|
+
two_theta_range?: Vec2 | null;
|
|
30
30
|
peak_merge_tol?: number;
|
|
31
31
|
scaled_intensity_tol?: number;
|
|
32
32
|
};
|
package/dist/xrd/parse.js
CHANGED
|
@@ -343,7 +343,7 @@ function parse_bruker_raw_v1(view, bytes) {
|
|
|
343
343
|
// Find where binary data starts (after header)
|
|
344
344
|
let data_offset = 512;
|
|
345
345
|
if (count_match) {
|
|
346
|
-
const expected_count = parseInt(count_match[1]);
|
|
346
|
+
const expected_count = parseInt(count_match[1], 10);
|
|
347
347
|
// Binary data is typically 4 bytes per intensity (float32)
|
|
348
348
|
data_offset = bytes.length - expected_count * 4;
|
|
349
349
|
}
|
|
@@ -406,7 +406,7 @@ function parse_rigaku_raw_file(data) {
|
|
|
406
406
|
return null; // Not a recognizable Rigaku format
|
|
407
407
|
const start = start_match ? parseFloat(start_match[1]) : 0;
|
|
408
408
|
const step = step_match ? parseFloat(step_match[1]) : DEFAULT_STEP_SIZE;
|
|
409
|
-
const expected_count = count_match ? parseInt(count_match[1]) : 0;
|
|
409
|
+
const expected_count = count_match ? parseInt(count_match[1], 10) : 0;
|
|
410
410
|
// Find binary data section
|
|
411
411
|
// Rigaku typically stores intensities as 32-bit floats or integers
|
|
412
412
|
let data_offset = 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterviz",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Interactive visualizations for materials science: periodic tables, 3D structures, MD trajectories, heatmaps, scatter plots.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chemistry",
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"**/*.css"
|
|
24
|
+
],
|
|
22
25
|
"exports": {
|
|
23
26
|
".": {
|
|
24
27
|
"types": "./dist/index.d.ts",
|
|
@@ -30,7 +33,6 @@
|
|
|
30
33
|
"default": "./dist/element/data.js"
|
|
31
34
|
},
|
|
32
35
|
"./app.css": {
|
|
33
|
-
"types": "./dist/app.css.d.ts",
|
|
34
36
|
"default": "./dist/app.css"
|
|
35
37
|
},
|
|
36
38
|
"./brillouin": {
|
|
@@ -109,10 +111,18 @@
|
|
|
109
111
|
"types": "./dist/plot/index.d.ts",
|
|
110
112
|
"default": "./dist/plot/index.js"
|
|
111
113
|
},
|
|
114
|
+
"./plot/*": {
|
|
115
|
+
"types": "./dist/plot/*/index.d.ts",
|
|
116
|
+
"default": "./dist/plot/*/index.js"
|
|
117
|
+
},
|
|
112
118
|
"./rdf": {
|
|
113
119
|
"types": "./dist/rdf/index.d.ts",
|
|
114
120
|
"default": "./dist/rdf/index.js"
|
|
115
121
|
},
|
|
122
|
+
"./scene": {
|
|
123
|
+
"types": "./dist/scene/index.d.ts",
|
|
124
|
+
"default": "./dist/scene/index.js"
|
|
125
|
+
},
|
|
116
126
|
"./spectral": {
|
|
117
127
|
"types": "./dist/spectral/index.d.ts",
|
|
118
128
|
"default": "./dist/spectral/index.js"
|
|
@@ -138,7 +148,6 @@
|
|
|
138
148
|
"default": "./dist/theme/index.js"
|
|
139
149
|
},
|
|
140
150
|
"./theme/themes": {
|
|
141
|
-
"types": "./dist/theme/themes.d.ts",
|
|
142
151
|
"default": "./dist/theme/themes.mjs"
|
|
143
152
|
},
|
|
144
153
|
"./tooltip": {
|
|
@@ -169,63 +178,69 @@
|
|
|
169
178
|
"scripts": {
|
|
170
179
|
"test": "vp test --run && playwright test",
|
|
171
180
|
"knip": "knip --include dependencies,devDependencies",
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"
|
|
181
|
+
"knip:exports": "knip --include exports,types,nsExports",
|
|
182
|
+
"publint": "publint",
|
|
183
|
+
"package-dist-assets": "node scripts/package-dist-assets.ts",
|
|
184
|
+
"package:dist": "svelte-package && pnpm run package-dist-assets",
|
|
185
|
+
"prepare": "svelte-kit sync && pnpm run package:dist",
|
|
186
|
+
"prepublishOnly": "pnpm run package:dist"
|
|
176
187
|
},
|
|
177
188
|
"dependencies": {
|
|
178
|
-
"@spglib/moyo-wasm": "^0.
|
|
179
|
-
"@sveltejs/kit": "2.
|
|
189
|
+
"@spglib/moyo-wasm": "^0.12.0",
|
|
190
|
+
"@sveltejs/kit": "2.65.1",
|
|
180
191
|
"@threlte/core": "^8.5.16",
|
|
181
|
-
"@threlte/extras": "^9.
|
|
192
|
+
"@threlte/extras": "^9.21.0",
|
|
182
193
|
"d3-array": "^3.2.4",
|
|
183
194
|
"d3-color": "^3.1.0",
|
|
184
195
|
"d3-format": "^3.1.2",
|
|
185
196
|
"d3-hierarchy": "^3.1.2",
|
|
186
197
|
"d3-interpolate-path": "^2.3.0",
|
|
198
|
+
"d3-sankey": "^0.12.3",
|
|
187
199
|
"d3-scale": "^4.0.2",
|
|
188
200
|
"d3-scale-chromatic": "^3.1.0",
|
|
189
201
|
"d3-shape": "^3.2.0",
|
|
190
202
|
"d3-time-format": "^4.1.0",
|
|
191
|
-
"dompurify": "
|
|
203
|
+
"dompurify": "3.4.7",
|
|
192
204
|
"fflate": "^0.8.3",
|
|
193
|
-
"h5wasm": "^0.10.
|
|
194
|
-
"js-yaml": "^4.
|
|
195
|
-
"svelte-multiselect": "^11.7.
|
|
205
|
+
"h5wasm": "^0.10.3",
|
|
206
|
+
"js-yaml": "^4.2.0",
|
|
207
|
+
"svelte-multiselect": "^11.7.2",
|
|
196
208
|
"three": "^0.184.0"
|
|
197
209
|
},
|
|
198
210
|
"devDependencies": {
|
|
211
|
+
"@janosh/vite-config": "github:janosh/dotfiles",
|
|
199
212
|
"@playwright/test": "^1.60.0",
|
|
200
213
|
"@sveltejs/adapter-static": "3.0.10",
|
|
201
|
-
"@sveltejs/package": "^2.5.
|
|
214
|
+
"@sveltejs/package": "^2.5.8",
|
|
202
215
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
203
216
|
"@types/d3-array": "^3.2.2",
|
|
204
217
|
"@types/d3-color": "^3.1.3",
|
|
205
218
|
"@types/d3-format": "^3.0.4",
|
|
206
219
|
"@types/d3-hierarchy": "^3.1.7",
|
|
207
220
|
"@types/d3-interpolate-path": "^2.0.3",
|
|
221
|
+
"@types/d3-sankey": "^0.12.5",
|
|
208
222
|
"@types/d3-scale": "^4.0.9",
|
|
209
223
|
"@types/d3-scale-chromatic": "^3.1.0",
|
|
210
224
|
"@types/d3-shape": "^3.1.8",
|
|
211
225
|
"@types/d3-time-format": "^4.0.3",
|
|
212
226
|
"@types/js-yaml": "^4.0.9",
|
|
213
|
-
"@types/node": "^25.9.
|
|
227
|
+
"@types/node": "^25.9.3",
|
|
214
228
|
"@types/three": "^0.184.1",
|
|
215
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
216
|
-
"@vitest/coverage-v8": "4.1.
|
|
217
|
-
"@wooorm/starry-night": "^3.
|
|
218
|
-
"happy-dom": "^20.
|
|
219
|
-
"knip": "^6.
|
|
229
|
+
"@typescript/native-preview": "7.0.0-dev.20260614.1",
|
|
230
|
+
"@vitest/coverage-v8": "4.1.8",
|
|
231
|
+
"@wooorm/starry-night": "^3.10.0",
|
|
232
|
+
"happy-dom": "^20.10.3",
|
|
233
|
+
"knip": "^6.16.1",
|
|
220
234
|
"mdsvex": "^0.12.7",
|
|
235
|
+
"publint": "^0.3.21",
|
|
221
236
|
"rehype-katex": "^7.0.1",
|
|
222
237
|
"remark-math": "3.0.1",
|
|
223
|
-
"svelte": "5.56.
|
|
224
|
-
"svelte-check-rs": "0.
|
|
238
|
+
"svelte": "^5.56.3",
|
|
239
|
+
"svelte-check-rs": "0.10.1",
|
|
225
240
|
"typescript": "6.0.3",
|
|
226
|
-
"vite": "^8.0.
|
|
241
|
+
"vite": "^8.0.16",
|
|
227
242
|
"vite-plus": "latest",
|
|
228
|
-
"vitest": "4.1.
|
|
243
|
+
"vitest": "4.1.8"
|
|
229
244
|
},
|
|
230
245
|
"peerDependencies": {
|
|
231
246
|
"svelte": "^5.0.0"
|
|
@@ -233,9 +248,11 @@
|
|
|
233
248
|
"engines": {
|
|
234
249
|
"node": ">=24"
|
|
235
250
|
},
|
|
251
|
+
"packageManager": "pnpm@11.5.0",
|
|
236
252
|
"knip": {
|
|
237
253
|
"entry": [
|
|
238
|
-
"svelte.config.ts"
|
|
254
|
+
"svelte.config.ts",
|
|
255
|
+
"src/site/**/*.{js,ts,svelte}"
|
|
239
256
|
],
|
|
240
257
|
"ignore": [
|
|
241
258
|
"extensions/**"
|