matterviz 0.3.7 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Icon.svelte +7 -4
- package/dist/MillerIndexInput.svelte +1 -1
- package/dist/api/optimade.js +32 -26
- package/dist/app.css +0 -3
- package/dist/brillouin/BrillouinZone.svelte +76 -148
- package/dist/brillouin/BrillouinZone.svelte.d.ts +6 -14
- package/dist/brillouin/BrillouinZoneExportPane.svelte +43 -96
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +9 -32
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +2 -3
- package/dist/brillouin/BrillouinZoneScene.svelte +97 -205
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +4 -23
- package/dist/brillouin/BrillouinZoneTooltip.svelte +16 -25
- package/dist/brillouin/ReciprocalVectors.svelte +39 -0
- package/dist/brillouin/ReciprocalVectors.svelte.d.ts +9 -0
- package/dist/brillouin/compute.d.ts +2 -0
- package/dist/brillouin/compute.js +89 -90
- package/dist/brillouin/geometry.d.ts +8 -0
- package/dist/brillouin/geometry.js +57 -0
- package/dist/brillouin/index.d.ts +2 -0
- package/dist/brillouin/index.js +2 -0
- package/dist/brillouin/types.d.ts +2 -2
- package/dist/chempot-diagram/ChemPotDiagram.svelte +14 -13
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +109 -203
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +4 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +180 -470
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +7 -1
- package/dist/chempot-diagram/async-compute.svelte.js +3 -1
- package/dist/chempot-diagram/chempot-worker.js +2 -1
- package/dist/chempot-diagram/color.d.ts +3 -6
- package/dist/chempot-diagram/color.js +5 -5
- package/dist/chempot-diagram/compute.d.ts +4 -4
- package/dist/chempot-diagram/compute.js +20 -20
- package/dist/chempot-diagram/controls-state.svelte.d.ts +10 -0
- package/dist/chempot-diagram/controls-state.svelte.js +42 -0
- package/dist/chempot-diagram/export.d.ts +47 -0
- package/dist/chempot-diagram/export.js +133 -0
- package/dist/chempot-diagram/index.d.ts +1 -0
- package/dist/chempot-diagram/index.js +1 -0
- package/dist/chempot-diagram/pointer.d.ts +0 -10
- package/dist/chempot-diagram/pointer.js +4 -4
- package/dist/chempot-diagram/types.d.ts +3 -3
- package/dist/colors/index.js +8 -7
- package/dist/composition/FormulaFilter.svelte +18 -11
- package/dist/composition/PieChart.svelte +11 -10
- package/dist/composition/chem-sys.d.ts +8 -0
- package/dist/composition/chem-sys.js +86 -0
- package/dist/composition/format.js +7 -4
- package/dist/composition/index.d.ts +1 -0
- package/dist/composition/index.js +1 -0
- package/dist/composition/parse.d.ts +0 -1
- package/dist/composition/parse.js +41 -31
- package/dist/controls.d.ts +1 -0
- package/dist/controls.js +0 -1
- package/dist/convex-hull/ConvexHull.svelte +8 -10
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -4
- package/dist/convex-hull/ConvexHull2D.svelte +106 -185
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +179 -683
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +183 -687
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +268 -0
- package/dist/convex-hull/ConvexHullChrome.svelte.d.ts +30 -0
- package/dist/convex-hull/ConvexHullControls.svelte +88 -7
- package/dist/convex-hull/ConvexHullControls.svelte.d.ts +7 -6
- package/dist/convex-hull/ConvexHullInfoPane.svelte +18 -5
- package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +6 -5
- package/dist/convex-hull/ConvexHullStats.svelte +36 -175
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +3 -1
- package/dist/convex-hull/ConvexHullTooltip.svelte +11 -2
- package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +2 -1
- package/dist/convex-hull/GasPressureControls.svelte +4 -4
- package/dist/convex-hull/TemperatureSlider.svelte +2 -2
- package/dist/convex-hull/barycentric-coords.d.ts +2 -4
- package/dist/convex-hull/barycentric-coords.js +6 -33
- package/dist/convex-hull/canvas-interactions.svelte.d.ts +79 -0
- package/dist/convex-hull/canvas-interactions.svelte.js +278 -0
- package/dist/convex-hull/demo-temperature.d.ts +1 -1
- package/dist/convex-hull/demo-temperature.js +20 -22
- package/dist/convex-hull/gas-thermodynamics.d.ts +2 -2
- package/dist/convex-hull/gas-thermodynamics.js +22 -30
- package/dist/convex-hull/helpers.d.ts +42 -7
- package/dist/convex-hull/helpers.js +171 -78
- package/dist/convex-hull/hull-state.svelte.d.ts +44 -0
- package/dist/convex-hull/hull-state.svelte.js +124 -0
- package/dist/convex-hull/index.d.ts +10 -8
- package/dist/convex-hull/index.js +7 -2
- package/dist/convex-hull/thermodynamics.js +136 -960
- package/dist/convex-hull/types.d.ts +13 -5
- package/dist/convex-hull/types.js +12 -0
- package/dist/coordination/CoordinationBarPlot.svelte +27 -34
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
- package/dist/element/BohrAtom.svelte +2 -1
- package/dist/element/index.d.ts +4 -0
- package/dist/element/index.js +18 -0
- package/dist/feedback/DragOverlay.svelte +3 -1
- package/dist/feedback/DragOverlay.svelte.d.ts +1 -0
- package/dist/feedback/StatusMessage.svelte +13 -3
- package/dist/fermi-surface/FermiSlice.svelte +13 -5
- package/dist/fermi-surface/FermiSurface.svelte +78 -151
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +5 -14
- package/dist/fermi-surface/FermiSurfaceControls.svelte +1 -1
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +72 -221
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +3 -23
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +8 -34
- package/dist/fermi-surface/compute.js +67 -66
- package/dist/fermi-surface/export.js +6 -16
- package/dist/fermi-surface/index.d.ts +0 -1
- package/dist/fermi-surface/index.js +0 -1
- package/dist/fermi-surface/parse.d.ts +1 -1
- package/dist/fermi-surface/parse.js +71 -79
- package/dist/fermi-surface/types.d.ts +3 -2
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +69 -52
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +4 -3
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +3 -2
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +5 -5
- package/dist/heatmap-matrix/index.d.ts +3 -2
- package/dist/heatmap-matrix/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/io/ExportPane.svelte +166 -0
- package/dist/io/ExportPane.svelte.d.ts +17 -0
- package/dist/io/decompress.js +5 -4
- package/dist/io/export.d.ts +9 -5
- package/dist/io/export.js +77 -51
- package/dist/io/fetch.d.ts +2 -1
- package/dist/io/fetch.js +5 -1
- package/dist/io/file-drop.d.ts +8 -1
- package/dist/io/file-drop.js +48 -36
- package/dist/io/index.d.ts +2 -0
- package/dist/io/index.js +10 -0
- package/dist/io/types.d.ts +13 -0
- package/dist/io/url-drop.js +64 -33
- package/dist/isosurface/parse.js +52 -51
- package/dist/isosurface/slice.js +5 -4
- package/dist/isosurface/types.js +1 -1
- package/dist/keyboard.d.ts +3 -0
- package/dist/keyboard.js +23 -0
- package/dist/labels.d.ts +1 -1
- package/dist/labels.js +9 -8
- package/dist/layout/FullscreenButton.svelte +33 -0
- package/dist/layout/FullscreenButton.svelte.d.ts +10 -0
- package/dist/layout/FullscreenToggle.svelte +8 -14
- package/dist/layout/PropertyFilter.svelte +3 -2
- package/dist/layout/SettingsSection.svelte +1 -1
- package/dist/layout/ViewerChrome.svelte +116 -0
- package/dist/layout/ViewerChrome.svelte.d.ts +17 -0
- package/dist/layout/fullscreen.d.ts +4 -0
- package/dist/layout/fullscreen.svelte.d.ts +8 -0
- package/dist/layout/fullscreen.svelte.js +37 -0
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.js +3 -0
- package/dist/layout/json-tree/JsonNode.svelte +1 -1
- package/dist/layout/json-tree/JsonTree.svelte +2 -2
- package/dist/layout/json-tree/utils.js +5 -4
- package/dist/marching-cubes.js +8 -13
- package/dist/math.d.ts +12 -4
- package/dist/math.js +42 -30
- package/dist/overlays/DraggablePane.svelte +4 -4
- package/dist/overlays/index.d.ts +4 -0
- package/dist/periodic-table/PeriodicTable.svelte +27 -15
- package/dist/periodic-table/PropertySelect.svelte +1 -0
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +9 -3
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramControls.svelte +3 -2
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +4 -3
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +4 -2
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +2 -3
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +47 -132
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +3 -4
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +1 -1
- package/dist/phase-diagram/build-diagram.js +2 -2
- package/dist/phase-diagram/colors.js +1 -1
- package/dist/phase-diagram/parse.d.ts +2 -1
- package/dist/phase-diagram/parse.js +6 -5
- package/dist/phase-diagram/types.d.ts +1 -1
- package/dist/phase-diagram/utils.d.ts +3 -3
- package/dist/phase-diagram/utils.js +8 -12
- package/dist/plot/{BarPlot.svelte → bar/BarPlot.svelte} +246 -841
- package/dist/plot/{BarPlot.svelte.d.ts → bar/BarPlot.svelte.d.ts} +8 -16
- package/dist/plot/{BarPlotControls.svelte → bar/BarPlotControls.svelte} +6 -5
- package/dist/plot/{BarPlotControls.svelte.d.ts → bar/BarPlotControls.svelte.d.ts} +3 -3
- package/dist/plot/{SpacegroupBarPlot.svelte → bar/SpacegroupBarPlot.svelte} +8 -7
- package/dist/plot/{SpacegroupBarPlot.svelte.d.ts → bar/SpacegroupBarPlot.svelte.d.ts} +1 -1
- package/dist/plot/bar/data.d.ts +40 -0
- package/dist/plot/bar/data.js +154 -0
- package/dist/plot/bar/geometry.d.ts +39 -0
- package/dist/plot/bar/geometry.js +60 -0
- package/dist/plot/bar/index.d.ts +3 -0
- package/dist/plot/bar/index.js +3 -0
- package/dist/plot/box/BoxPlot.svelte +1292 -0
- package/dist/plot/box/BoxPlot.svelte.d.ts +95 -0
- package/dist/plot/box/BoxPlotControls.svelte +109 -0
- package/dist/plot/box/BoxPlotControls.svelte.d.ts +19 -0
- package/dist/plot/box/Violin.svelte +14 -0
- package/dist/plot/box/Violin.svelte.d.ts +70 -0
- package/dist/plot/box/box-plot.d.ts +56 -0
- package/dist/plot/box/box-plot.js +129 -0
- package/dist/plot/box/index.d.ts +5 -0
- package/dist/plot/box/index.js +5 -0
- package/dist/plot/box/kde.d.ts +17 -0
- package/dist/plot/box/kde.js +160 -0
- package/dist/plot/box/quantile.d.ts +3 -0
- package/dist/plot/box/quantile.js +53 -0
- package/dist/plot/{auto-place.d.ts → core/auto-place.d.ts} +1 -1
- package/dist/plot/{auto-place.js → core/auto-place.js} +6 -3
- package/dist/plot/core/axis-utils.d.ts +46 -0
- package/dist/plot/core/axis-utils.js +110 -0
- package/dist/plot/{AxisLabel.svelte → core/components/AxisLabel.svelte} +2 -2
- package/dist/plot/{AxisLabel.svelte.d.ts → core/components/AxisLabel.svelte.d.ts} +1 -1
- package/dist/plot/{ColorBar.svelte → core/components/ColorBar.svelte} +41 -38
- package/dist/plot/{ColorBar.svelte.d.ts → core/components/ColorBar.svelte.d.ts} +7 -6
- package/dist/plot/{ColorScaleSelect.svelte → core/components/ColorScaleSelect.svelte} +4 -3
- package/dist/plot/{ColorScaleSelect.svelte.d.ts → core/components/ColorScaleSelect.svelte.d.ts} +2 -2
- package/dist/plot/core/components/ControlPane.svelte +46 -0
- package/dist/plot/core/components/ControlPane.svelte.d.ts +13 -0
- package/dist/plot/{FillArea.svelte → core/components/FillArea.svelte} +17 -6
- package/dist/plot/{FillArea.svelte.d.ts → core/components/FillArea.svelte.d.ts} +1 -1
- package/dist/plot/{InteractiveAxisLabel.svelte → core/components/InteractiveAxisLabel.svelte} +3 -3
- package/dist/plot/{InteractiveAxisLabel.svelte.d.ts → core/components/InteractiveAxisLabel.svelte.d.ts} +2 -2
- package/dist/plot/{Line.svelte → core/components/Line.svelte} +33 -15
- package/dist/plot/{Line.svelte.d.ts → core/components/Line.svelte.d.ts} +3 -2
- package/dist/plot/{PlotAxis.svelte → core/components/PlotAxis.svelte} +9 -6
- package/dist/plot/{PlotAxis.svelte.d.ts → core/components/PlotAxis.svelte.d.ts} +5 -3
- package/dist/plot/{PlotControls.svelte → core/components/PlotControls.svelte} +17 -29
- package/dist/plot/core/components/PlotControls.svelte.d.ts +4 -0
- package/dist/plot/{PlotLegend.svelte → core/components/PlotLegend.svelte} +21 -10
- package/dist/plot/{PlotLegend.svelte.d.ts → core/components/PlotLegend.svelte.d.ts} +3 -2
- package/dist/plot/{PlotTooltip.svelte → core/components/PlotTooltip.svelte} +17 -1
- package/dist/plot/{PlotTooltip.svelte.d.ts → core/components/PlotTooltip.svelte.d.ts} +8 -0
- package/dist/plot/{PortalSelect.svelte → core/components/PortalSelect.svelte} +11 -7
- package/dist/plot/{ReferenceLine.svelte → core/components/ReferenceLine.svelte} +3 -3
- package/dist/plot/{ReferenceLine.svelte.d.ts → core/components/ReferenceLine.svelte.d.ts} +1 -1
- package/dist/plot/{ReferenceLine3D.svelte → core/components/ReferenceLine3D.svelte} +5 -5
- package/dist/plot/{ReferenceLine3D.svelte.d.ts → core/components/ReferenceLine3D.svelte.d.ts} +5 -5
- package/dist/plot/{ReferencePlane.svelte → core/components/ReferencePlane.svelte} +8 -8
- package/dist/plot/{ReferencePlane.svelte.d.ts → core/components/ReferencePlane.svelte.d.ts} +5 -5
- package/dist/plot/{ZeroLines.svelte → core/components/ZeroLines.svelte} +3 -3
- package/dist/plot/{ZeroLines.svelte.d.ts → core/components/ZeroLines.svelte.d.ts} +3 -3
- package/dist/plot/{ZoomRect.svelte → core/components/ZoomRect.svelte} +1 -1
- package/dist/plot/{ZoomRect.svelte.d.ts → core/components/ZoomRect.svelte.d.ts} +1 -1
- package/dist/plot/core/components/index.d.ts +17 -0
- package/dist/plot/core/components/index.js +17 -0
- package/dist/plot/{data-cleaning.d.ts → core/data-cleaning.d.ts} +71 -1
- package/dist/plot/{data-cleaning.js → core/data-cleaning.js} +21 -23
- package/dist/plot/{data-transform.d.ts → core/data-transform.d.ts} +2 -2
- package/dist/plot/{data-transform.js → core/data-transform.js} +3 -3
- package/dist/plot/core/fill-utils.d.ts +34 -0
- package/dist/plot/core/fill-utils.js +391 -0
- package/dist/plot/core/index.d.ts +10 -0
- package/dist/plot/core/index.js +11 -0
- package/dist/plot/core/interactions.d.ts +39 -0
- package/dist/plot/core/interactions.js +209 -0
- package/dist/plot/{layout.d.ts → core/layout.d.ts} +1 -0
- package/dist/plot/{layout.js → core/layout.js} +16 -8
- package/dist/plot/core/pan-zoom.svelte.d.ts +35 -0
- package/dist/plot/core/pan-zoom.svelte.js +221 -0
- package/dist/plot/core/placed-tween.svelte.d.ts +21 -0
- package/dist/plot/core/placed-tween.svelte.js +68 -0
- package/dist/plot/{reference-line.d.ts → core/reference-line.d.ts} +11 -11
- package/dist/plot/{reference-line.js → core/reference-line.js} +29 -42
- package/dist/plot/core/scales.d.ts +40 -0
- package/dist/plot/{scales.js → core/scales.js} +94 -93
- package/dist/plot/core/svg.d.ts +3 -0
- package/dist/plot/core/svg.js +41 -0
- package/dist/plot/{types.d.ts → core/types.d.ts} +36 -85
- package/dist/plot/{types.js → core/types.js} +1 -1
- package/dist/plot/{utils → core/utils}/label-placement.d.ts +3 -3
- package/dist/plot/{utils → core/utils}/label-placement.js +3 -3
- package/dist/plot/core/utils/series-visibility.d.ts +26 -0
- package/dist/plot/{utils → core/utils}/series-visibility.js +29 -2
- package/dist/plot/core/utils.d.ts +12 -0
- package/dist/plot/core/utils.js +27 -0
- package/dist/plot/{Histogram.svelte → histogram/Histogram.svelte} +174 -551
- package/dist/plot/{Histogram.svelte.d.ts → histogram/Histogram.svelte.d.ts} +2 -2
- package/dist/plot/{HistogramControls.svelte → histogram/HistogramControls.svelte} +6 -6
- package/dist/plot/{HistogramControls.svelte.d.ts → histogram/HistogramControls.svelte.d.ts} +4 -4
- package/dist/plot/histogram/index.d.ts +2 -0
- package/dist/plot/histogram/index.js +2 -0
- package/dist/plot/index.d.ts +8 -41
- package/dist/plot/index.js +10 -39
- package/dist/plot/sankey/Sankey.svelte +697 -0
- package/dist/plot/sankey/Sankey.svelte.d.ts +74 -0
- package/dist/plot/sankey/SankeyControls.svelte +98 -0
- package/dist/plot/sankey/SankeyControls.svelte.d.ts +19 -0
- package/dist/plot/sankey/index.d.ts +4 -0
- package/dist/plot/sankey/index.js +3 -0
- package/dist/plot/sankey/sankey-types.d.ts +42 -0
- package/dist/plot/sankey/sankey-types.js +4 -0
- package/dist/plot/sankey/sankey.d.ts +52 -0
- package/dist/plot/sankey/sankey.js +189 -0
- package/dist/plot/{BinnedScatterPlot.svelte → scatter/BinnedScatterPlot.svelte} +64 -64
- package/dist/plot/{BinnedScatterPlot.svelte.d.ts → scatter/BinnedScatterPlot.svelte.d.ts} +6 -6
- package/dist/plot/{ElementScatter.svelte → scatter/ElementScatter.svelte} +6 -6
- package/dist/plot/{ElementScatter.svelte.d.ts → scatter/ElementScatter.svelte.d.ts} +2 -2
- package/dist/plot/{ScatterPlot.svelte → scatter/ScatterPlot.svelte} +297 -1008
- package/dist/plot/{ScatterPlot.svelte.d.ts → scatter/ScatterPlot.svelte.d.ts} +10 -18
- package/dist/plot/{ScatterPlotControls.svelte → scatter/ScatterPlotControls.svelte} +6 -5
- package/dist/plot/{ScatterPlotControls.svelte.d.ts → scatter/ScatterPlotControls.svelte.d.ts} +2 -2
- package/dist/plot/{ScatterPoint.svelte → scatter/ScatterPoint.svelte} +7 -7
- package/dist/plot/{ScatterPoint.svelte.d.ts → scatter/ScatterPoint.svelte.d.ts} +3 -3
- package/dist/plot/{adaptive-density.d.ts → scatter/adaptive-density.d.ts} +14 -4
- package/dist/plot/{adaptive-density.js → scatter/adaptive-density.js} +46 -20
- package/dist/plot/{binned-scatter-types.d.ts → scatter/binned-scatter-types.d.ts} +5 -12
- package/dist/plot/scatter/index.d.ts +7 -0
- package/dist/plot/scatter/index.js +5 -0
- package/dist/plot/scatter/scatter-data.d.ts +19 -0
- package/dist/plot/scatter/scatter-data.js +212 -0
- package/dist/plot/{ScatterPlot3D.svelte → scatter-3d/ScatterPlot3D.svelte} +25 -34
- package/dist/plot/{ScatterPlot3D.svelte.d.ts → scatter-3d/ScatterPlot3D.svelte.d.ts} +9 -17
- package/dist/plot/{ScatterPlot3DControls.svelte → scatter-3d/ScatterPlot3DControls.svelte} +14 -14
- package/dist/plot/{ScatterPlot3DControls.svelte.d.ts → scatter-3d/ScatterPlot3DControls.svelte.d.ts} +6 -6
- package/dist/plot/{ScatterPlot3DScene.svelte → scatter-3d/ScatterPlot3DScene.svelte} +129 -128
- package/dist/plot/{ScatterPlot3DScene.svelte.d.ts → scatter-3d/ScatterPlot3DScene.svelte.d.ts} +6 -15
- package/dist/plot/{Surface3D.svelte → scatter-3d/Surface3D.svelte} +7 -6
- package/dist/plot/{Surface3D.svelte.d.ts → scatter-3d/Surface3D.svelte.d.ts} +5 -4
- package/dist/plot/scatter-3d/index.d.ts +4 -0
- package/dist/plot/scatter-3d/index.js +4 -0
- package/dist/plot/sunburst/Sunburst.svelte +1041 -0
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +97 -0
- package/dist/plot/sunburst/SunburstControls.svelte +200 -0
- package/dist/plot/sunburst/SunburstControls.svelte.d.ts +26 -0
- package/dist/plot/sunburst/index.d.ts +4 -0
- package/dist/plot/sunburst/index.js +4 -0
- package/dist/plot/sunburst/render.d.ts +34 -0
- package/dist/plot/sunburst/render.js +122 -0
- package/dist/plot/sunburst/sunburst.d.ts +62 -0
- package/dist/plot/sunburst/sunburst.js +269 -0
- package/dist/rdf/RdfPlot.svelte +2 -1
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/calc-rdf.js +11 -24
- package/dist/sanitize.js +14 -3
- package/dist/scene/SceneCamera.svelte +62 -0
- package/dist/scene/SceneCamera.svelte.d.ts +19 -0
- package/dist/scene/bind-renderer.svelte.d.ts +2 -0
- package/dist/scene/bind-renderer.svelte.js +14 -0
- package/dist/scene/index.d.ts +4 -0
- package/dist/scene/index.js +5 -0
- package/dist/scene/props.js +52 -0
- package/dist/scene/types.d.ts +26 -0
- package/dist/scene/types.js +1 -0
- package/dist/settings.d.ts +79 -3
- package/dist/settings.js +321 -1
- package/dist/spectral/Bands.svelte +47 -36
- package/dist/spectral/Bands.svelte.d.ts +6 -6
- package/dist/spectral/BandsAndDos.svelte +23 -25
- package/dist/spectral/BrillouinBandsDos.svelte +42 -30
- package/dist/spectral/Dos.svelte +15 -23
- package/dist/spectral/Dos.svelte.d.ts +4 -3
- package/dist/spectral/helpers.d.ts +8 -6
- package/dist/spectral/helpers.js +137 -65
- package/dist/state.svelte.d.ts +0 -7
- package/dist/state.svelte.js +0 -6
- package/dist/structure/Arrow.svelte +2 -4
- package/dist/structure/AtomLegend.svelte +8 -9
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/CanvasTooltip.svelte +1 -0
- package/dist/structure/CellSelect.svelte +12 -5
- package/dist/structure/CellSelect.svelte.d.ts +2 -1
- package/dist/structure/Cylinder.svelte +12 -8
- package/dist/structure/Cylinder.svelte.d.ts +4 -1
- package/dist/structure/Lattice.svelte +2 -2
- package/dist/structure/Structure.svelte +365 -423
- package/dist/structure/Structure.svelte.d.ts +5 -15
- package/dist/structure/StructureControls.svelte +217 -2
- package/dist/structure/StructureControls.svelte.d.ts +5 -3
- package/dist/structure/StructureExportPane.svelte +54 -156
- package/dist/structure/StructureExportPane.svelte.d.ts +4 -5
- package/dist/structure/StructureInfoPane.svelte +10 -9
- package/dist/structure/StructureInfoPane.svelte.d.ts +5 -5
- package/dist/structure/StructureScene.svelte +376 -208
- package/dist/structure/StructureScene.svelte.d.ts +22 -20
- package/dist/structure/{label-placement.d.ts → atom-label-placement.d.ts} +3 -3
- package/dist/structure/{label-placement.js → atom-label-placement.js} +15 -5
- package/dist/structure/atom-properties.d.ts +1 -1
- package/dist/structure/atom-properties.js +17 -22
- package/dist/structure/bond-order-perception.js +3 -5
- package/dist/structure/bonding.d.ts +4 -0
- package/dist/structure/bonding.js +134 -63
- package/dist/structure/export.d.ts +24 -4
- package/dist/structure/export.js +89 -143
- package/dist/structure/index.d.ts +4 -4
- package/dist/structure/index.js +3 -3
- package/dist/structure/measure.d.ts +3 -2
- package/dist/structure/measure.js +6 -5
- package/dist/structure/parse.d.ts +3 -2
- package/dist/structure/parse.js +419 -438
- package/dist/structure/partial-occupancy.d.ts +0 -1
- package/dist/structure/partial-occupancy.js +1 -1
- package/dist/structure/pbc.d.ts +1 -1
- package/dist/structure/pbc.js +190 -13
- package/dist/structure/polyhedra.d.ts +41 -0
- package/dist/structure/polyhedra.js +602 -0
- package/dist/structure/site.d.ts +4 -0
- package/dist/structure/site.js +1 -0
- package/dist/structure/supercell.js +3 -2
- package/dist/structure/validation.js +5 -6
- package/dist/symmetry/SymmetryElementControls.svelte +69 -0
- package/dist/symmetry/SymmetryElementControls.svelte.d.ts +9 -0
- package/dist/symmetry/SymmetryElements.svelte +354 -0
- package/dist/symmetry/SymmetryElements.svelte.d.ts +24 -0
- package/dist/symmetry/SymmetryStats.svelte +113 -8
- package/dist/symmetry/WyckoffTable.svelte +68 -7
- package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -0
- package/dist/symmetry/cell-transform.js +7 -14
- package/dist/symmetry/index.d.ts +14 -4
- package/dist/symmetry/index.js +291 -72
- package/dist/symmetry/spacegroups.d.ts +12 -1
- package/dist/symmetry/spacegroups.js +63 -14
- package/dist/symmetry/symmetry-elements.d.ts +33 -0
- package/dist/symmetry/symmetry-elements.js +521 -0
- package/dist/symmetry/wyckoff-db.d.ts +9 -0
- package/dist/symmetry/wyckoff-db.js +87 -0
- package/dist/table/HeatmapTable.svelte +66 -25
- package/dist/table/HeatmapTable.svelte.d.ts +1 -1
- package/dist/table/index.d.ts +1 -3
- package/dist/table/index.js +1 -1
- package/dist/theme/index.js +8 -8
- package/dist/tooltip/KCoords.svelte +45 -0
- package/dist/tooltip/KCoords.svelte.d.ts +8 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/trajectory/Trajectory.svelte +123 -100
- package/dist/trajectory/Trajectory.svelte.d.ts +11 -22
- package/dist/trajectory/TrajectoryExportPane.svelte +17 -25
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +4 -5
- package/dist/trajectory/TrajectoryInfoPane.svelte +5 -3
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -2
- package/dist/trajectory/constants.js +6 -2
- package/dist/trajectory/extract.js +17 -37
- package/dist/trajectory/format-detect.d.ts +1 -1
- package/dist/trajectory/format-detect.js +27 -19
- package/dist/trajectory/frame-reader.d.ts +0 -1
- package/dist/trajectory/frame-reader.js +63 -162
- package/dist/trajectory/helpers.d.ts +10 -2
- package/dist/trajectory/helpers.js +56 -36
- package/dist/trajectory/index.js +1 -1
- package/dist/trajectory/parse/ase.d.ts +9 -1
- package/dist/trajectory/parse/ase.js +47 -32
- package/dist/trajectory/parse/diagnostics.d.ts +3 -0
- package/dist/trajectory/parse/diagnostics.js +14 -0
- package/dist/trajectory/parse/hdf5.js +1 -1
- package/dist/trajectory/parse/index.d.ts +1 -1
- package/dist/trajectory/parse/index.js +65 -105
- package/dist/trajectory/parse/lammps.d.ts +0 -2
- package/dist/trajectory/parse/lammps.js +8 -6
- package/dist/trajectory/parse/pymatgen.d.ts +2 -0
- package/dist/trajectory/parse/pymatgen.js +74 -0
- package/dist/trajectory/parse/vasp.js +38 -18
- package/dist/trajectory/parse/xyz.d.ts +13 -1
- package/dist/trajectory/parse/xyz.js +102 -94
- package/dist/trajectory/plotting.d.ts +1 -2
- package/dist/trajectory/plotting.js +16 -113
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +7 -5
- package/dist/xrd/XrdPlot.svelte +16 -30
- package/dist/xrd/broadening.d.ts +2 -1
- package/dist/xrd/calc-xrd.js +18 -20
- package/dist/xrd/index.d.ts +2 -2
- package/dist/xrd/parse.js +2 -2
- package/package.json +43 -26
- package/dist/element/data.json +0 -11864
- package/dist/fermi-surface/marching-cubes.d.ts +0 -2
- package/dist/fermi-surface/marching-cubes.js +0 -2
- package/dist/plot/PlotControls.svelte.d.ts +0 -4
- package/dist/plot/axis-utils.d.ts +0 -19
- package/dist/plot/axis-utils.js +0 -78
- package/dist/plot/defaults.d.ts +0 -19
- package/dist/plot/defaults.js +0 -9
- package/dist/plot/fill-utils.d.ts +0 -46
- package/dist/plot/fill-utils.js +0 -322
- package/dist/plot/hover-lock.svelte.d.ts +0 -14
- package/dist/plot/hover-lock.svelte.js +0 -46
- package/dist/plot/interactions.d.ts +0 -12
- package/dist/plot/interactions.js +0 -101
- package/dist/plot/scales.d.ts +0 -48
- package/dist/plot/svg.d.ts +0 -1
- package/dist/plot/svg.js +0 -11
- package/dist/plot/utils/series-visibility.d.ts +0 -15
- package/dist/plot/utils.d.ts +0 -1
- package/dist/plot/utils.js +0 -14
- /package/dist/plot/{PortalSelect.svelte.d.ts → core/components/PortalSelect.svelte.d.ts} +0 -0
- /package/dist/plot/{binned-scatter-types.js → scatter/binned-scatter-types.js} +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { ExportSection } from '../io'
|
|
3
|
+
import ExportPane from '../io/ExportPane.svelte'
|
|
2
4
|
import { export_canvas_as_png } from '../io/export'
|
|
3
|
-
import
|
|
4
|
-
import type { ComponentProps } from 'svelte'
|
|
5
|
-
import { CopyButton } from 'svelte-multiselect'
|
|
6
|
-
import { tooltip } from 'svelte-multiselect/attachments'
|
|
5
|
+
import { download } from '../io/fetch'
|
|
7
6
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
8
7
|
import type { Camera, Scene } from 'three'
|
|
9
8
|
import type { BrillouinZoneData } from './types'
|
|
@@ -27,30 +26,11 @@
|
|
|
27
26
|
png_dpi?: number
|
|
28
27
|
} = $props()
|
|
29
28
|
|
|
30
|
-
let json_copy_state = $state<ComponentProps<typeof CopyButton>[`state`]>(`ready`)
|
|
31
|
-
|
|
32
29
|
function export_as_png() {
|
|
33
30
|
const canvas = wrapper?.querySelector(`canvas`)
|
|
34
31
|
if (!canvas || !scene || !camera) return
|
|
35
|
-
|
|
36
|
-
const dpi = Math.max(50, Math.min(600, Math.trunc(png_dpi)))
|
|
37
32
|
const png_name = `${filename}-${bz_data?.order ?? `1`}.png`
|
|
38
|
-
export_canvas_as_png(canvas, png_name,
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function export_as_json() {
|
|
42
|
-
const json_data = get_json_data()
|
|
43
|
-
if (!json_data || !bz_data) return
|
|
44
|
-
|
|
45
|
-
const blob = new Blob([JSON.stringify(json_data, null, 2)], {
|
|
46
|
-
type: `application/json`,
|
|
47
|
-
})
|
|
48
|
-
const url = URL.createObjectURL(blob)
|
|
49
|
-
const link = document.createElement(`a`)
|
|
50
|
-
link.href = url
|
|
51
|
-
link.download = `${filename}-bz-order-${bz_data.order}.json`
|
|
52
|
-
link.click()
|
|
53
|
-
URL.revokeObjectURL(url)
|
|
33
|
+
export_canvas_as_png(canvas, png_name, png_dpi, scene, camera)
|
|
54
34
|
}
|
|
55
35
|
|
|
56
36
|
function get_json_data() {
|
|
@@ -65,82 +45,49 @@
|
|
|
65
45
|
}
|
|
66
46
|
}
|
|
67
47
|
|
|
68
|
-
|
|
48
|
+
function export_as_json() {
|
|
69
49
|
const json_data = get_json_data()
|
|
70
|
-
|
|
71
|
-
|
|
50
|
+
if (!json_data || !bz_data) return
|
|
51
|
+
download(
|
|
52
|
+
JSON.stringify(json_data, null, 2),
|
|
53
|
+
`${filename}-bz-order-${bz_data.order}.json`,
|
|
54
|
+
`application/json`,
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const sections = $derived<ExportSection[]>([
|
|
59
|
+
{
|
|
60
|
+
title: `Export as image`,
|
|
61
|
+
items: [{
|
|
62
|
+
label: `PNG`,
|
|
63
|
+
disabled: !scene || !camera,
|
|
64
|
+
show_dpi: true,
|
|
65
|
+
on_download: export_as_png,
|
|
66
|
+
}],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
title: `Export as data`,
|
|
70
|
+
tooltip: `Includes vertices, faces, edges, and reciprocal lattice vectors`,
|
|
71
|
+
items: [{
|
|
72
|
+
label: `JSON`,
|
|
73
|
+
disabled: !bz_data,
|
|
74
|
+
on_download: export_as_json,
|
|
75
|
+
copy_text: () => {
|
|
76
|
+
const json_data = get_json_data()
|
|
77
|
+
return json_data ? JSON.stringify(json_data, null, 2) : null
|
|
78
|
+
},
|
|
79
|
+
}],
|
|
80
|
+
},
|
|
81
|
+
])
|
|
72
82
|
</script>
|
|
73
83
|
|
|
74
|
-
<
|
|
75
|
-
bind:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
pane_props={{ ...rest, class: `export-pane ${rest.class ?? ``}` }}
|
|
84
|
+
<ExportPane
|
|
85
|
+
bind:export_pane_open
|
|
86
|
+
bind:png_dpi
|
|
87
|
+
{sections}
|
|
79
88
|
toggle_props={{
|
|
80
89
|
class: `bz-export-toggle`,
|
|
81
90
|
title: export_pane_open ? `` : `Export Brillouin zone`,
|
|
82
91
|
}}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<label>
|
|
86
|
-
PNG
|
|
87
|
-
<button
|
|
88
|
-
type="button"
|
|
89
|
-
onclick={export_as_png}
|
|
90
|
-
disabled={!scene || !camera}
|
|
91
|
-
title="PNG ({png_dpi} DPI)"
|
|
92
|
-
>
|
|
93
|
-
⬇
|
|
94
|
-
</button>
|
|
95
|
-
(DPI: <input
|
|
96
|
-
type="number"
|
|
97
|
-
min={72}
|
|
98
|
-
max={600}
|
|
99
|
-
bind:value={png_dpi}
|
|
100
|
-
title="Export resolution in dots per inch"
|
|
101
|
-
/>)
|
|
102
|
-
</label>
|
|
103
|
-
|
|
104
|
-
<h4 id="export-as-data"
|
|
105
|
-
{@attach tooltip({ content: `Includes vertices, faces, edges, and reciprocal lattice vectors` })}
|
|
106
|
-
>
|
|
107
|
-
Export as data
|
|
108
|
-
</h4>
|
|
109
|
-
<label>
|
|
110
|
-
JSON
|
|
111
|
-
<button
|
|
112
|
-
type="button"
|
|
113
|
-
onclick={export_as_json}
|
|
114
|
-
disabled={!bz_data}
|
|
115
|
-
title="Download JSON"
|
|
116
|
-
>
|
|
117
|
-
⬇
|
|
118
|
-
</button>
|
|
119
|
-
<CopyButton
|
|
120
|
-
content={json_string ?? ``}
|
|
121
|
-
bind:state={json_copy_state}
|
|
122
|
-
disabled={!json_string}
|
|
123
|
-
title="Copy JSON to clipboard"
|
|
124
|
-
/>
|
|
125
|
-
</label>
|
|
126
|
-
</DraggablePane>
|
|
127
|
-
|
|
128
|
-
<style>
|
|
129
|
-
label {
|
|
130
|
-
display: flex;
|
|
131
|
-
flex-wrap: wrap;
|
|
132
|
-
align-items: center;
|
|
133
|
-
gap: 4pt;
|
|
134
|
-
font-size: 0.95em;
|
|
135
|
-
}
|
|
136
|
-
button {
|
|
137
|
-
width: 1.9em;
|
|
138
|
-
height: 1.6em;
|
|
139
|
-
padding: 0 6pt;
|
|
140
|
-
margin: 0 0 0 4pt;
|
|
141
|
-
box-sizing: border-box;
|
|
142
|
-
}
|
|
143
|
-
input {
|
|
144
|
-
margin: 0 0 0 2pt;
|
|
145
|
-
}
|
|
146
|
-
</style>
|
|
92
|
+
{...rest}
|
|
93
|
+
/>
|
|
@@ -10,6 +10,6 @@ type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
10
10
|
filename?: string;
|
|
11
11
|
png_dpi?: number;
|
|
12
12
|
};
|
|
13
|
-
declare const BrillouinZoneExportPane: import("svelte").Component<$$ComponentProps, {}, "
|
|
13
|
+
declare const BrillouinZoneExportPane: import("svelte").Component<$$ComponentProps, {}, "export_pane_open" | "png_dpi">;
|
|
14
14
|
type BrillouinZoneExportPane = ReturnType<typeof BrillouinZoneExportPane>;
|
|
15
15
|
export default BrillouinZoneExportPane;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { PaneProps } from '../overlays'
|
|
2
3
|
import type { InfoItem } from '../layout'
|
|
3
4
|
import DraggablePane from '../overlays/DraggablePane.svelte'
|
|
5
|
+
import InfoPaneCards from '../overlays/InfoPaneCards.svelte'
|
|
4
6
|
import { format_num } from '../labels'
|
|
5
|
-
import { sanitize_html } from '../sanitize'
|
|
6
7
|
import type { Crystal } from '../structure'
|
|
7
8
|
import { analyze_structure_symmetry } from '../symmetry'
|
|
8
9
|
import type { MoyoDataset } from '@spglib/moyo-wasm'
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
pane_open?: boolean
|
|
19
20
|
structure?: Crystal
|
|
20
21
|
bz_data?: BrillouinZoneData
|
|
21
|
-
pane_props?:
|
|
22
|
+
pane_props?: PaneProps
|
|
22
23
|
} = $props()
|
|
23
24
|
|
|
24
25
|
let sym_data = $state<MoyoDataset | null>(null)
|
|
@@ -112,35 +113,11 @@
|
|
|
112
113
|
toggle_props={{ class: `bz-info-toggle`, title: `Brillouin zone info` }}
|
|
113
114
|
pane_props={{ ...pane_props, class: `bz-info-pane ${pane_props?.class ?? ``}` }}
|
|
114
115
|
>
|
|
115
|
-
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
<span>{item.label}</span>
|
|
122
|
-
<span>{@html sanitize_html(item.value)}</span>
|
|
123
|
-
</div>
|
|
124
|
-
{/each}
|
|
125
|
-
</section>
|
|
126
|
-
{/each}
|
|
116
|
+
<InfoPaneCards
|
|
117
|
+
cards={pane_data.map(({ title, items }) => ({ title, rows: items }))}
|
|
118
|
+
show_filter={false}
|
|
119
|
+
filter_placeholder="Filter Brillouin zone info"
|
|
120
|
+
empty_label="Brillouin zone info"
|
|
121
|
+
/>
|
|
127
122
|
</DraggablePane>
|
|
128
123
|
{/if}
|
|
129
|
-
|
|
130
|
-
<style>
|
|
131
|
-
section div.info-item {
|
|
132
|
-
display: flex;
|
|
133
|
-
justify-content: space-between;
|
|
134
|
-
gap: 6pt;
|
|
135
|
-
padding: 1pt;
|
|
136
|
-
line-height: 1.5;
|
|
137
|
-
}
|
|
138
|
-
h4 {
|
|
139
|
-
margin: 0.5em 0;
|
|
140
|
-
}
|
|
141
|
-
hr {
|
|
142
|
-
border: none;
|
|
143
|
-
border-top: 1px solid var(--divider-color, rgba(128, 128, 128, 0.2));
|
|
144
|
-
margin: 0.5em 0;
|
|
145
|
-
}
|
|
146
|
-
</style>
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { PaneProps } from '../overlays';
|
|
2
2
|
import type { Crystal } from '../structure';
|
|
3
|
-
import type { ComponentProps } from 'svelte';
|
|
4
3
|
import type { BrillouinZoneData } from './types';
|
|
5
4
|
type $$ComponentProps = {
|
|
6
5
|
pane_open?: boolean;
|
|
7
6
|
structure?: Crystal;
|
|
8
7
|
bz_data?: BrillouinZoneData;
|
|
9
|
-
pane_props?:
|
|
8
|
+
pane_props?: PaneProps;
|
|
10
9
|
};
|
|
11
10
|
declare const BrillouinZoneInfoPane: import("svelte").Component<$$ComponentProps, {}, "pane_open">;
|
|
12
11
|
type BrillouinZoneInfoPane = ReturnType<typeof BrillouinZoneInfoPane>;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { AXIS_COLORS, NEG_AXIS_COLORS } from '../colors'
|
|
3
2
|
import type { Vec3 } from '../math'
|
|
4
3
|
import * as math from '../math'
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
4
|
+
import { bind_renderer, build_orbit_props, SceneCamera } from '../scene'
|
|
5
|
+
import type { SceneControlProps, ThreltePointerEvent } from '../scene'
|
|
6
|
+
import { DEFAULTS } from '../settings'
|
|
7
7
|
import Cylinder from '../structure/Cylinder.svelte'
|
|
8
|
-
import { T
|
|
8
|
+
import { T } from '@threlte/core'
|
|
9
9
|
import * as extras from '@threlte/extras'
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import {
|
|
11
|
+
cartesian_to_fractional,
|
|
12
|
+
default_camera_position,
|
|
13
|
+
k_lattice_inverse,
|
|
14
|
+
k_space_size,
|
|
15
|
+
polyhedron_centroid,
|
|
16
|
+
polyhedron_geometry,
|
|
17
|
+
} from './geometry'
|
|
18
|
+
import ReciprocalVectors from './ReciprocalVectors.svelte'
|
|
13
19
|
import type { BrillouinZoneData, BZHoverData, IrreducibleBZData } from './types'
|
|
14
20
|
|
|
15
|
-
// Threlte pointer event type for mesh interactions
|
|
16
|
-
type ThreltePointerEvent = { point: Vector3; nativeEvent: PointerEvent }
|
|
17
|
-
|
|
18
21
|
let {
|
|
19
22
|
bz_data = $bindable(),
|
|
20
23
|
camera_position = $bindable(),
|
|
@@ -43,7 +46,6 @@
|
|
|
43
46
|
directional_light = DEFAULTS.structure.directional_light,
|
|
44
47
|
gizmo = DEFAULTS.structure.show_gizmo,
|
|
45
48
|
auto_rotate = DEFAULTS.structure.auto_rotate,
|
|
46
|
-
camera_is_moving = $bindable(false),
|
|
47
49
|
scene = $bindable(),
|
|
48
50
|
camera = $bindable(),
|
|
49
51
|
k_path_points = [],
|
|
@@ -51,10 +53,10 @@
|
|
|
51
53
|
hovered_k_point = null,
|
|
52
54
|
hovered_qpoint_index = null,
|
|
53
55
|
hover_data = $bindable<BZHoverData | null>(null),
|
|
54
|
-
|
|
56
|
+
on_kpath_hover,
|
|
57
|
+
}: SceneControlProps & {
|
|
55
58
|
bz_data?: BrillouinZoneData
|
|
56
59
|
camera_position?: Vec3 | undefined
|
|
57
|
-
camera_projection?: CameraProjection
|
|
58
60
|
surface_color?: string
|
|
59
61
|
surface_opacity?: number
|
|
60
62
|
edge_color?: string
|
|
@@ -66,150 +68,64 @@
|
|
|
66
68
|
ibz_data?: IrreducibleBZData | null
|
|
67
69
|
ibz_color?: string
|
|
68
70
|
ibz_opacity?: number
|
|
69
|
-
rotation_damping?: number
|
|
70
|
-
max_zoom?: number
|
|
71
|
-
min_zoom?: number
|
|
72
|
-
rotate_speed?: number
|
|
73
|
-
zoom_speed?: number
|
|
74
|
-
pan_speed?: number
|
|
75
|
-
zoom_to_cursor?: boolean
|
|
76
|
-
fov?: number
|
|
77
|
-
initial_zoom?: number
|
|
78
|
-
ambient_light?: number
|
|
79
|
-
directional_light?: number
|
|
80
|
-
gizmo?: boolean | ComponentProps<typeof extras.Gizmo>
|
|
81
|
-
auto_rotate?: number
|
|
82
|
-
camera_is_moving?: boolean
|
|
83
|
-
scene?: Scene
|
|
84
|
-
camera?: Camera
|
|
85
71
|
k_path_points?: Vec3[]
|
|
86
72
|
k_path_labels?: { position: Vec3; label: string | null }[]
|
|
87
73
|
hovered_k_point?: Vec3 | null
|
|
88
74
|
hovered_qpoint_index?: number | null
|
|
89
75
|
hover_data?: BZHoverData | null
|
|
76
|
+
on_kpath_hover?: (qpoint_index: number | null) => void
|
|
90
77
|
} = $props()
|
|
91
78
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
camera = threlte.camera.current
|
|
96
|
-
if (threlte.renderer) {
|
|
97
|
-
Object.assign(threlte.renderer.domElement, { __renderer: threlte.renderer })
|
|
98
|
-
}
|
|
79
|
+
bind_renderer((threlte_scene, threlte_camera) => {
|
|
80
|
+
scene = threlte_scene
|
|
81
|
+
camera = threlte_camera
|
|
99
82
|
})
|
|
100
83
|
|
|
101
84
|
extras.interactivity()
|
|
102
85
|
|
|
103
|
-
//
|
|
104
|
-
const rotation_target = $derived
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
[0, 0, 0] as Vec3,
|
|
109
|
-
)
|
|
110
|
-
return math.scale(sum, 1 / bz_data.vertices.length)
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
// BZ size for camera positioning: average magnitude of k-vectors
|
|
114
|
-
const bz_size = $derived.by(() => {
|
|
115
|
-
if (!bz_data?.k_lattice) return 10
|
|
116
|
-
const mags = bz_data.k_lattice.map((vec) => Math.hypot(...vec))
|
|
117
|
-
return mags.reduce((sum, mag) => sum + mag, 0) / 3
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
const computed_camera_position = $derived.by(() =>
|
|
121
|
-
camera_position || ([10, 3, 8].map((coord) => coord * Math.max(1, bz_size)) as Vec3)
|
|
86
|
+
// BZ centroid as rotation center; mean k-vector magnitude for camera positioning
|
|
87
|
+
const rotation_target = $derived(polyhedron_centroid(bz_data?.vertices))
|
|
88
|
+
const bz_size = $derived(k_space_size(bz_data?.k_lattice))
|
|
89
|
+
const computed_camera_position = $derived(
|
|
90
|
+
camera_position || default_camera_position(bz_size),
|
|
122
91
|
)
|
|
123
92
|
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
className: `responsive-gizmo`,
|
|
127
|
-
...Object.fromEntries(
|
|
128
|
-
[...AXIS_COLORS, ...NEG_AXIS_COLORS].map(([axis, color, hover]) => [
|
|
129
|
-
axis,
|
|
130
|
-
{
|
|
131
|
-
color,
|
|
132
|
-
labelColor: `#111`,
|
|
133
|
-
opacity: axis.startsWith(`n`) ? 0.9 : 0.8,
|
|
134
|
-
hover: {
|
|
135
|
-
color: hover,
|
|
136
|
-
labelColor: `#222`,
|
|
137
|
-
opacity: axis.startsWith(`n`) ? 1 : 0.9,
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
]),
|
|
141
|
-
),
|
|
142
|
-
...(typeof gizmo === `object` ? gizmo : {}),
|
|
143
|
-
offset: { left: 5, bottom: 5 },
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
const is_ortho = $derived(camera_projection === `orthographic`)
|
|
147
|
-
const orbit_controls_props = $derived({
|
|
148
|
-
position: [0, 0, 0],
|
|
93
|
+
const orbit_controls_props = $derived(build_orbit_props({
|
|
94
|
+
camera_projection,
|
|
149
95
|
target: rotation_target,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
96
|
+
rotate_speed,
|
|
97
|
+
zoom_speed,
|
|
98
|
+
zoom_to_cursor,
|
|
99
|
+
pan_speed,
|
|
100
|
+
max_zoom,
|
|
101
|
+
min_zoom,
|
|
102
|
+
auto_rotate,
|
|
103
|
+
rotation_damping,
|
|
104
|
+
}))
|
|
105
|
+
|
|
106
|
+
// K-path styling. The invisible hover proxy is twice the visible thickness so the cursor
|
|
107
|
+
// snaps to the path even when it isn't directly over the thin visible segment.
|
|
108
|
+
const KPATH_THICKNESS = 0.12
|
|
109
|
+
const KPATH_HOVER_THICKNESS = KPATH_THICKNESS * 2
|
|
110
|
+
|
|
111
|
+
// Threshold for skipping k-path segments that bridge a path discontinuity (e.g. `U|K`).
|
|
112
|
+
// Band paths are densely sampled, so legit segments are tiny; a discontinuity jumps by
|
|
113
|
+
// a fraction of the zone. Skip segments far longer than the median sampling step.
|
|
114
|
+
const k_path_seg_cutoff = $derived.by(() => {
|
|
115
|
+
if (!k_path_points || k_path_points.length < 3) return Infinity
|
|
116
|
+
const lens = k_path_points
|
|
117
|
+
.slice(1)
|
|
118
|
+
.map((pt, idx) => Math.hypot(...math.subtract(pt as Vec3, k_path_points[idx] as Vec3)))
|
|
119
|
+
.sort((len_a, len_b) => len_a - len_b)
|
|
120
|
+
return lens[Math.floor(lens.length / 2)] * 10
|
|
165
121
|
})
|
|
166
122
|
|
|
167
|
-
const vector_colors = [`red`, `green`, `blue`]
|
|
168
|
-
const vector_labels = [`b₁`, `b₂`, `b₃`]
|
|
169
|
-
|
|
170
|
-
// Create mesh geometry from faces with fan triangulation
|
|
171
|
-
function create_mesh_geometry(
|
|
172
|
-
vertices: Vec3[],
|
|
173
|
-
faces: number[][],
|
|
174
|
-
): BufferGeometry | null {
|
|
175
|
-
if (faces.length === 0) return null
|
|
176
|
-
|
|
177
|
-
const positions: number[] = []
|
|
178
|
-
const normals: number[] = []
|
|
179
|
-
|
|
180
|
-
for (const face of faces) {
|
|
181
|
-
if (face.length < 3) continue
|
|
182
|
-
for (let face_idx = 1; face_idx < face.length - 1; face_idx++) {
|
|
183
|
-
const indices = [face[0], face[face_idx], face[face_idx + 1]]
|
|
184
|
-
if (indices.some((idx) => idx < 0 || idx >= vertices.length)) continue
|
|
185
|
-
const [v0, v1, v2] = indices.map((idx) => vertices[idx])
|
|
186
|
-
positions.push(...v0, ...v1, ...v2)
|
|
187
|
-
|
|
188
|
-
const e1: Vec3 = math.subtract(v1, v0)
|
|
189
|
-
const e2: Vec3 = math.subtract(v2, v0)
|
|
190
|
-
const normal_vec = math.cross_3d(e1, e2)
|
|
191
|
-
const len = Math.hypot(...normal_vec)
|
|
192
|
-
const norm = len > 1e-10 ? normal_vec.map((coord) => coord / len) : [0, 0, 0]
|
|
193
|
-
normals.push(...norm, ...norm, ...norm)
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
const geometry = new BufferGeometry()
|
|
198
|
-
geometry.setAttribute(
|
|
199
|
-
`position`,
|
|
200
|
-
new BufferAttribute(new Float32Array(positions), 3),
|
|
201
|
-
)
|
|
202
|
-
geometry.setAttribute(`normal`, new BufferAttribute(new Float32Array(normals), 3))
|
|
203
|
-
geometry.computeBoundingSphere()
|
|
204
|
-
return geometry
|
|
205
|
-
}
|
|
206
|
-
|
|
207
123
|
const bz_geometry = $derived(
|
|
208
|
-
bz_data ?
|
|
124
|
+
bz_data ? polyhedron_geometry(bz_data.vertices, bz_data.faces) : null,
|
|
209
125
|
)
|
|
210
126
|
const ibz_geometry = $derived(
|
|
211
127
|
show_ibz && ibz_data
|
|
212
|
-
?
|
|
128
|
+
? polyhedron_geometry(ibz_data.vertices, ibz_data.faces)
|
|
213
129
|
: null,
|
|
214
130
|
)
|
|
215
131
|
|
|
@@ -223,21 +139,8 @@
|
|
|
223
139
|
return () => prev?.dispose()
|
|
224
140
|
})
|
|
225
141
|
|
|
226
|
-
//
|
|
227
|
-
const k_lattice_inv = $derived
|
|
228
|
-
if (!bz_data?.k_lattice) return null
|
|
229
|
-
try {
|
|
230
|
-
return math.matrix_inverse_3x3(bz_data.k_lattice)
|
|
231
|
-
} catch {
|
|
232
|
-
return null
|
|
233
|
-
}
|
|
234
|
-
})
|
|
235
|
-
|
|
236
|
-
// Convert Cartesian k-coordinates to fractional (reciprocal lattice units)
|
|
237
|
-
function cartesian_to_fractional(cart: Vec3): Vec3 | null {
|
|
238
|
-
if (!k_lattice_inv) return null
|
|
239
|
-
return math.mat3x3_vec3_multiply(k_lattice_inv, cart)
|
|
240
|
-
}
|
|
142
|
+
// Inverse of k_lattice for Cartesian->fractional conversion
|
|
143
|
+
const k_lattice_inv = $derived(k_lattice_inverse(bz_data?.k_lattice))
|
|
241
144
|
|
|
242
145
|
// Throttle state for pointer move events
|
|
243
146
|
let last_hover_time = 0
|
|
@@ -270,7 +173,7 @@
|
|
|
270
173
|
if (!bz_data) return null
|
|
271
174
|
|
|
272
175
|
const position_cartesian: Vec3 = [event.point.x, event.point.y, event.point.z]
|
|
273
|
-
const position_fractional = cartesian_to_fractional(position_cartesian)
|
|
176
|
+
const position_fractional = cartesian_to_fractional(k_lattice_inv, position_cartesian)
|
|
274
177
|
|
|
275
178
|
const { clientX, clientY } = event.nativeEvent
|
|
276
179
|
const ibz_vol = ibz_data?.volume ?? null
|
|
@@ -311,26 +214,26 @@
|
|
|
311
214
|
if (is_ibz) ibz_hovered = false
|
|
312
215
|
if (is_ibz || !ibz_hovered) hover_data = null
|
|
313
216
|
}
|
|
217
|
+
|
|
218
|
+
// K-path hover: report the nearer endpoint's q-point index of the hovered segment
|
|
219
|
+
function handle_kpath_hover(event: ThreltePointerEvent, seg_idx: number): void {
|
|
220
|
+
const { point } = event
|
|
221
|
+
const [from, to] = [k_path_points[seg_idx], k_path_points[seg_idx + 1]]
|
|
222
|
+
if (!from || !to) return
|
|
223
|
+
const dist_sq = (pt: Vec3) =>
|
|
224
|
+
(point.x - pt[0]) ** 2 + (point.y - pt[1]) ** 2 + (point.z - pt[2]) ** 2
|
|
225
|
+
on_kpath_hover?.(dist_sq(from) <= dist_sq(to) ? seg_idx : seg_idx + 1)
|
|
226
|
+
}
|
|
314
227
|
</script>
|
|
315
228
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
{
|
|
323
|
-
|
|
324
|
-
makeDefault
|
|
325
|
-
position={computed_camera_position}
|
|
326
|
-
zoom={initial_zoom}
|
|
327
|
-
near={-100}
|
|
328
|
-
>
|
|
329
|
-
<extras.OrbitControls {...orbit_controls_props}>
|
|
330
|
-
{#if gizmo}<extras.Gizmo {...gizmo_props} />{/if}
|
|
331
|
-
</extras.OrbitControls>
|
|
332
|
-
</T.OrthographicCamera>
|
|
333
|
-
{/if}
|
|
229
|
+
<SceneCamera
|
|
230
|
+
{camera_projection}
|
|
231
|
+
position={computed_camera_position}
|
|
232
|
+
{fov}
|
|
233
|
+
zoom={initial_zoom}
|
|
234
|
+
orbit_props={orbit_controls_props}
|
|
235
|
+
{gizmo}
|
|
236
|
+
/>
|
|
334
237
|
|
|
335
238
|
<T.DirectionalLight position={[3, 10, 10]} intensity={directional_light} />
|
|
336
239
|
<T.AmbientLight intensity={ambient_light} />
|
|
@@ -341,7 +244,7 @@
|
|
|
341
244
|
{#if bz_geometry}
|
|
342
245
|
<T.Mesh
|
|
343
246
|
geometry={bz_geometry}
|
|
344
|
-
onpointermove={(
|
|
247
|
+
onpointermove={(event: ThreltePointerEvent) => handle_hover(event, false)}
|
|
345
248
|
onpointerleave={() => handle_leave(false)}
|
|
346
249
|
>
|
|
347
250
|
<T.MeshStandardMaterial
|
|
@@ -364,7 +267,7 @@
|
|
|
364
267
|
{#if show_ibz && ibz_geometry}
|
|
365
268
|
<T.Mesh
|
|
366
269
|
geometry={ibz_geometry}
|
|
367
|
-
onpointermove={(
|
|
270
|
+
onpointermove={(event: ThreltePointerEvent) => handle_hover(event, true)}
|
|
368
271
|
onpointerleave={() => handle_leave(true)}
|
|
369
272
|
>
|
|
370
273
|
<T.MeshStandardMaterial
|
|
@@ -387,25 +290,7 @@
|
|
|
387
290
|
|
|
388
291
|
<!-- Reciprocal lattice vectors -->
|
|
389
292
|
{#if show_vectors && bz_data.k_lattice}
|
|
390
|
-
{
|
|
391
|
-
{@const scaled_vec = vec.map((coord) => coord * vector_scale) as Vec3}
|
|
392
|
-
{@const label_position = scaled_vec.map((coord) => coord * 1.15) as Vec3}
|
|
393
|
-
<Arrow
|
|
394
|
-
position={[0, 0, 0]}
|
|
395
|
-
vector={scaled_vec}
|
|
396
|
-
color={vector_colors[idx]}
|
|
397
|
-
scale={1}
|
|
398
|
-
/>
|
|
399
|
-
<!-- Vector label beyond tip -->
|
|
400
|
-
<extras.HTML center position={label_position}>
|
|
401
|
-
<span
|
|
402
|
-
style:color={vector_colors[idx]}
|
|
403
|
-
style:font-size="1.2em"
|
|
404
|
-
>
|
|
405
|
-
{vector_labels[idx]}
|
|
406
|
-
</span>
|
|
407
|
-
</extras.HTML>
|
|
408
|
-
{/each}
|
|
293
|
+
<ReciprocalVectors k_lattice={bz_data.k_lattice} {vector_scale} size={bz_size} />
|
|
409
294
|
{/if}
|
|
410
295
|
|
|
411
296
|
<!-- K-path visualization -->
|
|
@@ -416,14 +301,28 @@
|
|
|
416
301
|
(`${from_point}-${k_path_points[idx + 1]}#${idx}`)
|
|
417
302
|
}
|
|
418
303
|
{@const to_point = k_path_points[idx + 1]}
|
|
304
|
+
{@const seg_len = Math.hypot(
|
|
305
|
+
...math.subtract(to_point as Vec3, from_point as Vec3),
|
|
306
|
+
)}
|
|
419
307
|
{@const is_hovered = hovered_qpoint_index !== null &&
|
|
420
308
|
(idx === hovered_qpoint_index || idx === hovered_qpoint_index - 1)}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
309
|
+
{#if seg_len <= k_path_seg_cutoff}
|
|
310
|
+
<Cylinder
|
|
311
|
+
from={from_point as Vec3}
|
|
312
|
+
to={to_point as Vec3}
|
|
313
|
+
thickness={KPATH_THICKNESS}
|
|
314
|
+
color={is_hovered ? `#ff6b35` : `#ffcc00`}
|
|
315
|
+
/>
|
|
316
|
+
<!-- Invisible wider proxy: lets the cursor snap to the path within ~2× its radius -->
|
|
317
|
+
<Cylinder
|
|
318
|
+
from={from_point as Vec3}
|
|
319
|
+
to={to_point as Vec3}
|
|
320
|
+
thickness={KPATH_HOVER_THICKNESS}
|
|
321
|
+
opacity={0}
|
|
322
|
+
onpointermove={(event: ThreltePointerEvent) => handle_kpath_hover(event, idx)}
|
|
323
|
+
onpointerleave={() => on_kpath_hover?.(null)}
|
|
324
|
+
/>
|
|
325
|
+
{/if}
|
|
427
326
|
{/each}
|
|
428
327
|
{/if}
|
|
429
328
|
|
|
@@ -467,10 +366,3 @@
|
|
|
467
366
|
{/if}
|
|
468
367
|
{/if}
|
|
469
368
|
</T.Group>
|
|
470
|
-
|
|
471
|
-
<style>
|
|
472
|
-
:global(.brillouin-zone .responsive-gizmo) {
|
|
473
|
-
width: clamp(70px, 18cqmin, 100px) !important;
|
|
474
|
-
height: clamp(70px, 18cqmin, 100px) !important;
|
|
475
|
-
}
|
|
476
|
-
</style>
|