matterviz 0.3.7 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Icon.svelte +7 -4
- package/dist/MillerIndexInput.svelte +1 -1
- package/dist/api/optimade.js +32 -26
- package/dist/app.css +0 -3
- package/dist/brillouin/BrillouinZone.svelte +76 -148
- package/dist/brillouin/BrillouinZone.svelte.d.ts +6 -14
- package/dist/brillouin/BrillouinZoneExportPane.svelte +43 -96
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +9 -32
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +2 -3
- package/dist/brillouin/BrillouinZoneScene.svelte +97 -205
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +4 -23
- package/dist/brillouin/BrillouinZoneTooltip.svelte +16 -25
- package/dist/brillouin/ReciprocalVectors.svelte +39 -0
- package/dist/brillouin/ReciprocalVectors.svelte.d.ts +9 -0
- package/dist/brillouin/compute.d.ts +2 -0
- package/dist/brillouin/compute.js +89 -90
- package/dist/brillouin/geometry.d.ts +8 -0
- package/dist/brillouin/geometry.js +57 -0
- package/dist/brillouin/index.d.ts +2 -0
- package/dist/brillouin/index.js +2 -0
- package/dist/brillouin/types.d.ts +2 -2
- package/dist/chempot-diagram/ChemPotDiagram.svelte +14 -13
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +109 -203
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +4 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +180 -470
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +7 -1
- package/dist/chempot-diagram/async-compute.svelte.js +3 -1
- package/dist/chempot-diagram/chempot-worker.js +2 -1
- package/dist/chempot-diagram/color.d.ts +3 -6
- package/dist/chempot-diagram/color.js +5 -5
- package/dist/chempot-diagram/compute.d.ts +4 -4
- package/dist/chempot-diagram/compute.js +20 -20
- package/dist/chempot-diagram/controls-state.svelte.d.ts +10 -0
- package/dist/chempot-diagram/controls-state.svelte.js +42 -0
- package/dist/chempot-diagram/export.d.ts +47 -0
- package/dist/chempot-diagram/export.js +133 -0
- package/dist/chempot-diagram/index.d.ts +1 -0
- package/dist/chempot-diagram/index.js +1 -0
- package/dist/chempot-diagram/pointer.d.ts +0 -10
- package/dist/chempot-diagram/pointer.js +4 -4
- package/dist/chempot-diagram/types.d.ts +3 -3
- package/dist/colors/index.js +8 -7
- package/dist/composition/FormulaFilter.svelte +18 -11
- package/dist/composition/PieChart.svelte +11 -10
- package/dist/composition/chem-sys.d.ts +8 -0
- package/dist/composition/chem-sys.js +86 -0
- package/dist/composition/format.js +7 -4
- package/dist/composition/index.d.ts +1 -0
- package/dist/composition/index.js +1 -0
- package/dist/composition/parse.d.ts +0 -1
- package/dist/composition/parse.js +41 -31
- package/dist/controls.d.ts +1 -0
- package/dist/controls.js +0 -1
- package/dist/convex-hull/ConvexHull.svelte +8 -10
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -4
- package/dist/convex-hull/ConvexHull2D.svelte +106 -185
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +179 -683
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +183 -687
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +268 -0
- package/dist/convex-hull/ConvexHullChrome.svelte.d.ts +30 -0
- package/dist/convex-hull/ConvexHullControls.svelte +88 -7
- package/dist/convex-hull/ConvexHullControls.svelte.d.ts +7 -6
- package/dist/convex-hull/ConvexHullInfoPane.svelte +18 -5
- package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +6 -5
- package/dist/convex-hull/ConvexHullStats.svelte +36 -175
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +3 -1
- package/dist/convex-hull/ConvexHullTooltip.svelte +11 -2
- package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +2 -1
- package/dist/convex-hull/GasPressureControls.svelte +4 -4
- package/dist/convex-hull/TemperatureSlider.svelte +2 -2
- package/dist/convex-hull/barycentric-coords.d.ts +2 -4
- package/dist/convex-hull/barycentric-coords.js +6 -33
- package/dist/convex-hull/canvas-interactions.svelte.d.ts +79 -0
- package/dist/convex-hull/canvas-interactions.svelte.js +278 -0
- package/dist/convex-hull/demo-temperature.d.ts +1 -1
- package/dist/convex-hull/demo-temperature.js +20 -22
- package/dist/convex-hull/gas-thermodynamics.d.ts +2 -2
- package/dist/convex-hull/gas-thermodynamics.js +22 -30
- package/dist/convex-hull/helpers.d.ts +42 -7
- package/dist/convex-hull/helpers.js +171 -78
- package/dist/convex-hull/hull-state.svelte.d.ts +44 -0
- package/dist/convex-hull/hull-state.svelte.js +124 -0
- package/dist/convex-hull/index.d.ts +10 -8
- package/dist/convex-hull/index.js +7 -2
- package/dist/convex-hull/thermodynamics.js +136 -960
- package/dist/convex-hull/types.d.ts +13 -5
- package/dist/convex-hull/types.js +12 -0
- package/dist/coordination/CoordinationBarPlot.svelte +27 -34
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
- package/dist/element/BohrAtom.svelte +2 -1
- package/dist/element/index.d.ts +4 -0
- package/dist/element/index.js +18 -0
- package/dist/feedback/DragOverlay.svelte +3 -1
- package/dist/feedback/DragOverlay.svelte.d.ts +1 -0
- package/dist/feedback/StatusMessage.svelte +13 -3
- package/dist/fermi-surface/FermiSlice.svelte +13 -5
- package/dist/fermi-surface/FermiSurface.svelte +78 -151
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +5 -14
- package/dist/fermi-surface/FermiSurfaceControls.svelte +1 -1
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +72 -221
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +3 -23
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +8 -34
- package/dist/fermi-surface/compute.js +67 -66
- package/dist/fermi-surface/export.js +6 -16
- package/dist/fermi-surface/index.d.ts +0 -1
- package/dist/fermi-surface/index.js +0 -1
- package/dist/fermi-surface/parse.d.ts +1 -1
- package/dist/fermi-surface/parse.js +71 -79
- package/dist/fermi-surface/types.d.ts +3 -2
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +69 -52
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +4 -3
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +3 -2
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +5 -5
- package/dist/heatmap-matrix/index.d.ts +3 -2
- package/dist/heatmap-matrix/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/io/ExportPane.svelte +166 -0
- package/dist/io/ExportPane.svelte.d.ts +17 -0
- package/dist/io/decompress.js +5 -4
- package/dist/io/export.d.ts +9 -5
- package/dist/io/export.js +77 -51
- package/dist/io/fetch.d.ts +2 -1
- package/dist/io/fetch.js +5 -1
- package/dist/io/file-drop.d.ts +8 -1
- package/dist/io/file-drop.js +48 -36
- package/dist/io/index.d.ts +2 -0
- package/dist/io/index.js +10 -0
- package/dist/io/types.d.ts +13 -0
- package/dist/io/url-drop.js +64 -33
- package/dist/isosurface/parse.js +52 -51
- package/dist/isosurface/slice.js +5 -4
- package/dist/isosurface/types.js +1 -1
- package/dist/keyboard.d.ts +3 -0
- package/dist/keyboard.js +23 -0
- package/dist/labels.d.ts +1 -1
- package/dist/labels.js +9 -8
- package/dist/layout/FullscreenButton.svelte +33 -0
- package/dist/layout/FullscreenButton.svelte.d.ts +10 -0
- package/dist/layout/FullscreenToggle.svelte +8 -14
- package/dist/layout/PropertyFilter.svelte +3 -2
- package/dist/layout/SettingsSection.svelte +1 -1
- package/dist/layout/ViewerChrome.svelte +116 -0
- package/dist/layout/ViewerChrome.svelte.d.ts +17 -0
- package/dist/layout/fullscreen.d.ts +4 -0
- package/dist/layout/fullscreen.svelte.d.ts +8 -0
- package/dist/layout/fullscreen.svelte.js +37 -0
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.js +3 -0
- package/dist/layout/json-tree/JsonNode.svelte +1 -1
- package/dist/layout/json-tree/JsonTree.svelte +2 -2
- package/dist/layout/json-tree/utils.js +5 -4
- package/dist/marching-cubes.js +8 -13
- package/dist/math.d.ts +12 -4
- package/dist/math.js +42 -30
- package/dist/overlays/DraggablePane.svelte +4 -4
- package/dist/overlays/index.d.ts +4 -0
- package/dist/periodic-table/PeriodicTable.svelte +27 -15
- package/dist/periodic-table/PropertySelect.svelte +1 -0
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +9 -3
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramControls.svelte +3 -2
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +4 -3
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +4 -2
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +2 -3
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +47 -132
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +3 -4
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +1 -1
- package/dist/phase-diagram/build-diagram.js +2 -2
- package/dist/phase-diagram/colors.js +1 -1
- package/dist/phase-diagram/parse.d.ts +2 -1
- package/dist/phase-diagram/parse.js +6 -5
- package/dist/phase-diagram/types.d.ts +1 -1
- package/dist/phase-diagram/utils.d.ts +3 -3
- package/dist/phase-diagram/utils.js +8 -12
- package/dist/plot/{BarPlot.svelte → bar/BarPlot.svelte} +246 -841
- package/dist/plot/{BarPlot.svelte.d.ts → bar/BarPlot.svelte.d.ts} +8 -16
- package/dist/plot/{BarPlotControls.svelte → bar/BarPlotControls.svelte} +6 -5
- package/dist/plot/{BarPlotControls.svelte.d.ts → bar/BarPlotControls.svelte.d.ts} +3 -3
- package/dist/plot/{SpacegroupBarPlot.svelte → bar/SpacegroupBarPlot.svelte} +8 -7
- package/dist/plot/{SpacegroupBarPlot.svelte.d.ts → bar/SpacegroupBarPlot.svelte.d.ts} +1 -1
- package/dist/plot/bar/data.d.ts +40 -0
- package/dist/plot/bar/data.js +154 -0
- package/dist/plot/bar/geometry.d.ts +39 -0
- package/dist/plot/bar/geometry.js +60 -0
- package/dist/plot/bar/index.d.ts +3 -0
- package/dist/plot/bar/index.js +3 -0
- package/dist/plot/box/BoxPlot.svelte +1292 -0
- package/dist/plot/box/BoxPlot.svelte.d.ts +95 -0
- package/dist/plot/box/BoxPlotControls.svelte +109 -0
- package/dist/plot/box/BoxPlotControls.svelte.d.ts +19 -0
- package/dist/plot/box/Violin.svelte +14 -0
- package/dist/plot/box/Violin.svelte.d.ts +70 -0
- package/dist/plot/box/box-plot.d.ts +56 -0
- package/dist/plot/box/box-plot.js +129 -0
- package/dist/plot/box/index.d.ts +5 -0
- package/dist/plot/box/index.js +5 -0
- package/dist/plot/box/kde.d.ts +17 -0
- package/dist/plot/box/kde.js +160 -0
- package/dist/plot/box/quantile.d.ts +3 -0
- package/dist/plot/box/quantile.js +53 -0
- package/dist/plot/{auto-place.d.ts → core/auto-place.d.ts} +1 -1
- package/dist/plot/{auto-place.js → core/auto-place.js} +6 -3
- package/dist/plot/core/axis-utils.d.ts +46 -0
- package/dist/plot/core/axis-utils.js +110 -0
- package/dist/plot/{AxisLabel.svelte → core/components/AxisLabel.svelte} +2 -2
- package/dist/plot/{AxisLabel.svelte.d.ts → core/components/AxisLabel.svelte.d.ts} +1 -1
- package/dist/plot/{ColorBar.svelte → core/components/ColorBar.svelte} +41 -38
- package/dist/plot/{ColorBar.svelte.d.ts → core/components/ColorBar.svelte.d.ts} +7 -6
- package/dist/plot/{ColorScaleSelect.svelte → core/components/ColorScaleSelect.svelte} +4 -3
- package/dist/plot/{ColorScaleSelect.svelte.d.ts → core/components/ColorScaleSelect.svelte.d.ts} +2 -2
- package/dist/plot/core/components/ControlPane.svelte +46 -0
- package/dist/plot/core/components/ControlPane.svelte.d.ts +13 -0
- package/dist/plot/{FillArea.svelte → core/components/FillArea.svelte} +17 -6
- package/dist/plot/{FillArea.svelte.d.ts → core/components/FillArea.svelte.d.ts} +1 -1
- package/dist/plot/{InteractiveAxisLabel.svelte → core/components/InteractiveAxisLabel.svelte} +3 -3
- package/dist/plot/{InteractiveAxisLabel.svelte.d.ts → core/components/InteractiveAxisLabel.svelte.d.ts} +2 -2
- package/dist/plot/{Line.svelte → core/components/Line.svelte} +33 -15
- package/dist/plot/{Line.svelte.d.ts → core/components/Line.svelte.d.ts} +3 -2
- package/dist/plot/{PlotAxis.svelte → core/components/PlotAxis.svelte} +9 -6
- package/dist/plot/{PlotAxis.svelte.d.ts → core/components/PlotAxis.svelte.d.ts} +5 -3
- package/dist/plot/{PlotControls.svelte → core/components/PlotControls.svelte} +17 -29
- package/dist/plot/core/components/PlotControls.svelte.d.ts +4 -0
- package/dist/plot/{PlotLegend.svelte → core/components/PlotLegend.svelte} +21 -10
- package/dist/plot/{PlotLegend.svelte.d.ts → core/components/PlotLegend.svelte.d.ts} +3 -2
- package/dist/plot/{PlotTooltip.svelte → core/components/PlotTooltip.svelte} +17 -1
- package/dist/plot/{PlotTooltip.svelte.d.ts → core/components/PlotTooltip.svelte.d.ts} +8 -0
- package/dist/plot/{PortalSelect.svelte → core/components/PortalSelect.svelte} +11 -7
- package/dist/plot/{ReferenceLine.svelte → core/components/ReferenceLine.svelte} +3 -3
- package/dist/plot/{ReferenceLine.svelte.d.ts → core/components/ReferenceLine.svelte.d.ts} +1 -1
- package/dist/plot/{ReferenceLine3D.svelte → core/components/ReferenceLine3D.svelte} +5 -5
- package/dist/plot/{ReferenceLine3D.svelte.d.ts → core/components/ReferenceLine3D.svelte.d.ts} +5 -5
- package/dist/plot/{ReferencePlane.svelte → core/components/ReferencePlane.svelte} +8 -8
- package/dist/plot/{ReferencePlane.svelte.d.ts → core/components/ReferencePlane.svelte.d.ts} +5 -5
- package/dist/plot/{ZeroLines.svelte → core/components/ZeroLines.svelte} +3 -3
- package/dist/plot/{ZeroLines.svelte.d.ts → core/components/ZeroLines.svelte.d.ts} +3 -3
- package/dist/plot/{ZoomRect.svelte → core/components/ZoomRect.svelte} +1 -1
- package/dist/plot/{ZoomRect.svelte.d.ts → core/components/ZoomRect.svelte.d.ts} +1 -1
- package/dist/plot/core/components/index.d.ts +17 -0
- package/dist/plot/core/components/index.js +17 -0
- package/dist/plot/{data-cleaning.d.ts → core/data-cleaning.d.ts} +71 -1
- package/dist/plot/{data-cleaning.js → core/data-cleaning.js} +21 -23
- package/dist/plot/{data-transform.d.ts → core/data-transform.d.ts} +2 -2
- package/dist/plot/{data-transform.js → core/data-transform.js} +3 -3
- package/dist/plot/core/fill-utils.d.ts +34 -0
- package/dist/plot/core/fill-utils.js +391 -0
- package/dist/plot/core/index.d.ts +10 -0
- package/dist/plot/core/index.js +11 -0
- package/dist/plot/core/interactions.d.ts +39 -0
- package/dist/plot/core/interactions.js +209 -0
- package/dist/plot/{layout.d.ts → core/layout.d.ts} +1 -0
- package/dist/plot/{layout.js → core/layout.js} +16 -8
- package/dist/plot/core/pan-zoom.svelte.d.ts +35 -0
- package/dist/plot/core/pan-zoom.svelte.js +221 -0
- package/dist/plot/core/placed-tween.svelte.d.ts +21 -0
- package/dist/plot/core/placed-tween.svelte.js +68 -0
- package/dist/plot/{reference-line.d.ts → core/reference-line.d.ts} +11 -11
- package/dist/plot/{reference-line.js → core/reference-line.js} +29 -42
- package/dist/plot/core/scales.d.ts +40 -0
- package/dist/plot/{scales.js → core/scales.js} +94 -93
- package/dist/plot/core/svg.d.ts +3 -0
- package/dist/plot/core/svg.js +41 -0
- package/dist/plot/{types.d.ts → core/types.d.ts} +36 -85
- package/dist/plot/{types.js → core/types.js} +1 -1
- package/dist/plot/{utils → core/utils}/label-placement.d.ts +3 -3
- package/dist/plot/{utils → core/utils}/label-placement.js +3 -3
- package/dist/plot/core/utils/series-visibility.d.ts +26 -0
- package/dist/plot/{utils → core/utils}/series-visibility.js +29 -2
- package/dist/plot/core/utils.d.ts +12 -0
- package/dist/plot/core/utils.js +27 -0
- package/dist/plot/{Histogram.svelte → histogram/Histogram.svelte} +174 -551
- package/dist/plot/{Histogram.svelte.d.ts → histogram/Histogram.svelte.d.ts} +2 -2
- package/dist/plot/{HistogramControls.svelte → histogram/HistogramControls.svelte} +6 -6
- package/dist/plot/{HistogramControls.svelte.d.ts → histogram/HistogramControls.svelte.d.ts} +4 -4
- package/dist/plot/histogram/index.d.ts +2 -0
- package/dist/plot/histogram/index.js +2 -0
- package/dist/plot/index.d.ts +8 -41
- package/dist/plot/index.js +10 -39
- package/dist/plot/sankey/Sankey.svelte +697 -0
- package/dist/plot/sankey/Sankey.svelte.d.ts +74 -0
- package/dist/plot/sankey/SankeyControls.svelte +98 -0
- package/dist/plot/sankey/SankeyControls.svelte.d.ts +19 -0
- package/dist/plot/sankey/index.d.ts +4 -0
- package/dist/plot/sankey/index.js +3 -0
- package/dist/plot/sankey/sankey-types.d.ts +42 -0
- package/dist/plot/sankey/sankey-types.js +4 -0
- package/dist/plot/sankey/sankey.d.ts +52 -0
- package/dist/plot/sankey/sankey.js +189 -0
- package/dist/plot/{BinnedScatterPlot.svelte → scatter/BinnedScatterPlot.svelte} +64 -64
- package/dist/plot/{BinnedScatterPlot.svelte.d.ts → scatter/BinnedScatterPlot.svelte.d.ts} +6 -6
- package/dist/plot/{ElementScatter.svelte → scatter/ElementScatter.svelte} +6 -6
- package/dist/plot/{ElementScatter.svelte.d.ts → scatter/ElementScatter.svelte.d.ts} +2 -2
- package/dist/plot/{ScatterPlot.svelte → scatter/ScatterPlot.svelte} +297 -1008
- package/dist/plot/{ScatterPlot.svelte.d.ts → scatter/ScatterPlot.svelte.d.ts} +10 -18
- package/dist/plot/{ScatterPlotControls.svelte → scatter/ScatterPlotControls.svelte} +6 -5
- package/dist/plot/{ScatterPlotControls.svelte.d.ts → scatter/ScatterPlotControls.svelte.d.ts} +2 -2
- package/dist/plot/{ScatterPoint.svelte → scatter/ScatterPoint.svelte} +7 -7
- package/dist/plot/{ScatterPoint.svelte.d.ts → scatter/ScatterPoint.svelte.d.ts} +3 -3
- package/dist/plot/{adaptive-density.d.ts → scatter/adaptive-density.d.ts} +14 -4
- package/dist/plot/{adaptive-density.js → scatter/adaptive-density.js} +46 -20
- package/dist/plot/{binned-scatter-types.d.ts → scatter/binned-scatter-types.d.ts} +5 -12
- package/dist/plot/scatter/index.d.ts +7 -0
- package/dist/plot/scatter/index.js +5 -0
- package/dist/plot/scatter/scatter-data.d.ts +19 -0
- package/dist/plot/scatter/scatter-data.js +212 -0
- package/dist/plot/{ScatterPlot3D.svelte → scatter-3d/ScatterPlot3D.svelte} +25 -34
- package/dist/plot/{ScatterPlot3D.svelte.d.ts → scatter-3d/ScatterPlot3D.svelte.d.ts} +9 -17
- package/dist/plot/{ScatterPlot3DControls.svelte → scatter-3d/ScatterPlot3DControls.svelte} +14 -14
- package/dist/plot/{ScatterPlot3DControls.svelte.d.ts → scatter-3d/ScatterPlot3DControls.svelte.d.ts} +6 -6
- package/dist/plot/{ScatterPlot3DScene.svelte → scatter-3d/ScatterPlot3DScene.svelte} +129 -128
- package/dist/plot/{ScatterPlot3DScene.svelte.d.ts → scatter-3d/ScatterPlot3DScene.svelte.d.ts} +6 -15
- package/dist/plot/{Surface3D.svelte → scatter-3d/Surface3D.svelte} +7 -6
- package/dist/plot/{Surface3D.svelte.d.ts → scatter-3d/Surface3D.svelte.d.ts} +5 -4
- package/dist/plot/scatter-3d/index.d.ts +4 -0
- package/dist/plot/scatter-3d/index.js +4 -0
- package/dist/plot/sunburst/Sunburst.svelte +1041 -0
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +97 -0
- package/dist/plot/sunburst/SunburstControls.svelte +200 -0
- package/dist/plot/sunburst/SunburstControls.svelte.d.ts +26 -0
- package/dist/plot/sunburst/index.d.ts +4 -0
- package/dist/plot/sunburst/index.js +4 -0
- package/dist/plot/sunburst/render.d.ts +34 -0
- package/dist/plot/sunburst/render.js +122 -0
- package/dist/plot/sunburst/sunburst.d.ts +62 -0
- package/dist/plot/sunburst/sunburst.js +269 -0
- package/dist/rdf/RdfPlot.svelte +2 -1
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/calc-rdf.js +11 -24
- package/dist/sanitize.js +14 -3
- package/dist/scene/SceneCamera.svelte +62 -0
- package/dist/scene/SceneCamera.svelte.d.ts +19 -0
- package/dist/scene/bind-renderer.svelte.d.ts +2 -0
- package/dist/scene/bind-renderer.svelte.js +14 -0
- package/dist/scene/index.d.ts +4 -0
- package/dist/scene/index.js +5 -0
- package/dist/scene/props.js +52 -0
- package/dist/scene/types.d.ts +26 -0
- package/dist/scene/types.js +1 -0
- package/dist/settings.d.ts +79 -3
- package/dist/settings.js +321 -1
- package/dist/spectral/Bands.svelte +47 -36
- package/dist/spectral/Bands.svelte.d.ts +6 -6
- package/dist/spectral/BandsAndDos.svelte +23 -25
- package/dist/spectral/BrillouinBandsDos.svelte +42 -30
- package/dist/spectral/Dos.svelte +15 -23
- package/dist/spectral/Dos.svelte.d.ts +4 -3
- package/dist/spectral/helpers.d.ts +8 -6
- package/dist/spectral/helpers.js +137 -65
- package/dist/state.svelte.d.ts +0 -7
- package/dist/state.svelte.js +0 -6
- package/dist/structure/Arrow.svelte +2 -4
- package/dist/structure/AtomLegend.svelte +8 -9
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/CanvasTooltip.svelte +1 -0
- package/dist/structure/CellSelect.svelte +12 -5
- package/dist/structure/CellSelect.svelte.d.ts +2 -1
- package/dist/structure/Cylinder.svelte +12 -8
- package/dist/structure/Cylinder.svelte.d.ts +4 -1
- package/dist/structure/Lattice.svelte +2 -2
- package/dist/structure/Structure.svelte +365 -423
- package/dist/structure/Structure.svelte.d.ts +5 -15
- package/dist/structure/StructureControls.svelte +217 -2
- package/dist/structure/StructureControls.svelte.d.ts +5 -3
- package/dist/structure/StructureExportPane.svelte +54 -156
- package/dist/structure/StructureExportPane.svelte.d.ts +4 -5
- package/dist/structure/StructureInfoPane.svelte +10 -9
- package/dist/structure/StructureInfoPane.svelte.d.ts +5 -5
- package/dist/structure/StructureScene.svelte +376 -208
- package/dist/structure/StructureScene.svelte.d.ts +22 -20
- package/dist/structure/{label-placement.d.ts → atom-label-placement.d.ts} +3 -3
- package/dist/structure/{label-placement.js → atom-label-placement.js} +15 -5
- package/dist/structure/atom-properties.d.ts +1 -1
- package/dist/structure/atom-properties.js +17 -22
- package/dist/structure/bond-order-perception.js +3 -5
- package/dist/structure/bonding.d.ts +4 -0
- package/dist/structure/bonding.js +134 -63
- package/dist/structure/export.d.ts +24 -4
- package/dist/structure/export.js +89 -143
- package/dist/structure/index.d.ts +4 -4
- package/dist/structure/index.js +3 -3
- package/dist/structure/measure.d.ts +3 -2
- package/dist/structure/measure.js +6 -5
- package/dist/structure/parse.d.ts +3 -2
- package/dist/structure/parse.js +419 -438
- package/dist/structure/partial-occupancy.d.ts +0 -1
- package/dist/structure/partial-occupancy.js +1 -1
- package/dist/structure/pbc.d.ts +1 -1
- package/dist/structure/pbc.js +190 -13
- package/dist/structure/polyhedra.d.ts +41 -0
- package/dist/structure/polyhedra.js +602 -0
- package/dist/structure/site.d.ts +4 -0
- package/dist/structure/site.js +1 -0
- package/dist/structure/supercell.js +3 -2
- package/dist/structure/validation.js +5 -6
- package/dist/symmetry/SymmetryElementControls.svelte +69 -0
- package/dist/symmetry/SymmetryElementControls.svelte.d.ts +9 -0
- package/dist/symmetry/SymmetryElements.svelte +354 -0
- package/dist/symmetry/SymmetryElements.svelte.d.ts +24 -0
- package/dist/symmetry/SymmetryStats.svelte +113 -8
- package/dist/symmetry/WyckoffTable.svelte +68 -7
- package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -0
- package/dist/symmetry/cell-transform.js +7 -14
- package/dist/symmetry/index.d.ts +14 -4
- package/dist/symmetry/index.js +291 -72
- package/dist/symmetry/spacegroups.d.ts +12 -1
- package/dist/symmetry/spacegroups.js +63 -14
- package/dist/symmetry/symmetry-elements.d.ts +33 -0
- package/dist/symmetry/symmetry-elements.js +521 -0
- package/dist/symmetry/wyckoff-db.d.ts +9 -0
- package/dist/symmetry/wyckoff-db.js +87 -0
- package/dist/table/HeatmapTable.svelte +66 -25
- package/dist/table/HeatmapTable.svelte.d.ts +1 -1
- package/dist/table/index.d.ts +1 -3
- package/dist/table/index.js +1 -1
- package/dist/theme/index.js +8 -8
- package/dist/tooltip/KCoords.svelte +45 -0
- package/dist/tooltip/KCoords.svelte.d.ts +8 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/trajectory/Trajectory.svelte +123 -100
- package/dist/trajectory/Trajectory.svelte.d.ts +11 -22
- package/dist/trajectory/TrajectoryExportPane.svelte +17 -25
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +4 -5
- package/dist/trajectory/TrajectoryInfoPane.svelte +5 -3
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -2
- package/dist/trajectory/constants.js +6 -2
- package/dist/trajectory/extract.js +17 -37
- package/dist/trajectory/format-detect.d.ts +1 -1
- package/dist/trajectory/format-detect.js +27 -19
- package/dist/trajectory/frame-reader.d.ts +0 -1
- package/dist/trajectory/frame-reader.js +63 -162
- package/dist/trajectory/helpers.d.ts +10 -2
- package/dist/trajectory/helpers.js +56 -36
- package/dist/trajectory/index.js +1 -1
- package/dist/trajectory/parse/ase.d.ts +9 -1
- package/dist/trajectory/parse/ase.js +47 -32
- package/dist/trajectory/parse/diagnostics.d.ts +3 -0
- package/dist/trajectory/parse/diagnostics.js +14 -0
- package/dist/trajectory/parse/hdf5.js +1 -1
- package/dist/trajectory/parse/index.d.ts +1 -1
- package/dist/trajectory/parse/index.js +65 -105
- package/dist/trajectory/parse/lammps.d.ts +0 -2
- package/dist/trajectory/parse/lammps.js +8 -6
- package/dist/trajectory/parse/pymatgen.d.ts +2 -0
- package/dist/trajectory/parse/pymatgen.js +74 -0
- package/dist/trajectory/parse/vasp.js +38 -18
- package/dist/trajectory/parse/xyz.d.ts +13 -1
- package/dist/trajectory/parse/xyz.js +102 -94
- package/dist/trajectory/plotting.d.ts +1 -2
- package/dist/trajectory/plotting.js +16 -113
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +7 -5
- package/dist/xrd/XrdPlot.svelte +16 -30
- package/dist/xrd/broadening.d.ts +2 -1
- package/dist/xrd/calc-xrd.js +18 -20
- package/dist/xrd/index.d.ts +2 -2
- package/dist/xrd/parse.js +2 -2
- package/package.json +43 -26
- package/dist/element/data.json +0 -11864
- package/dist/fermi-surface/marching-cubes.d.ts +0 -2
- package/dist/fermi-surface/marching-cubes.js +0 -2
- package/dist/plot/PlotControls.svelte.d.ts +0 -4
- package/dist/plot/axis-utils.d.ts +0 -19
- package/dist/plot/axis-utils.js +0 -78
- package/dist/plot/defaults.d.ts +0 -19
- package/dist/plot/defaults.js +0 -9
- package/dist/plot/fill-utils.d.ts +0 -46
- package/dist/plot/fill-utils.js +0 -322
- package/dist/plot/hover-lock.svelte.d.ts +0 -14
- package/dist/plot/hover-lock.svelte.js +0 -46
- package/dist/plot/interactions.d.ts +0 -12
- package/dist/plot/interactions.js +0 -101
- package/dist/plot/scales.d.ts +0 -48
- package/dist/plot/svg.d.ts +0 -1
- package/dist/plot/svg.js +0 -11
- package/dist/plot/utils/series-visibility.d.ts +0 -15
- package/dist/plot/utils.d.ts +0 -1
- package/dist/plot/utils.js +0 -14
- /package/dist/plot/{PortalSelect.svelte.d.ts → core/components/PortalSelect.svelte.d.ts} +0 -0
- /package/dist/plot/{binned-scatter-types.js → scatter/binned-scatter-types.js} +0 -0
package/dist/Icon.svelte
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { SVGAttributes } from 'svelte/elements'
|
|
3
3
|
import { ICON_DATA, type IconName } from './icons'
|
|
4
|
-
import { sanitize_icon_svg } from './sanitize'
|
|
5
4
|
|
|
6
5
|
type IconData = { path: string; viewBox: string; stroke?: string }
|
|
7
6
|
let { icon, path, viewBox = `0 0 24 24`, stroke, ...rest }:
|
|
@@ -10,11 +9,15 @@
|
|
|
10
9
|
& SVGAttributes<SVGSVGElement> = $props()
|
|
11
10
|
|
|
12
11
|
const data: IconData = $derived.by(() => {
|
|
13
|
-
if (path) return { path, viewBox
|
|
12
|
+
if (path) return { path, viewBox, stroke }
|
|
14
13
|
if (icon && icon in ICON_DATA) return ICON_DATA[icon]
|
|
15
14
|
if (icon) console.error(`Icon '${icon}' not found`)
|
|
16
15
|
return ICON_DATA.Alert
|
|
17
16
|
})
|
|
17
|
+
|
|
18
|
+
// {@html} only ever gets trusted ICON_DATA, never the user `path` prop (which renders as an
|
|
19
|
+
// escaped <path d> below) — so no XSS via path and identical SSR/CSR output (no hydration mismatch)
|
|
20
|
+
const icon_markup = $derived(!path && data.path.trim().startsWith(`<`) ? data.path : null)
|
|
18
21
|
</script>
|
|
19
22
|
|
|
20
23
|
<svg
|
|
@@ -24,8 +27,8 @@
|
|
|
24
27
|
viewBox={data.viewBox}
|
|
25
28
|
{...rest}
|
|
26
29
|
>
|
|
27
|
-
{#if
|
|
28
|
-
{@html
|
|
30
|
+
{#if icon_markup != null}
|
|
31
|
+
{@html icon_markup}
|
|
29
32
|
{:else}
|
|
30
33
|
<path d={data.path} />
|
|
31
34
|
{/if}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
if (nums.every((num) => !isNaN(num))) return nums as Vec3
|
|
20
20
|
}
|
|
21
21
|
// Fall back to compact single-digit format: "001", "-101"
|
|
22
|
-
const compact = input.
|
|
22
|
+
const compact = input.replaceAll(/\s+/g, ``)
|
|
23
23
|
const match = compact.match(/^(-?\d)(-?\d)(-?\d)$/)
|
|
24
24
|
if (match) return [Number(match[1]), Number(match[2]), Number(match[3])] as Vec3
|
|
25
25
|
return null
|
package/dist/api/optimade.js
CHANGED
|
@@ -1,34 +1,41 @@
|
|
|
1
1
|
// OPTIMADE API utilities for fetching structure data
|
|
2
2
|
// Based on OPTIMADE 1.2.0 specification
|
|
3
|
-
//
|
|
3
|
+
// CORS proxies for fallback reliability. Query-style proxies need the target URL
|
|
4
|
+
// percent-encoded; path-suffix proxies need it verbatim (encoded can never succeed).
|
|
4
5
|
const CORS_PROXIES = [
|
|
5
|
-
`https://corsproxy.io/?`,
|
|
6
|
-
`https://api.allorigins.win/raw?url=`,
|
|
7
|
-
`https://cors-anywhere.herokuapp.com/`,
|
|
8
|
-
`https://thingproxy.freeboard.io/fetch/`,
|
|
9
|
-
`https://cors.bridged.cc/`,
|
|
6
|
+
{ prefix: `https://corsproxy.io/?`, encode: true },
|
|
7
|
+
{ prefix: `https://api.allorigins.win/raw?url=`, encode: true },
|
|
8
|
+
{ prefix: `https://cors-anywhere.herokuapp.com/`, encode: false },
|
|
9
|
+
{ prefix: `https://thingproxy.freeboard.io/fetch/`, encode: false },
|
|
10
|
+
{ prefix: `https://cors.bridged.cc/`, encode: false },
|
|
10
11
|
];
|
|
11
12
|
let cached_providers = null;
|
|
12
13
|
let providers_cache_time = 0;
|
|
13
14
|
const CACHE_DURATION = 5 * 60 * 1000;
|
|
15
|
+
// Per-key timestamps: a shared one would let any resolution refresh every entry's TTL
|
|
14
16
|
const resolved_provider_urls = {};
|
|
15
|
-
let resolved_urls_cache_time = 0;
|
|
16
17
|
const RESOLVED_URLS_CACHE_DURATION = 10 * 60 * 1000;
|
|
17
18
|
async function fetch_with_cors_proxy(url) {
|
|
19
|
+
const headers = { Accept: `application/vnd.api+json`, 'User-Agent': `MatterViz/1.0` };
|
|
20
|
+
let direct;
|
|
18
21
|
try {
|
|
19
|
-
|
|
20
|
-
headers: { Accept: `application/vnd.api+json`, 'User-Agent': `MatterViz/1.0` },
|
|
21
|
-
});
|
|
22
|
-
if (direct_response.ok)
|
|
23
|
-
return direct_response;
|
|
22
|
+
direct = await fetch(url, { headers });
|
|
24
23
|
}
|
|
25
24
|
catch {
|
|
26
|
-
//
|
|
25
|
+
// No response at all (network/CORS failure) — fall back to CORS proxies below
|
|
27
26
|
}
|
|
28
|
-
|
|
27
|
+
// A returned response means CORS succeeded. Surface a definitive HTTP error status
|
|
28
|
+
// directly (rather than masking a 404/500 behind callers' JSON.parse or the proxy
|
|
29
|
+
// fallback); only a thrown fetch (no response) warrants the proxies.
|
|
30
|
+
if (direct) {
|
|
31
|
+
if (direct.ok)
|
|
32
|
+
return direct;
|
|
33
|
+
throw new Error(`Request failed: ${direct.status} ${direct.statusText} for ${url}`);
|
|
34
|
+
}
|
|
35
|
+
for (const { prefix, encode } of CORS_PROXIES) {
|
|
29
36
|
try {
|
|
30
|
-
const response = await fetch(`${
|
|
31
|
-
headers
|
|
37
|
+
const response = await fetch(`${prefix}${encode ? encodeURIComponent(url) : url}`, {
|
|
38
|
+
headers,
|
|
32
39
|
});
|
|
33
40
|
if (response.ok)
|
|
34
41
|
return response;
|
|
@@ -41,9 +48,9 @@ async function fetch_with_cors_proxy(url) {
|
|
|
41
48
|
}
|
|
42
49
|
async function resolve_provider_url(provider_base_url) {
|
|
43
50
|
const now = Date.now();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return
|
|
51
|
+
const cached = resolved_provider_urls[provider_base_url];
|
|
52
|
+
if (cached && now - cached.time < RESOLVED_URLS_CACHE_DURATION) {
|
|
53
|
+
return cached.url;
|
|
47
54
|
}
|
|
48
55
|
for (const endpoint of [`/links`, `/v1/links`]) {
|
|
49
56
|
try {
|
|
@@ -52,18 +59,17 @@ async function resolve_provider_url(provider_base_url) {
|
|
|
52
59
|
const self_link = data.data?.find((link) => link.type === `links` &&
|
|
53
60
|
link.attributes?.base_url &&
|
|
54
61
|
link.attributes.link_type === `child`);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return
|
|
62
|
+
const url = self_link?.attributes.base_url;
|
|
63
|
+
if (url) {
|
|
64
|
+
resolved_provider_urls[provider_base_url] = { url, time: now };
|
|
65
|
+
return url;
|
|
59
66
|
}
|
|
60
67
|
}
|
|
61
68
|
catch {
|
|
62
69
|
// Try next endpoint
|
|
63
70
|
}
|
|
64
71
|
}
|
|
65
|
-
resolved_provider_urls[provider_base_url] = provider_base_url;
|
|
66
|
-
resolved_urls_cache_time = now;
|
|
72
|
+
resolved_provider_urls[provider_base_url] = { url: provider_base_url, time: now };
|
|
67
73
|
return provider_base_url;
|
|
68
74
|
}
|
|
69
75
|
export async function fetch_optimade_providers() {
|
|
@@ -97,7 +103,7 @@ export async function fetch_optimade_providers() {
|
|
|
97
103
|
}
|
|
98
104
|
}
|
|
99
105
|
// URL encode/decode utilities for structure IDs with special characters
|
|
100
|
-
export const encode_structure_id = (id) => encodeURIComponent(id).
|
|
106
|
+
export const encode_structure_id = (id) => encodeURIComponent(id).replaceAll('.', `%2E`).replaceAll('/', `%2F`);
|
|
101
107
|
export const decode_structure_id = (encoded_id) => decodeURIComponent(encoded_id);
|
|
102
108
|
export function detect_provider_from_slug(slug, providers) {
|
|
103
109
|
const decoded_slug = decode_structure_id(slug);
|
package/dist/app.css
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* Starry-night syntax highlighting (GitHub-style, auto light/dark) */
|
|
2
|
-
@import '@wooorm/starry-night/style/both';
|
|
3
|
-
|
|
4
1
|
/* CSS variables are unlayered so they're available to both layers and to
|
|
5
2
|
components that reference them via var(). Custom properties inherit
|
|
6
3
|
naturally regardless of layer ordering. */
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type
|
|
3
|
-
import { normalize_show_controls } from '../controls'
|
|
2
|
+
import { normalize_show_controls, type ShowControlsProp } from '../controls'
|
|
4
3
|
import EmptyState from '../EmptyState.svelte'
|
|
5
4
|
import { StatusMessage } from '../feedback'
|
|
6
5
|
import Spinner from '../feedback/Spinner.svelte'
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { create_file_drop_handler, drag_over_handlers, load_from_url } from '../io'
|
|
7
|
+
import { type FullscreenToggleProp, toggle_fullscreen, ViewerChrome } from '../layout'
|
|
8
|
+
import { sync_fullscreen } from '../layout/fullscreen.svelte'
|
|
10
9
|
import type { Vec3 } from '../math'
|
|
11
10
|
import { PlotTooltip } from '../plot'
|
|
12
11
|
import { type CameraProjection, DEFAULTS } from '../settings'
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
import { Canvas } from '@threlte/core'
|
|
17
16
|
import type { ComponentProps, Snippet } from 'svelte'
|
|
18
17
|
import { untrack } from 'svelte'
|
|
19
|
-
import { tooltip } from 'svelte-multiselect/attachments'
|
|
20
18
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
21
19
|
import BrillouinZoneControls from './BrillouinZoneControls.svelte'
|
|
22
20
|
import BrillouinZoneExportPane from './BrillouinZoneExportPane.svelte'
|
|
@@ -29,6 +27,7 @@
|
|
|
29
27
|
extract_point_group_from_operations,
|
|
30
28
|
reciprocal_lattice,
|
|
31
29
|
} from './compute'
|
|
30
|
+
import { to_error } from '../utils'
|
|
32
31
|
import type {
|
|
33
32
|
BrillouinZoneData,
|
|
34
33
|
BZHoverData,
|
|
@@ -83,11 +82,13 @@
|
|
|
83
82
|
k_path_labels = [],
|
|
84
83
|
hovered_k_point = null,
|
|
85
84
|
hovered_qpoint_index = null,
|
|
85
|
+
on_kpath_hover,
|
|
86
86
|
children,
|
|
87
87
|
tooltip_config,
|
|
88
88
|
on_file_load,
|
|
89
89
|
on_error,
|
|
90
90
|
on_fullscreen_change,
|
|
91
|
+
on_point_hover,
|
|
91
92
|
on_hover,
|
|
92
93
|
...rest
|
|
93
94
|
}:
|
|
@@ -109,15 +110,13 @@
|
|
|
109
110
|
ibz_color?: string
|
|
110
111
|
ibz_opacity?: number
|
|
111
112
|
ibz_data?: IrreducibleBZData | null
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
* Control names: 'filename', 'fullscreen', 'info-pane', 'export-pane', 'controls'
|
|
120
|
-
*/
|
|
113
|
+
// Controls visibility configuration.
|
|
114
|
+
// - 'always': controls always visible
|
|
115
|
+
// - 'hover': controls visible on component hover (default)
|
|
116
|
+
// - 'never': controls never visible
|
|
117
|
+
// - object: { mode, hidden, style } for fine-grained control
|
|
118
|
+
//
|
|
119
|
+
// Control names: 'filename', 'fullscreen', 'info-pane', 'export-pane', 'controls'
|
|
121
120
|
show_controls?: ShowControlsProp
|
|
122
121
|
fullscreen?: boolean
|
|
123
122
|
width?: number
|
|
@@ -127,7 +126,7 @@
|
|
|
127
126
|
hovered?: boolean
|
|
128
127
|
dragover?: boolean
|
|
129
128
|
allow_file_drop?: boolean
|
|
130
|
-
fullscreen_toggle?:
|
|
129
|
+
fullscreen_toggle?: FullscreenToggleProp
|
|
131
130
|
data_url?: string
|
|
132
131
|
on_file_drop?: (content: string | ArrayBuffer, filename: string) => void
|
|
133
132
|
spinner_props?: ComponentProps<typeof Spinner>
|
|
@@ -144,6 +143,8 @@
|
|
|
144
143
|
hovered_k_point?: Vec3 | null
|
|
145
144
|
// Index of the currently hovered q-point in the band structure
|
|
146
145
|
hovered_qpoint_index?: number | null
|
|
146
|
+
// Called with the q-point index when the user hovers the k-path in the BZ (null on leave)
|
|
147
|
+
on_kpath_hover?: (qpoint_index: number | null) => void
|
|
147
148
|
children?: Snippet<
|
|
148
149
|
[{ structure?: Crystal; bz_data?: BrillouinZoneData }]
|
|
149
150
|
>
|
|
@@ -151,6 +152,8 @@
|
|
|
151
152
|
on_file_load?: (data: BZHandlerData) => void
|
|
152
153
|
on_error?: (data: BZHandlerData) => void
|
|
153
154
|
on_fullscreen_change?: (data: BZHandlerData) => void
|
|
155
|
+
on_point_hover?: (data: BZHoverData | null) => void
|
|
156
|
+
// Deprecated alias for on_point_hover (honored when on_point_hover is unset)
|
|
154
157
|
on_hover?: (data: BZHoverData | null) => void
|
|
155
158
|
}
|
|
156
159
|
& HTMLAttributes<HTMLDivElement> = $props()
|
|
@@ -161,9 +164,16 @@
|
|
|
161
164
|
let current_filename = $state<string | undefined>(undefined)
|
|
162
165
|
let hover_data = $state<BZHoverData | null>(null)
|
|
163
166
|
|
|
164
|
-
// Call
|
|
167
|
+
// Call on_point_hover callback when hover_data changes (on_hover is a deprecated alias)
|
|
168
|
+
let warned_deprecated_on_hover = false
|
|
165
169
|
$effect(() => {
|
|
166
|
-
on_hover
|
|
170
|
+
if (on_hover && !on_point_hover && !warned_deprecated_on_hover) {
|
|
171
|
+
warned_deprecated_on_hover = true
|
|
172
|
+
console.warn(
|
|
173
|
+
`BrillouinZone: the on_hover prop was renamed to on_point_hover; the alias will be removed in a future release`,
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
;(on_point_hover ?? on_hover)?.(hover_data)
|
|
167
177
|
})
|
|
168
178
|
|
|
169
179
|
// Normalize show_controls prop into consistent config
|
|
@@ -189,7 +199,7 @@
|
|
|
189
199
|
parse_structure(content, filename)
|
|
190
200
|
} catch (err) {
|
|
191
201
|
error_msg = `Failed to parse ${filename}: ${
|
|
192
|
-
err
|
|
202
|
+
to_error(err).message
|
|
193
203
|
}`
|
|
194
204
|
on_error?.({ error_msg, filename })
|
|
195
205
|
}
|
|
@@ -211,7 +221,7 @@
|
|
|
211
221
|
const valid_order = Math.min(Math.max(1, bz_order), 3) as 1 | 2 | 3
|
|
212
222
|
bz_data = compute_brillouin_zone(k_lattice, valid_order)
|
|
213
223
|
} catch (err) {
|
|
214
|
-
const msg = err
|
|
224
|
+
const msg = to_error(err).message
|
|
215
225
|
error_msg = `BZ computation failed: ${msg}`
|
|
216
226
|
bz_data = undefined
|
|
217
227
|
untrack(() => on_error?.({ error_msg, structure, bz_order }))
|
|
@@ -250,7 +260,7 @@
|
|
|
250
260
|
// Load structure from URL or string
|
|
251
261
|
$effect(() => {
|
|
252
262
|
const handle_error = (err: unknown, source: string) => {
|
|
253
|
-
error_msg = err
|
|
263
|
+
error_msg = to_error(err).message
|
|
254
264
|
on_error?.({ error_msg, filename: source })
|
|
255
265
|
}
|
|
256
266
|
|
|
@@ -307,23 +317,16 @@
|
|
|
307
317
|
}
|
|
308
318
|
}
|
|
309
319
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
320
|
+
sync_fullscreen({
|
|
321
|
+
get_wrapper: () => wrapper,
|
|
322
|
+
get_fullscreen: () => fullscreen,
|
|
323
|
+
set_fullscreen: (val) => (fullscreen = val),
|
|
324
|
+
bg_css_var: `--bz-bg-fullscreen`,
|
|
325
|
+
on_change: (val) =>
|
|
326
|
+
on_fullscreen_change?.({ structure, bz_data, bz_order, fullscreen: val }),
|
|
317
327
|
})
|
|
318
328
|
</script>
|
|
319
329
|
|
|
320
|
-
<svelte:document
|
|
321
|
-
onfullscreenchange={() => {
|
|
322
|
-
fullscreen = Boolean(document.fullscreenElement)
|
|
323
|
-
on_fullscreen_change?.({ structure, bz_data, bz_order, fullscreen })
|
|
324
|
-
}}
|
|
325
|
-
/>
|
|
326
|
-
|
|
327
330
|
<div
|
|
328
331
|
class:dragover
|
|
329
332
|
class:active={info_pane_open || controls_open || export_pane_open}
|
|
@@ -335,15 +338,7 @@
|
|
|
335
338
|
onmouseenter={() => (hovered = true)}
|
|
336
339
|
onmouseleave={() => (hovered = false)}
|
|
337
340
|
ondrop={handle_file_drop}
|
|
338
|
-
|
|
339
|
-
event.preventDefault()
|
|
340
|
-
if (!allow_file_drop) return
|
|
341
|
-
dragover = true
|
|
342
|
-
}}
|
|
343
|
-
ondragleave={(event) => {
|
|
344
|
-
event.preventDefault()
|
|
345
|
-
dragover = false
|
|
346
|
-
}}
|
|
341
|
+
{...drag_over_handlers({ allow: () => allow_file_drop, set_dragover: (over) => dragover = over })}
|
|
347
342
|
{onkeydown}
|
|
348
343
|
{...rest}
|
|
349
344
|
class="brillouin-zone {rest.class ?? ``}"
|
|
@@ -354,65 +349,45 @@
|
|
|
354
349
|
{:else if error_msg}
|
|
355
350
|
<StatusMessage bind:message={error_msg} type="error" dismissible />
|
|
356
351
|
{:else if structure && `lattice` in structure}
|
|
357
|
-
<
|
|
358
|
-
|
|
359
|
-
|
|
352
|
+
<ViewerChrome
|
|
353
|
+
{controls_config}
|
|
354
|
+
filename={current_filename}
|
|
355
|
+
{fullscreen}
|
|
356
|
+
{fullscreen_toggle}
|
|
357
|
+
{wrapper}
|
|
360
358
|
>
|
|
361
|
-
{#if controls_config.
|
|
362
|
-
{
|
|
363
|
-
|
|
364
|
-
{/if}
|
|
365
|
-
|
|
366
|
-
{#if fullscreen_toggle && controls_config.visible(`fullscreen`)}
|
|
367
|
-
<button
|
|
368
|
-
type="button"
|
|
369
|
-
onclick={() => fullscreen_toggle && toggle_fullscreen(wrapper)}
|
|
370
|
-
title="{fullscreen ? `Exit` : `Enter`} fullscreen"
|
|
371
|
-
aria-pressed={fullscreen}
|
|
372
|
-
class="fullscreen-toggle"
|
|
373
|
-
{@attach tooltip()}
|
|
374
|
-
>
|
|
375
|
-
{#if typeof fullscreen_toggle === `function`}
|
|
376
|
-
{@render fullscreen_toggle({ fullscreen })}
|
|
377
|
-
{:else}
|
|
378
|
-
<Icon icon="{fullscreen ? `Exit` : ``}Fullscreen" />
|
|
379
|
-
{/if}
|
|
380
|
-
</button>
|
|
381
|
-
{/if}
|
|
382
|
-
|
|
383
|
-
{#if controls_config.visible(`info-pane`)}
|
|
384
|
-
<BrillouinZoneInfoPane {structure} {bz_data} bind:pane_open={info_pane_open} />
|
|
385
|
-
{/if}
|
|
359
|
+
{#if controls_config.visible(`info-pane`)}
|
|
360
|
+
<BrillouinZoneInfoPane {structure} {bz_data} bind:pane_open={info_pane_open} />
|
|
361
|
+
{/if}
|
|
386
362
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
363
|
+
{#if controls_config.visible(`export-pane`)}
|
|
364
|
+
<BrillouinZoneExportPane
|
|
365
|
+
bind:export_pane_open
|
|
366
|
+
{bz_data}
|
|
367
|
+
{wrapper}
|
|
368
|
+
{scene}
|
|
369
|
+
{camera}
|
|
370
|
+
bind:png_dpi
|
|
371
|
+
filename={current_filename || `brillouin-zone`}
|
|
372
|
+
/>
|
|
373
|
+
{/if}
|
|
398
374
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
{/if}
|
|
375
|
+
{#if controls_config.visible(`controls`)}
|
|
376
|
+
<BrillouinZoneControls
|
|
377
|
+
bind:controls_open
|
|
378
|
+
bind:bz_order
|
|
379
|
+
bind:surface_color
|
|
380
|
+
bind:surface_opacity
|
|
381
|
+
bind:edge_color
|
|
382
|
+
bind:edge_width
|
|
383
|
+
bind:show_vectors
|
|
384
|
+
bind:camera_projection
|
|
385
|
+
bind:show_ibz
|
|
386
|
+
bind:ibz_color
|
|
387
|
+
bind:ibz_opacity
|
|
388
|
+
/>
|
|
414
389
|
{/if}
|
|
415
|
-
</
|
|
390
|
+
</ViewerChrome>
|
|
416
391
|
|
|
417
392
|
{#if typeof WebGLRenderingContext !== `undefined`}
|
|
418
393
|
<div style="overflow: hidden; height: 100%">
|
|
@@ -430,6 +405,7 @@
|
|
|
430
405
|
{k_path_labels}
|
|
431
406
|
{hovered_k_point}
|
|
432
407
|
{hovered_qpoint_index}
|
|
408
|
+
{on_kpath_hover}
|
|
433
409
|
{show_ibz}
|
|
434
410
|
{ibz_data}
|
|
435
411
|
{ibz_color}
|
|
@@ -447,7 +423,7 @@
|
|
|
447
423
|
y={hover_data.screen_position.y}
|
|
448
424
|
bg_color={hover_data.is_ibz ? ibz_color : surface_color}
|
|
449
425
|
fixed
|
|
450
|
-
style="z-index: calc(var(--
|
|
426
|
+
style="z-index: calc(var(--z-index-overlay-controls, 100000000) + 1); backdrop-filter: blur(4px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3)"
|
|
451
427
|
>
|
|
452
428
|
<BrillouinZoneTooltip {hover_data} tooltip={tooltip_config} />
|
|
453
429
|
</PlotTooltip>
|
|
@@ -494,54 +470,6 @@
|
|
|
494
470
|
.brillouin-zone :global(canvas) {
|
|
495
471
|
user-select: none;
|
|
496
472
|
}
|
|
497
|
-
section.control-buttons {
|
|
498
|
-
position: absolute;
|
|
499
|
-
display: flex;
|
|
500
|
-
top: var(--bz-buttons-top, var(--ctrl-btn-top, 1ex));
|
|
501
|
-
right: var(--bz-buttons-right, var(--ctrl-btn-right, 1ex));
|
|
502
|
-
gap: clamp(6pt, 1cqmin, 9pt);
|
|
503
|
-
z-index: var(
|
|
504
|
-
--bz-buttons-z-index,
|
|
505
|
-
var(--z-index-overlay-controls, 100000000)
|
|
506
|
-
);
|
|
507
|
-
opacity: 0;
|
|
508
|
-
pointer-events: none;
|
|
509
|
-
transition: opacity 0.2s ease;
|
|
510
|
-
align-items: center;
|
|
511
|
-
}
|
|
512
|
-
/* Mode: always - controls always visible */
|
|
513
|
-
section.control-buttons.always-visible {
|
|
514
|
-
opacity: 1;
|
|
515
|
-
pointer-events: auto;
|
|
516
|
-
}
|
|
517
|
-
/* Mode: hover - controls visible on component hover */
|
|
518
|
-
.brillouin-zone:hover section.control-buttons.hover-visible,
|
|
519
|
-
.brillouin-zone:focus-within section.control-buttons.hover-visible {
|
|
520
|
-
opacity: 1;
|
|
521
|
-
pointer-events: auto;
|
|
522
|
-
}
|
|
523
|
-
/* Mode: never - stays hidden (default state, no additional CSS needed) */
|
|
524
|
-
section.control-buttons > :global(button) {
|
|
525
|
-
background-color: transparent;
|
|
526
|
-
display: flex;
|
|
527
|
-
padding: 4px;
|
|
528
|
-
border-radius: var(--border-radius, 3pt);
|
|
529
|
-
font-size: clamp(0.85em, 2cqmin, 1.3em);
|
|
530
|
-
}
|
|
531
|
-
section.control-buttons :global(button:hover) {
|
|
532
|
-
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
533
|
-
}
|
|
534
|
-
.filename {
|
|
535
|
-
font-family: monospace;
|
|
536
|
-
font-size: 0.9em;
|
|
537
|
-
background: var(--code-bg, rgba(0, 0, 0, 0.1));
|
|
538
|
-
padding: 3pt 6pt;
|
|
539
|
-
border-radius: 3pt;
|
|
540
|
-
max-width: 200px;
|
|
541
|
-
overflow: hidden;
|
|
542
|
-
text-overflow: ellipsis;
|
|
543
|
-
white-space: nowrap;
|
|
544
|
-
}
|
|
545
473
|
p.warn {
|
|
546
474
|
text-align: center;
|
|
547
475
|
padding: 2rem;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ShowControlsProp } from '../controls';
|
|
2
2
|
import Spinner from '../feedback/Spinner.svelte';
|
|
3
|
+
import { type FullscreenToggleProp } from '../layout';
|
|
3
4
|
import type { Vec3 } from '../math';
|
|
4
5
|
import { type CameraProjection } from '../settings';
|
|
5
6
|
import type { Crystal } from '../structure';
|
|
@@ -32,15 +33,6 @@ type $$ComponentProps = {
|
|
|
32
33
|
ibz_color?: string;
|
|
33
34
|
ibz_opacity?: number;
|
|
34
35
|
ibz_data?: IrreducibleBZData | null;
|
|
35
|
-
/**
|
|
36
|
-
* Controls visibility configuration.
|
|
37
|
-
* - 'always': controls always visible
|
|
38
|
-
* - 'hover': controls visible on component hover (default)
|
|
39
|
-
* - 'never': controls never visible
|
|
40
|
-
* - object: { mode, hidden, style } for fine-grained control
|
|
41
|
-
*
|
|
42
|
-
* Control names: 'filename', 'fullscreen', 'info-pane', 'export-pane', 'controls'
|
|
43
|
-
*/
|
|
44
36
|
show_controls?: ShowControlsProp;
|
|
45
37
|
fullscreen?: boolean;
|
|
46
38
|
width?: number;
|
|
@@ -50,9 +42,7 @@ type $$ComponentProps = {
|
|
|
50
42
|
hovered?: boolean;
|
|
51
43
|
dragover?: boolean;
|
|
52
44
|
allow_file_drop?: boolean;
|
|
53
|
-
fullscreen_toggle?:
|
|
54
|
-
fullscreen: boolean;
|
|
55
|
-
}]> | boolean;
|
|
45
|
+
fullscreen_toggle?: FullscreenToggleProp;
|
|
56
46
|
data_url?: string;
|
|
57
47
|
on_file_drop?: (content: string | ArrayBuffer, filename: string) => void;
|
|
58
48
|
spinner_props?: ComponentProps<typeof Spinner>;
|
|
@@ -66,6 +56,7 @@ type $$ComponentProps = {
|
|
|
66
56
|
}[];
|
|
67
57
|
hovered_k_point?: Vec3 | null;
|
|
68
58
|
hovered_qpoint_index?: number | null;
|
|
59
|
+
on_kpath_hover?: (qpoint_index: number | null) => void;
|
|
69
60
|
children?: Snippet<[
|
|
70
61
|
{
|
|
71
62
|
structure?: Crystal;
|
|
@@ -76,8 +67,9 @@ type $$ComponentProps = {
|
|
|
76
67
|
on_file_load?: (data: BZHandlerData) => void;
|
|
77
68
|
on_error?: (data: BZHandlerData) => void;
|
|
78
69
|
on_fullscreen_change?: (data: BZHandlerData) => void;
|
|
70
|
+
on_point_hover?: (data: BZHoverData | null) => void;
|
|
79
71
|
on_hover?: (data: BZHoverData | null) => void;
|
|
80
72
|
} & HTMLAttributes<HTMLDivElement>;
|
|
81
|
-
declare const BrillouinZone: import("svelte").Component<$$ComponentProps, {}, "structure" | "height" | "width" | "dragover" | "
|
|
73
|
+
declare const BrillouinZone: import("svelte").Component<$$ComponentProps, {}, "structure" | "height" | "width" | "dragover" | "fullscreen" | "wrapper" | "hovered" | "controls_open" | "loading" | "camera_projection" | "vector_scale" | "png_dpi" | "info_pane_open" | "error_msg" | "bz_order" | "surface_color" | "surface_opacity" | "edge_color" | "edge_width" | "show_vectors" | "show_ibz" | "ibz_color" | "ibz_opacity" | "bz_data" | "ibz_data">;
|
|
82
74
|
type BrillouinZone = ReturnType<typeof BrillouinZone>;
|
|
83
75
|
export default BrillouinZone;
|