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,13 +1,9 @@
|
|
|
1
1
|
import type { Vec3 } from '../math';
|
|
2
|
-
import {
|
|
3
|
-
import * as extras from '@threlte/extras';
|
|
4
|
-
import type { ComponentProps } from 'svelte';
|
|
5
|
-
import type { Camera, Scene } from 'three';
|
|
2
|
+
import type { SceneControlProps } from '../scene';
|
|
6
3
|
import type { BrillouinZoneData, BZHoverData, IrreducibleBZData } from './types';
|
|
7
|
-
type $$ComponentProps = {
|
|
4
|
+
type $$ComponentProps = SceneControlProps & {
|
|
8
5
|
bz_data?: BrillouinZoneData;
|
|
9
6
|
camera_position?: Vec3 | undefined;
|
|
10
|
-
camera_projection?: CameraProjection;
|
|
11
7
|
surface_color?: string;
|
|
12
8
|
surface_opacity?: number;
|
|
13
9
|
edge_color?: string;
|
|
@@ -18,22 +14,6 @@ type $$ComponentProps = {
|
|
|
18
14
|
ibz_data?: IrreducibleBZData | null;
|
|
19
15
|
ibz_color?: string;
|
|
20
16
|
ibz_opacity?: number;
|
|
21
|
-
rotation_damping?: number;
|
|
22
|
-
max_zoom?: number;
|
|
23
|
-
min_zoom?: number;
|
|
24
|
-
rotate_speed?: number;
|
|
25
|
-
zoom_speed?: number;
|
|
26
|
-
pan_speed?: number;
|
|
27
|
-
zoom_to_cursor?: boolean;
|
|
28
|
-
fov?: number;
|
|
29
|
-
initial_zoom?: number;
|
|
30
|
-
ambient_light?: number;
|
|
31
|
-
directional_light?: number;
|
|
32
|
-
gizmo?: boolean | ComponentProps<typeof extras.Gizmo>;
|
|
33
|
-
auto_rotate?: number;
|
|
34
|
-
camera_is_moving?: boolean;
|
|
35
|
-
scene?: Scene;
|
|
36
|
-
camera?: Camera;
|
|
37
17
|
k_path_points?: Vec3[];
|
|
38
18
|
k_path_labels?: {
|
|
39
19
|
position: Vec3;
|
|
@@ -42,7 +22,8 @@ type $$ComponentProps = {
|
|
|
42
22
|
hovered_k_point?: Vec3 | null;
|
|
43
23
|
hovered_qpoint_index?: number | null;
|
|
44
24
|
hover_data?: BZHoverData | null;
|
|
25
|
+
on_kpath_hover?: (qpoint_index: number | null) => void;
|
|
45
26
|
};
|
|
46
|
-
declare const BrillouinZoneScene: import("svelte").Component<$$ComponentProps, {}, "
|
|
27
|
+
declare const BrillouinZoneScene: import("svelte").Component<$$ComponentProps, {}, "scene" | "camera" | "camera_projection" | "camera_position" | "vector_scale" | "surface_color" | "surface_opacity" | "edge_color" | "edge_width" | "show_vectors" | "bz_data" | "hover_data">;
|
|
47
28
|
type BrillouinZoneScene = ReturnType<typeof BrillouinZoneScene>;
|
|
48
29
|
export default BrillouinZoneScene;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
// Tooltip component for Brillouin zone hover information
|
|
3
3
|
// Displays k-coordinates, BZ order, volume, and IBZ-specific info
|
|
4
|
-
import { format_num
|
|
5
|
-
import { TooltipContent } from '../tooltip'
|
|
4
|
+
import { format_num } from '../labels'
|
|
5
|
+
import { KCoords, TooltipContent } from '../tooltip'
|
|
6
6
|
import type { BZHoverData, BZTooltipProp } from './types'
|
|
7
7
|
|
|
8
8
|
let {
|
|
@@ -19,33 +19,26 @@
|
|
|
19
19
|
|
|
20
20
|
<TooltipContent data={hover_data} snippet_arg={{ hover_data }} {tooltip}>
|
|
21
21
|
<div class="bz-tooltip-content">
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<div class="bz-tooltip-row">
|
|
29
|
-
<span class="bz-tooltip-label">k (Å⁻¹):</span>
|
|
30
|
-
<span class="bz-tooltip-value">{format_vec3(hover_data.position_cartesian)}</span>
|
|
31
|
-
</div>
|
|
32
|
-
{#if hover_data.position_fractional}
|
|
33
|
-
<div class="bz-tooltip-row">
|
|
34
|
-
<span class="bz-tooltip-label">k (frac):</span>
|
|
35
|
-
<span class="bz-tooltip-value">{
|
|
36
|
-
format_vec3(hover_data.position_fractional)
|
|
37
|
-
}</span>
|
|
22
|
+
{#if hover_data.is_ibz || hover_data.bz_order > 1}
|
|
23
|
+
<div class="bz-tooltip-title">
|
|
24
|
+
{#if hover_data.is_ibz}<strong>Irreducible BZ</strong>{/if}
|
|
25
|
+
{#if hover_data.bz_order > 1}
|
|
26
|
+
<span class="bz-tooltip-badge">{ordinal(hover_data.bz_order)}</span>
|
|
27
|
+
{/if}
|
|
38
28
|
</div>
|
|
39
29
|
{/if}
|
|
30
|
+
<KCoords
|
|
31
|
+
cartesian={hover_data.position_cartesian}
|
|
32
|
+
fractional={hover_data.position_fractional}
|
|
33
|
+
/>
|
|
40
34
|
<div class="bz-tooltip-row">
|
|
41
35
|
<span class="bz-tooltip-label">BZ Volume:</span>
|
|
42
|
-
<span
|
|
36
|
+
<span>{format_num(hover_data.bz_volume, `.4~`)} Å⁻³</span>
|
|
43
37
|
</div>
|
|
44
38
|
{#if hover_data.is_ibz && hover_data.ibz_volume != null}
|
|
45
39
|
<div class="bz-tooltip-row">
|
|
46
40
|
<span class="bz-tooltip-label">IBZ Volume:</span>
|
|
47
|
-
<span
|
|
48
|
-
Å⁻³</span>
|
|
41
|
+
<span>{format_num(hover_data.ibz_volume, `.4~`)} Å⁻³</span>
|
|
49
42
|
</div>
|
|
50
43
|
{#if hover_data.symmetry_multiplicity != null}
|
|
51
44
|
<div class="bz-tooltip-symmetry">
|
|
@@ -59,7 +52,6 @@
|
|
|
59
52
|
<style>
|
|
60
53
|
.bz-tooltip-content {
|
|
61
54
|
max-width: var(--bz-tooltip-max-width, 250px);
|
|
62
|
-
text-align: left;
|
|
63
55
|
}
|
|
64
56
|
.bz-tooltip-title {
|
|
65
57
|
margin-bottom: 4px;
|
|
@@ -71,6 +63,8 @@
|
|
|
71
63
|
font-weight: 500;
|
|
72
64
|
background: #666;
|
|
73
65
|
color: white;
|
|
66
|
+
}
|
|
67
|
+
.bz-tooltip-badge:not(:first-child) {
|
|
74
68
|
margin-left: 6px;
|
|
75
69
|
}
|
|
76
70
|
.bz-tooltip-row {
|
|
@@ -81,9 +75,6 @@
|
|
|
81
75
|
opacity: 0.8;
|
|
82
76
|
min-width: 75px;
|
|
83
77
|
}
|
|
84
|
-
.bz-tooltip-value {
|
|
85
|
-
font-family: monospace;
|
|
86
|
-
}
|
|
87
78
|
.bz-tooltip-symmetry {
|
|
88
79
|
margin-top: 2px;
|
|
89
80
|
opacity: 0.8;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Reciprocal lattice vector arrows (b₁, b₂, b₃) with HTML labels beyond the tips, shared by BrillouinZoneScene and FermiSurfaceScene
|
|
3
|
+
import type { Matrix3x3, Vec3 } from '../math'
|
|
4
|
+
import Arrow from '../structure/Arrow.svelte'
|
|
5
|
+
import * as extras from '@threlte/extras'
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
k_lattice,
|
|
9
|
+
vector_scale = 1.0,
|
|
10
|
+
size = 1,
|
|
11
|
+
}: {
|
|
12
|
+
k_lattice: Matrix3x3
|
|
13
|
+
vector_scale?: number
|
|
14
|
+
size?: number // characteristic scene size used to scale arrow proportions
|
|
15
|
+
} = $props()
|
|
16
|
+
|
|
17
|
+
const vector_colors = [`red`, `green`, `blue`]
|
|
18
|
+
const vector_labels = [`b₁`, `b₂`, `b₃`]
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
{#each k_lattice as vec, idx (idx)}
|
|
22
|
+
{@const scaled_vec = vec.map((coord) => coord * vector_scale) as Vec3}
|
|
23
|
+
{@const label_position = scaled_vec.map((coord) => coord * 1.15) as Vec3}
|
|
24
|
+
<Arrow
|
|
25
|
+
position={[0, 0, 0]}
|
|
26
|
+
vector={scaled_vec}
|
|
27
|
+
color={vector_colors[idx]}
|
|
28
|
+
scale={1}
|
|
29
|
+
shaft_radius={size * 0.008}
|
|
30
|
+
arrow_head_radius={size * 0.028}
|
|
31
|
+
arrow_head_length={-0.1}
|
|
32
|
+
/>
|
|
33
|
+
<!-- Vector label beyond tip -->
|
|
34
|
+
<extras.HTML center position={label_position}>
|
|
35
|
+
<span style:color={vector_colors[idx]} style:font-size="1.2em">
|
|
36
|
+
{vector_labels[idx]}
|
|
37
|
+
</span>
|
|
38
|
+
</extras.HTML>
|
|
39
|
+
{/each}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Matrix3x3 } from '../math';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
k_lattice: Matrix3x3;
|
|
4
|
+
vector_scale?: number;
|
|
5
|
+
size?: number;
|
|
6
|
+
};
|
|
7
|
+
declare const ReciprocalVectors: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type ReciprocalVectors = ReturnType<typeof ReciprocalVectors>;
|
|
9
|
+
export default ReciprocalVectors;
|
|
@@ -12,6 +12,8 @@ type ClippingPlane = {
|
|
|
12
12
|
normal: Vec3;
|
|
13
13
|
dist: number;
|
|
14
14
|
};
|
|
15
|
+
export declare const IBZ_REFERENCE_DIRECTIONS: Vec3[];
|
|
16
|
+
export declare function find_ibz_reference_direction(non_identity_ops: Matrix3x3[]): Vec3;
|
|
15
17
|
export declare function compute_ibz_clipping_planes(point_group_ops: Matrix3x3[]): ClippingPlane[];
|
|
16
18
|
export declare function compute_irreducible_bz(bz_data: BrillouinZoneData, point_group_ops: Matrix3x3[], edge_sharp_angle_deg?: number): IrreducibleBZData | null;
|
|
17
19
|
export {};
|
|
@@ -3,10 +3,6 @@ import * as math from '../math';
|
|
|
3
3
|
import { Vector3 } from 'three';
|
|
4
4
|
import { ConvexGeometry } from 'three/examples/jsm/geometries/ConvexGeometry.js';
|
|
5
5
|
const TOL = 1e-8;
|
|
6
|
-
const normalize = (vec) => {
|
|
7
|
-
const mag = Math.hypot(...vec);
|
|
8
|
-
return mag < 1e-10 ? [0, 0, 0] : [vec[0] / mag, vec[1] / mag, vec[2] / mag];
|
|
9
|
-
};
|
|
10
6
|
// Check if rotation matrix is identity
|
|
11
7
|
const is_identity_rotation = (rot) => rot.every((row, idx) => row.every((val, jdx) => Math.abs(val - (idx === jdx ? 1 : 0)) < TOL));
|
|
12
8
|
// Extract unique point group rotation matrices from space group operations.
|
|
@@ -20,39 +16,21 @@ export function extract_point_group_from_operations(operations) {
|
|
|
20
16
|
if (seen.has(key))
|
|
21
17
|
continue;
|
|
22
18
|
seen.add(key);
|
|
23
|
-
|
|
19
|
+
// moyo serializes rotations COLUMN-major; vec9_to_mat3x3 reads row-major → transpose to get W
|
|
20
|
+
const rot = math.transpose_3x3_matrix(math.vec9_to_mat3x3(Array.from(rotation)));
|
|
24
21
|
unique_rotations.push(rot);
|
|
25
22
|
}
|
|
26
23
|
return unique_rotations;
|
|
27
24
|
}
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
[0, 0, 0],
|
|
32
|
-
[0, 0, 0],
|
|
33
|
-
[0, 0, 0],
|
|
34
|
-
];
|
|
35
|
-
for (let row = 0; row < 3; row++) {
|
|
36
|
-
for (let col = 0; col < 3; col++) {
|
|
37
|
-
result[row][col] = A[row][0] * B[0][col] + A[row][1] * B[1][col] + A[row][2] * B[2][col];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
// Convert fractional-coordinate rotation W to Cartesian k-space rotation.
|
|
43
|
-
// In reciprocal space: R_cart = B · W^{-T} · B^{-1}, where B is the k_lattice
|
|
44
|
-
// and W^{-T} is the inverse transpose of the direct-space rotation matrix.
|
|
45
|
-
// This follows the dual-basis relation: if direct fractional rotation is x' = W·x,
|
|
46
|
-
// then reciprocal fractional rotation is q' = W^{-T}·q. For non-orthogonal lattices
|
|
47
|
-
// (monoclinic, triclinic, hexagonal), W^{-1} ≠ W^T since integer rotation matrices
|
|
48
|
-
// are not orthogonal in these systems.
|
|
25
|
+
// Convert fractional rotation W to Cartesian k-space rotation. k_lattice stores reciprocal
|
|
26
|
+
// vectors as ROWS (k_cart = Bᵀ·q) and reciprocal fractional rotation is q' = W^{-T}·q, so
|
|
27
|
+
// R_cart = Bᵀ·W^{-T}·B^{-T}. For non-orthogonal lattices W^{-1} ≠ Wᵀ, so the transpose matters.
|
|
49
28
|
export function fractional_to_cartesian_rotation(W, k_lattice) {
|
|
50
29
|
try {
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return mat3x3_multiply(mat3x3_multiply(k_lattice, W_inv_T), k_lattice_inv);
|
|
30
|
+
const B_T = math.transpose_3x3_matrix(k_lattice);
|
|
31
|
+
const W_inv_T = math.transpose_3x3_matrix(math.matrix_inverse_3x3(W));
|
|
32
|
+
// R_cart = Bᵀ · W^{-T} · B^{-T}
|
|
33
|
+
return math.dot(math.dot(B_T, W_inv_T), math.matrix_inverse_3x3(B_T));
|
|
56
34
|
}
|
|
57
35
|
catch {
|
|
58
36
|
// Fallback to identity if inversion fails (shouldn't happen for valid rotations)
|
|
@@ -145,7 +123,11 @@ max_planes_by_order = { 1: 26, 2: 80, 3: 150 }) {
|
|
|
145
123
|
if (idx === center_idx)
|
|
146
124
|
return null;
|
|
147
125
|
const dist_sq = pt[0] ** 2 + pt[1] ** 2 + pt[2] ** 2;
|
|
148
|
-
return {
|
|
126
|
+
return {
|
|
127
|
+
normal: math.normalize_vec(pt, [0, 0, 0]),
|
|
128
|
+
dist: Math.sqrt(dist_sq) / 2,
|
|
129
|
+
dist_sq,
|
|
130
|
+
};
|
|
149
131
|
})
|
|
150
132
|
.filter((plane) => plane !== null)
|
|
151
133
|
.sort((a, b) => a.dist_sq - b.dist_sq)
|
|
@@ -235,7 +217,7 @@ export function compute_convex_hull(vertices, edge_sharp_angle_deg = 5) {
|
|
|
235
217
|
// Compute face normals and build edge-to-face adjacency
|
|
236
218
|
const face_normals = faces.map((face) => {
|
|
237
219
|
const [v0, v1, v2] = face.slice(0, 3).map((vertex_idx) => unique_verts[vertex_idx]);
|
|
238
|
-
return
|
|
220
|
+
return math.normalize_vec(math.cross_3d(math.subtract(v1, v0), math.subtract(v2, v0)), [0, 0, 0]);
|
|
239
221
|
});
|
|
240
222
|
const edge_to_faces = new Map();
|
|
241
223
|
faces.forEach((face, face_idx) => {
|
|
@@ -281,51 +263,72 @@ max_planes_by_order = { 1: 26, 2: 80, 3: 150 }) {
|
|
|
281
263
|
volume: compute_hull_volume(hull.vertices, hull.faces),
|
|
282
264
|
};
|
|
283
265
|
}
|
|
284
|
-
//
|
|
285
|
-
//
|
|
286
|
-
//
|
|
287
|
-
//
|
|
288
|
-
const
|
|
289
|
-
[1,
|
|
290
|
-
[
|
|
291
|
-
[
|
|
292
|
-
[1, 1, 0],
|
|
293
|
-
[1, 0, 1],
|
|
294
|
-
[0, 1, 1], // face diagonals (avoid 2-fold axes)
|
|
295
|
-
[1, 1, 1], // body diagonal (avoid 3-fold axis)
|
|
296
|
-
[1, 2, 3], // generic point on no special axis
|
|
266
|
+
// Generic reference directions for the Dirichlet-domain construction. Irrational-ish
|
|
267
|
+
// component ratios keep them off every rotation axis and mirror plane of crystallographic
|
|
268
|
+
// point groups in practice; the later directions are fallbacks in case a pathological
|
|
269
|
+
// Cartesian orientation pins the first onto a symmetry element.
|
|
270
|
+
export const IBZ_REFERENCE_DIRECTIONS = [
|
|
271
|
+
[1, Math.SQRT2 / 3, Math.E / 7],
|
|
272
|
+
[Math.PI / 5, 1, Math.SQRT1_2 / 4],
|
|
273
|
+
[Math.E / 9, Math.LN2, 1],
|
|
297
274
|
];
|
|
298
|
-
//
|
|
299
|
-
//
|
|
300
|
-
//
|
|
275
|
+
// A reference direction is valid for the Dirichlet construction iff it has a trivial
|
|
276
|
+
// stabilizer: no non-identity operation fixes it (R·t ≠ t for every R). Such a direction
|
|
277
|
+
// always exists because the fixed-point sets (rotation axes, mirror planes) have measure
|
|
278
|
+
// zero. Try the curated generic directions first, then deterministic pseudo-random ones,
|
|
279
|
+
// and throw in the (mathematically unreachable) case where none qualify — rather than
|
|
280
|
+
// silently using a non-generic direction, which would drop that operation's clipping
|
|
281
|
+
// plane and inflate the IBZ volume above V_BZ/|G|.
|
|
282
|
+
export function find_ibz_reference_direction(non_identity_ops) {
|
|
283
|
+
const has_trivial_stabilizer = (dir) => non_identity_ops.every((rot) => Math.hypot(...math.subtract(math.mat3x3_vec3_multiply(rot, dir), dir)) > TOL);
|
|
284
|
+
const curated = IBZ_REFERENCE_DIRECTIONS.find(has_trivial_stabilizer);
|
|
285
|
+
if (curated)
|
|
286
|
+
return curated;
|
|
287
|
+
// Park-Miller minstd PRNG (safe-integer arithmetic) keeps the rare fallback
|
|
288
|
+
// reproducible across runs while sampling generic directions
|
|
289
|
+
let seed = 16807;
|
|
290
|
+
const next_component = () => {
|
|
291
|
+
seed = (seed * 16807) % 2147483647;
|
|
292
|
+
return (seed / 2147483647) * 2 - 1;
|
|
293
|
+
};
|
|
294
|
+
for (let attempt = 0; attempt < 128; attempt++) {
|
|
295
|
+
const dir = [next_component(), next_component(), next_component()];
|
|
296
|
+
if (Math.hypot(...dir) > 0.1 && has_trivial_stabilizer(dir))
|
|
297
|
+
return dir;
|
|
298
|
+
}
|
|
299
|
+
throw new Error(`IBZ construction: no generic reference direction found for ${non_identity_ops.length} symmetry operations`);
|
|
300
|
+
}
|
|
301
|
+
// Compute clipping planes from point group operations via the Dirichlet (Voronoi)
|
|
302
|
+
// fundamental-domain construction: pick ONE generic direction t with trivial stabilizer,
|
|
303
|
+
// then for every non-identity operation R keep the half-space x·t ≥ x·(R·t), i.e.
|
|
304
|
+
// (R·t − t)·x ≤ 0. Intersecting all half-spaces with the BZ yields an irreducible wedge
|
|
305
|
+
// of exactly volume(BZ)/|G|. (Using a different reference point per operation — or
|
|
306
|
+
// flipping individual planes — does NOT yield a fundamental domain in general.)
|
|
301
307
|
export function compute_ibz_clipping_planes(point_group_ops) {
|
|
308
|
+
const non_identity_ops = point_group_ops.filter((rot) => !is_identity_rotation(rot));
|
|
309
|
+
if (non_identity_ops.length === 0)
|
|
310
|
+
return [];
|
|
311
|
+
const ref_dir = find_ibz_reference_direction(non_identity_ops);
|
|
302
312
|
const planes = [];
|
|
303
313
|
const seen_normals = new Set();
|
|
304
|
-
for (const rot of
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
319
|
-
break;
|
|
314
|
+
for (const rot of non_identity_ops) {
|
|
315
|
+
const rotated = math.mat3x3_vec3_multiply(rot, ref_dir);
|
|
316
|
+
const diff = math.subtract(rotated, ref_dir);
|
|
317
|
+
// ref_dir has a trivial stabilizer, so every op must move it; a zero diff would
|
|
318
|
+
// silently drop a plane and inflate the IBZ — surface it instead
|
|
319
|
+
if (Math.hypot(...diff) < TOL) {
|
|
320
|
+
throw new Error(`IBZ construction: reference direction unexpectedly fixed by an operation`);
|
|
321
|
+
}
|
|
322
|
+
const plane_normal = math.normalize_vec(diff, [0, 0, 0]);
|
|
323
|
+
// NOTE: do NOT merge antiparallel normals — n and −n select opposite half-spaces
|
|
324
|
+
const key = plane_normal.map((val) => Math.round(val * 1e6)).join(`,`);
|
|
325
|
+
if (!seen_normals.has(key)) {
|
|
326
|
+
seen_normals.add(key);
|
|
327
|
+
planes.push({ normal: plane_normal, dist: 0 });
|
|
320
328
|
}
|
|
321
329
|
}
|
|
322
330
|
return planes;
|
|
323
331
|
}
|
|
324
|
-
// Flip a clipping plane to the opposite half-space
|
|
325
|
-
const flip_plane = (plane) => ({
|
|
326
|
-
normal: math.scale(plane.normal, -1),
|
|
327
|
-
dist: -plane.dist,
|
|
328
|
-
});
|
|
329
332
|
// Clip polyhedron vertices by a half-space, adding intersection points where edges cross
|
|
330
333
|
function clip_polyhedron_by_plane(vertices, faces, plane) {
|
|
331
334
|
const { normal, dist } = plane;
|
|
@@ -354,14 +357,14 @@ function clip_polyhedron_by_plane(vertices, faces, plane) {
|
|
|
354
357
|
// Skip if denominator too small (tighter than TOL for numerical stability)
|
|
355
358
|
if (Math.abs(denom) < 1e-12)
|
|
356
359
|
continue;
|
|
357
|
-
const
|
|
360
|
+
const frac = d1 / denom;
|
|
358
361
|
// Only add intersection if it's not at an endpoint (which is already kept)
|
|
359
|
-
if (
|
|
362
|
+
if (frac > TOL && frac < 1 - TOL) {
|
|
360
363
|
const [v1, v2] = [vertices[i1], vertices[i2]];
|
|
361
364
|
result.push([
|
|
362
|
-
v1[0] +
|
|
363
|
-
v1[1] +
|
|
364
|
-
v1[2] +
|
|
365
|
+
v1[0] + frac * (v2[0] - v1[0]),
|
|
366
|
+
v1[1] + frac * (v2[1] - v1[1]),
|
|
367
|
+
v1[2] + frac * (v2[2] - v1[2]),
|
|
365
368
|
]);
|
|
366
369
|
}
|
|
367
370
|
}
|
|
@@ -382,7 +385,7 @@ function try_build_hull(vertices, edge_sharp_angle_deg) {
|
|
|
382
385
|
// Compute the irreducible Brillouin zone by clipping the full BZ with symmetry planes
|
|
383
386
|
export function compute_irreducible_bz(bz_data, point_group_ops, edge_sharp_angle_deg = 5) {
|
|
384
387
|
// Convert fractional rotations to Cartesian k-space rotations
|
|
385
|
-
// R_cart = B · W^{-T} · B^{-
|
|
388
|
+
// R_cart = Bᵀ · W^{-T} · B^{-T}, where B is k_lattice (reciprocal vectors as rows)
|
|
386
389
|
const cartesian_ops = point_group_ops.map((W) => fractional_to_cartesian_rotation(W, bz_data.k_lattice));
|
|
387
390
|
const clipping_planes = compute_ibz_clipping_planes(cartesian_ops);
|
|
388
391
|
if (clipping_planes.length === 0) {
|
|
@@ -397,21 +400,17 @@ export function compute_irreducible_bz(bz_data, point_group_ops, edge_sharp_angl
|
|
|
397
400
|
let current_vertices = [...bz_data.vertices];
|
|
398
401
|
let current_faces = [...bz_data.faces];
|
|
399
402
|
for (const plane of clipping_planes) {
|
|
400
|
-
//
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
clipped_successfully = true;
|
|
409
|
-
break;
|
|
410
|
-
}
|
|
403
|
+
// Planes from the Dirichlet construction are consistently oriented (the kept side
|
|
404
|
+
// n·x ≤ 0 always contains the reference direction) so clip directly — flipping a
|
|
405
|
+
// plane would select the wrong half-space and break the fundamental-domain property
|
|
406
|
+
const clipped = clip_polyhedron_by_plane(current_vertices, current_faces, plane);
|
|
407
|
+
const hull = try_build_hull(clipped, edge_sharp_angle_deg);
|
|
408
|
+
if (hull) {
|
|
409
|
+
current_vertices = hull.vertices;
|
|
410
|
+
current_faces = hull.faces;
|
|
411
411
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
console.warn(`IBZ clipping: plane orientation failed, continuing with current geometry`);
|
|
412
|
+
else {
|
|
413
|
+
console.warn(`IBZ clipping: degenerate clip result, skipping plane`);
|
|
415
414
|
}
|
|
416
415
|
}
|
|
417
416
|
const hull = try_build_hull(current_vertices, edge_sharp_angle_deg);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Matrix3x3, Vec3 } from '../math';
|
|
2
|
+
import { BufferGeometry } from 'three';
|
|
3
|
+
export declare function polyhedron_geometry(vertices: Vec3[], faces: number[][]): BufferGeometry | null;
|
|
4
|
+
export declare function k_lattice_inverse(k_lattice: Matrix3x3 | undefined): Matrix3x3 | null;
|
|
5
|
+
export declare const cartesian_to_fractional: (k_lattice_inv: Matrix3x3 | null, cart: Vec3) => Vec3 | null;
|
|
6
|
+
export declare const polyhedron_centroid: (vertices: Vec3[] | undefined) => Vec3;
|
|
7
|
+
export declare const k_space_size: (k_lattice: Matrix3x3 | undefined) => number;
|
|
8
|
+
export declare const default_camera_position: (size: number) => Vec3;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as math from '../math';
|
|
2
|
+
import { BufferAttribute, BufferGeometry } from 'three';
|
|
3
|
+
// Build a renderable mesh from polyhedron vertices + polygonal faces via fan triangulation with flat per-face normals. Assumes convex faces (true for BZ/IBZ polyhedra); non-convex faces would triangulate incorrectly. Shared by BrillouinZoneScene (BZ + IBZ meshes) and FermiSurfaceScene (BZ overlay). Caller owns disposal.
|
|
4
|
+
export function polyhedron_geometry(vertices, faces) {
|
|
5
|
+
if (faces.length === 0)
|
|
6
|
+
return null;
|
|
7
|
+
const positions = [];
|
|
8
|
+
const normals = [];
|
|
9
|
+
for (const face of faces) {
|
|
10
|
+
if (face.length < 3)
|
|
11
|
+
continue;
|
|
12
|
+
for (let face_idx = 1; face_idx < face.length - 1; face_idx++) {
|
|
13
|
+
const indices = [face[0], face[face_idx], face[face_idx + 1]];
|
|
14
|
+
if (indices.some((idx) => idx < 0 || idx >= vertices.length))
|
|
15
|
+
continue;
|
|
16
|
+
const [vertex_a, vertex_b, vertex_c] = indices.map((idx) => vertices[idx]);
|
|
17
|
+
positions.push(...vertex_a, ...vertex_b, ...vertex_c);
|
|
18
|
+
const edge_ab = math.subtract(vertex_b, vertex_a);
|
|
19
|
+
const edge_ac = math.subtract(vertex_c, vertex_a);
|
|
20
|
+
const face_normal = math.cross_3d(edge_ab, edge_ac);
|
|
21
|
+
const normal_length = Math.hypot(...face_normal);
|
|
22
|
+
const unit_normal = normal_length > 1e-10 ? face_normal.map((coord) => coord / normal_length) : [0, 0, 0];
|
|
23
|
+
normals.push(...unit_normal, ...unit_normal, ...unit_normal);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// All faces degenerate or out-of-range -> no triangles, so return null instead of an empty geometry
|
|
27
|
+
if (positions.length === 0)
|
|
28
|
+
return null;
|
|
29
|
+
const geometry = new BufferGeometry();
|
|
30
|
+
geometry.setAttribute(`position`, new BufferAttribute(new Float32Array(positions), 3));
|
|
31
|
+
geometry.setAttribute(`normal`, new BufferAttribute(new Float32Array(normals), 3));
|
|
32
|
+
geometry.computeBoundingSphere();
|
|
33
|
+
return geometry;
|
|
34
|
+
}
|
|
35
|
+
// Inverse of the reciprocal lattice for Cartesian -> fractional conversion; null if the lattice is missing or singular
|
|
36
|
+
export function k_lattice_inverse(k_lattice) {
|
|
37
|
+
if (!k_lattice)
|
|
38
|
+
return null;
|
|
39
|
+
try {
|
|
40
|
+
return math.matrix_inverse_3x3(k_lattice);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Convert Cartesian k-coordinates to fractional (reciprocal lattice units); null if the (pre-computed) lattice inverse is unavailable
|
|
47
|
+
export const cartesian_to_fractional = (k_lattice_inv, cart) => k_lattice_inv && math.mat3x3_vec3_multiply(k_lattice_inv, cart);
|
|
48
|
+
// Centroid of polyhedron vertices, used as orbit/rotation target by BZ + Fermi scenes
|
|
49
|
+
export const polyhedron_centroid = (vertices) => vertices?.length
|
|
50
|
+
? math.scale(vertices.reduce((acc, vert) => math.add(acc, vert), [0, 0, 0]), 1 / vertices.length)
|
|
51
|
+
: [0, 0, 0];
|
|
52
|
+
// Mean reciprocal-lattice vector magnitude: characteristic scene size for camera placement
|
|
53
|
+
// and arrow scaling. Fallback 10 (upper end of typical |b_i| ~ 2pi/a in 1/A) keeps the
|
|
54
|
+
// camera at a sensible distance while no data is loaded.
|
|
55
|
+
export const k_space_size = (k_lattice) => k_lattice ? k_lattice.reduce((sum, vec) => sum + Math.hypot(...vec), 0) / 3 : 10;
|
|
56
|
+
// Default camera position scaled to the scene size
|
|
57
|
+
export const default_camera_position = (size) => [10, 3, 8].map((coord) => coord * Math.max(1, size));
|
|
@@ -5,4 +5,6 @@ export { default as BrillouinZoneInfoPane } from './BrillouinZoneInfoPane.svelte
|
|
|
5
5
|
export { default as BrillouinZoneScene } from './BrillouinZoneScene.svelte';
|
|
6
6
|
export { default as BrillouinZoneTooltip } from './BrillouinZoneTooltip.svelte';
|
|
7
7
|
export * from './compute';
|
|
8
|
+
export * from './geometry';
|
|
9
|
+
export { default as ReciprocalVectors } from './ReciprocalVectors.svelte';
|
|
8
10
|
export type * from './types';
|
package/dist/brillouin/index.js
CHANGED
|
@@ -5,3 +5,5 @@ export { default as BrillouinZoneInfoPane } from './BrillouinZoneInfoPane.svelte
|
|
|
5
5
|
export { default as BrillouinZoneScene } from './BrillouinZoneScene.svelte';
|
|
6
6
|
export { default as BrillouinZoneTooltip } from './BrillouinZoneTooltip.svelte';
|
|
7
7
|
export * from './compute';
|
|
8
|
+
export * from './geometry';
|
|
9
|
+
export { default as ReciprocalVectors } from './ReciprocalVectors.svelte';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Matrix3x3, Point2D, Vec3 } from '../math';
|
|
1
|
+
import type { Matrix3x3, Point2D, Vec2, Vec3 } from '../math';
|
|
2
2
|
import type { Crystal } from '../structure';
|
|
3
3
|
import type { TooltipConfig, TooltipProp } from '../tooltip';
|
|
4
4
|
export type BZHoverData = {
|
|
@@ -38,6 +38,6 @@ export type BrillouinZoneProps = {
|
|
|
38
38
|
show_vectors?: boolean;
|
|
39
39
|
};
|
|
40
40
|
export type ConvexHullData = Pick<BZMeshData, `vertices` | `faces`> & {
|
|
41
|
-
edges: [
|
|
41
|
+
edges: Vec2[];
|
|
42
42
|
};
|
|
43
43
|
export {};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { get_electro_neg_formula } from '../composition/format'
|
|
3
|
-
import type { PhaseData } from '../convex-hull/types'
|
|
4
|
-
import Spinner from '../feedback/Spinner.svelte'
|
|
5
|
-
import { format_num } from '../labels'
|
|
6
|
-
import { constrain_tooltip_position } from '../plot/layout'
|
|
7
|
-
import { sanitize_html } from '../sanitize'
|
|
8
|
-
import { compute_chempot_async } from './async-compute.svelte'
|
|
9
|
-
import ChemPotDiagram2D from './ChemPotDiagram2D.svelte'
|
|
10
|
-
import ChemPotDiagram3D from './ChemPotDiagram3D.svelte'
|
|
11
|
-
import { get_ternary_combinations } from './compute'
|
|
2
|
+
import { get_electro_neg_formula } from '../composition/format'
|
|
3
|
+
import type { PhaseData } from '../convex-hull/types'
|
|
4
|
+
import Spinner from '../feedback/Spinner.svelte'
|
|
5
|
+
import { format_num } from '../labels'
|
|
6
|
+
import { constrain_tooltip_position } from '../plot/core/layout'
|
|
7
|
+
import { sanitize_html } from '../sanitize'
|
|
8
|
+
import { compute_chempot_async } from './async-compute.svelte'
|
|
9
|
+
import ChemPotDiagram2D from './ChemPotDiagram2D.svelte'
|
|
10
|
+
import ChemPotDiagram3D from './ChemPotDiagram3D.svelte'
|
|
11
|
+
import { get_ternary_combinations } from './compute'
|
|
12
12
|
import type {
|
|
13
13
|
ChemPotDiagramConfig,
|
|
14
14
|
ChemPotHoverInfo,
|
|
15
15
|
ChemPotHoverInfo3D,
|
|
16
|
-
} from './types'
|
|
17
|
-
import { CHEMPOT_DEFAULTS } from './types'
|
|
16
|
+
} from './types'
|
|
17
|
+
import { CHEMPOT_DEFAULTS } from './types'
|
|
18
|
+
import { to_error } from '../utils'
|
|
18
19
|
|
|
19
20
|
let {
|
|
20
21
|
entries = [],
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
.catch((err) => {
|
|
85
86
|
if (cancelled) return
|
|
86
87
|
console.error(`Grid precompute failed:`, err)
|
|
87
|
-
grid_error = err
|
|
88
|
+
grid_error = to_error(err).message
|
|
88
89
|
})
|
|
89
90
|
return () => { cancelled = true }
|
|
90
91
|
})
|
|
@@ -8,6 +8,6 @@ type $$ComponentProps = {
|
|
|
8
8
|
temperature?: number;
|
|
9
9
|
hover_info?: ChemPotHoverInfo | null;
|
|
10
10
|
};
|
|
11
|
-
declare const ChemPotDiagram: import("svelte").Component<$$ComponentProps, {}, "
|
|
11
|
+
declare const ChemPotDiagram: import("svelte").Component<$$ComponentProps, {}, "height" | "width" | "temperature" | "hover_info">;
|
|
12
12
|
type ChemPotDiagram = ReturnType<typeof ChemPotDiagram>;
|
|
13
13
|
export default ChemPotDiagram;
|