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
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import EmptyState from '../EmptyState.svelte'
|
|
4
4
|
import { format_num } from '../labels'
|
|
5
5
|
import { sanitize_html } from '../sanitize'
|
|
6
|
+
import { is_plain_object } from '../utils'
|
|
6
7
|
import { SettingsSection } from '../layout'
|
|
7
8
|
import type { Vec2 } from '../math'
|
|
8
9
|
import ScatterPlot from '../plot/scatter/ScatterPlot.svelte'
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
path_mode?: PathMode
|
|
57
58
|
band_type?: BandStructureType
|
|
58
59
|
show_legend?: boolean
|
|
59
|
-
x_positions?: Record<string,
|
|
60
|
+
x_positions?: Record<string, Vec2>
|
|
60
61
|
reference_frequency?: number | null
|
|
61
62
|
// Q-point index to highlight with a vertical line (synced from BZ k-path hover)
|
|
62
63
|
highlighted_qpoint_index?: number | null
|
|
@@ -104,12 +105,12 @@
|
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
if (
|
|
108
|
+
if (is_plain_object(line_kwargs)) {
|
|
108
109
|
const mode_key = is_acoustic ? `acoustic` : `optical`
|
|
109
|
-
const mode_kwargs =
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
const mode_kwargs = line_kwargs[mode_key]
|
|
111
|
+
const source: Record<string, unknown> = is_plain_object(mode_kwargs)
|
|
112
|
+
? mode_kwargs
|
|
113
|
+
: line_kwargs
|
|
113
114
|
return {
|
|
114
115
|
stroke: (source.stroke as string) ?? defaults.stroke,
|
|
115
116
|
stroke_width: (source.stroke_width as number) ?? defaults.stroke_width,
|
|
@@ -142,25 +143,25 @@
|
|
|
142
143
|
if (!band_structs) return {}
|
|
143
144
|
|
|
144
145
|
// Detect single band structure by checking for characteristic fields
|
|
145
|
-
// - pymatgen format: has @class or @module markers (may also have branches)
|
|
146
146
|
// - matterviz format: has qpoints + branches (no pymatgen markers)
|
|
147
|
-
const has_qpoints =
|
|
147
|
+
const has_qpoints =
|
|
148
|
+
`qpoints` in band_structs &&
|
|
148
149
|
Array.isArray(band_structs.qpoints) &&
|
|
149
150
|
band_structs.qpoints.length > 0
|
|
150
|
-
const has_kpoints =
|
|
151
|
+
const has_kpoints =
|
|
152
|
+
`kpoints` in band_structs &&
|
|
151
153
|
Array.isArray(band_structs.kpoints) &&
|
|
152
154
|
band_structs.kpoints.length > 0
|
|
153
155
|
const has_bands = `bands` in band_structs
|
|
154
|
-
const has_frequencies_cm =
|
|
155
|
-
Array.isArray(band_structs.frequencies_cm)
|
|
156
|
+
const has_frequencies_cm =
|
|
157
|
+
`frequencies_cm` in band_structs && Array.isArray(band_structs.frequencies_cm)
|
|
156
158
|
const has_branches = `branches` in band_structs
|
|
157
159
|
// Pymatgen structures have explicit class/module markers
|
|
158
160
|
const is_pymatgen = `@class` in band_structs || `@module` in band_structs
|
|
159
161
|
|
|
160
162
|
// Pymatgen single: has markers and point/band data (may have branches too)
|
|
161
|
-
const is_pymatgen_single =
|
|
162
|
-
(has_qpoints || has_kpoints) &&
|
|
163
|
-
(has_bands || has_frequencies_cm)
|
|
163
|
+
const is_pymatgen_single =
|
|
164
|
+
is_pymatgen && (has_qpoints || has_kpoints) && (has_bands || has_frequencies_cm)
|
|
164
165
|
// Matterviz single: has qpoints + branches but NO pymatgen markers
|
|
165
166
|
const is_matterviz_single = !is_pymatgen && has_qpoints && has_branches
|
|
166
167
|
const is_single = is_matterviz_single || is_pymatgen_single
|
|
@@ -185,8 +186,11 @@
|
|
|
185
186
|
if (!band_structs) return `phonon`
|
|
186
187
|
|
|
187
188
|
// Single structure has marker fields; dict of structures has label keys
|
|
188
|
-
const is_single =
|
|
189
|
-
`
|
|
189
|
+
const is_single =
|
|
190
|
+
`@class` in band_structs ||
|
|
191
|
+
`@module` in band_structs ||
|
|
192
|
+
`kpoints` in band_structs ||
|
|
193
|
+
`qpoints` in band_structs
|
|
190
194
|
const source = (is_single ? band_structs : Object.values(band_structs)[0]) as
|
|
191
195
|
| Record<string, unknown>
|
|
192
196
|
| undefined
|
|
@@ -195,12 +199,11 @@
|
|
|
195
199
|
// Electronic: has kpoints, BandStructure* class (not Phonon*), or electronic_structure module
|
|
196
200
|
const py_class_name = String(source[`@class`] ?? ``)
|
|
197
201
|
if (
|
|
198
|
-
(`kpoints` in source && Array.isArray(source.kpoints) &&
|
|
199
|
-
|
|
200
|
-
(py_class_name.startsWith(`BandStructure`) &&
|
|
201
|
-
!py_class_name.startsWith(`Phonon`)) ||
|
|
202
|
+
(`kpoints` in source && Array.isArray(source.kpoints) && source.kpoints.length > 0) ||
|
|
203
|
+
(py_class_name.startsWith(`BandStructure`) && !py_class_name.startsWith(`Phonon`)) ||
|
|
202
204
|
String(source[`@module`] ?? ``).includes(`electronic_structure`)
|
|
203
|
-
)
|
|
205
|
+
)
|
|
206
|
+
return `electronic`
|
|
204
207
|
|
|
205
208
|
return `phonon`
|
|
206
209
|
})
|
|
@@ -211,16 +214,15 @@
|
|
|
211
214
|
if (detected_band_type !== `electronic`) return undefined
|
|
212
215
|
|
|
213
216
|
// Check raw input for efermi field
|
|
214
|
-
const source =
|
|
215
|
-
? band_structs
|
|
216
|
-
: Object.values(band_structs)[0]
|
|
217
|
+
const source =
|
|
218
|
+
`efermi` in (band_structs as object) ? band_structs : Object.values(band_structs)[0]
|
|
217
219
|
const efermi = (source as Record<string, unknown>)?.efermi
|
|
218
220
|
return typeof efermi === `number` ? efermi : undefined
|
|
219
221
|
})
|
|
220
222
|
|
|
221
223
|
let effective_spin_mode = $derived.by((): BandsSpinMode => {
|
|
222
224
|
if (detected_band_type !== `electronic`) return null
|
|
223
|
-
return
|
|
225
|
+
return band_spin_mode === `up_only` || band_spin_mode === `down_only`
|
|
224
226
|
? band_spin_mode
|
|
225
227
|
: `overlay`
|
|
226
228
|
})
|
|
@@ -251,13 +253,15 @@
|
|
|
251
253
|
let common_segment_keys = $derived.by(() =>
|
|
252
254
|
all_segment_keys.filter(
|
|
253
255
|
(segment_key) => all_segments[segment_key].length === num_structures,
|
|
254
|
-
)
|
|
256
|
+
),
|
|
255
257
|
)
|
|
256
258
|
let empty_state_attrs = $derived.by(() => {
|
|
257
259
|
const attrs: Record<string, Dom_attr_value> = {}
|
|
258
260
|
for (const [attr_name, attr_value] of Object.entries(rest)) {
|
|
259
261
|
if (
|
|
260
|
-
(attr_name === `class` ||
|
|
262
|
+
(attr_name === `class` ||
|
|
263
|
+
attr_name === `style` ||
|
|
264
|
+
attr_name === `role` ||
|
|
261
265
|
attr_name.startsWith(`aria-`)) &&
|
|
262
266
|
is_dom_attr_value(attr_value)
|
|
263
267
|
) {
|
|
@@ -287,7 +291,7 @@
|
|
|
287
291
|
x_positions = {}
|
|
288
292
|
return
|
|
289
293
|
}
|
|
290
|
-
const positions: Record<string,
|
|
294
|
+
const positions: Record<string, Vec2> = {}
|
|
291
295
|
let current_x = 0
|
|
292
296
|
|
|
293
297
|
// Preserve physical path order using the first available structure
|
|
@@ -298,8 +302,7 @@
|
|
|
298
302
|
}
|
|
299
303
|
const ordered_segments = helpers.get_ordered_segments(canonical, segments_to_plot)
|
|
300
304
|
|
|
301
|
-
for (
|
|
302
|
-
const segment_key = ordered_segments[seg_idx]
|
|
305
|
+
for (const segment_key of ordered_segments) {
|
|
303
306
|
if (positions[segment_key]) continue
|
|
304
307
|
|
|
305
308
|
const [start_label, end_label] = segment_key.split(`_`)
|
|
@@ -321,8 +324,8 @@
|
|
|
321
324
|
// Place at same x position as current, no advancement
|
|
322
325
|
positions[segment_key] = [current_x, current_x]
|
|
323
326
|
} else {
|
|
324
|
-
const segment_len =
|
|
325
|
-
bs.distance[matching_branch.start_index]
|
|
327
|
+
const segment_len =
|
|
328
|
+
bs.distance[matching_branch.end_index] - bs.distance[matching_branch.start_index]
|
|
326
329
|
positions[segment_key] = [current_x, current_x + segment_len]
|
|
327
330
|
current_x += segment_len
|
|
328
331
|
}
|
|
@@ -335,130 +338,130 @@
|
|
|
335
338
|
})
|
|
336
339
|
|
|
337
340
|
// Convert band structures to scatter plot series + track max slope in one pass
|
|
338
|
-
let { series_data, max_abs_slope } = $derived.by(
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
341
|
+
let { series_data, max_abs_slope } = $derived.by(
|
|
342
|
+
(): {
|
|
343
|
+
series_data: DataSeries[]
|
|
344
|
+
max_abs_slope: number
|
|
345
|
+
} => {
|
|
346
|
+
if (Object.keys(band_structs_dict).length === 0 || segments_to_plot.size === 0) {
|
|
347
|
+
return { series_data: [], max_abs_slope: 1 }
|
|
348
|
+
}
|
|
345
349
|
|
|
346
|
-
|
|
347
|
-
|
|
350
|
+
const all_series: DataSeries[] = []
|
|
351
|
+
let max_slope = 0
|
|
348
352
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
: []
|
|
353
|
+
for (const [bs_idx, [label, bs]] of Object.entries(band_structs_dict).entries()) {
|
|
354
|
+
const color = PLOT_COLORS[bs_idx % PLOT_COLORS.length]
|
|
355
|
+
const structure_label = label || `Structure ${bs_idx + 1}`
|
|
356
|
+
const gamma_indices =
|
|
357
|
+
detected_band_type === `phonon` ? helpers.find_gamma_indices(bs) : []
|
|
355
358
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
if (!segments_to_plot.has(segment_key)) continue
|
|
359
|
+
for (const branch of bs.branches) {
|
|
360
|
+
const start_idx = branch.start_index
|
|
361
|
+
const end_idx = branch.end_index + 1
|
|
362
|
+
const start_label = bs.qpoints[start_idx]?.label ?? undefined
|
|
363
|
+
const end_label = bs.qpoints[end_idx - 1]?.label ?? undefined
|
|
364
|
+
const segment_key = helpers.get_segment_key(start_label, end_label)
|
|
364
365
|
|
|
365
|
-
|
|
366
|
-
const is_discontinuity = branch.end_index - branch.start_index === 1
|
|
367
|
-
if (is_discontinuity) continue
|
|
366
|
+
if (!segments_to_plot.has(segment_key)) continue
|
|
368
367
|
|
|
369
|
-
|
|
368
|
+
// Skip discontinuous segments (consecutive labeled points)
|
|
369
|
+
const is_discontinuity = branch.end_index - branch.start_index === 1
|
|
370
|
+
if (is_discontinuity) continue
|
|
370
371
|
|
|
371
|
-
|
|
372
|
-
const segment_distances = bs.distance.slice(start_idx, end_idx)
|
|
373
|
-
const scaled_distances = helpers.scale_segment_distances(
|
|
374
|
-
segment_distances,
|
|
375
|
-
x_start,
|
|
376
|
-
x_end,
|
|
377
|
-
)
|
|
372
|
+
const [x_start, x_end] = x_positions?.[segment_key] || [0, 1]
|
|
378
373
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
const
|
|
382
|
-
|
|
374
|
+
// Scale distances for this segment
|
|
375
|
+
const segment_distances = bs.distance.slice(start_idx, end_idx)
|
|
376
|
+
const scaled_distances = helpers.scale_segment_distances(
|
|
377
|
+
segment_distances,
|
|
378
|
+
x_start,
|
|
379
|
+
x_end,
|
|
383
380
|
)
|
|
384
|
-
const is_acoustic = helpers.classify_acoustic(bs, band_idx, gamma_indices)
|
|
385
381
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
382
|
+
// Create series for each band (and spin channel for electronic structures)
|
|
383
|
+
for (let band_idx = 0; band_idx < bs.nb_bands; band_idx++) {
|
|
384
|
+
const frequencies = convert_band_values(
|
|
385
|
+
bs.bands[band_idx].slice(start_idx, end_idx),
|
|
386
|
+
)
|
|
387
|
+
const is_acoustic = helpers.classify_acoustic(bs, band_idx, gamma_indices)
|
|
392
388
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
389
|
+
const line_style_up = get_line_style(
|
|
390
|
+
color,
|
|
391
|
+
is_acoustic === true,
|
|
392
|
+
frequencies,
|
|
393
|
+
band_idx,
|
|
394
|
+
)
|
|
397
395
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
396
|
+
const spin_down_band = bs.spin_down_bands?.[band_idx]
|
|
397
|
+
const has_spin_down_channel =
|
|
398
|
+
detected_band_type === `electronic` &&
|
|
399
|
+
Array.isArray(spin_down_band) &&
|
|
400
|
+
spin_down_band.length >= end_idx
|
|
401
|
+
|
|
402
|
+
const track_max_slope = (meta: helpers.BandPointMeta[]) => {
|
|
403
|
+
for (const pt of meta) {
|
|
404
|
+
if (typeof pt.slope === `number` && Number.isFinite(pt.slope)) {
|
|
405
|
+
max_slope = Math.max(max_slope, Math.abs(pt.slope))
|
|
406
|
+
}
|
|
402
407
|
}
|
|
403
408
|
}
|
|
404
|
-
}
|
|
405
409
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
:
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
})
|
|
427
|
-
}
|
|
410
|
+
if (effective_spin_mode !== `down_only`) {
|
|
411
|
+
const meta = helpers.build_point_metadata({
|
|
412
|
+
x_vals: scaled_distances,
|
|
413
|
+
y_vals: frequencies,
|
|
414
|
+
band_idx,
|
|
415
|
+
spin: `up`,
|
|
416
|
+
is_acoustic,
|
|
417
|
+
bs,
|
|
418
|
+
start_idx,
|
|
419
|
+
})
|
|
420
|
+
track_max_slope(meta)
|
|
421
|
+
all_series.push({
|
|
422
|
+
x: scaled_distances,
|
|
423
|
+
y: frequencies,
|
|
424
|
+
markers: `line`,
|
|
425
|
+
label: has_spin_down_channel ? `${structure_label} (↑)` : structure_label,
|
|
426
|
+
line_style: line_style_up,
|
|
427
|
+
metadata: meta,
|
|
428
|
+
})
|
|
429
|
+
}
|
|
428
430
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
431
|
+
if (has_spin_down_channel && effective_spin_mode !== `up_only`) {
|
|
432
|
+
const spin_down_frequencies = convert_band_values(
|
|
433
|
+
spin_down_band.slice(start_idx, end_idx),
|
|
434
|
+
)
|
|
435
|
+
const meta = helpers.build_point_metadata({
|
|
436
|
+
x_vals: scaled_distances,
|
|
437
|
+
y_vals: spin_down_frequencies,
|
|
438
|
+
band_idx,
|
|
439
|
+
spin: `down`,
|
|
440
|
+
is_acoustic,
|
|
441
|
+
bs,
|
|
442
|
+
start_idx,
|
|
443
|
+
})
|
|
444
|
+
track_max_slope(meta)
|
|
445
|
+
all_series.push({
|
|
446
|
+
x: scaled_distances,
|
|
447
|
+
y: spin_down_frequencies,
|
|
448
|
+
markers: `line`,
|
|
449
|
+
label: `${structure_label} (↓)`,
|
|
450
|
+
line_style: {
|
|
451
|
+
...line_style_up,
|
|
452
|
+
line_dash: `4,2`,
|
|
453
|
+
stroke_width: Math.max(1, line_style_up.stroke_width - 0.1),
|
|
454
|
+
},
|
|
455
|
+
metadata: meta,
|
|
456
|
+
})
|
|
457
|
+
}
|
|
455
458
|
}
|
|
456
459
|
}
|
|
457
460
|
}
|
|
458
|
-
}
|
|
459
461
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
+
return { series_data: all_series, max_abs_slope: max_slope || 1 }
|
|
463
|
+
},
|
|
464
|
+
)
|
|
462
465
|
|
|
463
466
|
// Compute ribbon data for bands with width information
|
|
464
467
|
let ribbon_data = $derived.by((): RibbonData[] => {
|
|
@@ -508,9 +511,7 @@
|
|
|
508
511
|
// Skip if all widths are zero or missing
|
|
509
512
|
if (width_values.every((wv) => !wv || wv <= 0)) continue
|
|
510
513
|
|
|
511
|
-
const y_values = convert_band_values(
|
|
512
|
-
bs.bands[band_idx].slice(start_idx, end_idx),
|
|
513
|
-
)
|
|
514
|
+
const y_values = convert_band_values(bs.bands[band_idx].slice(start_idx, end_idx))
|
|
514
515
|
|
|
515
516
|
all_ribbons.push({
|
|
516
517
|
x_values: scaled_distances,
|
|
@@ -547,9 +548,7 @@
|
|
|
547
548
|
.sort(([, [a]], [, [b]]) => a - b)
|
|
548
549
|
.forEach(([segment_key, [x_start, x_end]]) => {
|
|
549
550
|
const [start_lbl, end_lbl] = segment_key.split(`_`)
|
|
550
|
-
const pretty_start = start_lbl !== `null`
|
|
551
|
-
? helpers.pretty_sym_point(start_lbl)
|
|
552
|
-
: ``
|
|
551
|
+
const pretty_start = start_lbl !== `null` ? helpers.pretty_sym_point(start_lbl) : ``
|
|
553
552
|
const pretty_end = end_lbl !== `null` ? helpers.pretty_sym_point(end_lbl) : ``
|
|
554
553
|
|
|
555
554
|
// Check if this is a discontinuity (zero-length segment)
|
|
@@ -568,10 +567,7 @@
|
|
|
568
567
|
|
|
569
568
|
// Merge labels at same position with pipe separator
|
|
570
569
|
return Object.fromEntries(
|
|
571
|
-
Array.from(tick_map.entries()).map(([pos, labels]) => [
|
|
572
|
-
pos,
|
|
573
|
-
labels.join(` | `),
|
|
574
|
-
]),
|
|
570
|
+
Array.from(tick_map.entries()).map(([pos, labels]) => [pos, labels.join(` | `)]),
|
|
575
571
|
)
|
|
576
572
|
})
|
|
577
573
|
|
|
@@ -587,16 +583,17 @@
|
|
|
587
583
|
...(bs.spin_down_bands?.flat() ?? []),
|
|
588
584
|
])
|
|
589
585
|
// Keep electronic y-range independent of phonon unit conversion options.
|
|
590
|
-
const display_values =
|
|
591
|
-
? convert_band_values(all_freqs)
|
|
592
|
-
: all_freqs
|
|
586
|
+
const display_values =
|
|
587
|
+
detected_band_type === `phonon` ? convert_band_values(all_freqs) : all_freqs
|
|
593
588
|
if (display_values.length === 0) return undefined
|
|
594
589
|
const finite = display_values.filter(Number.isFinite)
|
|
595
590
|
if (finite.length === 0) return undefined
|
|
596
|
-
let min_val = Math.min(...finite),
|
|
591
|
+
let min_val = Math.min(...finite),
|
|
592
|
+
max_val = Math.max(...finite)
|
|
597
593
|
if (
|
|
598
594
|
// clamp phonon min to 0 if negatives are noise
|
|
599
|
-
detected_band_type === `phonon` &&
|
|
595
|
+
detected_band_type === `phonon` &&
|
|
596
|
+
min_val < 0 &&
|
|
600
597
|
helpers.negative_fraction(finite) < helpers.IMAGINARY_MODE_NOISE_THRESHOLD
|
|
601
598
|
) {
|
|
602
599
|
min_val = 0
|
|
@@ -630,48 +627,47 @@
|
|
|
630
627
|
!shade_imaginary_modes ||
|
|
631
628
|
!y_range ||
|
|
632
629
|
y_range[0] >= 0
|
|
633
|
-
)
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
630
|
+
)
|
|
631
|
+
return []
|
|
632
|
+
return [
|
|
633
|
+
{
|
|
634
|
+
lower: y_range[0],
|
|
635
|
+
upper: 0,
|
|
636
|
+
fill: `var(--bands-imaginary-region-color, light-dark(#f8d7da, #5a1a1f))`,
|
|
637
|
+
fill_opacity: 0.2,
|
|
638
|
+
label: `Imaginary modes`,
|
|
639
|
+
show_in_legend: false,
|
|
640
|
+
z_index: `below-lines`,
|
|
641
|
+
},
|
|
642
|
+
]
|
|
643
643
|
})
|
|
644
644
|
|
|
645
645
|
let custom_highlight_regions = $derived.by((): FillRegion[] =>
|
|
646
646
|
(highlight_regions ?? [])
|
|
647
|
-
.filter((region) =>
|
|
648
|
-
Number.isFinite(region.y_min) && Number.isFinite(region.y_max)
|
|
649
|
-
)
|
|
647
|
+
.filter((region) => Number.isFinite(region.y_min) && Number.isFinite(region.y_max))
|
|
650
648
|
.map((region) => ({
|
|
651
649
|
lower: Math.min(region.y_min, region.y_max),
|
|
652
650
|
upper: Math.max(region.y_min, region.y_max),
|
|
653
|
-
fill:
|
|
654
|
-
`var(--bands-highlight-region-color, light-dark(#f6e8c3, #4d3f20))`,
|
|
651
|
+
fill:
|
|
652
|
+
region.color ?? `var(--bands-highlight-region-color, light-dark(#f6e8c3, #4d3f20))`,
|
|
655
653
|
fill_opacity: region.opacity ?? 0.2,
|
|
656
654
|
label: region.label,
|
|
657
655
|
show_in_legend: Boolean(region.label),
|
|
658
656
|
z_index: `below-lines` as const,
|
|
659
|
-
}))
|
|
657
|
+
})),
|
|
660
658
|
)
|
|
661
659
|
|
|
662
|
-
let fill_regions = $derived([
|
|
663
|
-
...imaginary_mode_region,
|
|
664
|
-
...custom_highlight_regions,
|
|
665
|
-
])
|
|
660
|
+
let fill_regions = $derived([...imaginary_mode_region, ...custom_highlight_regions])
|
|
666
661
|
|
|
667
662
|
let electronic_gap_annotation = $derived.by(() => {
|
|
668
663
|
if (
|
|
669
664
|
!show_gap_annotation ||
|
|
670
665
|
detected_band_type !== `electronic` ||
|
|
671
666
|
effective_fermi_level === undefined
|
|
672
|
-
)
|
|
667
|
+
)
|
|
668
|
+
return null
|
|
673
669
|
const all_energies = series_data.flatMap((series_item) =>
|
|
674
|
-
series_item.y.filter(Number.isFinite)
|
|
670
|
+
series_item.y.filter(Number.isFinite),
|
|
675
671
|
)
|
|
676
672
|
const occupied = all_energies.filter((energy) => energy <= effective_fermi_level)
|
|
677
673
|
const unoccupied = all_energies.filter((energy) => energy > effective_fermi_level)
|
|
@@ -700,11 +696,14 @@
|
|
|
700
696
|
let highlight_x = $derived.by(() => {
|
|
701
697
|
if (highlighted_qpoint_index == null) return null
|
|
702
698
|
const bs = Object.values(band_structs_dict)[0]
|
|
703
|
-
return bs
|
|
699
|
+
return bs
|
|
700
|
+
? helpers.qpoint_x_position(bs, highlighted_qpoint_index, x_positions ?? {})
|
|
701
|
+
: null
|
|
704
702
|
})
|
|
705
703
|
|
|
706
704
|
let display = $state({ x_grid: false, y_grid: true, y_zero_line: true })
|
|
707
705
|
</script>
|
|
706
|
+
|
|
708
707
|
{#if has_series && !is_strict_path_error}
|
|
709
708
|
<ScatterPlot
|
|
710
709
|
{id}
|
|
@@ -727,32 +726,37 @@
|
|
|
727
726
|
>
|
|
728
727
|
{#snippet tooltip({ x, y, y_formatted, label, metadata })}
|
|
729
728
|
{@const y_label_full = internal_y_axis.label ?? ``}
|
|
730
|
-
{@const [, y_label, y_unit] = y_label_full.match(/^(.+?)\s*\(([^)]+)\)$/) ??
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
{@const
|
|
736
|
-
|
|
737
|
-
|
|
729
|
+
{@const [, y_label, y_unit] = y_label_full.match(/^(.+?)\s*\(([^)]+)\)$/) ?? [
|
|
730
|
+
,
|
|
731
|
+
y_label_full,
|
|
732
|
+
``,
|
|
733
|
+
]}
|
|
734
|
+
{@const segment = Object.entries(x_positions ?? {}).find(
|
|
735
|
+
([, [start, end]]) => x >= start && x <= end,
|
|
736
|
+
)}
|
|
737
|
+
{@const path =
|
|
738
|
+
segment?.[0]
|
|
739
|
+
.split(`_`)
|
|
740
|
+
.map((lbl) => (lbl !== `null` ? helpers.pretty_sym_point(lbl) : ``))
|
|
741
|
+
.filter(Boolean)
|
|
742
|
+
.join(` → `) || null}
|
|
738
743
|
{@const {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
744
|
+
band_idx,
|
|
745
|
+
spin,
|
|
746
|
+
is_acoustic,
|
|
747
|
+
nb_bands,
|
|
748
|
+
frac_coords,
|
|
749
|
+
qpoint_label,
|
|
750
|
+
band_width,
|
|
751
|
+
slope,
|
|
752
|
+
} = (metadata ?? {}) as Partial<helpers.BandPointMeta>}
|
|
748
753
|
{@const num_structs = Object.keys(band_structs_dict).length}
|
|
749
754
|
{#if num_structs > 1 && label}<strong>{label}</strong><br />{/if}
|
|
750
|
-
{@html sanitize_html(y_label || `Value`)}: {y_formatted}{y_unit ? ` ${y_unit}` : ``}<br
|
|
755
|
+
{@html sanitize_html(y_label || `Value`)}: {y_formatted}{y_unit ? ` ${y_unit}` : ``}<br
|
|
756
|
+
/>
|
|
751
757
|
{#if path}Path: {path}<br />{/if}
|
|
752
758
|
{#if typeof band_idx === `number`}
|
|
753
|
-
Band: {band_idx + 1}{#if typeof nb_bands === `number`} / {
|
|
754
|
-
nb_bands
|
|
755
|
-
}{/if}
|
|
759
|
+
Band: {band_idx + 1}{#if typeof nb_bands === `number`} / {nb_bands}{/if}
|
|
756
760
|
{#if typeof is_acoustic === `boolean`}
|
|
757
761
|
({is_acoustic ? `acoustic` : `optical`})
|
|
758
762
|
{:else if detected_band_type === `electronic` && effective_fermi_level !== undefined}
|
|
@@ -766,9 +770,9 @@
|
|
|
766
770
|
<br />At: {helpers.pretty_sym_point(qpoint_label)}
|
|
767
771
|
{/if}
|
|
768
772
|
{#if Array.isArray(frac_coords)}
|
|
769
|
-
<br />{detected_band_type === `electronic` ? `k` : `q`}: [{
|
|
770
|
-
|
|
771
|
-
|
|
773
|
+
<br />{detected_band_type === `electronic` ? `k` : `q`}: [{frac_coords
|
|
774
|
+
.map((coord: number) => format_num(coord, `.3f`))
|
|
775
|
+
.join(`, `)}]
|
|
772
776
|
{/if}
|
|
773
777
|
{#if typeof band_width === `number` && band_width > 0}
|
|
774
778
|
<br />Projection: {format_num(band_width, `.3~g`)}
|
|
@@ -853,19 +857,16 @@
|
|
|
853
857
|
|
|
854
858
|
{#snippet user_content({ height, x_scale_fn, y_scale_fn, pad })}
|
|
855
859
|
<!-- Fat band ribbons (rendered behind band lines) -->
|
|
856
|
-
{#each ribbon_data as
|
|
857
|
-
ribbon
|
|
858
|
-
(`${ribbon.structure_label}-${ribbon.segment_key}-${ribbon.band_idx}`)
|
|
859
|
-
}
|
|
860
|
+
{#each ribbon_data as ribbon (`${ribbon.structure_label}-${ribbon.segment_key}-${ribbon.band_idx}`)}
|
|
860
861
|
{@const path_d = helpers.generate_ribbon_path(
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
862
|
+
ribbon.x_values,
|
|
863
|
+
ribbon.y_values,
|
|
864
|
+
ribbon.width_values,
|
|
865
|
+
x_scale_fn,
|
|
866
|
+
y_scale_fn,
|
|
867
|
+
ribbon.max_width,
|
|
868
|
+
ribbon.scale,
|
|
869
|
+
)}
|
|
869
870
|
{#if path_d}
|
|
870
871
|
<path
|
|
871
872
|
d={path_d}
|
|
@@ -878,12 +879,10 @@
|
|
|
878
879
|
{/each}
|
|
879
880
|
|
|
880
881
|
<!-- Symmetry point vertical lines (filter NaN from scale) -->
|
|
881
|
-
{#each Object.keys(x_axis_ticks)
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
scaled_x
|
|
885
|
-
(scaled_x)
|
|
886
|
-
}
|
|
882
|
+
{#each Object.keys(x_axis_ticks)
|
|
883
|
+
.map(Number)
|
|
884
|
+
.map((tick) => x_scale_fn(tick))
|
|
885
|
+
.filter(Number.isFinite) as scaled_x (scaled_x)}
|
|
887
886
|
<line
|
|
888
887
|
x1={scaled_x}
|
|
889
888
|
x2={scaled_x}
|
|
@@ -913,19 +912,22 @@
|
|
|
913
912
|
{/if}
|
|
914
913
|
|
|
915
914
|
<!-- Shared geometry for Fermi level and gap annotations -->
|
|
916
|
-
{@const fermi_y =
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
915
|
+
{@const fermi_y =
|
|
916
|
+
effective_fermi_level !== undefined ? y_scale_fn(effective_fermi_level) : NaN}
|
|
917
|
+
{@const bands_x_end = x_scale_fn(
|
|
918
|
+
Object.values(x_positions ?? {})
|
|
919
|
+
.flat()
|
|
920
|
+
.at(-1) ?? 1,
|
|
921
|
+
)}
|
|
920
922
|
{@const gap_data = electronic_gap_annotation}
|
|
921
923
|
{@const vbm_y = gap_data ? y_scale_fn(gap_data.vbm) : NaN}
|
|
922
924
|
{@const cbm_y = gap_data ? y_scale_fn(gap_data.cbm) : NaN}
|
|
923
925
|
{@const gap_mid_y = (vbm_y + cbm_y) / 2}
|
|
924
|
-
{@const ef_needs_offset =
|
|
925
|
-
|
|
926
|
+
{@const ef_needs_offset =
|
|
927
|
+
Number.isFinite(gap_mid_y) && Math.abs(fermi_y - gap_mid_y) < 16}
|
|
926
928
|
{@const ef_label_y = ef_needs_offset
|
|
927
|
-
|
|
928
|
-
|
|
929
|
+
? gap_mid_y + (fermi_y >= gap_mid_y ? 16 : -16)
|
|
930
|
+
: fermi_y}
|
|
929
931
|
|
|
930
932
|
<!-- Fermi level line for electronic bands -->
|
|
931
933
|
{#if Number.isFinite(fermi_y) && Number.isFinite(bands_x_end)}
|
|
@@ -965,9 +967,8 @@
|
|
|
965
967
|
{/if}
|
|
966
968
|
|
|
967
969
|
<!-- Reference frequency horizontal line -->
|
|
968
|
-
{@const ref_freq =
|
|
969
|
-
|
|
970
|
-
: NaN}
|
|
970
|
+
{@const ref_freq =
|
|
971
|
+
reference_frequency != null ? convert_band_values([reference_frequency])[0] : NaN}
|
|
971
972
|
{@const ref_y = Number.isFinite(ref_freq) ? y_scale_fn(ref_freq) : NaN}
|
|
972
973
|
{#if Number.isFinite(ref_y) && Number.isFinite(bands_x_end)}
|
|
973
974
|
<line
|
|
@@ -983,15 +984,8 @@
|
|
|
983
984
|
{/if}
|
|
984
985
|
|
|
985
986
|
<!-- Electronic band edge and gap annotation -->
|
|
986
|
-
{#if gap_data && Number.isFinite(vbm_y) && Number.isFinite(cbm_y) &&
|
|
987
|
-
|
|
988
|
-
{#each [
|
|
989
|
-
[vbm_y, `var(--bands-gap-vbm-color, light-dark(#1f77b4, #7db7ff))`],
|
|
990
|
-
[cbm_y, `var(--bands-gap-cbm-color, light-dark(#2ca02c, #7ddc7d))`],
|
|
991
|
-
] as [number, string][] as
|
|
992
|
-
[edge_y, color]
|
|
993
|
-
(edge_y)
|
|
994
|
-
}
|
|
987
|
+
{#if gap_data && Number.isFinite(vbm_y) && Number.isFinite(cbm_y) && Number.isFinite(bands_x_end)}
|
|
988
|
+
{#each [[vbm_y, `var(--bands-gap-vbm-color, light-dark(#1f77b4, #7db7ff))`], [cbm_y, `var(--bands-gap-cbm-color, light-dark(#2ca02c, #7ddc7d))`]] as [number, string][] as [edge_y, color] (edge_y)}
|
|
995
989
|
<line
|
|
996
990
|
x1={pad.l}
|
|
997
991
|
x2={bands_x_end + 3}
|