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
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
import Icon from '../Icon.svelte'
|
|
9
9
|
import type { D3SymbolName } from '../labels'
|
|
10
10
|
import { symbol_map } from '../labels'
|
|
11
|
-
import { set_fullscreen_bg, setup_fullscreen_effect } from '../layout'
|
|
11
|
+
import { FullscreenButton, set_fullscreen_bg, setup_fullscreen_effect } from '../layout'
|
|
12
|
+
import type { Point2D, Vec2 } from '../math'
|
|
12
13
|
import type {
|
|
13
14
|
AxisConfig,
|
|
14
15
|
PointStyle,
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
import ConvexHullTooltip from './ConvexHullTooltip.svelte'
|
|
26
27
|
import GasPressureControls from './GasPressureControls.svelte'
|
|
27
28
|
import * as helpers from './helpers'
|
|
29
|
+
import { create_hull_data_pipeline } from './hull-state.svelte'
|
|
28
30
|
import type { BaseConvexHullProps } from './index'
|
|
29
31
|
import { CONVEX_HULL_STYLE, default_controls, default_hull_config } from './index'
|
|
30
32
|
import StructurePopup from './StructurePopup.svelte'
|
|
@@ -36,27 +38,31 @@
|
|
|
36
38
|
HoverData3D,
|
|
37
39
|
PhaseData,
|
|
38
40
|
} from './types'
|
|
39
|
-
import {
|
|
41
|
+
import { MAGNETIC_ORDERING_CATEGORY } from './types'
|
|
40
42
|
|
|
41
43
|
// Binary convex hull rendered as energy vs composition (x in [0, 1])
|
|
42
44
|
let {
|
|
43
45
|
entries = [],
|
|
44
46
|
controls = {},
|
|
45
47
|
config = {},
|
|
48
|
+
show_controls,
|
|
46
49
|
on_point_click,
|
|
47
50
|
on_point_hover,
|
|
48
51
|
fullscreen = $bindable(DEFAULTS.convex_hull.binary.fullscreen),
|
|
52
|
+
fullscreen_toggle = true,
|
|
49
53
|
enable_info_pane = true,
|
|
50
54
|
wrapper = $bindable(),
|
|
51
55
|
label_threshold = 50,
|
|
52
56
|
show_stable = $bindable(DEFAULTS.convex_hull.binary.show_stable),
|
|
53
57
|
show_unstable = $bindable(DEFAULTS.convex_hull.binary.show_unstable),
|
|
58
|
+
entry_category = MAGNETIC_ORDERING_CATEGORY,
|
|
59
|
+
hidden_categories = $bindable([]),
|
|
54
60
|
color_mode = $bindable(DEFAULTS.convex_hull.binary.color_mode),
|
|
55
61
|
color_scale = $bindable(
|
|
56
62
|
DEFAULTS.convex_hull.binary.color_scale as D3InterpolateName,
|
|
57
63
|
),
|
|
58
64
|
info_pane_open = $bindable(DEFAULTS.convex_hull.binary.info_pane_open),
|
|
59
|
-
|
|
65
|
+
controls_open = $bindable(DEFAULTS.convex_hull.binary.legend_pane_open),
|
|
60
66
|
max_hull_dist_show_phases = $bindable(
|
|
61
67
|
DEFAULTS.convex_hull.binary.max_hull_dist_show_phases,
|
|
62
68
|
),
|
|
@@ -95,7 +101,7 @@
|
|
|
95
101
|
} = $props()
|
|
96
102
|
|
|
97
103
|
const merged_controls = $derived({ ...default_controls, ...controls })
|
|
98
|
-
const controls_config = $derived(normalize_show_controls(
|
|
104
|
+
const controls_config = $derived(normalize_show_controls(show_controls))
|
|
99
105
|
const merged_config = $derived({
|
|
100
106
|
...default_hull_config,
|
|
101
107
|
point_size: 6, // Binary diagrams use slightly smaller points
|
|
@@ -104,6 +110,12 @@
|
|
|
104
110
|
margin: { t: 40, r: 40, b: 60, l: 60, ...config.margin },
|
|
105
111
|
})
|
|
106
112
|
|
|
113
|
+
// Narrow deriveds to primitive fields so heavy downstream deriveds (scatter series,
|
|
114
|
+
// hull segments) don't recompute whenever the broad merged_config object is recreated.
|
|
115
|
+
const stable_color = $derived(merged_config.colors?.stable)
|
|
116
|
+
const unstable_color = $derived(merged_config.colors?.unstable)
|
|
117
|
+
const show_hull_line = $derived(merged_config.show_hull)
|
|
118
|
+
|
|
107
119
|
// Merge highlight style with defaults (consistent with 3D/4D)
|
|
108
120
|
const merged_highlight_style = $derived(
|
|
109
121
|
helpers.merge_highlight_style(highlight_style),
|
|
@@ -113,86 +125,35 @@
|
|
|
113
125
|
const is_highlighted = (entry: ConvexHullEntry): boolean =>
|
|
114
126
|
helpers.is_entry_highlighted(entry, highlighted_entries)
|
|
115
127
|
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
// Gas-dependent chemical potential support (corrections based on T, P)
|
|
141
|
-
const {
|
|
142
|
-
entries: gas_corrected_entries,
|
|
143
|
-
analysis: gas_analysis,
|
|
144
|
-
merged_config: merged_gas_config,
|
|
145
|
-
} = $derived(
|
|
146
|
-
helpers.get_gas_corrected_entries(
|
|
147
|
-
temp_filtered_entries,
|
|
148
|
-
gas_config,
|
|
149
|
-
gas_pressures,
|
|
150
|
-
temperature ?? helpers.DEFAULT_GAS_TEMP,
|
|
151
|
-
),
|
|
152
|
-
)
|
|
153
|
-
|
|
154
|
-
let { // Compute energy mode information
|
|
155
|
-
has_precomputed_e_form,
|
|
156
|
-
has_precomputed_hull,
|
|
157
|
-
can_compute_e_form,
|
|
158
|
-
can_compute_hull,
|
|
159
|
-
energy_mode,
|
|
160
|
-
unary_refs,
|
|
161
|
-
} = $derived(
|
|
162
|
-
helpers.compute_energy_mode_info(
|
|
163
|
-
gas_corrected_entries,
|
|
164
|
-
thermo.find_lowest_energy_unary_refs,
|
|
165
|
-
energy_source_mode,
|
|
166
|
-
),
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
const effective_entries = $derived(
|
|
170
|
-
helpers.get_effective_entries(
|
|
171
|
-
gas_corrected_entries,
|
|
172
|
-
energy_mode,
|
|
173
|
-
unary_refs,
|
|
174
|
-
thermo.compute_e_form_per_atom,
|
|
175
|
-
),
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
// Process data and element set
|
|
179
|
-
const pd_data = $derived(thermo.process_hull_entries(effective_entries))
|
|
180
|
-
|
|
181
|
-
const polymorph_stats_map = $derived(
|
|
182
|
-
helpers.compute_all_polymorph_stats(effective_entries),
|
|
183
|
-
) // Pre-compute polymorph stats once for O(1) tooltip lookups
|
|
184
|
-
|
|
185
|
-
const elements = $derived.by(() => {
|
|
186
|
-
if (pd_data.elements.length > 2) {
|
|
187
|
-
console.error(
|
|
188
|
-
`ConvexHull2D: Dataset contains ${pd_data.elements.length} elements, but binary diagrams require exactly 2. Found: [${
|
|
189
|
-
pd_data.elements.join(`, `)
|
|
190
|
-
}]`,
|
|
191
|
-
)
|
|
192
|
-
return []
|
|
193
|
-
}
|
|
194
|
-
return pd_data.elements
|
|
128
|
+
// Shared reactive data pipeline (temperature → gas → energy mode → hull data → threshold)
|
|
129
|
+
// Explicit generic breaks the circular type inference through the all_enriched_entries thunk
|
|
130
|
+
const hull_data = create_hull_data_pipeline<ConvexHullEntry>({
|
|
131
|
+
dim: 2,
|
|
132
|
+
entries: () => entries,
|
|
133
|
+
temperature: () => temperature,
|
|
134
|
+
interpolate_temperature: () => interpolate_temperature,
|
|
135
|
+
max_interpolation_gap: () => max_interpolation_gap,
|
|
136
|
+
gas_config: () => gas_config,
|
|
137
|
+
gas_pressures: () => gas_pressures,
|
|
138
|
+
energy_source_mode: () => energy_source_mode,
|
|
139
|
+
all_enriched_entries: () => all_enriched_entries,
|
|
140
|
+
max_hull_dist_show_phases: () => max_hull_dist_show_phases,
|
|
141
|
+
show_stable: () => show_stable,
|
|
142
|
+
show_unstable: () => show_unstable,
|
|
143
|
+
entry_category: () => entry_category,
|
|
144
|
+
hidden_categories: () => hidden_categories,
|
|
145
|
+
keep_plot_entry: (entry, max_dist) =>
|
|
146
|
+
helpers.entry_is_stable(entry) || (entry.e_above_hull ?? 0) <= max_dist,
|
|
147
|
+
set_temperature: (next_temp) => temperature = next_temp,
|
|
148
|
+
set_max_hull_dist_show_phases: (value) => max_hull_dist_show_phases = value,
|
|
149
|
+
set_stable_entries: (value) => stable_entries = value,
|
|
150
|
+
set_unstable_entries: (value) => unstable_entries = value,
|
|
195
151
|
})
|
|
152
|
+
const merged_gas_config = $derived(hull_data.merged_gas_config)
|
|
153
|
+
const elements = $derived(hull_data.elements)
|
|
154
|
+
const auto_default_threshold = $derived(hull_data.auto_default_threshold)
|
|
155
|
+
const plot_entries = $derived(hull_data.plot_entries)
|
|
156
|
+
const visible_entries = $derived(hull_data.visible_entries)
|
|
196
157
|
|
|
197
158
|
// Coordinate computation ----------------------------------------------------
|
|
198
159
|
function compute_binary_coordinates(
|
|
@@ -209,7 +170,7 @@
|
|
|
209
170
|
const total = Object.values(entry.composition).reduce((sum, amount) => sum + amount, 0)
|
|
210
171
|
if (total <= 0) continue
|
|
211
172
|
const frac_b = (entry.composition[el2] || 0) / total
|
|
212
|
-
const is_element = is_unary_entry(entry)
|
|
173
|
+
const is_element = helpers.is_unary_entry(entry)
|
|
213
174
|
coords.push({ ...entry, x: frac_b, y: e_form, z: 0, is_element })
|
|
214
175
|
}
|
|
215
176
|
// Ensure elemental references at x=0 and x=1 with y=0 to close the hull
|
|
@@ -234,7 +195,7 @@
|
|
|
234
195
|
const coords_entries = $derived.by(() => {
|
|
235
196
|
if (elements.length !== 2) return []
|
|
236
197
|
try {
|
|
237
|
-
return compute_binary_coordinates(pd_data.entries, elements)
|
|
198
|
+
return compute_binary_coordinates(hull_data.pd_data.entries, elements)
|
|
238
199
|
} catch (error) {
|
|
239
200
|
console.error(`Error computing binary coordinates:`, error)
|
|
240
201
|
return []
|
|
@@ -242,10 +203,12 @@
|
|
|
242
203
|
})
|
|
243
204
|
|
|
244
205
|
// Compute hull and enrich entries with e_above_hull (before filtering)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
206
|
+
// Explicit return type breaks circular type inference with the hull_data pipeline
|
|
207
|
+
const { all_enriched_entries, hull_points } = $derived.by(
|
|
208
|
+
(): { all_enriched_entries: ConvexHullEntry[]; hull_points: Point2D[] } => {
|
|
209
|
+
if (coords_entries.length === 0) {
|
|
210
|
+
return { all_enriched_entries: [], hull_points: [] }
|
|
211
|
+
}
|
|
249
212
|
|
|
250
213
|
// Build lower hull input: one minimum-energy point per composition x.
|
|
251
214
|
// Excluded entries don't participate in hull construction.
|
|
@@ -267,52 +230,11 @@
|
|
|
267
230
|
const enriched_entries = coords_entries.map((entry) => {
|
|
268
231
|
const y_hull = thermo.interpolate_hull_2d(computed_hull_points, entry.x)
|
|
269
232
|
const raw_dist = y_hull == null ? 0 : entry.y - y_hull
|
|
270
|
-
return { ...entry, ...compute_hull_stability(raw_dist, entry.exclude_from_hull) }
|
|
233
|
+
return { ...entry, ...helpers.compute_hull_stability(raw_dist, entry.exclude_from_hull) }
|
|
271
234
|
})
|
|
272
235
|
return { all_enriched_entries: enriched_entries, hull_points: computed_hull_points }
|
|
273
236
|
})
|
|
274
237
|
|
|
275
|
-
// Auto threshold: show all for few entries, use default for many, interpolate between
|
|
276
|
-
const max_hull_dist_in_data = $derived(
|
|
277
|
-
helpers.calc_max_hull_dist_in_data(all_enriched_entries),
|
|
278
|
-
)
|
|
279
|
-
const auto_default_threshold = $derived(helpers.compute_auto_hull_dist_threshold(
|
|
280
|
-
all_enriched_entries.length,
|
|
281
|
-
max_hull_dist_in_data,
|
|
282
|
-
DEFAULTS.convex_hull.binary.max_hull_dist_show_phases,
|
|
283
|
-
))
|
|
284
|
-
|
|
285
|
-
const next_auto_threshold = helpers.auto_threshold_reset(
|
|
286
|
-
DEFAULTS.convex_hull.binary.max_hull_dist_show_phases,
|
|
287
|
-
)
|
|
288
|
-
$effect(() => {
|
|
289
|
-
max_hull_dist_show_phases = next_auto_threshold(
|
|
290
|
-
entries,
|
|
291
|
-
max_hull_dist_show_phases,
|
|
292
|
-
auto_default_threshold,
|
|
293
|
-
) ?? max_hull_dist_show_phases
|
|
294
|
-
})
|
|
295
|
-
|
|
296
|
-
// Filter by threshold; visibility is a view predicate, not entry state.
|
|
297
|
-
const plot_entries = $derived(
|
|
298
|
-
all_enriched_entries.filter((entry) =>
|
|
299
|
-
helpers.entry_is_stable(entry) ||
|
|
300
|
-
(entry.e_above_hull ?? 0) <= max_hull_dist_show_phases
|
|
301
|
-
),
|
|
302
|
-
)
|
|
303
|
-
|
|
304
|
-
// Update bindable entries arrays when plot_entries change (single pass)
|
|
305
|
-
$effect(() => {
|
|
306
|
-
const stable: ConvexHullEntry[] = []
|
|
307
|
-
const unstable: ConvexHullEntry[] = []
|
|
308
|
-
for (const entry of plot_entries) {
|
|
309
|
-
if (helpers.entry_is_stable(entry)) stable.push(entry)
|
|
310
|
-
else unstable.push(entry)
|
|
311
|
-
}
|
|
312
|
-
stable_entries = stable
|
|
313
|
-
unstable_entries = unstable
|
|
314
|
-
})
|
|
315
|
-
|
|
316
238
|
let reset_counter = $state(0)
|
|
317
239
|
// Drag and drop state (to match 3D/4D components)
|
|
318
240
|
let drag_over = $state(false)
|
|
@@ -320,7 +242,7 @@
|
|
|
320
242
|
let copy_feedback = $state({ visible: false, position: { x: 0, y: 0 } })
|
|
321
243
|
|
|
322
244
|
// Structure popup state
|
|
323
|
-
let structure_popup = $state<{
|
|
245
|
+
let structure_popup = $state.raw<{
|
|
324
246
|
open: boolean
|
|
325
247
|
structure: AnyStructure | null
|
|
326
248
|
entry: ConvexHullEntry | null
|
|
@@ -333,8 +255,8 @@
|
|
|
333
255
|
})
|
|
334
256
|
|
|
335
257
|
// Axis mapping helpers ------------------------------------------------------
|
|
336
|
-
const x_domain = $derived<
|
|
337
|
-
const y_domain = $derived.by(():
|
|
258
|
+
const x_domain = $derived<Vec2>([0, 1])
|
|
259
|
+
const y_domain = $derived.by((): Vec2 => {
|
|
338
260
|
const ys = plot_entries.map((entry) => entry.y)
|
|
339
261
|
if (ys.length === 0) return [-1, 0]
|
|
340
262
|
const min_y_data = Math.min(...ys)
|
|
@@ -353,13 +275,6 @@
|
|
|
353
275
|
return name in symbol_map ? (name as D3SymbolName) : undefined
|
|
354
276
|
}
|
|
355
277
|
|
|
356
|
-
// Pre-compute visible entries to avoid redundant filtering
|
|
357
|
-
const visible_entries = $derived(helpers.visible_entries(
|
|
358
|
-
plot_entries,
|
|
359
|
-
show_stable,
|
|
360
|
-
show_unstable,
|
|
361
|
-
))
|
|
362
|
-
|
|
363
278
|
const scatter_points_series = $derived.by(() => {
|
|
364
279
|
const is_energy_mode = color_mode === `energy`
|
|
365
280
|
const count = visible_entries.length
|
|
@@ -381,17 +296,17 @@
|
|
|
381
296
|
const hl = is_highlighted(entry) ? merged_highlight_style : null
|
|
382
297
|
|
|
383
298
|
point_style[idx] = {
|
|
384
|
-
fill: hl
|
|
385
|
-
? hl
|
|
299
|
+
fill: hl?.effect === `color` || hl?.effect === `both`
|
|
300
|
+
? hl?.color
|
|
386
301
|
: is_energy_mode
|
|
387
302
|
? undefined
|
|
388
|
-
:
|
|
303
|
+
: (is_stable ? stable_color : unstable_color),
|
|
389
304
|
stroke: is_stable ? `#ffffff` : `#000000`,
|
|
390
|
-
radius: hl
|
|
391
|
-
? base_radius * hl
|
|
305
|
+
radius: hl?.effect === `size` || hl?.effect === `both`
|
|
306
|
+
? base_radius * (hl?.size_multiplier ?? 1)
|
|
392
307
|
: base_radius,
|
|
393
308
|
symbol_type: marker_to_d3_symbol(entry.marker),
|
|
394
|
-
is_highlighted:
|
|
309
|
+
is_highlighted: Boolean(hl),
|
|
395
310
|
highlight_effect: hl?.effect,
|
|
396
311
|
highlight_color: hl?.color,
|
|
397
312
|
}
|
|
@@ -400,7 +315,9 @@
|
|
|
400
315
|
return {
|
|
401
316
|
x: x_vals,
|
|
402
317
|
y: y_vals,
|
|
403
|
-
|
|
318
|
+
// ConvexHullEntry is an interface (no implicit index signature), so cast for
|
|
319
|
+
// ScatterPlot's Metadata extends Record<string, unknown> constraint
|
|
320
|
+
metadata: visible_entries as (ConvexHullEntry & Record<string, unknown>)[],
|
|
404
321
|
markers: `points` as const,
|
|
405
322
|
point_style,
|
|
406
323
|
...(is_energy_mode ? { color_values } : {}),
|
|
@@ -408,7 +325,7 @@
|
|
|
408
325
|
})
|
|
409
326
|
|
|
410
327
|
const hull_segments_series = $derived.by(() => {
|
|
411
|
-
if (!
|
|
328
|
+
if (!show_hull_line || hull_points.length < 2) return []
|
|
412
329
|
const segments = []
|
|
413
330
|
for (let idx = 0; idx < hull_points.length - 1; idx++) {
|
|
414
331
|
const p1 = hull_points[idx]
|
|
@@ -436,8 +353,10 @@
|
|
|
436
353
|
const selected_scatter_point = $derived.by(() => {
|
|
437
354
|
const entry = selected_entry
|
|
438
355
|
if (!entry) return null
|
|
439
|
-
|
|
440
|
-
|
|
356
|
+
// match by entry_id (same_entry), not reference: selected_entry may be a proxied/
|
|
357
|
+
// different instance than visible_entries elements when bound to a parent $state
|
|
358
|
+
const idx = visible_entries.findIndex((vis_entry) => helpers.same_entry(vis_entry, entry))
|
|
359
|
+
return idx === -1 ? null : { series_idx: 0, point_idx: idx }
|
|
441
360
|
})
|
|
442
361
|
|
|
443
362
|
// Convex hull statistics - compute internally and expose via bindable prop
|
|
@@ -445,22 +364,18 @@
|
|
|
445
364
|
phase_stats = thermo.get_convex_hull_stats(plot_entries, elements, 3)
|
|
446
365
|
})
|
|
447
366
|
|
|
448
|
-
|
|
449
|
-
entry
|
|
450
|
-
): AnyStructure | null {
|
|
451
|
-
if (!entry.entry_id) return null
|
|
452
|
-
const orig_entry = entries.find((ent) => ent.entry_id === entry.entry_id)
|
|
453
|
-
return orig_entry?.structure as AnyStructure || null
|
|
454
|
-
}
|
|
367
|
+
const extract_structure_from_entry = (entry: ConvexHullEntry): AnyStructure | null =>
|
|
368
|
+
helpers.extract_structure_from_entry(entries, entry)
|
|
455
369
|
|
|
456
370
|
function reset_all() {
|
|
457
371
|
fullscreen = DEFAULTS.convex_hull.binary.fullscreen
|
|
458
372
|
info_pane_open = DEFAULTS.convex_hull.binary.info_pane_open
|
|
459
|
-
|
|
373
|
+
controls_open = DEFAULTS.convex_hull.binary.legend_pane_open
|
|
460
374
|
color_mode = DEFAULTS.convex_hull.binary.color_mode
|
|
461
375
|
color_scale = DEFAULTS.convex_hull.binary.color_scale as D3InterpolateName
|
|
462
376
|
show_stable = DEFAULTS.convex_hull.binary.show_stable
|
|
463
377
|
show_unstable = DEFAULTS.convex_hull.binary.show_unstable
|
|
378
|
+
hidden_categories = []
|
|
464
379
|
show_stable_labels = DEFAULTS.convex_hull.binary.show_stable_labels
|
|
465
380
|
show_unstable_labels = DEFAULTS.convex_hull.binary.show_unstable_labels
|
|
466
381
|
// Use auto-computed threshold based on entry count instead of static default
|
|
@@ -475,11 +390,12 @@
|
|
|
475
390
|
const has_changes_to_reset = $derived(
|
|
476
391
|
fullscreen !== DEFAULTS.convex_hull.binary.fullscreen ||
|
|
477
392
|
info_pane_open !== DEFAULTS.convex_hull.binary.info_pane_open ||
|
|
478
|
-
|
|
393
|
+
controls_open !== DEFAULTS.convex_hull.binary.legend_pane_open ||
|
|
479
394
|
color_mode !== DEFAULTS.convex_hull.binary.color_mode ||
|
|
480
395
|
color_scale !== DEFAULTS.convex_hull.binary.color_scale ||
|
|
481
396
|
show_stable !== DEFAULTS.convex_hull.binary.show_stable ||
|
|
482
397
|
show_unstable !== DEFAULTS.convex_hull.binary.show_unstable ||
|
|
398
|
+
hidden_categories.length > 0 ||
|
|
483
399
|
show_stable_labels !== DEFAULTS.convex_hull.binary.show_stable_labels ||
|
|
484
400
|
show_unstable_labels !== DEFAULTS.convex_hull.binary.show_unstable_labels ||
|
|
485
401
|
// Compare with auto-computed threshold, with small tolerance for floating point
|
|
@@ -489,11 +405,11 @@
|
|
|
489
405
|
)
|
|
490
406
|
|
|
491
407
|
// Custom hover tooltip state used with ScatterPlot events
|
|
492
|
-
let hover_data = $state<HoverData3D<ConvexHullEntry> | null>(null)
|
|
408
|
+
let hover_data = $state.raw<HoverData3D<ConvexHullEntry> | null>(null)
|
|
493
409
|
$effect(() => {
|
|
494
410
|
const current_selection = helpers.current_entry(selected_entry, plot_entries)
|
|
495
411
|
if (selected_entry && !current_selection) selected_entry = null
|
|
496
|
-
else if (current_selection && current_selection
|
|
412
|
+
else if (current_selection && !helpers.same_entry(current_selection, selected_entry)) {
|
|
497
413
|
selected_entry = current_selection
|
|
498
414
|
}
|
|
499
415
|
const current_hover = helpers.current_entry(hover_data?.entry, plot_entries)
|
|
@@ -539,7 +455,7 @@
|
|
|
539
455
|
await helpers.copy_entry_to_clipboard(entry, position, (visible, pos) => {
|
|
540
456
|
copy_feedback.visible = visible
|
|
541
457
|
copy_feedback.position = pos
|
|
542
|
-
})
|
|
458
|
+
}, entry_category)
|
|
543
459
|
}
|
|
544
460
|
|
|
545
461
|
function close_structure_popup() {
|
|
@@ -595,19 +511,13 @@
|
|
|
595
511
|
set_fullscreen_bg(wrapper, fullscreen, `--hull-2d-bg-fullscreen`)
|
|
596
512
|
})
|
|
597
513
|
|
|
598
|
-
let style = $derived(
|
|
599
|
-
`--hull-stable-color:${merged_config.colors?.stable || `#0072B2`};
|
|
600
|
-
--hull-unstable-color:${merged_config.colors?.unstable || `#E69F00`};
|
|
601
|
-
--hull-edge-color:${merged_config.colors?.edge || `var(--text-color, #212121)`};
|
|
602
|
-
--hull-text-color:${
|
|
603
|
-
merged_config.colors?.annotation || `var(--text-color, #212121)`
|
|
604
|
-
};`,
|
|
605
|
-
)
|
|
514
|
+
let style = $derived(helpers.hull_style_css(merged_config.colors))
|
|
606
515
|
</script>
|
|
607
516
|
|
|
608
517
|
<svelte:document
|
|
609
518
|
onfullscreenchange={() => {
|
|
610
|
-
fullscreen
|
|
519
|
+
// tie fullscreen state to this component's own wrapper, not any fullscreen element
|
|
520
|
+
fullscreen = document.fullscreenElement === wrapper
|
|
611
521
|
}}
|
|
612
522
|
/>
|
|
613
523
|
|
|
@@ -620,8 +530,9 @@
|
|
|
620
530
|
{#if entry}
|
|
621
531
|
<ConvexHullTooltip
|
|
622
532
|
{entry}
|
|
623
|
-
{polymorph_stats_map}
|
|
533
|
+
polymorph_stats_map={hull_data.polymorph_stats_map}
|
|
624
534
|
highlight_style={entry_highlight}
|
|
535
|
+
{entry_category}
|
|
625
536
|
tooltip={custom_tooltip}
|
|
626
537
|
/>
|
|
627
538
|
{/if}
|
|
@@ -648,6 +559,8 @@
|
|
|
648
559
|
{unstable_entries}
|
|
649
560
|
{show_stable}
|
|
650
561
|
{show_unstable}
|
|
562
|
+
{entry_category}
|
|
563
|
+
{hidden_categories}
|
|
651
564
|
{max_hull_dist_show_phases}
|
|
652
565
|
{max_hull_dist_show_labels}
|
|
653
566
|
{label_threshold}
|
|
@@ -655,27 +568,33 @@
|
|
|
655
568
|
/>
|
|
656
569
|
{/if}
|
|
657
570
|
|
|
571
|
+
{#if fullscreen_toggle && controls_config.visible(`fullscreen`)}
|
|
572
|
+
<FullscreenButton {fullscreen} toggle={fullscreen_toggle} {wrapper} />
|
|
573
|
+
{/if}
|
|
574
|
+
|
|
658
575
|
{#if controls_config.visible(`controls`)}
|
|
659
576
|
<ConvexHullControls
|
|
660
|
-
bind:controls_open
|
|
577
|
+
bind:controls_open
|
|
661
578
|
bind:color_mode
|
|
662
579
|
bind:color_scale
|
|
663
580
|
bind:show_stable
|
|
664
581
|
bind:show_unstable
|
|
582
|
+
{entry_category}
|
|
583
|
+
bind:hidden_categories
|
|
665
584
|
bind:show_stable_labels
|
|
666
585
|
bind:show_unstable_labels
|
|
667
586
|
bind:max_hull_dist_show_phases
|
|
668
587
|
bind:max_hull_dist_show_labels
|
|
669
|
-
{max_hull_dist_in_data}
|
|
588
|
+
max_hull_dist_in_data={hull_data.max_hull_dist_in_data}
|
|
670
589
|
{stable_entries}
|
|
671
590
|
{unstable_entries}
|
|
672
591
|
{merged_controls}
|
|
673
592
|
toggle_props={{ class: `control-btn legend-controls-btn` }}
|
|
674
593
|
bind:energy_source_mode
|
|
675
|
-
{has_precomputed_e_form}
|
|
676
|
-
{can_compute_e_form}
|
|
677
|
-
{has_precomputed_hull}
|
|
678
|
-
{can_compute_hull}
|
|
594
|
+
has_precomputed_e_form={hull_data.has_precomputed_e_form}
|
|
595
|
+
can_compute_e_form={hull_data.can_compute_e_form}
|
|
596
|
+
has_precomputed_hull={hull_data.has_precomputed_hull}
|
|
597
|
+
can_compute_hull={hull_data.can_compute_hull}
|
|
679
598
|
/>
|
|
680
599
|
{/if}
|
|
681
600
|
{/if}
|
|
@@ -718,6 +637,7 @@
|
|
|
718
637
|
series={scatter_series}
|
|
719
638
|
bind:display
|
|
720
639
|
controls={{ show: false }}
|
|
640
|
+
fullscreen_toggle={false}
|
|
721
641
|
x_axis={{
|
|
722
642
|
label: elements.length === 2 ? `x in ${elements[0]}₁₋ₓ ${elements[1]}ₓ` : `x`,
|
|
723
643
|
range: x_domain,
|
|
@@ -771,11 +691,11 @@
|
|
|
771
691
|
/>
|
|
772
692
|
<DragOverlay visible={drag_over} />
|
|
773
693
|
|
|
774
|
-
{#if has_temp_data && temperature !== undefined}
|
|
775
|
-
<TemperatureSlider {available_temperatures} bind:temperature />
|
|
694
|
+
{#if hull_data.has_temp_data && temperature !== undefined}
|
|
695
|
+
<TemperatureSlider available_temperatures={hull_data.available_temperatures} bind:temperature />
|
|
776
696
|
{/if}
|
|
777
697
|
|
|
778
|
-
{#if gas_analysis.has_gas_dependent_elements && merged_gas_config}
|
|
698
|
+
{#if hull_data.gas_analysis.has_gas_dependent_elements && merged_gas_config}
|
|
779
699
|
<GasPressureControls
|
|
780
700
|
config={merged_gas_config}
|
|
781
701
|
bind:pressures={gas_pressures}
|
|
@@ -807,8 +727,9 @@
|
|
|
807
727
|
:global(.convex-hull-2d.dragover) {
|
|
808
728
|
border: 2px dashed var(--accent-color, #1976d2) !important;
|
|
809
729
|
}
|
|
810
|
-
/* Styles for control buttons rendered via header_controls snippet
|
|
811
|
-
|
|
730
|
+
/* Styles for control buttons rendered via header_controls snippet
|
|
731
|
+
(.fullscreen-btn is FullscreenButton's built-in class) */
|
|
732
|
+
:global(.convex-hull-2d :is(.control-btn, .fullscreen-btn)) {
|
|
812
733
|
background: transparent;
|
|
813
734
|
border: none;
|
|
814
735
|
padding: 4px;
|
|
@@ -819,7 +740,7 @@
|
|
|
819
740
|
display: flex;
|
|
820
741
|
font-size: clamp(0.85em, 2cqmin, 1.3em);
|
|
821
742
|
}
|
|
822
|
-
:global(.convex-hull-2d .control-btn:hover) {
|
|
743
|
+
:global(.convex-hull-2d :is(.control-btn, .fullscreen-btn):hover) {
|
|
823
744
|
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
824
745
|
}
|
|
825
746
|
</style>
|
|
@@ -6,6 +6,6 @@ type $$ComponentProps = BaseConvexHullProps<ConvexHullEntry> & {
|
|
|
6
6
|
x_axis?: AxisConfig;
|
|
7
7
|
y_axis?: AxisConfig;
|
|
8
8
|
};
|
|
9
|
-
declare const ConvexHull2D: import("svelte").Component<$$ComponentProps, {}, "
|
|
9
|
+
declare const ConvexHull2D: import("svelte").Component<$$ComponentProps, {}, "display" | "temperature" | "fullscreen" | "wrapper" | "controls_open" | "color_scale" | "info_pane_open" | "color_mode" | "show_stable" | "show_unstable" | "show_stable_labels" | "show_unstable_labels" | "max_hull_dist_show_phases" | "max_hull_dist_show_labels" | "hidden_categories" | "energy_source_mode" | "stable_entries" | "unstable_entries" | "phase_stats" | "highlighted_entries" | "selected_entry" | "gas_pressures">;
|
|
10
10
|
type ConvexHull2D = ReturnType<typeof ConvexHull2D>;
|
|
11
11
|
export default ConvexHull2D;
|