matterviz 0.4.0 → 0.4.2
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/EmptyState.svelte +10 -4
- package/dist/FilePicker.svelte +12 -14
- package/dist/Icon.svelte +7 -4
- package/dist/MillerIndexInput.svelte +2 -2
- package/dist/app.css +53 -0
- package/dist/brillouin/BrillouinZone.svelte +132 -219
- package/dist/brillouin/BrillouinZone.svelte.d.ts +9 -20
- package/dist/brillouin/BrillouinZoneControls.svelte +3 -6
- package/dist/brillouin/BrillouinZoneExportPane.svelte +47 -96
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +15 -42
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +2 -3
- package/dist/brillouin/BrillouinZoneScene.svelte +63 -230
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +3 -23
- 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 +80 -77
- 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 +33 -38
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +143 -246
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +4 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +652 -976
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +7 -1
- package/dist/chempot-diagram/async-compute.svelte.js +1 -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 +3 -3
- package/dist/chempot-diagram/compute.js +3 -1
- 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.d.ts +0 -4
- package/dist/colors/index.js +21 -22
- package/dist/composition/BarChart.svelte +37 -31
- package/dist/composition/BubbleChart.svelte +17 -17
- package/dist/composition/Composition.svelte +7 -11
- package/dist/composition/Formula.svelte +18 -25
- package/dist/composition/FormulaFilter.svelte +96 -98
- package/dist/composition/PieChart.svelte +60 -46
- package/dist/composition/chem-sys.js +3 -2
- package/dist/composition/format.js +4 -3
- package/dist/composition/index.d.ts +2 -0
- package/dist/composition/index.js +14 -0
- package/dist/composition/parse.d.ts +2 -3
- package/dist/composition/parse.js +27 -28
- package/dist/constants.js +11 -9
- package/dist/controls.d.ts +1 -0
- package/dist/controls.js +0 -1
- package/dist/convex-hull/ConvexHull.svelte +20 -25
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -4
- package/dist/convex-hull/ConvexHull2D.svelte +176 -256
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +269 -804
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +236 -755
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +264 -0
- package/dist/convex-hull/ConvexHullChrome.svelte.d.ts +30 -0
- package/dist/convex-hull/ConvexHullControls.svelte +128 -49
- 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 +210 -351
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +3 -1
- package/dist/convex-hull/ConvexHullTooltip.svelte +16 -14
- package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +2 -1
- package/dist/convex-hull/GasPressureControls.svelte +5 -12
- package/dist/convex-hull/StructurePopup.svelte +17 -21
- package/dist/convex-hull/StructurePopup.svelte.d.ts +2 -0
- package/dist/convex-hull/TemperatureSlider.svelte +4 -10
- 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 +279 -0
- package/dist/convex-hull/helpers.d.ts +47 -17
- package/dist/convex-hull/helpers.js +186 -101
- 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 +9 -7
- package/dist/convex-hull/index.js +7 -2
- package/dist/convex-hull/thermodynamics.js +109 -937
- package/dist/convex-hull/types.d.ts +12 -4
- package/dist/convex-hull/types.js +12 -0
- package/dist/coordination/CoordinationBarPlot.svelte +41 -43
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
- package/dist/coordination/calc-coordination.d.ts +1 -1
- package/dist/coordination/calc-coordination.js +28 -25
- package/dist/element/BohrAtom.svelte +6 -8
- package/dist/element/ElementHeading.svelte +4 -1
- package/dist/element/ElementPhoto.svelte +11 -9
- package/dist/element/ElementStats.svelte +12 -10
- package/dist/element/ElementTile.svelte +24 -29
- package/dist/element/ElementTile.svelte.d.ts +1 -1
- package/dist/element/Nucleus.svelte +4 -2
- package/dist/element/data.d.ts +1 -2
- package/dist/element/helpers.d.ts +4 -0
- package/dist/element/helpers.js +18 -0
- package/dist/element/index.d.ts +1 -0
- package/dist/element/index.js +3 -0
- package/dist/feedback/DragOverlay.svelte +5 -3
- package/dist/feedback/DragOverlay.svelte.d.ts +2 -1
- package/dist/feedback/StatusMessage.svelte +20 -7
- package/dist/fermi-surface/FermiSlice.svelte +21 -18
- package/dist/fermi-surface/FermiSurface.svelte +78 -165
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +9 -20
- package/dist/fermi-surface/FermiSurfaceControls.svelte +6 -20
- package/dist/fermi-surface/FermiSurfaceScene.svelte +93 -272
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +3 -23
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +9 -6
- package/dist/fermi-surface/compute.js +14 -13
- package/dist/fermi-surface/export.js +4 -15
- 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 +84 -97
- package/dist/fermi-surface/types.d.ts +2 -2
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +161 -185
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +6 -5
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +12 -9
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +5 -5
- package/dist/heatmap-matrix/index.d.ts +8 -2
- package/dist/icons.d.ts +4 -0
- package/dist/icons.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/io/ExportPane.svelte +170 -0
- package/dist/io/ExportPane.svelte.d.ts +17 -0
- package/dist/io/decompress.d.ts +2 -1
- package/dist/io/decompress.js +22 -36
- package/dist/io/export.d.ts +9 -1
- package/dist/io/export.js +37 -29
- package/dist/io/fetch.d.ts +2 -4
- package/dist/io/fetch.js +0 -11
- package/dist/io/file-drop.d.ts +7 -0
- package/dist/io/file-drop.js +13 -0
- package/dist/io/index.d.ts +1 -0
- package/dist/io/index.js +3 -0
- package/dist/io/is-binary.d.ts +9 -0
- package/dist/io/is-binary.js +45 -1
- package/dist/io/types.d.ts +13 -0
- package/dist/io/url-drop.js +13 -25
- package/dist/isosurface/Isosurface.svelte +17 -23
- package/dist/isosurface/IsosurfaceControls.svelte +37 -42
- package/dist/isosurface/parse-vaspwave.d.ts +3 -0
- package/dist/isosurface/parse-vaspwave.js +138 -0
- package/dist/isosurface/parse.js +50 -48
- package/dist/labels.d.ts +6 -2
- package/dist/labels.js +44 -14
- package/dist/layout/FullscreenButton.svelte +34 -0
- package/dist/layout/FullscreenButton.svelte.d.ts +10 -0
- package/dist/layout/FullscreenToggle.svelte +12 -12
- package/dist/layout/InfoCard.svelte +7 -18
- package/dist/layout/InfoTag.svelte +1 -3
- package/dist/layout/NumberRangeInput.svelte +46 -0
- package/dist/layout/NumberRangeInput.svelte.d.ts +12 -0
- package/dist/layout/PropertyFilter.svelte +2 -6
- package/dist/layout/SettingsSection.svelte +21 -17
- package/dist/layout/SubpageGrid.svelte +3 -1
- package/dist/layout/ViewerChrome.svelte +115 -0
- package/dist/layout/ViewerChrome.svelte.d.ts +18 -0
- package/dist/layout/fullscreen.d.ts +4 -0
- package/dist/layout/fullscreen.js +3 -5
- package/dist/layout/fullscreen.svelte.d.ts +8 -0
- package/dist/layout/fullscreen.svelte.js +36 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout/index.js +4 -0
- package/dist/layout/json-tree/JsonNode.svelte +8 -11
- package/dist/layout/json-tree/JsonTree.svelte +53 -77
- package/dist/layout/json-tree/JsonValue.svelte +7 -15
- package/dist/layout/json-tree/utils.js +14 -23
- package/dist/math.d.ts +9 -3
- package/dist/math.js +37 -21
- package/dist/overlays/ContextMenu.svelte +4 -2
- package/dist/overlays/CopyButton.svelte +11 -5
- package/dist/overlays/DragControlTab.svelte +6 -1
- package/dist/overlays/DraggablePane.svelte +81 -26
- package/dist/overlays/DraggablePane.svelte.d.ts +1 -0
- package/dist/overlays/GlassChip.svelte +30 -0
- package/dist/overlays/GlassChip.svelte.d.ts +8 -0
- package/dist/overlays/InfoPaneCards.svelte +11 -23
- package/dist/overlays/index.d.ts +11 -0
- package/dist/overlays/index.js +26 -0
- package/dist/overlays/portal.d.ts +2 -0
- package/dist/overlays/portal.js +14 -0
- package/dist/periodic-table/PeriodicTable.svelte +115 -146
- package/dist/periodic-table/PeriodicTable.svelte.d.ts +5 -3
- package/dist/periodic-table/PeriodicTableControls.svelte +11 -63
- package/dist/periodic-table/TableInset.svelte +9 -4
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +50 -71
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +6 -8
- package/dist/phase-diagram/PhaseDiagramControls.svelte +73 -96
- 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 +49 -134
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +3 -4
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +54 -58
- package/dist/phase-diagram/TdbInfoPanel.svelte +21 -15
- package/dist/phase-diagram/build-diagram.js +3 -3
- package/dist/phase-diagram/colors.js +1 -1
- package/dist/phase-diagram/diagram-input.d.ts +1 -2
- package/dist/phase-diagram/parse.d.ts +2 -1
- package/dist/phase-diagram/parse.js +15 -15
- package/dist/phase-diagram/svg-to-diagram.js +21 -15
- package/dist/phase-diagram/utils.js +2 -3
- package/dist/plot/bar/BarPlot.svelte +494 -692
- package/dist/plot/bar/BarPlot.svelte.d.ts +9 -15
- package/dist/plot/bar/BarPlotControls.svelte +1 -3
- package/dist/plot/bar/BarPlotControls.svelte.d.ts +5 -7
- package/dist/plot/bar/SpacegroupBarPlot.svelte +31 -37
- package/dist/plot/bar/data.d.ts +5 -4
- package/dist/plot/bar/data.js +2 -1
- package/dist/plot/box/BoxPlot.svelte +361 -439
- package/dist/plot/box/BoxPlot.svelte.d.ts +6 -3
- package/dist/plot/box/BoxPlotControls.svelte.d.ts +1 -1
- package/dist/plot/box/Violin.svelte.d.ts +2 -1
- package/dist/plot/box/box-plot.d.ts +3 -2
- package/dist/plot/box/box-plot.js +6 -3
- package/dist/plot/box/kde.d.ts +2 -1
- package/dist/plot/box/kde.js +4 -4
- package/dist/plot/core/auto-place.d.ts +1 -1
- package/dist/plot/core/auto-place.js +5 -2
- package/dist/plot/core/axis-utils.d.ts +12 -7
- package/dist/plot/core/axis-utils.js +48 -48
- package/dist/plot/core/components/AxisLabel.svelte +82 -20
- package/dist/plot/core/components/AxisLabel.svelte.d.ts +1 -0
- package/dist/plot/core/components/ColorBar.svelte +106 -111
- package/dist/plot/core/components/ColorBar.svelte.d.ts +5 -4
- package/dist/plot/core/components/ColorScaleSelect.svelte +1 -1
- package/dist/plot/core/components/FillArea.svelte +10 -17
- package/dist/plot/core/components/HierarchyControls.svelte +249 -0
- package/dist/plot/{sunburst/SunburstControls.svelte.d.ts → core/components/HierarchyControls.svelte.d.ts} +12 -8
- package/dist/plot/core/components/InteractiveAxisLabel.svelte +1 -1
- package/dist/plot/core/components/InteractiveAxisLabel.svelte.d.ts +1 -1
- package/dist/plot/core/components/Line.svelte +21 -11
- package/dist/plot/core/components/Line.svelte.d.ts +5 -2
- package/dist/plot/core/components/PlotAxis.svelte +42 -18
- package/dist/plot/core/components/PlotAxis.svelte.d.ts +2 -1
- package/dist/plot/core/components/PlotControls.svelte +65 -41
- package/dist/plot/core/components/PlotControls.svelte.d.ts +1 -1
- package/dist/plot/core/components/PlotLegend.svelte +31 -35
- package/dist/plot/core/components/PlotMarginals.svelte +616 -0
- package/dist/plot/core/components/PlotMarginals.svelte.d.ts +15 -0
- package/dist/plot/core/components/PlotTooltip.svelte +1 -1
- package/dist/plot/core/components/PortalSelect.svelte +4 -8
- package/dist/plot/core/components/ReferenceLine.svelte +27 -24
- package/dist/plot/core/components/ReferenceLine3D.svelte +56 -59
- package/dist/plot/core/components/ReferenceLine3D.svelte.d.ts +4 -4
- package/dist/plot/core/components/ReferencePlane.svelte +9 -10
- package/dist/plot/core/components/ReferencePlane.svelte.d.ts +4 -4
- package/dist/plot/core/components/ZeroLines.svelte +4 -8
- package/dist/plot/core/components/ZoomRect.svelte +1 -2
- package/dist/plot/core/components/index.d.ts +1 -0
- package/dist/plot/core/components/index.js +1 -0
- package/dist/plot/core/data-cleaning-signal.d.ts +46 -0
- package/dist/plot/core/data-cleaning-signal.js +467 -0
- package/dist/plot/core/data-cleaning.d.ts +2 -42
- package/dist/plot/core/data-cleaning.js +29 -476
- package/dist/plot/core/data-transform.js +9 -5
- package/dist/plot/core/fill-utils.d.ts +7 -4
- package/dist/plot/core/fill-utils.js +34 -9
- package/dist/plot/core/index.d.ts +1 -0
- package/dist/plot/core/index.js +1 -0
- package/dist/plot/core/interactions.d.ts +5 -1
- package/dist/plot/core/interactions.js +14 -2
- package/dist/plot/core/layout.d.ts +3 -1
- package/dist/plot/core/layout.js +22 -13
- package/dist/plot/core/marginals.d.ts +170 -0
- package/dist/plot/core/marginals.js +436 -0
- 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/core/reference-line.d.ts +10 -10
- package/dist/plot/core/reference-line.js +7 -7
- package/dist/plot/core/scales.d.ts +40 -25
- package/dist/plot/core/scales.js +49 -21
- package/dist/plot/core/svg.d.ts +2 -1
- package/dist/plot/core/types/fills.d.ts +101 -0
- package/dist/plot/core/types/fills.js +15 -0
- package/dist/plot/core/types/plot-3d.d.ts +87 -0
- package/dist/plot/core/types/plot-3d.js +4 -0
- package/dist/plot/core/types/reference-lines.d.ts +140 -0
- package/dist/plot/core/types/reference-lines.js +9 -0
- package/dist/plot/core/types.d.ts +47 -331
- package/dist/plot/core/types.js +23 -20
- package/dist/plot/core/utils/hierarchy-chart.d.ts +51 -0
- package/dist/plot/core/utils/hierarchy-chart.js +179 -0
- package/dist/plot/core/utils/hierarchy-labels.d.ts +20 -0
- package/dist/plot/core/utils/hierarchy-labels.js +99 -0
- package/dist/plot/core/utils/label-placement.d.ts +1 -1
- package/dist/plot/core/utils/label-placement.js +5 -5
- package/dist/plot/core/utils.d.ts +2 -1
- package/dist/plot/histogram/Histogram.svelte +373 -631
- package/dist/plot/histogram/Histogram.svelte.d.ts +7 -7
- package/dist/plot/histogram/HistogramControls.svelte +30 -28
- package/dist/plot/histogram/HistogramControls.svelte.d.ts +1 -1
- package/dist/plot/histogram/histogram.d.ts +31 -0
- package/dist/plot/histogram/histogram.js +70 -0
- package/dist/plot/histogram/index.d.ts +1 -0
- package/dist/plot/histogram/index.js +1 -0
- package/dist/plot/index.d.ts +1 -0
- package/dist/plot/index.js +1 -0
- package/dist/plot/sankey/Sankey.svelte +79 -73
- package/dist/plot/sankey/Sankey.svelte.d.ts +3 -3
- package/dist/plot/sankey/SankeyControls.svelte +22 -16
- package/dist/plot/sankey/sankey.js +3 -1
- package/dist/plot/scatter/BinnedScatterPlot.svelte +264 -112
- package/dist/plot/scatter/BinnedScatterPlot.svelte.d.ts +11 -4
- package/dist/plot/scatter/ElementScatter.svelte +4 -1
- package/dist/plot/scatter/ScatterPlot.svelte +623 -821
- package/dist/plot/scatter/ScatterPlot.svelte.d.ts +9 -15
- package/dist/plot/scatter/ScatterPlotControls.svelte +18 -19
- package/dist/plot/scatter/ScatterPlotControls.svelte.d.ts +1 -1
- package/dist/plot/scatter/ScatterPoint.svelte +16 -9
- package/dist/plot/scatter/binned-scatter-types.d.ts +6 -12
- package/dist/plot/scatter/binned-scatter-types.js +6 -1
- package/dist/plot/scatter/index.d.ts +1 -1
- package/dist/plot/scatter/scatter-data.d.ts +1 -1
- package/dist/plot/scatter/scatter-data.js +8 -7
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte +40 -60
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte.d.ts +6 -14
- package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte +17 -15
- package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte.d.ts +5 -5
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte +232 -234
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte.d.ts +5 -14
- package/dist/plot/scatter-3d/Surface3D.svelte +9 -17
- package/dist/plot/scatter-3d/Surface3D.svelte.d.ts +4 -3
- package/dist/plot/sunburst/Sunburst.svelte +256 -338
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +4 -3
- package/dist/plot/sunburst/index.d.ts +1 -1
- package/dist/plot/sunburst/index.js +2 -1
- package/dist/plot/sunburst/render.d.ts +2 -2
- package/dist/plot/sunburst/render.js +47 -22
- package/dist/plot/sunburst/sunburst.d.ts +5 -1
- package/dist/plot/sunburst/sunburst.js +14 -4
- package/dist/plot/treemap/Treemap.svelte +907 -0
- package/dist/plot/treemap/Treemap.svelte.d.ts +84 -0
- package/dist/plot/treemap/index.d.ts +3 -0
- package/dist/plot/treemap/index.js +4 -0
- package/dist/plot/treemap/treemap.d.ts +26 -0
- package/dist/plot/treemap/treemap.js +99 -0
- package/dist/rdf/RdfPlot.svelte +22 -26
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/calc-rdf.js +4 -8
- 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 +22 -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 +33 -11
- package/dist/settings.js +136 -51
- package/dist/spectral/Bands.svelte +231 -237
- package/dist/spectral/Bands.svelte.d.ts +3 -2
- package/dist/spectral/BandsAndDos.svelte +29 -29
- package/dist/spectral/BrillouinBandsDos.svelte +21 -29
- package/dist/spectral/Dos.svelte +75 -77
- package/dist/spectral/Dos.svelte.d.ts +2 -1
- package/dist/spectral/helpers.d.ts +9 -9
- package/dist/spectral/helpers.js +66 -70
- package/dist/state.svelte.d.ts +0 -7
- package/dist/state.svelte.js +5 -24
- package/dist/structure/Arrow.svelte +6 -21
- package/dist/structure/ArrowInstances.svelte +160 -0
- package/dist/structure/ArrowInstances.svelte.d.ts +16 -0
- package/dist/structure/AtomLegend.svelte +115 -75
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/Bond.svelte +31 -23
- package/dist/structure/CanvasTooltip.svelte +16 -3
- package/dist/structure/CellSelect.svelte +22 -29
- package/dist/structure/CellSelect.svelte.d.ts +2 -1
- package/dist/structure/Cylinder.svelte +24 -40
- package/dist/structure/InstancedAtoms.svelte +114 -0
- package/dist/structure/InstancedAtoms.svelte.d.ts +15 -0
- package/dist/structure/Lattice.svelte +85 -149
- package/dist/structure/SiteLabels.svelte +122 -0
- package/dist/structure/SiteLabels.svelte.d.ts +18 -0
- package/dist/structure/Structure.svelte +725 -735
- package/dist/structure/Structure.svelte.d.ts +8 -16
- package/dist/structure/StructureCarousel.svelte +630 -0
- package/dist/structure/StructureCarousel.svelte.d.ts +19 -0
- package/dist/structure/StructureControls.svelte +298 -325
- package/dist/structure/StructureControls.svelte.d.ts +5 -3
- package/dist/structure/StructureExportPane.svelte +62 -168
- package/dist/structure/StructureExportPane.svelte.d.ts +4 -5
- package/dist/structure/StructureInfoPane.svelte +77 -69
- package/dist/structure/StructureInfoPane.svelte.d.ts +6 -6
- package/dist/structure/StructureScene.svelte +758 -600
- package/dist/structure/StructureScene.svelte.d.ts +24 -20
- package/dist/structure/StructureViewport.svelte +386 -0
- package/dist/structure/StructureViewport.svelte.d.ts +63 -0
- package/dist/structure/atom-label-placement.d.ts +18 -0
- package/dist/structure/atom-label-placement.js +115 -0
- package/dist/structure/atom-properties.d.ts +3 -1
- package/dist/structure/atom-properties.js +115 -54
- package/dist/structure/bond-order-perception.js +2 -4
- package/dist/structure/bonding.d.ts +12 -2
- package/dist/structure/bonding.js +172 -73
- package/dist/structure/edit-history.d.ts +6 -0
- package/dist/structure/edit-history.js +27 -0
- package/dist/structure/export.d.ts +25 -4
- package/dist/structure/export.js +103 -153
- package/dist/structure/format-detect.d.ts +1 -0
- package/dist/structure/format-detect.js +22 -0
- package/dist/structure/geometry.d.ts +9 -0
- package/dist/structure/geometry.js +27 -0
- package/dist/structure/index.d.ts +18 -1
- package/dist/structure/index.js +15 -2
- package/dist/structure/measure.d.ts +1 -1
- package/dist/structure/measure.js +6 -12
- package/dist/structure/parse.d.ts +5 -3
- package/dist/structure/parse.js +551 -567
- package/dist/structure/partial-occupancy.d.ts +0 -1
- package/dist/structure/partial-occupancy.js +5 -3
- package/dist/structure/pbc.d.ts +1 -1
- package/dist/structure/pbc.js +204 -51
- package/dist/structure/polyhedra.d.ts +40 -0
- package/dist/structure/polyhedra.js +587 -0
- package/dist/structure/site.d.ts +4 -0
- package/dist/structure/site.js +1 -0
- package/dist/structure/supercell.d.ts +1 -2
- package/dist/structure/supercell.js +10 -15
- 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 +350 -0
- package/dist/symmetry/SymmetryElements.svelte.d.ts +24 -0
- package/dist/symmetry/SymmetryStats.svelte +142 -49
- package/dist/symmetry/WyckoffTable.svelte +58 -16
- package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -0
- package/dist/symmetry/cell-transform.js +8 -14
- package/dist/symmetry/index.d.ts +15 -4
- package/dist/symmetry/index.js +308 -81
- package/dist/symmetry/spacegroups.d.ts +5 -1
- package/dist/symmetry/spacegroups.js +18 -3
- 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 +1104 -378
- package/dist/table/HeatmapTable.svelte.d.ts +12 -2
- package/dist/table/ToggleMenu.svelte +5 -12
- package/dist/table/index.d.ts +21 -6
- package/dist/table/index.js +34 -21
- package/dist/theme/ThemeControl.svelte +16 -8
- package/dist/theme/index.d.ts +1 -5
- package/dist/theme/index.js +4 -10
- package/dist/theme/themes.mjs +14 -7
- package/dist/tooltip/KCoords.svelte +4 -1
- package/dist/tooltip/TooltipContent.svelte +2 -5
- package/dist/trajectory/Trajectory.svelte +556 -352
- package/dist/trajectory/Trajectory.svelte.d.ts +10 -22
- package/dist/trajectory/TrajectoryError.svelte +11 -8
- package/dist/trajectory/TrajectoryExportPane.svelte +28 -54
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +4 -5
- package/dist/trajectory/TrajectoryInfoPane.svelte +88 -99
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -2
- package/dist/trajectory/constants.js +6 -2
- package/dist/trajectory/extract.js +73 -71
- package/dist/trajectory/format-detect.d.ts +0 -1
- package/dist/trajectory/format-detect.js +13 -17
- package/dist/trajectory/frame-reader.d.ts +2 -1
- package/dist/trajectory/frame-reader.js +74 -136
- package/dist/trajectory/helpers.d.ts +12 -2
- package/dist/trajectory/helpers.js +68 -37
- package/dist/trajectory/index.d.ts +1 -0
- package/dist/trajectory/index.js +3 -0
- 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/h5-utils.d.ts +13 -0
- package/dist/trajectory/parse/h5-utils.js +109 -0
- package/dist/trajectory/parse/hdf5.d.ts +1 -1
- package/dist/trajectory/parse/hdf5.js +116 -106
- package/dist/trajectory/parse/index.d.ts +3 -4
- package/dist/trajectory/parse/index.js +68 -119
- package/dist/trajectory/parse/lammps.d.ts +0 -2
- package/dist/trajectory/parse/lammps.js +14 -16
- package/dist/trajectory/parse/pymatgen.d.ts +2 -0
- package/dist/trajectory/parse/pymatgen.js +74 -0
- package/dist/trajectory/parse/vasp.js +13 -9
- package/dist/trajectory/parse/vaspout-electronic.d.ts +13 -0
- package/dist/trajectory/parse/vaspout-electronic.js +207 -0
- package/dist/trajectory/parse/vaspout-h5.d.ts +5 -0
- package/dist/trajectory/parse/vaspout-h5.js +284 -0
- package/dist/trajectory/parse/xyz.d.ts +9 -21
- package/dist/trajectory/parse/xyz.js +38 -39
- package/dist/trajectory/plotting.d.ts +8 -10
- package/dist/trajectory/plotting.js +102 -127
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +8 -1
- package/dist/xrd/XrdPlot.svelte +56 -85
- package/dist/xrd/broadening.d.ts +2 -1
- package/dist/xrd/broadening.js +2 -1
- package/dist/xrd/calc-xrd.js +8 -15
- package/dist/xrd/index.d.ts +2 -2
- package/dist/xrd/parse.d.ts +0 -1
- package/dist/xrd/parse.js +56 -73
- package/package.json +77 -36
- package/dist/api/mp.d.ts +0 -6
- package/dist/api/mp.js +0 -22
- 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/core/hover-lock.svelte.d.ts +0 -14
- package/dist/plot/core/hover-lock.svelte.js +0 -45
- package/dist/plot/sunburst/SunburstControls.svelte +0 -200
- package/dist/structure/label-placement.d.ts +0 -14
- package/dist/structure/label-placement.js +0 -72
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Vec2 } from '../math';
|
|
1
2
|
import ScatterPlot from '../plot/scatter/ScatterPlot.svelte';
|
|
2
3
|
import type { AxisConfig } from '../plot/core/types';
|
|
3
4
|
import type { BandsSpinMode, BandStructureType, BaseBandStructure, FrequencyUnit, LineKwargs, PathMode, RibbonConfig } from './types';
|
|
@@ -10,7 +11,7 @@ type $$ComponentProps = ComponentProps<typeof ScatterPlot> & {
|
|
|
10
11
|
path_mode?: PathMode;
|
|
11
12
|
band_type?: BandStructureType;
|
|
12
13
|
show_legend?: boolean;
|
|
13
|
-
x_positions?: Record<string,
|
|
14
|
+
x_positions?: Record<string, Vec2>;
|
|
14
15
|
reference_frequency?: number | null;
|
|
15
16
|
highlighted_qpoint_index?: number | null;
|
|
16
17
|
ribbon_config?: RibbonConfig | Record<string, RibbonConfig>;
|
|
@@ -34,6 +35,6 @@ type $$ComponentProps = ComponentProps<typeof ScatterPlot> & {
|
|
|
34
35
|
id?: string;
|
|
35
36
|
'data-testid'?: string;
|
|
36
37
|
};
|
|
37
|
-
declare const Bands: import("svelte").Component<$$ComponentProps, {}, "y_axis" | "
|
|
38
|
+
declare const Bands: import("svelte").Component<$$ComponentProps, {}, "y_axis" | "x_positions" | "units" | "band_spin_mode">;
|
|
38
39
|
type Bands = ReturnType<typeof Bands>;
|
|
39
40
|
export default Bands;
|
|
@@ -44,10 +44,12 @@
|
|
|
44
44
|
const bands_default_axis = (range = shared_frequency_range): AxisConfig =>
|
|
45
45
|
shared_y_axis ? axis_with_range(bands_props.y_axis, range) : { ...bands_props.y_axis }
|
|
46
46
|
const dos_default_axis = (range = shared_frequency_range): AxisConfig =>
|
|
47
|
-
shared_y_axis
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
shared_y_axis
|
|
48
|
+
? axis_with_range(dos_props.y_axis, range, ``)
|
|
49
|
+
: {
|
|
50
|
+
label: ``,
|
|
51
|
+
...dos_props.y_axis,
|
|
52
|
+
}
|
|
51
53
|
|
|
52
54
|
let synced_zoom_range = $state<Vec2 | null>(null)
|
|
53
55
|
let bands_y_axis = $state<AxisConfig>(bands_default_axis())
|
|
@@ -74,31 +76,29 @@
|
|
|
74
76
|
if (result !== undefined) synced_zoom_range = result
|
|
75
77
|
})
|
|
76
78
|
|
|
77
|
-
// Propagate synced range to
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return
|
|
85
|
-
}
|
|
86
|
-
// Only include range if it's valid (don't override child's auto-range with undefined)
|
|
87
|
-
bands_y_axis = bands_default_axis(base_range)
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
// Propagate synced range to DOS y-axis (untrack current to avoid overwriting child zoom)
|
|
91
|
-
$effect(() => {
|
|
79
|
+
// Propagate the synced range to a child y-axis (untrack current to avoid overwriting
|
|
80
|
+
// child zoom). Skips when the current range already matches base, or is valid but
|
|
81
|
+
// differs (child zoom in progress).
|
|
82
|
+
const propagate_synced_range = (
|
|
83
|
+
current_range: Vec2 | undefined,
|
|
84
|
+
apply: (base_range: Vec2 | undefined) => void,
|
|
85
|
+
) => {
|
|
92
86
|
const base_range = synced_zoom_range ?? shared_frequency_range
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
87
|
+
if (ranges_equal(current_range, base_range) || is_valid_range(current_range)) return
|
|
88
|
+
apply(base_range)
|
|
89
|
+
}
|
|
90
|
+
$effect(() =>
|
|
91
|
+
propagate_synced_range(
|
|
92
|
+
untrack(() => bands_y_axis.range) as Vec2 | undefined,
|
|
93
|
+
(base_range) => (bands_y_axis = bands_default_axis(base_range)),
|
|
94
|
+
),
|
|
95
|
+
)
|
|
96
|
+
$effect(() =>
|
|
97
|
+
propagate_synced_range(
|
|
98
|
+
untrack(() => dos_y_axis.range) as Vec2 | undefined,
|
|
99
|
+
(base_range) => (dos_y_axis = dos_default_axis(base_range)),
|
|
100
|
+
),
|
|
101
|
+
)
|
|
102
102
|
|
|
103
103
|
let hovered_frequency = $state<number | null>(null)
|
|
104
104
|
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
|
|
109
109
|
<div
|
|
110
110
|
{...rest}
|
|
111
|
-
class=
|
|
111
|
+
class={[`bands-and-dos`, rest.class]}
|
|
112
112
|
style={`display: grid; grid-template-columns: 1fr 200px; gap: 0;` + (rest.style ?? ``)}
|
|
113
113
|
>
|
|
114
114
|
{@render children?.({ hovered_frequency })}
|
|
@@ -44,16 +44,13 @@
|
|
|
44
44
|
) as BaseBandStructure | null
|
|
45
45
|
|
|
46
46
|
// Compute shared frequency/energy range from both bands and DOS data
|
|
47
|
-
let shared_frequency_range = $derived(
|
|
48
|
-
helpers.compute_frequency_range(band_structs, doses),
|
|
49
|
-
)
|
|
47
|
+
let shared_frequency_range = $derived(helpers.compute_frequency_range(band_structs, doses))
|
|
50
48
|
|
|
51
49
|
// Extract Fermi level from electronic band structure or DOS data
|
|
52
50
|
let fermi_level = $derived.by((): number | undefined => {
|
|
53
51
|
// Check band structures for efermi
|
|
54
|
-
const bs_source =
|
|
55
|
-
? band_structs
|
|
56
|
-
: Object.values(band_structs)[0]
|
|
52
|
+
const bs_source =
|
|
53
|
+
`efermi` in (band_structs as object) ? band_structs : Object.values(band_structs)[0]
|
|
57
54
|
const bs_efermi = (bs_source as Record<string, unknown>)?.efermi
|
|
58
55
|
if (typeof bs_efermi === `number`) return bs_efermi
|
|
59
56
|
|
|
@@ -73,15 +70,14 @@
|
|
|
73
70
|
})
|
|
74
71
|
|
|
75
72
|
let hovered_band_point = $state<InternalPoint | null>(null)
|
|
76
|
-
let bands_x_positions = $state<Record<string,
|
|
73
|
+
let bands_x_positions = $state<Record<string, Vec2>>({})
|
|
77
74
|
let hovered_qpoint_index = $derived(
|
|
78
|
-
hovered_band_point && first_band_struct &&
|
|
79
|
-
Object.keys(bands_x_positions).length > 0
|
|
75
|
+
hovered_band_point && first_band_struct && Object.keys(bands_x_positions).length > 0
|
|
80
76
|
? helpers.find_qpoint_at_rescaled_x(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
first_band_struct,
|
|
78
|
+
hovered_band_point.x,
|
|
79
|
+
bands_x_positions,
|
|
80
|
+
)
|
|
85
81
|
: null,
|
|
86
82
|
)
|
|
87
83
|
// Q-point hovered directly on the BZ k-path (reverse direction: BZ -> bands/DOS)
|
|
@@ -89,9 +85,7 @@
|
|
|
89
85
|
// Unified hovered q-point: a band-point hover takes priority, else a BZ k-path hover
|
|
90
86
|
let active_qpoint_index = $derived(hovered_qpoint_index ?? bz_hovered_qpoint_index)
|
|
91
87
|
let hovered_k_point = $derived(
|
|
92
|
-
active_qpoint_index !== null
|
|
93
|
-
? (k_path_points[active_qpoint_index] as Vec3)
|
|
94
|
-
: null,
|
|
88
|
+
active_qpoint_index !== null ? (k_path_points[active_qpoint_index] as Vec3) : null,
|
|
95
89
|
)
|
|
96
90
|
const [desktop_width, tablet_width] = [1200, 600]
|
|
97
91
|
let clientWidth = $state(desktop_width)
|
|
@@ -101,8 +95,8 @@
|
|
|
101
95
|
clientWidth >= desktop_width
|
|
102
96
|
? `desktop`
|
|
103
97
|
: clientWidth >= tablet_width
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
? `tablet`
|
|
99
|
+
: `phone`,
|
|
106
100
|
)
|
|
107
101
|
|
|
108
102
|
const bands_default_axis = (range = shared_frequency_range): AxisConfig =>
|
|
@@ -169,11 +163,7 @@
|
|
|
169
163
|
let hovered_frequency = $state<number | null>(null)
|
|
170
164
|
</script>
|
|
171
165
|
|
|
172
|
-
<div
|
|
173
|
-
{...rest}
|
|
174
|
-
class="bands-dos-brillouin {screen_class} {rest.class ?? ``}"
|
|
175
|
-
bind:clientWidth
|
|
176
|
-
>
|
|
166
|
+
<div {...rest} class={[`bands-dos-brillouin`, screen_class, rest.class]} bind:clientWidth>
|
|
177
167
|
{@render children?.({
|
|
178
168
|
hovered_frequency,
|
|
179
169
|
hovered_band_point,
|
|
@@ -199,13 +189,15 @@
|
|
|
199
189
|
style="grid-area: bz; min-width: 0; min-height: 0; overflow: hidden; height: 100%"
|
|
200
190
|
{structure}
|
|
201
191
|
{k_path_points}
|
|
202
|
-
k_path_labels={first_band_struct?.qpoints?.flatMap((
|
|
192
|
+
k_path_labels={first_band_struct?.qpoints?.flatMap((qpoint, idx) =>
|
|
203
193
|
k_path_points[idx]
|
|
204
|
-
? [
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
194
|
+
? [
|
|
195
|
+
{
|
|
196
|
+
position: k_path_points[idx],
|
|
197
|
+
label: qpoint.label ? helpers.pretty_sym_point(qpoint.label) : null,
|
|
198
|
+
},
|
|
199
|
+
]
|
|
200
|
+
: [],
|
|
209
201
|
) ?? []}
|
|
210
202
|
{hovered_k_point}
|
|
211
203
|
hovered_qpoint_index={active_qpoint_index}
|
package/dist/spectral/Dos.svelte
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { PLOT_COLORS } from '../colors'
|
|
3
3
|
import EmptyState from '../EmptyState.svelte'
|
|
4
4
|
import { SettingsSection } from '../layout'
|
|
5
|
+
import type { Vec2 } from '../math'
|
|
5
6
|
import ScatterPlot from '../plot/scatter/ScatterPlot.svelte'
|
|
6
7
|
import type { AxisConfig, DataSeries } from '../plot/core/types'
|
|
7
8
|
import type { ComponentProps } from 'svelte'
|
|
@@ -78,7 +79,7 @@
|
|
|
78
79
|
show_sigma_control?: boolean // Show sigma/smearing control
|
|
79
80
|
show_normalize_control?: boolean // Show normalization selector
|
|
80
81
|
show_units_control?: boolean // Show units selector (phonon DOS only)
|
|
81
|
-
sigma_range?:
|
|
82
|
+
sigma_range?: Vec2 // Min/max range for sigma slider (auto-detected if not provided)
|
|
82
83
|
} = $props()
|
|
83
84
|
|
|
84
85
|
const is_horizontal = $derived(orientation === `horizontal`)
|
|
@@ -174,17 +175,18 @@
|
|
|
174
175
|
}
|
|
175
176
|
|
|
176
177
|
// Check for spin-down data (only for electronic DOS)
|
|
177
|
-
const has_spin_down =
|
|
178
|
-
dos.spin_down_densities?.length === dos.densities.length
|
|
178
|
+
const has_spin_down =
|
|
179
|
+
dos.type === `electronic` && dos.spin_down_densities?.length === dos.densities.length
|
|
179
180
|
const should_show_spin_up = effective_spin_mode !== `down_only`
|
|
180
|
-
const should_show_spin_down =
|
|
181
|
-
effective_spin_mode !== `up_only` && effective_spin_mode !== null
|
|
181
|
+
const should_show_spin_down =
|
|
182
|
+
has_spin_down && effective_spin_mode !== `up_only` && effective_spin_mode !== null
|
|
182
183
|
|
|
183
184
|
// Process spin-up (or total) densities
|
|
184
185
|
if (should_show_spin_up) {
|
|
185
|
-
let densities_up =
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
let densities_up =
|
|
187
|
+
sigma > 0
|
|
188
|
+
? apply_gaussian_smearing(x_values, dos.densities, sigma)
|
|
189
|
+
: [...dos.densities]
|
|
188
190
|
|
|
189
191
|
densities_up = normalize_densities(densities_up, x_values, normalize)
|
|
190
192
|
|
|
@@ -193,8 +195,8 @@
|
|
|
193
195
|
|
|
194
196
|
// For stacked plots, accumulate densities (only if array lengths match)
|
|
195
197
|
if (stack && cumulative_spin_up?.length === densities_up.length) {
|
|
196
|
-
densities_up = densities_up.map(
|
|
197
|
-
density + (cumulative_spin_up?.[idx] ?? 0)
|
|
198
|
+
densities_up = densities_up.map(
|
|
199
|
+
(density, idx) => density + (cumulative_spin_up?.[idx] ?? 0),
|
|
198
200
|
)
|
|
199
201
|
} else if (stack && cumulative_spin_up) {
|
|
200
202
|
console.warn(`DOS stacking: length mismatch for "${label}"`)
|
|
@@ -211,9 +213,10 @@
|
|
|
211
213
|
cumulative_spin_up = densities_up
|
|
212
214
|
}
|
|
213
215
|
|
|
214
|
-
const spin_label =
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
const spin_label =
|
|
217
|
+
has_spin_down && effective_spin_mode
|
|
218
|
+
? `${label || `DOS ${dos_idx + 1}`} (↑)`
|
|
219
|
+
: label || `DOS ${dos_idx + 1}`
|
|
217
220
|
|
|
218
221
|
const series_up: DataSeries = {
|
|
219
222
|
x: is_horizontal ? densities_up : x_values,
|
|
@@ -227,13 +230,11 @@
|
|
|
227
230
|
}
|
|
228
231
|
|
|
229
232
|
// Process spin-down densities if available
|
|
230
|
-
if (
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
? apply_gaussian_smearing(x_values, dos.spin_down_densities, sigma)
|
|
236
|
-
: [...dos.spin_down_densities]
|
|
233
|
+
if (should_show_spin_down && dos.type === `electronic` && dos.spin_down_densities) {
|
|
234
|
+
let densities_down =
|
|
235
|
+
sigma > 0
|
|
236
|
+
? apply_gaussian_smearing(x_values, dos.spin_down_densities, sigma)
|
|
237
|
+
: [...dos.spin_down_densities]
|
|
237
238
|
|
|
238
239
|
densities_down = normalize_densities(densities_down, x_values, normalize)
|
|
239
240
|
|
|
@@ -245,12 +246,10 @@
|
|
|
245
246
|
// For stacked plots with overlay mode, use separate spin-down cumulative
|
|
246
247
|
// This prevents spin-down from stacking on top of spin-up within the same DOS
|
|
247
248
|
if (stack && effective_spin_mode === `overlay`) {
|
|
248
|
-
const prev_spin_down = cumulative_spin_down
|
|
249
|
-
? [...cumulative_spin_down]
|
|
250
|
-
: null
|
|
249
|
+
const prev_spin_down = cumulative_spin_down ? [...cumulative_spin_down] : null
|
|
251
250
|
if (cumulative_spin_down?.length === densities_down.length) {
|
|
252
|
-
densities_down = densities_down.map(
|
|
253
|
-
density + (cumulative_spin_down?.[idx] ?? 0)
|
|
251
|
+
densities_down = densities_down.map(
|
|
252
|
+
(density, idx) => density + (cumulative_spin_down?.[idx] ?? 0),
|
|
254
253
|
)
|
|
255
254
|
} else if (cumulative_spin_down) {
|
|
256
255
|
console.warn(`DOS stacking (spin-down): length mismatch for "${label}"`)
|
|
@@ -267,9 +266,10 @@
|
|
|
267
266
|
}
|
|
268
267
|
|
|
269
268
|
// Use a slightly different shade for spin-down in overlay mode
|
|
270
|
-
const spin_down_color =
|
|
271
|
-
|
|
272
|
-
|
|
269
|
+
const spin_down_color =
|
|
270
|
+
effective_spin_mode === `overlay`
|
|
271
|
+
? PLOT_COLORS[(dos_idx * 2 + 1) % PLOT_COLORS.length]
|
|
272
|
+
: color
|
|
273
273
|
|
|
274
274
|
const series_down: DataSeries = {
|
|
275
275
|
x: is_horizontal ? densities_down : x_values,
|
|
@@ -290,9 +290,10 @@
|
|
|
290
290
|
},
|
|
291
291
|
)
|
|
292
292
|
|
|
293
|
-
let all_freqs = $derived(
|
|
293
|
+
let all_freqs = $derived(
|
|
294
|
+
// for clamping phonon noise
|
|
294
295
|
Object.values(doses_dict).flatMap((dos) =>
|
|
295
|
-
dos.type === `phonon` ? dos.frequencies : dos.energies
|
|
296
|
+
dos.type === `phonon` ? dos.frequencies : dos.energies,
|
|
296
297
|
),
|
|
297
298
|
)
|
|
298
299
|
let clamp_to_zero = $derived(
|
|
@@ -303,24 +304,24 @@
|
|
|
303
304
|
)
|
|
304
305
|
|
|
305
306
|
// Check if we have mirrored spin-down data (negative densities)
|
|
306
|
-
let has_mirrored_spin = $derived(
|
|
307
|
-
effective_spin_mode === `mirror` && has_spin_polarized,
|
|
308
|
-
)
|
|
307
|
+
let has_mirrored_spin = $derived(effective_spin_mode === `mirror` && has_spin_polarized)
|
|
309
308
|
|
|
310
|
-
let x_range = $derived.by(():
|
|
309
|
+
let x_range = $derived.by((): Vec2 | undefined => {
|
|
311
310
|
if (series_data.length === 0) return undefined
|
|
312
311
|
const all_x = series_data.flatMap((srs) => srs.x)
|
|
313
|
-
const min_x = Math.min(...all_x),
|
|
312
|
+
const min_x = Math.min(...all_x),
|
|
313
|
+
max_x = Math.max(...all_x)
|
|
314
314
|
// For horizontal orientation with mirror mode, allow negative values (mirrored densities)
|
|
315
315
|
if (is_horizontal && has_mirrored_spin) return [min_x, max_x]
|
|
316
316
|
if (is_horizontal || clamp_to_zero) return [0, max_x]
|
|
317
317
|
return [min_x, max_x]
|
|
318
318
|
})
|
|
319
319
|
|
|
320
|
-
let y_range = $derived.by(():
|
|
320
|
+
let y_range = $derived.by((): Vec2 | undefined => {
|
|
321
321
|
if (series_data.length === 0) return undefined
|
|
322
322
|
const all_y = series_data.flatMap((srs) => srs.y)
|
|
323
|
-
const min_y = Math.min(...all_y),
|
|
323
|
+
const min_y = Math.min(...all_y),
|
|
324
|
+
max_y = Math.max(...all_y)
|
|
324
325
|
// For vertical orientation with mirror mode, allow negative values (mirrored densities)
|
|
325
326
|
if (!is_horizontal && has_mirrored_spin) return [min_y, max_y]
|
|
326
327
|
if (!is_horizontal || clamp_to_zero) return [0, max_y]
|
|
@@ -329,16 +330,10 @@
|
|
|
329
330
|
|
|
330
331
|
// Get axis labels based on orientation
|
|
331
332
|
let x_label = $derived(
|
|
332
|
-
is_horizontal
|
|
333
|
-
? `Density of States`
|
|
334
|
-
: is_phonon
|
|
335
|
-
? `Frequency (${units})`
|
|
336
|
-
: `Energy (eV)`,
|
|
333
|
+
is_horizontal ? `Density of States` : is_phonon ? `Frequency (${units})` : `Energy (eV)`,
|
|
337
334
|
)
|
|
338
335
|
let y_label = $derived(
|
|
339
|
-
is_horizontal
|
|
340
|
-
? (is_phonon ? `Frequency (${units})` : `Energy (eV)`)
|
|
341
|
-
: `Density of States`,
|
|
336
|
+
is_horizontal ? (is_phonon ? `Frequency (${units})` : `Energy (eV)`) : `Density of States`,
|
|
342
337
|
)
|
|
343
338
|
|
|
344
339
|
// Compute final axis configurations with default labels
|
|
@@ -358,7 +353,6 @@
|
|
|
358
353
|
range: y_range,
|
|
359
354
|
...y_axis,
|
|
360
355
|
})
|
|
361
|
-
|
|
362
356
|
// Sync zoom changes from ScatterPlot back to parent via bindable y_axis
|
|
363
357
|
// Also clears parent range when internal range becomes invalid (auto-range reset)
|
|
364
358
|
$effect(() => {
|
|
@@ -377,7 +371,7 @@
|
|
|
377
371
|
let has_valid_data = $derived(series_data.length > 0)
|
|
378
372
|
|
|
379
373
|
// Auto-detect sigma range based on frequency/energy range
|
|
380
|
-
let effective_sigma_range = $derived.by(():
|
|
374
|
+
let effective_sigma_range = $derived.by((): Vec2 => {
|
|
381
375
|
if (sigma_range) return sigma_range
|
|
382
376
|
if (all_freqs.length === 0) return [0, 1]
|
|
383
377
|
const freq_range = Math.max(...all_freqs) - Math.min(...all_freqs)
|
|
@@ -419,9 +413,13 @@
|
|
|
419
413
|
lower_coords.push(`${lower_x.toFixed(2)},${lower_y.toFixed(2)}`)
|
|
420
414
|
}
|
|
421
415
|
// Trace upper edge forward, lower edge backward, close path
|
|
422
|
-
return `M${upper_coords[0]} ${
|
|
423
|
-
|
|
424
|
-
|
|
416
|
+
return `M${upper_coords[0]} ${upper_coords
|
|
417
|
+
.slice(1)
|
|
418
|
+
.map((coord) => `L${coord}`)
|
|
419
|
+
.join(` `)} ${lower_coords
|
|
420
|
+
.toReversed()
|
|
421
|
+
.map((coord) => `L${coord}`)
|
|
422
|
+
.join(` `)} Z`
|
|
425
423
|
}
|
|
426
424
|
</script>
|
|
427
425
|
|
|
@@ -435,24 +433,22 @@
|
|
|
435
433
|
hover_config={{ threshold_px: 50 }}
|
|
436
434
|
controls={{ show: show_controls }}
|
|
437
435
|
on_point_hover={(event) => {
|
|
438
|
-
hovered_frequency = is_horizontal
|
|
439
|
-
? (event?.point?.y ?? null)
|
|
440
|
-
: (event?.point?.x ?? null)
|
|
436
|
+
hovered_frequency = is_horizontal ? (event?.point?.y ?? null) : (event?.point?.x ?? null)
|
|
441
437
|
}}
|
|
442
438
|
{...{ range_padding: 0, ...rest }}
|
|
443
439
|
>
|
|
444
440
|
{#snippet tooltip({ x_formatted, y_formatted, label })}
|
|
445
441
|
{@const tooltip_data = format_dos_tooltip(
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
442
|
+
x_formatted,
|
|
443
|
+
y_formatted,
|
|
444
|
+
label ?? null,
|
|
445
|
+
is_horizontal,
|
|
446
|
+
is_phonon,
|
|
447
|
+
units,
|
|
448
|
+
final_x_axis.label ?? ``,
|
|
449
|
+
internal_y_axis.label ?? ``,
|
|
450
|
+
Object.keys(doses_dict).length,
|
|
451
|
+
)}
|
|
456
452
|
{#if tooltip_data.title}<strong>{tooltip_data.title}</strong><br />{/if}
|
|
457
453
|
{#each tooltip_data.lines as line, line_idx (line_idx)}
|
|
458
454
|
{line}{#if line_idx < tooltip_data.lines.length - 1}<br />{/if}
|
|
@@ -558,15 +554,16 @@
|
|
|
558
554
|
{/if}
|
|
559
555
|
|
|
560
556
|
<!-- Fermi level line for electronic DOS -->
|
|
561
|
-
{@const fermi_pos =
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
557
|
+
{@const fermi_pos =
|
|
558
|
+
effective_fermi_level !== undefined
|
|
559
|
+
? is_horizontal
|
|
560
|
+
? y_scale_fn(effective_fermi_level)
|
|
561
|
+
: x_scale_fn(effective_fermi_level)
|
|
562
|
+
: NaN}
|
|
566
563
|
{#if Number.isFinite(fermi_pos)}
|
|
567
564
|
{@const [x1, x2, y1, y2] = is_horizontal
|
|
568
|
-
|
|
569
|
-
|
|
565
|
+
? [pad.l, width - pad.r, fermi_pos, fermi_pos]
|
|
566
|
+
: [fermi_pos, fermi_pos, pad.t, height - pad.b]}
|
|
570
567
|
<line
|
|
571
568
|
class="fermi-level-line"
|
|
572
569
|
{x1}
|
|
@@ -607,15 +604,16 @@
|
|
|
607
604
|
{/if}
|
|
608
605
|
|
|
609
606
|
<!-- Reference frequency line -->
|
|
610
|
-
{@const ref_pos =
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
607
|
+
{@const ref_pos =
|
|
608
|
+
reference_frequency !== null
|
|
609
|
+
? is_horizontal
|
|
610
|
+
? y_scale_fn(reference_frequency)
|
|
611
|
+
: x_scale_fn(reference_frequency)
|
|
612
|
+
: NaN}
|
|
615
613
|
{#if Number.isFinite(ref_pos)}
|
|
616
614
|
{@const [x1, x2, y1, y2] = is_horizontal
|
|
617
|
-
|
|
618
|
-
|
|
615
|
+
? [pad.l, width - pad.r, ref_pos, ref_pos]
|
|
616
|
+
: [ref_pos, ref_pos, pad.t, height - pad.b]}
|
|
619
617
|
<line
|
|
620
618
|
{x1}
|
|
621
619
|
{x2}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Vec2 } from '../math';
|
|
1
2
|
import ScatterPlot from '../plot/scatter/ScatterPlot.svelte';
|
|
2
3
|
import type { AxisConfig } from '../plot/core/types';
|
|
3
4
|
import type { ComponentProps } from 'svelte';
|
|
@@ -22,7 +23,7 @@ type $$ComponentProps = ComponentProps<typeof ScatterPlot> & {
|
|
|
22
23
|
show_sigma_control?: boolean;
|
|
23
24
|
show_normalize_control?: boolean;
|
|
24
25
|
show_units_control?: boolean;
|
|
25
|
-
sigma_range?:
|
|
26
|
+
sigma_range?: Vec2;
|
|
26
27
|
};
|
|
27
28
|
declare const Dos: import("svelte").Component<$$ComponentProps, {}, "normalize" | "y_axis" | "units" | "sigma" | "hovered_frequency" | "spin_mode">;
|
|
28
29
|
type Dos = ReturnType<typeof Dos>;
|
|
@@ -22,7 +22,7 @@ export declare function extract_spin_channels<T>(data: unknown): {
|
|
|
22
22
|
up: T;
|
|
23
23
|
down: T | null;
|
|
24
24
|
} | null;
|
|
25
|
-
export declare function normalize_band_structure(
|
|
25
|
+
export declare function normalize_band_structure(band_struct: unknown): types.BaseBandStructure | null;
|
|
26
26
|
export declare function normalize_dos(dos: unknown, options?: {
|
|
27
27
|
auto_convert_units?: boolean;
|
|
28
28
|
}): types.DosData | null;
|
|
@@ -30,18 +30,18 @@ export declare function extract_k_path_points(band_struct: types.BaseBandStructu
|
|
|
30
30
|
wrap_to_bz?: boolean;
|
|
31
31
|
}): Vec3[];
|
|
32
32
|
export declare function find_qpoint_at_distance(band_struct: types.BaseBandStructure, target: number): number | null;
|
|
33
|
-
export declare function qpoint_x_position(band_struct: types.BaseBandStructure, qpoint_index: number, x_positions: Record<string,
|
|
34
|
-
export declare function find_qpoint_at_rescaled_x(band_struct: types.BaseBandStructure, rescaled_x: number, x_positions: Record<string,
|
|
33
|
+
export declare function qpoint_x_position(band_struct: types.BaseBandStructure, qpoint_index: number, x_positions: Record<string, Vec2>): number | null;
|
|
34
|
+
export declare function find_qpoint_at_rescaled_x(band_struct: types.BaseBandStructure, rescaled_x: number, x_positions: Record<string, Vec2>): number | null;
|
|
35
35
|
type SpinDensities = Record<string, number[]>;
|
|
36
36
|
export interface PymatgenDos {
|
|
37
|
-
'@class'
|
|
38
|
-
'@module'
|
|
37
|
+
'@class'?: string;
|
|
38
|
+
'@module'?: string;
|
|
39
39
|
energies: number[];
|
|
40
40
|
densities: SpinDensities | number[];
|
|
41
41
|
efermi: number;
|
|
42
42
|
}
|
|
43
43
|
export interface PymatgenCompleteDos extends PymatgenDos {
|
|
44
|
-
'@class'
|
|
44
|
+
'@class'?: `CompleteDos` | `LobsterCompleteDos`;
|
|
45
45
|
structure?: Record<string, unknown>;
|
|
46
46
|
pdos?: Record<string, SpinDensities>[];
|
|
47
47
|
atom_dos?: Record<string, PymatgenDos>;
|
|
@@ -52,7 +52,7 @@ export declare function shift_to_fermi(dos: PymatgenCompleteDos): PymatgenComple
|
|
|
52
52
|
export declare function generate_ribbon_path(x_values: number[], y_values: number[], width_values: number[], x_scale_fn: (x: number) => number, y_scale_fn: (y: number) => number, max_width_px: number, scale?: number): string;
|
|
53
53
|
export declare function extract_efermi(data: unknown): number | undefined;
|
|
54
54
|
export declare function negative_fraction(values: number[]): number;
|
|
55
|
-
export declare function compute_frequency_range(band_structs: unknown, doses: unknown, padding_factor?: number):
|
|
55
|
+
export declare function compute_frequency_range(band_structs: unknown, doses: unknown, padding_factor?: number): Vec2 | undefined;
|
|
56
56
|
export declare function format_dos_tooltip(x_formatted: string, y_formatted: string, label: string | null, is_horizontal: boolean, is_phonon: boolean, units: types.FrequencyUnit, x_axis_label: string, y_axis_label: string, num_series: number): {
|
|
57
57
|
title?: string;
|
|
58
58
|
lines: string[];
|
|
@@ -93,8 +93,8 @@ export declare const DEFAULT_SIGMA = 0;
|
|
|
93
93
|
export declare const DEFAULT_NORMALIZE: types.NormalizationMode;
|
|
94
94
|
export declare const DEFAULT_UNITS: types.FrequencyUnit;
|
|
95
95
|
export declare function format_sigma(val: number): string;
|
|
96
|
-
export declare const validate_sigma_range: ([min, max]:
|
|
97
|
-
export declare function calculate_sigma_step(range:
|
|
96
|
+
export declare const validate_sigma_range: ([min, max]: Vec2) => Vec2;
|
|
97
|
+
export declare function calculate_sigma_step(range: Vec2): number;
|
|
98
98
|
export interface BandPointMeta extends Record<string, unknown> {
|
|
99
99
|
band_idx: number;
|
|
100
100
|
spin: `up` | `down`;
|