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,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { PaneToggleProps } from '../overlays'
|
|
3
|
+
import type { ExportSection } from '../io'
|
|
4
|
+
import ExportPane from '../io/ExportPane.svelte'
|
|
2
5
|
import { export_svg_as_png, export_svg_as_svg } from '../io/export'
|
|
3
|
-
import
|
|
6
|
+
import { download } from '../io/fetch'
|
|
4
7
|
import type { ComponentProps } from 'svelte'
|
|
5
|
-
import { CopyButton } from 'svelte-multiselect'
|
|
6
|
-
import { tooltip } from 'svelte-multiselect/attachments'
|
|
7
8
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
8
9
|
import type { PhaseDiagramData } from './types'
|
|
9
10
|
|
|
@@ -29,12 +30,9 @@
|
|
|
29
30
|
filename?: string
|
|
30
31
|
png_dpi?: number
|
|
31
32
|
icon_style?: string
|
|
32
|
-
toggle_props?:
|
|
33
|
+
toggle_props?: PaneToggleProps
|
|
33
34
|
} = $props()
|
|
34
35
|
|
|
35
|
-
let json_copy_state = $state<ComponentProps<typeof CopyButton>[`state`]>(`ready`)
|
|
36
|
-
let svg_copy_state = $state<ComponentProps<typeof CopyButton>[`state`]>(`ready`)
|
|
37
|
-
|
|
38
36
|
// Generate filename with components if available (requires exactly 2 components)
|
|
39
37
|
const full_filename = $derived(
|
|
40
38
|
data?.components?.length === 2
|
|
@@ -48,137 +46,54 @@
|
|
|
48
46
|
)
|
|
49
47
|
|
|
50
48
|
const json_export_data = $derived(json_payload ?? data)
|
|
49
|
+
const json_string = (): string | null =>
|
|
50
|
+
json_export_data ? JSON.stringify(json_export_data, null, 2) : null
|
|
51
51
|
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
const sections = $derived<ExportSection[]>([
|
|
53
|
+
{
|
|
54
|
+
title: `Image`,
|
|
55
|
+
tooltip: `Download or copy the phase diagram`,
|
|
56
|
+
items: [
|
|
57
|
+
{
|
|
58
|
+
label: `SVG`,
|
|
59
|
+
disabled: !svg,
|
|
60
|
+
on_download: () => svg && export_svg_as_svg(svg, `${full_filename}.svg`),
|
|
61
|
+
copy_text: () => (svg ? new XMLSerializer().serializeToString(svg) : null),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: `PNG`,
|
|
65
|
+
disabled: !svg,
|
|
66
|
+
show_dpi: true,
|
|
67
|
+
on_download: () =>
|
|
68
|
+
svg && export_svg_as_png(svg, `${full_filename}.png`, png_dpi),
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
title: `Data`,
|
|
74
|
+
tooltip: `Export phase diagram data as JSON`,
|
|
75
|
+
items: [{
|
|
76
|
+
label: `JSON`,
|
|
77
|
+
disabled: !json_export_data,
|
|
78
|
+
on_download: () => {
|
|
79
|
+
const content = json_string()
|
|
80
|
+
if (content) download(content, `${full_filename}.json`, `application/json`)
|
|
81
|
+
},
|
|
82
|
+
copy_text: json_string,
|
|
83
|
+
}],
|
|
84
|
+
},
|
|
85
|
+
])
|
|
72
86
|
</script>
|
|
73
87
|
|
|
74
|
-
<
|
|
75
|
-
bind:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
pane_props={{ ...rest, class: `export-pane ${rest.class ?? ``}` }}
|
|
88
|
+
<ExportPane
|
|
89
|
+
bind:export_pane_open
|
|
90
|
+
bind:png_dpi
|
|
91
|
+
{sections}
|
|
79
92
|
{icon_style}
|
|
80
93
|
toggle_props={{
|
|
81
94
|
class: `pd-export-toggle`,
|
|
82
95
|
title: export_pane_open ? `` : `Export phase diagram`,
|
|
83
96
|
...caller_toggle_props,
|
|
84
97
|
}}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<h4 id="image" {@attach tooltip({ content: `Download or copy the phase diagram` })}>
|
|
88
|
-
Image
|
|
89
|
-
</h4>
|
|
90
|
-
<label>
|
|
91
|
-
SVG
|
|
92
|
-
<button
|
|
93
|
-
type="button"
|
|
94
|
-
onclick={() => svg && export_svg_as_svg(svg, `${full_filename}.svg`)}
|
|
95
|
-
disabled={!svg}
|
|
96
|
-
title="Download SVG"
|
|
97
|
-
>
|
|
98
|
-
⬇
|
|
99
|
-
</button>
|
|
100
|
-
<CopyButton
|
|
101
|
-
content={svg_string ?? ``}
|
|
102
|
-
title="Copy SVG to clipboard"
|
|
103
|
-
bind:state={svg_copy_state}
|
|
104
|
-
disabled={!svg_string}
|
|
105
|
-
/>
|
|
106
|
-
</label>
|
|
107
|
-
<label>
|
|
108
|
-
PNG
|
|
109
|
-
<button
|
|
110
|
-
type="button"
|
|
111
|
-
onclick={() => svg && export_svg_as_png(svg, `${full_filename}.png`, png_dpi)}
|
|
112
|
-
disabled={!svg}
|
|
113
|
-
title={`Download PNG (${png_dpi} DPI)`}
|
|
114
|
-
>
|
|
115
|
-
⬇
|
|
116
|
-
</button>
|
|
117
|
-
<span class="dpi-input"
|
|
118
|
-
>(DPI: <input
|
|
119
|
-
type="number"
|
|
120
|
-
min={50}
|
|
121
|
-
max={600}
|
|
122
|
-
bind:value={png_dpi}
|
|
123
|
-
title="Export resolution in dots per inch"
|
|
124
|
-
/>)</span>
|
|
125
|
-
</label>
|
|
126
|
-
|
|
127
|
-
<h4 id="data" {@attach tooltip({ content: `Export phase diagram data as JSON` })}>
|
|
128
|
-
Data
|
|
129
|
-
</h4>
|
|
130
|
-
<label>
|
|
131
|
-
JSON
|
|
132
|
-
<button
|
|
133
|
-
type="button"
|
|
134
|
-
onclick={download_json}
|
|
135
|
-
disabled={!json_export_data}
|
|
136
|
-
title="Download JSON"
|
|
137
|
-
>
|
|
138
|
-
⬇
|
|
139
|
-
</button>
|
|
140
|
-
<CopyButton
|
|
141
|
-
content={json_string ?? ``}
|
|
142
|
-
title="Copy JSON to clipboard"
|
|
143
|
-
bind:state={json_copy_state}
|
|
144
|
-
disabled={!json_string}
|
|
145
|
-
/>
|
|
146
|
-
</label>
|
|
147
|
-
</div>
|
|
148
|
-
</DraggablePane>
|
|
149
|
-
|
|
150
|
-
<style>
|
|
151
|
-
.export-grid {
|
|
152
|
-
display: flex;
|
|
153
|
-
flex-wrap: wrap;
|
|
154
|
-
align-items: center;
|
|
155
|
-
gap: 4pt 10pt;
|
|
156
|
-
}
|
|
157
|
-
.export-grid h4 {
|
|
158
|
-
display: inline-flex;
|
|
159
|
-
align-items: center;
|
|
160
|
-
margin: 0;
|
|
161
|
-
}
|
|
162
|
-
label {
|
|
163
|
-
display: flex;
|
|
164
|
-
align-items: center;
|
|
165
|
-
gap: 8pt;
|
|
166
|
-
font-size: 0.95em;
|
|
167
|
-
white-space: nowrap;
|
|
168
|
-
}
|
|
169
|
-
.dpi-input {
|
|
170
|
-
display: inline-flex;
|
|
171
|
-
align-items: center;
|
|
172
|
-
gap: 2pt;
|
|
173
|
-
white-space: nowrap;
|
|
174
|
-
}
|
|
175
|
-
button {
|
|
176
|
-
width: 1.9em;
|
|
177
|
-
height: 1.6em;
|
|
178
|
-
padding: 0 6pt;
|
|
179
|
-
box-sizing: border-box;
|
|
180
|
-
}
|
|
181
|
-
input {
|
|
182
|
-
width: 3.5em;
|
|
183
|
-
}
|
|
184
|
-
</style>
|
|
98
|
+
{...rest}
|
|
99
|
+
/>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { ComponentProps } from 'svelte';
|
|
1
|
+
import type { PaneToggleProps } from '../overlays';
|
|
3
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
3
|
import type { PhaseDiagramData } from './types';
|
|
5
4
|
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
@@ -12,8 +11,8 @@ type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
12
11
|
filename?: string;
|
|
13
12
|
png_dpi?: number;
|
|
14
13
|
icon_style?: string;
|
|
15
|
-
toggle_props?:
|
|
14
|
+
toggle_props?: PaneToggleProps;
|
|
16
15
|
};
|
|
17
|
-
declare const PhaseDiagramExportPane: import("svelte").Component<$$ComponentProps, {}, "
|
|
16
|
+
declare const PhaseDiagramExportPane: import("svelte").Component<$$ComponentProps, {}, "export_pane_open" | "png_dpi">;
|
|
18
17
|
type PhaseDiagramExportPane = ReturnType<typeof PhaseDiagramExportPane>;
|
|
19
18
|
export default PhaseDiagramExportPane;
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
|
|
107
107
|
// Calculate distance to nearest phase boundary (liquidus/solidus)
|
|
108
108
|
const boundary_distance = $derived.by(() => {
|
|
109
|
-
if (
|
|
109
|
+
if (boundaries.length === 0) return null
|
|
110
110
|
const { composition, temperature } = hover_info
|
|
111
111
|
let min_dist: { type: string; delta_t: number } | null = null
|
|
112
112
|
|
|
@@ -22,8 +22,8 @@ export function parse_curve_ref(ref) {
|
|
|
22
22
|
const slice_match = /^(.+)\[(-?\d*):(-?\d*)\]$/.exec(name);
|
|
23
23
|
if (slice_match) {
|
|
24
24
|
name = slice_match[1];
|
|
25
|
-
start = slice_match[2] ? parseInt(slice_match[2]) : null;
|
|
26
|
-
end = slice_match[3] ? parseInt(slice_match[3]) : null;
|
|
25
|
+
start = slice_match[2] ? parseInt(slice_match[2], 10) : null;
|
|
26
|
+
end = slice_match[3] ? parseInt(slice_match[3], 10) : null;
|
|
27
27
|
}
|
|
28
28
|
return { name, reverse, start, end };
|
|
29
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Phase diagram color palette
|
|
2
2
|
// Keys can be referenced in diagram JSON files
|
|
3
|
-
const rgba = (
|
|
3
|
+
const rgba = (red, green, blue, alpha = 0.6) => `rgba(${red}, ${green}, ${blue}, ${alpha})`;
|
|
4
4
|
// Color palette for diagram JSON files - keyed colors that can be referenced by name
|
|
5
5
|
export const DIAGRAM_COLORS = {
|
|
6
6
|
// Single-phase regions (alpha=0.6)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Vec2 } from '../math';
|
|
1
2
|
export declare const TDB_TEMP_DEFAULTS: {
|
|
2
3
|
readonly min: 298.15;
|
|
3
4
|
readonly max_fallback: 3000;
|
|
@@ -47,7 +48,7 @@ export interface TdbParseResult {
|
|
|
47
48
|
error?: string;
|
|
48
49
|
binary_system?: [string, string];
|
|
49
50
|
available_phases?: string[];
|
|
50
|
-
temperature_range?:
|
|
51
|
+
temperature_range?: Vec2;
|
|
51
52
|
}
|
|
52
53
|
export declare function parse_tdb(content: string): TdbParseResult;
|
|
53
54
|
export declare const get_system_name: (elements: string[]) => string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// TDB (Thermodynamic Database) file parser
|
|
2
2
|
// Parses CALPHAD TDB files to extract metadata about elements, phases, and parameters
|
|
3
3
|
import { ELEM_SYMBOLS } from '../labels';
|
|
4
|
+
import { to_error } from '../utils';
|
|
4
5
|
// Default temperature bounds for TDB parsing (in Kelvin)
|
|
5
6
|
export const TDB_TEMP_DEFAULTS = {
|
|
6
7
|
min: 298.15, // Room temperature
|
|
@@ -20,21 +21,21 @@ export function parse_tdb(content) {
|
|
|
20
21
|
};
|
|
21
22
|
// Normalize line endings and join continuation lines
|
|
22
23
|
const normalized = content
|
|
23
|
-
.
|
|
24
|
-
.
|
|
24
|
+
.replaceAll('\r\n', `\n`)
|
|
25
|
+
.replaceAll('\r', `\n`)
|
|
25
26
|
// Join lines that don't end with ! (continuation)
|
|
26
27
|
.split(`\n`)
|
|
27
28
|
.reduce((acc, line) => {
|
|
28
29
|
const trimmed = line.trim();
|
|
29
30
|
if (trimmed.startsWith(`$`)) {
|
|
30
|
-
data.comments.push(trimmed.
|
|
31
|
+
data.comments.push(trimmed.slice(1).trim());
|
|
31
32
|
return acc;
|
|
32
33
|
}
|
|
33
34
|
if (acc.length === 0 || acc[acc.length - 1].endsWith(`!`)) {
|
|
34
35
|
acc.push(trimmed);
|
|
35
36
|
}
|
|
36
37
|
else {
|
|
37
|
-
acc[acc.length - 1] += `
|
|
38
|
+
acc[acc.length - 1] += ` ${trimmed}`;
|
|
38
39
|
}
|
|
39
40
|
return acc;
|
|
40
41
|
}, [])
|
|
@@ -76,7 +77,7 @@ export function parse_tdb(content) {
|
|
|
76
77
|
return {
|
|
77
78
|
success: false,
|
|
78
79
|
data: null,
|
|
79
|
-
error: exc
|
|
80
|
+
error: to_error(exc).message,
|
|
80
81
|
};
|
|
81
82
|
}
|
|
82
83
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Point2D, Vec2 } from '../math';
|
|
2
2
|
import type { LineStyle } from '../plot';
|
|
3
|
-
import type { Sides } from '../plot/layout';
|
|
3
|
+
import type { Sides } from '../plot/core/layout';
|
|
4
4
|
import type { TooltipConfig, TooltipProp } from '../tooltip';
|
|
5
5
|
export type TempUnit = `K` | `°C` | `°F`;
|
|
6
6
|
export type CompUnit = `at%` | `wt%` | `mol%` | `fraction`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Vec2 } from '../math';
|
|
2
|
-
import type { Sides } from '../plot/layout';
|
|
2
|
+
import type { Sides } from '../plot/core/layout';
|
|
3
3
|
import type { CompUnit, LeverRuleMode, LeverRuleResult, PhaseDiagramConfig, PhaseDiagramData, PhaseHoverInfo, PhaseRegion, TempUnit, VerticalLeverRuleResult } from './types';
|
|
4
4
|
export declare function convert_temp(value: number, from: TempUnit, to: TempUnit): number;
|
|
5
5
|
export declare const PHASE_DIAGRAM_DEFAULTS: Readonly<{
|
|
@@ -28,7 +28,7 @@ export declare const PHASE_DIAGRAM_DEFAULTS: Readonly<{
|
|
|
28
28
|
margin: Readonly<Required<Sides>>;
|
|
29
29
|
png_dpi: 150;
|
|
30
30
|
}>;
|
|
31
|
-
export declare
|
|
31
|
+
export declare const merge_phase_diagram_config: (config: Partial<PhaseDiagramConfig>) => {
|
|
32
32
|
margin: {
|
|
33
33
|
t: number;
|
|
34
34
|
b: number;
|
|
@@ -91,7 +91,7 @@ export declare function compute_label_properties(label: string, bounds: {
|
|
|
91
91
|
};
|
|
92
92
|
export declare const transform_vertices: (vertices: Vec2[], x_scale: (val: number) => number, y_scale: (val: number) => number) => Vec2[];
|
|
93
93
|
export declare function format_composition(value: number, unit?: CompUnit, include_unit?: boolean): string;
|
|
94
|
-
export declare
|
|
94
|
+
export declare const format_temperature: (value: number, unit?: TempUnit) => string;
|
|
95
95
|
export declare function calculate_lever_rule(region: PhaseRegion, composition: number, temperature: number): LeverRuleResult | null;
|
|
96
96
|
export declare function calculate_vertical_lever_rule(region: PhaseRegion, composition: number, temperature: number): VerticalLeverRuleResult | null;
|
|
97
97
|
export declare function format_hover_info_text(info: PhaseHoverInfo, temp_unit?: TempUnit, comp_unit?: CompUnit, component_a?: string, component_b?: string, data_temp_unit?: TempUnit, lever_rule_mode?: LeverRuleMode): string;
|
|
@@ -46,15 +46,13 @@ export const PHASE_DIAGRAM_DEFAULTS = Object.freeze({
|
|
|
46
46
|
png_dpi: 150,
|
|
47
47
|
});
|
|
48
48
|
// Merge partial config with defaults - single helper for consistent merging
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
}
|
|
49
|
+
export const merge_phase_diagram_config = (config) => ({
|
|
50
|
+
margin: { ...PHASE_DIAGRAM_DEFAULTS.margin, ...config.margin },
|
|
51
|
+
font_size: config.font_size ?? PHASE_DIAGRAM_DEFAULTS.font_size,
|
|
52
|
+
special_point_radius: config.special_point_radius ?? PHASE_DIAGRAM_DEFAULTS.special_point_radius,
|
|
53
|
+
tie_line: { ...PHASE_DIAGRAM_DEFAULTS.tie_line, ...config.tie_line },
|
|
54
|
+
colors: { ...PHASE_DIAGRAM_DEFAULTS.colors, ...config.colors },
|
|
55
|
+
});
|
|
58
56
|
// Phase colors as hex - single source of truth
|
|
59
57
|
// Extended palette supports 3+ phase regions (Greek letters α through λ)
|
|
60
58
|
export const PHASE_COLOR_HEX = {
|
|
@@ -231,9 +229,7 @@ export function format_composition(value, unit = `at%`, include_unit = true) {
|
|
|
231
229
|
return include_unit ? `${formatted} ${unit}` : formatted;
|
|
232
230
|
}
|
|
233
231
|
// Format temperature value for display
|
|
234
|
-
export
|
|
235
|
-
return `${format_num(value, `.0f`)} ${unit}`;
|
|
236
|
-
}
|
|
232
|
+
export const format_temperature = (value, unit = `K`) => `${format_num(value, `.0f`)} ${unit}`;
|
|
237
233
|
// Parse a two-phase region name into its two phase names
|
|
238
234
|
// Returns null if the region is not exactly a two-phase region
|
|
239
235
|
function parse_two_phases(name) {
|