matterviz 0.3.7 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Icon.svelte +7 -4
- package/dist/MillerIndexInput.svelte +1 -1
- package/dist/api/optimade.js +32 -26
- package/dist/app.css +0 -3
- package/dist/brillouin/BrillouinZone.svelte +76 -148
- package/dist/brillouin/BrillouinZone.svelte.d.ts +6 -14
- package/dist/brillouin/BrillouinZoneExportPane.svelte +43 -96
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +9 -32
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +2 -3
- package/dist/brillouin/BrillouinZoneScene.svelte +97 -205
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +4 -23
- package/dist/brillouin/BrillouinZoneTooltip.svelte +16 -25
- package/dist/brillouin/ReciprocalVectors.svelte +39 -0
- package/dist/brillouin/ReciprocalVectors.svelte.d.ts +9 -0
- package/dist/brillouin/compute.d.ts +2 -0
- package/dist/brillouin/compute.js +89 -90
- package/dist/brillouin/geometry.d.ts +8 -0
- package/dist/brillouin/geometry.js +57 -0
- package/dist/brillouin/index.d.ts +2 -0
- package/dist/brillouin/index.js +2 -0
- package/dist/brillouin/types.d.ts +2 -2
- package/dist/chempot-diagram/ChemPotDiagram.svelte +14 -13
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +109 -203
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +4 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +180 -470
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +7 -1
- package/dist/chempot-diagram/async-compute.svelte.js +3 -1
- package/dist/chempot-diagram/chempot-worker.js +2 -1
- package/dist/chempot-diagram/color.d.ts +3 -6
- package/dist/chempot-diagram/color.js +5 -5
- package/dist/chempot-diagram/compute.d.ts +4 -4
- package/dist/chempot-diagram/compute.js +20 -20
- package/dist/chempot-diagram/controls-state.svelte.d.ts +10 -0
- package/dist/chempot-diagram/controls-state.svelte.js +42 -0
- package/dist/chempot-diagram/export.d.ts +47 -0
- package/dist/chempot-diagram/export.js +133 -0
- package/dist/chempot-diagram/index.d.ts +1 -0
- package/dist/chempot-diagram/index.js +1 -0
- package/dist/chempot-diagram/pointer.d.ts +0 -10
- package/dist/chempot-diagram/pointer.js +4 -4
- package/dist/chempot-diagram/types.d.ts +3 -3
- package/dist/colors/index.js +8 -7
- package/dist/composition/FormulaFilter.svelte +18 -11
- package/dist/composition/PieChart.svelte +11 -10
- package/dist/composition/chem-sys.d.ts +8 -0
- package/dist/composition/chem-sys.js +86 -0
- package/dist/composition/format.js +7 -4
- package/dist/composition/index.d.ts +1 -0
- package/dist/composition/index.js +1 -0
- package/dist/composition/parse.d.ts +0 -1
- package/dist/composition/parse.js +41 -31
- package/dist/controls.d.ts +1 -0
- package/dist/controls.js +0 -1
- package/dist/convex-hull/ConvexHull.svelte +8 -10
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -4
- package/dist/convex-hull/ConvexHull2D.svelte +106 -185
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +179 -683
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +183 -687
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +268 -0
- package/dist/convex-hull/ConvexHullChrome.svelte.d.ts +30 -0
- package/dist/convex-hull/ConvexHullControls.svelte +88 -7
- package/dist/convex-hull/ConvexHullControls.svelte.d.ts +7 -6
- package/dist/convex-hull/ConvexHullInfoPane.svelte +18 -5
- package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +6 -5
- package/dist/convex-hull/ConvexHullStats.svelte +36 -175
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +3 -1
- package/dist/convex-hull/ConvexHullTooltip.svelte +11 -2
- package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +2 -1
- package/dist/convex-hull/GasPressureControls.svelte +4 -4
- package/dist/convex-hull/TemperatureSlider.svelte +2 -2
- package/dist/convex-hull/barycentric-coords.d.ts +2 -4
- package/dist/convex-hull/barycentric-coords.js +6 -33
- package/dist/convex-hull/canvas-interactions.svelte.d.ts +79 -0
- package/dist/convex-hull/canvas-interactions.svelte.js +278 -0
- package/dist/convex-hull/demo-temperature.d.ts +1 -1
- package/dist/convex-hull/demo-temperature.js +20 -22
- package/dist/convex-hull/gas-thermodynamics.d.ts +2 -2
- package/dist/convex-hull/gas-thermodynamics.js +22 -30
- package/dist/convex-hull/helpers.d.ts +42 -7
- package/dist/convex-hull/helpers.js +171 -78
- package/dist/convex-hull/hull-state.svelte.d.ts +44 -0
- package/dist/convex-hull/hull-state.svelte.js +124 -0
- package/dist/convex-hull/index.d.ts +10 -8
- package/dist/convex-hull/index.js +7 -2
- package/dist/convex-hull/thermodynamics.js +136 -960
- package/dist/convex-hull/types.d.ts +13 -5
- package/dist/convex-hull/types.js +12 -0
- package/dist/coordination/CoordinationBarPlot.svelte +27 -34
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
- package/dist/element/BohrAtom.svelte +2 -1
- package/dist/element/index.d.ts +4 -0
- package/dist/element/index.js +18 -0
- package/dist/feedback/DragOverlay.svelte +3 -1
- package/dist/feedback/DragOverlay.svelte.d.ts +1 -0
- package/dist/feedback/StatusMessage.svelte +13 -3
- package/dist/fermi-surface/FermiSlice.svelte +13 -5
- package/dist/fermi-surface/FermiSurface.svelte +78 -151
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +5 -14
- package/dist/fermi-surface/FermiSurfaceControls.svelte +1 -1
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +72 -221
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +3 -23
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +8 -34
- package/dist/fermi-surface/compute.js +67 -66
- package/dist/fermi-surface/export.js +6 -16
- package/dist/fermi-surface/index.d.ts +0 -1
- package/dist/fermi-surface/index.js +0 -1
- package/dist/fermi-surface/parse.d.ts +1 -1
- package/dist/fermi-surface/parse.js +71 -79
- package/dist/fermi-surface/types.d.ts +3 -2
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +69 -52
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +4 -3
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +3 -2
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +5 -5
- package/dist/heatmap-matrix/index.d.ts +3 -2
- package/dist/heatmap-matrix/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/io/ExportPane.svelte +166 -0
- package/dist/io/ExportPane.svelte.d.ts +17 -0
- package/dist/io/decompress.js +5 -4
- package/dist/io/export.d.ts +9 -5
- package/dist/io/export.js +77 -51
- package/dist/io/fetch.d.ts +2 -1
- package/dist/io/fetch.js +5 -1
- package/dist/io/file-drop.d.ts +8 -1
- package/dist/io/file-drop.js +48 -36
- package/dist/io/index.d.ts +2 -0
- package/dist/io/index.js +10 -0
- package/dist/io/types.d.ts +13 -0
- package/dist/io/url-drop.js +64 -33
- package/dist/isosurface/parse.js +52 -51
- package/dist/isosurface/slice.js +5 -4
- package/dist/isosurface/types.js +1 -1
- package/dist/keyboard.d.ts +3 -0
- package/dist/keyboard.js +23 -0
- package/dist/labels.d.ts +1 -1
- package/dist/labels.js +9 -8
- package/dist/layout/FullscreenButton.svelte +33 -0
- package/dist/layout/FullscreenButton.svelte.d.ts +10 -0
- package/dist/layout/FullscreenToggle.svelte +8 -14
- package/dist/layout/PropertyFilter.svelte +3 -2
- package/dist/layout/SettingsSection.svelte +1 -1
- package/dist/layout/ViewerChrome.svelte +116 -0
- package/dist/layout/ViewerChrome.svelte.d.ts +17 -0
- package/dist/layout/fullscreen.d.ts +4 -0
- package/dist/layout/fullscreen.svelte.d.ts +8 -0
- package/dist/layout/fullscreen.svelte.js +37 -0
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.js +3 -0
- package/dist/layout/json-tree/JsonNode.svelte +1 -1
- package/dist/layout/json-tree/JsonTree.svelte +2 -2
- package/dist/layout/json-tree/utils.js +5 -4
- package/dist/marching-cubes.js +8 -13
- package/dist/math.d.ts +12 -4
- package/dist/math.js +42 -30
- package/dist/overlays/DraggablePane.svelte +4 -4
- package/dist/overlays/index.d.ts +4 -0
- package/dist/periodic-table/PeriodicTable.svelte +27 -15
- package/dist/periodic-table/PropertySelect.svelte +1 -0
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +9 -3
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramControls.svelte +3 -2
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +4 -3
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +4 -2
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +2 -3
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +47 -132
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +3 -4
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +1 -1
- package/dist/phase-diagram/build-diagram.js +2 -2
- package/dist/phase-diagram/colors.js +1 -1
- package/dist/phase-diagram/parse.d.ts +2 -1
- package/dist/phase-diagram/parse.js +6 -5
- package/dist/phase-diagram/types.d.ts +1 -1
- package/dist/phase-diagram/utils.d.ts +3 -3
- package/dist/phase-diagram/utils.js +8 -12
- package/dist/plot/{BarPlot.svelte → bar/BarPlot.svelte} +246 -841
- package/dist/plot/{BarPlot.svelte.d.ts → bar/BarPlot.svelte.d.ts} +8 -16
- package/dist/plot/{BarPlotControls.svelte → bar/BarPlotControls.svelte} +6 -5
- package/dist/plot/{BarPlotControls.svelte.d.ts → bar/BarPlotControls.svelte.d.ts} +3 -3
- package/dist/plot/{SpacegroupBarPlot.svelte → bar/SpacegroupBarPlot.svelte} +8 -7
- package/dist/plot/{SpacegroupBarPlot.svelte.d.ts → bar/SpacegroupBarPlot.svelte.d.ts} +1 -1
- package/dist/plot/bar/data.d.ts +40 -0
- package/dist/plot/bar/data.js +154 -0
- package/dist/plot/bar/geometry.d.ts +39 -0
- package/dist/plot/bar/geometry.js +60 -0
- package/dist/plot/bar/index.d.ts +3 -0
- package/dist/plot/bar/index.js +3 -0
- package/dist/plot/box/BoxPlot.svelte +1292 -0
- package/dist/plot/box/BoxPlot.svelte.d.ts +95 -0
- package/dist/plot/box/BoxPlotControls.svelte +109 -0
- package/dist/plot/box/BoxPlotControls.svelte.d.ts +19 -0
- package/dist/plot/box/Violin.svelte +14 -0
- package/dist/plot/box/Violin.svelte.d.ts +70 -0
- package/dist/plot/box/box-plot.d.ts +56 -0
- package/dist/plot/box/box-plot.js +129 -0
- package/dist/plot/box/index.d.ts +5 -0
- package/dist/plot/box/index.js +5 -0
- package/dist/plot/box/kde.d.ts +17 -0
- package/dist/plot/box/kde.js +160 -0
- package/dist/plot/box/quantile.d.ts +3 -0
- package/dist/plot/box/quantile.js +53 -0
- package/dist/plot/{auto-place.d.ts → core/auto-place.d.ts} +1 -1
- package/dist/plot/{auto-place.js → core/auto-place.js} +6 -3
- package/dist/plot/core/axis-utils.d.ts +46 -0
- package/dist/plot/core/axis-utils.js +110 -0
- package/dist/plot/{AxisLabel.svelte → core/components/AxisLabel.svelte} +2 -2
- package/dist/plot/{AxisLabel.svelte.d.ts → core/components/AxisLabel.svelte.d.ts} +1 -1
- package/dist/plot/{ColorBar.svelte → core/components/ColorBar.svelte} +41 -38
- package/dist/plot/{ColorBar.svelte.d.ts → core/components/ColorBar.svelte.d.ts} +7 -6
- package/dist/plot/{ColorScaleSelect.svelte → core/components/ColorScaleSelect.svelte} +4 -3
- package/dist/plot/{ColorScaleSelect.svelte.d.ts → core/components/ColorScaleSelect.svelte.d.ts} +2 -2
- package/dist/plot/core/components/ControlPane.svelte +46 -0
- package/dist/plot/core/components/ControlPane.svelte.d.ts +13 -0
- package/dist/plot/{FillArea.svelte → core/components/FillArea.svelte} +17 -6
- package/dist/plot/{FillArea.svelte.d.ts → core/components/FillArea.svelte.d.ts} +1 -1
- package/dist/plot/{InteractiveAxisLabel.svelte → core/components/InteractiveAxisLabel.svelte} +3 -3
- package/dist/plot/{InteractiveAxisLabel.svelte.d.ts → core/components/InteractiveAxisLabel.svelte.d.ts} +2 -2
- package/dist/plot/{Line.svelte → core/components/Line.svelte} +33 -15
- package/dist/plot/{Line.svelte.d.ts → core/components/Line.svelte.d.ts} +3 -2
- package/dist/plot/{PlotAxis.svelte → core/components/PlotAxis.svelte} +9 -6
- package/dist/plot/{PlotAxis.svelte.d.ts → core/components/PlotAxis.svelte.d.ts} +5 -3
- package/dist/plot/{PlotControls.svelte → core/components/PlotControls.svelte} +17 -29
- package/dist/plot/core/components/PlotControls.svelte.d.ts +4 -0
- package/dist/plot/{PlotLegend.svelte → core/components/PlotLegend.svelte} +21 -10
- package/dist/plot/{PlotLegend.svelte.d.ts → core/components/PlotLegend.svelte.d.ts} +3 -2
- package/dist/plot/{PlotTooltip.svelte → core/components/PlotTooltip.svelte} +17 -1
- package/dist/plot/{PlotTooltip.svelte.d.ts → core/components/PlotTooltip.svelte.d.ts} +8 -0
- package/dist/plot/{PortalSelect.svelte → core/components/PortalSelect.svelte} +11 -7
- package/dist/plot/{ReferenceLine.svelte → core/components/ReferenceLine.svelte} +3 -3
- package/dist/plot/{ReferenceLine.svelte.d.ts → core/components/ReferenceLine.svelte.d.ts} +1 -1
- package/dist/plot/{ReferenceLine3D.svelte → core/components/ReferenceLine3D.svelte} +5 -5
- package/dist/plot/{ReferenceLine3D.svelte.d.ts → core/components/ReferenceLine3D.svelte.d.ts} +5 -5
- package/dist/plot/{ReferencePlane.svelte → core/components/ReferencePlane.svelte} +8 -8
- package/dist/plot/{ReferencePlane.svelte.d.ts → core/components/ReferencePlane.svelte.d.ts} +5 -5
- package/dist/plot/{ZeroLines.svelte → core/components/ZeroLines.svelte} +3 -3
- package/dist/plot/{ZeroLines.svelte.d.ts → core/components/ZeroLines.svelte.d.ts} +3 -3
- package/dist/plot/{ZoomRect.svelte → core/components/ZoomRect.svelte} +1 -1
- package/dist/plot/{ZoomRect.svelte.d.ts → core/components/ZoomRect.svelte.d.ts} +1 -1
- package/dist/plot/core/components/index.d.ts +17 -0
- package/dist/plot/core/components/index.js +17 -0
- package/dist/plot/{data-cleaning.d.ts → core/data-cleaning.d.ts} +71 -1
- package/dist/plot/{data-cleaning.js → core/data-cleaning.js} +21 -23
- package/dist/plot/{data-transform.d.ts → core/data-transform.d.ts} +2 -2
- package/dist/plot/{data-transform.js → core/data-transform.js} +3 -3
- package/dist/plot/core/fill-utils.d.ts +34 -0
- package/dist/plot/core/fill-utils.js +391 -0
- package/dist/plot/core/index.d.ts +10 -0
- package/dist/plot/core/index.js +11 -0
- package/dist/plot/core/interactions.d.ts +39 -0
- package/dist/plot/core/interactions.js +209 -0
- package/dist/plot/{layout.d.ts → core/layout.d.ts} +1 -0
- package/dist/plot/{layout.js → core/layout.js} +16 -8
- package/dist/plot/core/pan-zoom.svelte.d.ts +35 -0
- package/dist/plot/core/pan-zoom.svelte.js +221 -0
- package/dist/plot/core/placed-tween.svelte.d.ts +21 -0
- package/dist/plot/core/placed-tween.svelte.js +68 -0
- package/dist/plot/{reference-line.d.ts → core/reference-line.d.ts} +11 -11
- package/dist/plot/{reference-line.js → core/reference-line.js} +29 -42
- package/dist/plot/core/scales.d.ts +40 -0
- package/dist/plot/{scales.js → core/scales.js} +94 -93
- package/dist/plot/core/svg.d.ts +3 -0
- package/dist/plot/core/svg.js +41 -0
- package/dist/plot/{types.d.ts → core/types.d.ts} +36 -85
- package/dist/plot/{types.js → core/types.js} +1 -1
- package/dist/plot/{utils → core/utils}/label-placement.d.ts +3 -3
- package/dist/plot/{utils → core/utils}/label-placement.js +3 -3
- package/dist/plot/core/utils/series-visibility.d.ts +26 -0
- package/dist/plot/{utils → core/utils}/series-visibility.js +29 -2
- package/dist/plot/core/utils.d.ts +12 -0
- package/dist/plot/core/utils.js +27 -0
- package/dist/plot/{Histogram.svelte → histogram/Histogram.svelte} +174 -551
- package/dist/plot/{Histogram.svelte.d.ts → histogram/Histogram.svelte.d.ts} +2 -2
- package/dist/plot/{HistogramControls.svelte → histogram/HistogramControls.svelte} +6 -6
- package/dist/plot/{HistogramControls.svelte.d.ts → histogram/HistogramControls.svelte.d.ts} +4 -4
- package/dist/plot/histogram/index.d.ts +2 -0
- package/dist/plot/histogram/index.js +2 -0
- package/dist/plot/index.d.ts +8 -41
- package/dist/plot/index.js +10 -39
- package/dist/plot/sankey/Sankey.svelte +697 -0
- package/dist/plot/sankey/Sankey.svelte.d.ts +74 -0
- package/dist/plot/sankey/SankeyControls.svelte +98 -0
- package/dist/plot/sankey/SankeyControls.svelte.d.ts +19 -0
- package/dist/plot/sankey/index.d.ts +4 -0
- package/dist/plot/sankey/index.js +3 -0
- package/dist/plot/sankey/sankey-types.d.ts +42 -0
- package/dist/plot/sankey/sankey-types.js +4 -0
- package/dist/plot/sankey/sankey.d.ts +52 -0
- package/dist/plot/sankey/sankey.js +189 -0
- package/dist/plot/{BinnedScatterPlot.svelte → scatter/BinnedScatterPlot.svelte} +64 -64
- package/dist/plot/{BinnedScatterPlot.svelte.d.ts → scatter/BinnedScatterPlot.svelte.d.ts} +6 -6
- package/dist/plot/{ElementScatter.svelte → scatter/ElementScatter.svelte} +6 -6
- package/dist/plot/{ElementScatter.svelte.d.ts → scatter/ElementScatter.svelte.d.ts} +2 -2
- package/dist/plot/{ScatterPlot.svelte → scatter/ScatterPlot.svelte} +297 -1008
- package/dist/plot/{ScatterPlot.svelte.d.ts → scatter/ScatterPlot.svelte.d.ts} +10 -18
- package/dist/plot/{ScatterPlotControls.svelte → scatter/ScatterPlotControls.svelte} +6 -5
- package/dist/plot/{ScatterPlotControls.svelte.d.ts → scatter/ScatterPlotControls.svelte.d.ts} +2 -2
- package/dist/plot/{ScatterPoint.svelte → scatter/ScatterPoint.svelte} +7 -7
- package/dist/plot/{ScatterPoint.svelte.d.ts → scatter/ScatterPoint.svelte.d.ts} +3 -3
- package/dist/plot/{adaptive-density.d.ts → scatter/adaptive-density.d.ts} +14 -4
- package/dist/plot/{adaptive-density.js → scatter/adaptive-density.js} +46 -20
- package/dist/plot/{binned-scatter-types.d.ts → scatter/binned-scatter-types.d.ts} +5 -12
- package/dist/plot/scatter/index.d.ts +7 -0
- package/dist/plot/scatter/index.js +5 -0
- package/dist/plot/scatter/scatter-data.d.ts +19 -0
- package/dist/plot/scatter/scatter-data.js +212 -0
- package/dist/plot/{ScatterPlot3D.svelte → scatter-3d/ScatterPlot3D.svelte} +25 -34
- package/dist/plot/{ScatterPlot3D.svelte.d.ts → scatter-3d/ScatterPlot3D.svelte.d.ts} +9 -17
- package/dist/plot/{ScatterPlot3DControls.svelte → scatter-3d/ScatterPlot3DControls.svelte} +14 -14
- package/dist/plot/{ScatterPlot3DControls.svelte.d.ts → scatter-3d/ScatterPlot3DControls.svelte.d.ts} +6 -6
- package/dist/plot/{ScatterPlot3DScene.svelte → scatter-3d/ScatterPlot3DScene.svelte} +129 -128
- package/dist/plot/{ScatterPlot3DScene.svelte.d.ts → scatter-3d/ScatterPlot3DScene.svelte.d.ts} +6 -15
- package/dist/plot/{Surface3D.svelte → scatter-3d/Surface3D.svelte} +7 -6
- package/dist/plot/{Surface3D.svelte.d.ts → scatter-3d/Surface3D.svelte.d.ts} +5 -4
- package/dist/plot/scatter-3d/index.d.ts +4 -0
- package/dist/plot/scatter-3d/index.js +4 -0
- package/dist/plot/sunburst/Sunburst.svelte +1041 -0
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +97 -0
- package/dist/plot/sunburst/SunburstControls.svelte +200 -0
- package/dist/plot/sunburst/SunburstControls.svelte.d.ts +26 -0
- package/dist/plot/sunburst/index.d.ts +4 -0
- package/dist/plot/sunburst/index.js +4 -0
- package/dist/plot/sunburst/render.d.ts +34 -0
- package/dist/plot/sunburst/render.js +122 -0
- package/dist/plot/sunburst/sunburst.d.ts +62 -0
- package/dist/plot/sunburst/sunburst.js +269 -0
- package/dist/rdf/RdfPlot.svelte +2 -1
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/calc-rdf.js +11 -24
- package/dist/sanitize.js +14 -3
- package/dist/scene/SceneCamera.svelte +62 -0
- package/dist/scene/SceneCamera.svelte.d.ts +19 -0
- package/dist/scene/bind-renderer.svelte.d.ts +2 -0
- package/dist/scene/bind-renderer.svelte.js +14 -0
- package/dist/scene/index.d.ts +4 -0
- package/dist/scene/index.js +5 -0
- package/dist/scene/props.js +52 -0
- package/dist/scene/types.d.ts +26 -0
- package/dist/scene/types.js +1 -0
- package/dist/settings.d.ts +79 -3
- package/dist/settings.js +321 -1
- package/dist/spectral/Bands.svelte +47 -36
- package/dist/spectral/Bands.svelte.d.ts +6 -6
- package/dist/spectral/BandsAndDos.svelte +23 -25
- package/dist/spectral/BrillouinBandsDos.svelte +42 -30
- package/dist/spectral/Dos.svelte +15 -23
- package/dist/spectral/Dos.svelte.d.ts +4 -3
- package/dist/spectral/helpers.d.ts +8 -6
- package/dist/spectral/helpers.js +137 -65
- package/dist/state.svelte.d.ts +0 -7
- package/dist/state.svelte.js +0 -6
- package/dist/structure/Arrow.svelte +2 -4
- package/dist/structure/AtomLegend.svelte +8 -9
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/CanvasTooltip.svelte +1 -0
- package/dist/structure/CellSelect.svelte +12 -5
- package/dist/structure/CellSelect.svelte.d.ts +2 -1
- package/dist/structure/Cylinder.svelte +12 -8
- package/dist/structure/Cylinder.svelte.d.ts +4 -1
- package/dist/structure/Lattice.svelte +2 -2
- package/dist/structure/Structure.svelte +365 -423
- package/dist/structure/Structure.svelte.d.ts +5 -15
- package/dist/structure/StructureControls.svelte +217 -2
- package/dist/structure/StructureControls.svelte.d.ts +5 -3
- package/dist/structure/StructureExportPane.svelte +54 -156
- package/dist/structure/StructureExportPane.svelte.d.ts +4 -5
- package/dist/structure/StructureInfoPane.svelte +10 -9
- package/dist/structure/StructureInfoPane.svelte.d.ts +5 -5
- package/dist/structure/StructureScene.svelte +376 -208
- package/dist/structure/StructureScene.svelte.d.ts +22 -20
- package/dist/structure/{label-placement.d.ts → atom-label-placement.d.ts} +3 -3
- package/dist/structure/{label-placement.js → atom-label-placement.js} +15 -5
- package/dist/structure/atom-properties.d.ts +1 -1
- package/dist/structure/atom-properties.js +17 -22
- package/dist/structure/bond-order-perception.js +3 -5
- package/dist/structure/bonding.d.ts +4 -0
- package/dist/structure/bonding.js +134 -63
- package/dist/structure/export.d.ts +24 -4
- package/dist/structure/export.js +89 -143
- package/dist/structure/index.d.ts +4 -4
- package/dist/structure/index.js +3 -3
- package/dist/structure/measure.d.ts +3 -2
- package/dist/structure/measure.js +6 -5
- package/dist/structure/parse.d.ts +3 -2
- package/dist/structure/parse.js +419 -438
- package/dist/structure/partial-occupancy.d.ts +0 -1
- package/dist/structure/partial-occupancy.js +1 -1
- package/dist/structure/pbc.d.ts +1 -1
- package/dist/structure/pbc.js +190 -13
- package/dist/structure/polyhedra.d.ts +41 -0
- package/dist/structure/polyhedra.js +602 -0
- package/dist/structure/site.d.ts +4 -0
- package/dist/structure/site.js +1 -0
- package/dist/structure/supercell.js +3 -2
- package/dist/structure/validation.js +5 -6
- package/dist/symmetry/SymmetryElementControls.svelte +69 -0
- package/dist/symmetry/SymmetryElementControls.svelte.d.ts +9 -0
- package/dist/symmetry/SymmetryElements.svelte +354 -0
- package/dist/symmetry/SymmetryElements.svelte.d.ts +24 -0
- package/dist/symmetry/SymmetryStats.svelte +113 -8
- package/dist/symmetry/WyckoffTable.svelte +68 -7
- package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -0
- package/dist/symmetry/cell-transform.js +7 -14
- package/dist/symmetry/index.d.ts +14 -4
- package/dist/symmetry/index.js +291 -72
- package/dist/symmetry/spacegroups.d.ts +12 -1
- package/dist/symmetry/spacegroups.js +63 -14
- package/dist/symmetry/symmetry-elements.d.ts +33 -0
- package/dist/symmetry/symmetry-elements.js +521 -0
- package/dist/symmetry/wyckoff-db.d.ts +9 -0
- package/dist/symmetry/wyckoff-db.js +87 -0
- package/dist/table/HeatmapTable.svelte +66 -25
- package/dist/table/HeatmapTable.svelte.d.ts +1 -1
- package/dist/table/index.d.ts +1 -3
- package/dist/table/index.js +1 -1
- package/dist/theme/index.js +8 -8
- package/dist/tooltip/KCoords.svelte +45 -0
- package/dist/tooltip/KCoords.svelte.d.ts +8 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/trajectory/Trajectory.svelte +123 -100
- package/dist/trajectory/Trajectory.svelte.d.ts +11 -22
- package/dist/trajectory/TrajectoryExportPane.svelte +17 -25
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +4 -5
- package/dist/trajectory/TrajectoryInfoPane.svelte +5 -3
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -2
- package/dist/trajectory/constants.js +6 -2
- package/dist/trajectory/extract.js +17 -37
- package/dist/trajectory/format-detect.d.ts +1 -1
- package/dist/trajectory/format-detect.js +27 -19
- package/dist/trajectory/frame-reader.d.ts +0 -1
- package/dist/trajectory/frame-reader.js +63 -162
- package/dist/trajectory/helpers.d.ts +10 -2
- package/dist/trajectory/helpers.js +56 -36
- package/dist/trajectory/index.js +1 -1
- package/dist/trajectory/parse/ase.d.ts +9 -1
- package/dist/trajectory/parse/ase.js +47 -32
- package/dist/trajectory/parse/diagnostics.d.ts +3 -0
- package/dist/trajectory/parse/diagnostics.js +14 -0
- package/dist/trajectory/parse/hdf5.js +1 -1
- package/dist/trajectory/parse/index.d.ts +1 -1
- package/dist/trajectory/parse/index.js +65 -105
- package/dist/trajectory/parse/lammps.d.ts +0 -2
- package/dist/trajectory/parse/lammps.js +8 -6
- package/dist/trajectory/parse/pymatgen.d.ts +2 -0
- package/dist/trajectory/parse/pymatgen.js +74 -0
- package/dist/trajectory/parse/vasp.js +38 -18
- package/dist/trajectory/parse/xyz.d.ts +13 -1
- package/dist/trajectory/parse/xyz.js +102 -94
- package/dist/trajectory/plotting.d.ts +1 -2
- package/dist/trajectory/plotting.js +16 -113
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +7 -5
- package/dist/xrd/XrdPlot.svelte +16 -30
- package/dist/xrd/broadening.d.ts +2 -1
- package/dist/xrd/calc-xrd.js +18 -20
- package/dist/xrd/index.d.ts +2 -2
- package/dist/xrd/parse.js +2 -2
- package/package.json +43 -26
- package/dist/element/data.json +0 -11864
- package/dist/fermi-surface/marching-cubes.d.ts +0 -2
- package/dist/fermi-surface/marching-cubes.js +0 -2
- package/dist/plot/PlotControls.svelte.d.ts +0 -4
- package/dist/plot/axis-utils.d.ts +0 -19
- package/dist/plot/axis-utils.js +0 -78
- package/dist/plot/defaults.d.ts +0 -19
- package/dist/plot/defaults.js +0 -9
- package/dist/plot/fill-utils.d.ts +0 -46
- package/dist/plot/fill-utils.js +0 -322
- package/dist/plot/hover-lock.svelte.d.ts +0 -14
- package/dist/plot/hover-lock.svelte.js +0 -46
- package/dist/plot/interactions.d.ts +0 -12
- package/dist/plot/interactions.js +0 -101
- package/dist/plot/scales.d.ts +0 -48
- package/dist/plot/svg.d.ts +0 -1
- package/dist/plot/svg.js +0 -11
- package/dist/plot/utils/series-visibility.d.ts +0 -15
- package/dist/plot/utils.d.ts +0 -1
- package/dist/plot/utils.js +0 -14
- /package/dist/plot/{PortalSelect.svelte.d.ts → core/components/PortalSelect.svelte.d.ts} +0 -0
- /package/dist/plot/{binned-scatter-types.js → scatter/binned-scatter-types.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { luminance, watch_dark_mode } from '../colors'
|
|
3
3
|
import Icon from '../Icon.svelte'
|
|
4
|
+
import { download } from '../io/fetch'
|
|
4
5
|
import { format_num } from '../labels'
|
|
5
6
|
import { SettingsSection } from '../layout'
|
|
6
7
|
import ContextMenu from '../overlays/ContextMenu.svelte'
|
|
@@ -32,6 +33,57 @@
|
|
|
32
33
|
const is_invalid = (val: unknown) =>
|
|
33
34
|
val == null || (typeof val === `number` && Number.isNaN(val))
|
|
34
35
|
|
|
36
|
+
// tooltip() wires [title]/[aria-label]/[data-title] elements once when it runs.
|
|
37
|
+
// Table cells are replaced when the table re-renders (sort, filter, data or
|
|
38
|
+
// pagination changes), which would silently drop their tooltips. Observe the
|
|
39
|
+
// container and incrementally wire newly added elements / unwire removed ones,
|
|
40
|
+
// instead of tearing down and rebuilding every tooltip on each unrelated DOM
|
|
41
|
+
// mutation (dropdowns, panes, pagination, context menu).
|
|
42
|
+
const tooltip_selector = `[title], [aria-label], [data-title]`
|
|
43
|
+
function table_tooltips(node: HTMLElement) {
|
|
44
|
+
const options = { allow_html: true } as const
|
|
45
|
+
// Per-element cleanups so individual nodes can be unwired as they leave the DOM.
|
|
46
|
+
const wired = new SvelteMap<Element, () => void>()
|
|
47
|
+
|
|
48
|
+
const wire = (root: Element) => {
|
|
49
|
+
const targets = root.matches(tooltip_selector)
|
|
50
|
+
? [root, ...root.querySelectorAll(tooltip_selector)]
|
|
51
|
+
: [...root.querySelectorAll(tooltip_selector)]
|
|
52
|
+
for (const el of targets) {
|
|
53
|
+
if (!(el instanceof HTMLElement) || wired.has(el)) continue
|
|
54
|
+
// tooltip() only mutates attributes (title -> data-original-title), never
|
|
55
|
+
// childList, so wiring here can't re-trigger the childList observer below.
|
|
56
|
+
const cleanup = tooltip(options)(el)
|
|
57
|
+
if (cleanup) wired.set(el, cleanup)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
wire(node)
|
|
62
|
+
const observer = new MutationObserver((mutations) => {
|
|
63
|
+
// Unwire elements that left the DOM. isConnected stays true for moved nodes
|
|
64
|
+
// (e.g. row reordering on sort), so those keep their tooltips without churn.
|
|
65
|
+
// Deleting the current entry mid-iteration is safe for Map.
|
|
66
|
+
for (const [el, cleanup] of wired) {
|
|
67
|
+
if (!el.isConnected) {
|
|
68
|
+
cleanup()
|
|
69
|
+
wired.delete(el)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Wire only the freshly added subtrees, not the whole container.
|
|
73
|
+
for (const { addedNodes } of mutations) {
|
|
74
|
+
for (const added of addedNodes) {
|
|
75
|
+
if (added instanceof Element) wire(added)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
observer.observe(node, { childList: true, subtree: true })
|
|
80
|
+
return () => {
|
|
81
|
+
observer.disconnect()
|
|
82
|
+
for (const cleanup of wired.values()) cleanup()
|
|
83
|
+
wired.clear()
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
35
87
|
const NUMERIC_WITH_ERROR_RE =
|
|
36
88
|
/^([-+−]?(?:\d+\.?\d*|\d*\.\d+)(?:[eE][-+−]?\d+)?)\s*(?:±|\+[-−]|\()/
|
|
37
89
|
|
|
@@ -484,7 +536,7 @@
|
|
|
484
536
|
|
|
485
537
|
// Push invalid values to bottom
|
|
486
538
|
if (is_invalid(val1) || is_invalid(val2)) {
|
|
487
|
-
return
|
|
539
|
+
return Number(is_invalid(val1)) - Number(is_invalid(val2))
|
|
488
540
|
}
|
|
489
541
|
|
|
490
542
|
const sort_val1 = get_sort_val(val1)
|
|
@@ -497,10 +549,11 @@
|
|
|
497
549
|
sensitivity: `base`,
|
|
498
550
|
})
|
|
499
551
|
if (cmp !== 0) return cmp * modifier
|
|
500
|
-
} else {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
552
|
+
} else if (typeof sort_val1 !== typeof sort_val2) {
|
|
553
|
+
// number<string is false both ways, breaking the comparator: numbers sort first
|
|
554
|
+
return (typeof sort_val1 === `number` ? -1 : 1) * modifier
|
|
555
|
+
} else if (sort_val1 !== sort_val2) {
|
|
556
|
+
return (sort_val1 ?? 0) < (sort_val2 ?? 0) ? -modifier : modifier
|
|
504
557
|
}
|
|
505
558
|
}
|
|
506
559
|
return 0
|
|
@@ -558,7 +611,7 @@
|
|
|
558
611
|
// Shift+click for multi-column sort
|
|
559
612
|
if (event.shiftKey) {
|
|
560
613
|
const existing_idx = multi_sort.findIndex((sort_entry) => sort_entry.column === col_id)
|
|
561
|
-
if (existing_idx
|
|
614
|
+
if (existing_idx !== -1) {
|
|
562
615
|
// Toggle direction or remove if clicked again
|
|
563
616
|
const existing = multi_sort[existing_idx]
|
|
564
617
|
if (existing.ascending === (col.better === `lower`)) {
|
|
@@ -684,7 +737,7 @@
|
|
|
684
737
|
|
|
685
738
|
// Check multi-sort first
|
|
686
739
|
const multi_idx = multi_sort.findIndex((sort_entry) => sort_entry.column === col_id)
|
|
687
|
-
if (multi_idx
|
|
740
|
+
if (multi_idx !== -1) {
|
|
688
741
|
const arrow = multi_sort[multi_idx].ascending ? `↓` : `↑`
|
|
689
742
|
const badge = multi_sort.length > 1 ? `<sup>${multi_idx + 1}</sup>` : ``
|
|
690
743
|
return `<span style="font-size: 0.8em;">${arrow}${badge}</span>`
|
|
@@ -716,8 +769,8 @@
|
|
|
716
769
|
function toggle_row_select(row: RowData) {
|
|
717
770
|
const row_id = get_row_id(row)
|
|
718
771
|
const idx = selected_rows.findIndex((selected_row) => get_row_id(selected_row) === row_id)
|
|
719
|
-
if (idx
|
|
720
|
-
selected_rows = selected_rows.filter((_,
|
|
772
|
+
if (idx !== -1) {
|
|
773
|
+
selected_rows = selected_rows.filter((_, row_idx) => row_idx !== idx)
|
|
721
774
|
} else {
|
|
722
775
|
selected_rows = [...selected_rows, row]
|
|
723
776
|
}
|
|
@@ -755,7 +808,7 @@
|
|
|
755
808
|
const quote = (str: string) => {
|
|
756
809
|
if (!csv_quote) return str
|
|
757
810
|
if (str.includes(`,`) || str.includes(`"`) || str.includes(`\n`)) {
|
|
758
|
-
return `"${str.
|
|
811
|
+
return `"${str.replaceAll('"', `""`)}"`
|
|
759
812
|
}
|
|
760
813
|
return str
|
|
761
814
|
}
|
|
@@ -771,7 +824,7 @@
|
|
|
771
824
|
}
|
|
772
825
|
|
|
773
826
|
function export_csv(filename = `table-export`) {
|
|
774
|
-
|
|
827
|
+
download(serialize_table(`,`, true), `${filename}.csv`, `text/csv`)
|
|
775
828
|
}
|
|
776
829
|
|
|
777
830
|
function export_json(filename = `table-export`) {
|
|
@@ -786,25 +839,13 @@
|
|
|
786
839
|
}
|
|
787
840
|
return clean_row
|
|
788
841
|
})
|
|
789
|
-
|
|
842
|
+
download(
|
|
790
843
|
JSON.stringify(rows, null, 2),
|
|
791
844
|
`${filename}.json`,
|
|
792
845
|
`application/json`,
|
|
793
846
|
)
|
|
794
847
|
}
|
|
795
848
|
|
|
796
|
-
function download_file(content: string, filename: string, mime_type: string) {
|
|
797
|
-
const blob = new Blob([content], { type: mime_type })
|
|
798
|
-
const url = URL.createObjectURL(blob)
|
|
799
|
-
const link = document.createElement(`a`)
|
|
800
|
-
link.href = url
|
|
801
|
-
link.download = filename
|
|
802
|
-
document.body.appendChild(link)
|
|
803
|
-
link.click()
|
|
804
|
-
document.body.removeChild(link)
|
|
805
|
-
URL.revokeObjectURL(url)
|
|
806
|
-
}
|
|
807
|
-
|
|
808
849
|
function copy_to_clipboard() {
|
|
809
850
|
navigator.clipboard.writeText(serialize_table(`\t`))
|
|
810
851
|
}
|
|
@@ -869,7 +910,7 @@
|
|
|
869
910
|
{/snippet}
|
|
870
911
|
|
|
871
912
|
<div
|
|
872
|
-
{@attach
|
|
913
|
+
{@attach table_tooltips}
|
|
873
914
|
{...rest_props}
|
|
874
915
|
bind:this={container_el}
|
|
875
916
|
class="table-container {rest_props.class ?? ``}"
|
|
@@ -44,6 +44,6 @@ type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
44
44
|
}]>;
|
|
45
45
|
footer?: Snippet;
|
|
46
46
|
};
|
|
47
|
-
declare const HeatmapTable: import("svelte").Component<$$ComponentProps, {}, "sort" | "data" | "show_controls" | "
|
|
47
|
+
declare const HeatmapTable: import("svelte").Component<$$ComponentProps, {}, "sort" | "data" | "show_controls" | "controls_open" | "loading" | "show_heatmap" | "column_order" | "selected_rows" | "hidden_columns" | "heatmap_opacity">;
|
|
48
48
|
type HeatmapTable = ReturnType<typeof HeatmapTable>;
|
|
49
49
|
export default HeatmapTable;
|
package/dist/table/index.d.ts
CHANGED
|
@@ -2,9 +2,7 @@ import * as d3sc from 'd3-scale-chromatic';
|
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
export { default as HeatmapTable } from './HeatmapTable.svelte';
|
|
4
4
|
export { default as ToggleMenu } from './ToggleMenu.svelte';
|
|
5
|
-
export type CellVal = string | number | boolean | undefined | null | Record<string, unknown> |
|
|
6
|
-
[key: string]: string | number | null | undefined | boolean;
|
|
7
|
-
}[];
|
|
5
|
+
export type CellVal = string | number | boolean | undefined | null | Record<string, unknown> | Record<string, string | number | null | undefined | boolean>[];
|
|
8
6
|
export type RowData = {
|
|
9
7
|
style?: string;
|
|
10
8
|
class?: string;
|
package/dist/table/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as d3sc from 'd3-scale-chromatic';
|
|
|
5
5
|
export { default as HeatmapTable } from './HeatmapTable.svelte';
|
|
6
6
|
export { default as ToggleMenu } from './ToggleMenu.svelte';
|
|
7
7
|
// Strip HTML tags from a string (for search, export, etc.)
|
|
8
|
-
export const strip_html = (str) => str.
|
|
8
|
+
export const strip_html = (str) => str.replaceAll(/<[^>]*>/g, ``);
|
|
9
9
|
// Calculate table cell background color based on its value and column config
|
|
10
10
|
export function calc_cell_color(val, // cell value
|
|
11
11
|
all_values, // all values in the column
|
package/dist/theme/index.js
CHANGED
|
@@ -33,7 +33,7 @@ export const get_theme_preference = () => {
|
|
|
33
33
|
return AUTO_THEME;
|
|
34
34
|
try {
|
|
35
35
|
const saved = localStorage[storage_key];
|
|
36
|
-
return is_valid_theme_mode(saved
|
|
36
|
+
return is_valid_theme_mode(saved ?? ``) ? saved : AUTO_THEME;
|
|
37
37
|
}
|
|
38
38
|
catch {
|
|
39
39
|
return AUTO_THEME;
|
|
@@ -57,8 +57,8 @@ export const apply_theme_to_dom = (mode) => {
|
|
|
57
57
|
if (!resolved || !(resolved in THEME_TYPE)) {
|
|
58
58
|
throw new Error(`Invalid theme mode: ${resolved}`);
|
|
59
59
|
}
|
|
60
|
-
const theme = globalThis.MATTERVIZ_THEMES?.[resolved]
|
|
61
|
-
const css_vars = globalThis.MATTERVIZ_CSS_MAP
|
|
60
|
+
const theme = globalThis.MATTERVIZ_THEMES?.[resolved] ?? {};
|
|
61
|
+
const css_vars = globalThis.MATTERVIZ_CSS_MAP ?? {};
|
|
62
62
|
const root = document.documentElement;
|
|
63
63
|
Object.entries(theme).forEach(([key, value]) => {
|
|
64
64
|
const css_var = css_vars[key];
|
|
@@ -72,8 +72,8 @@ export const apply_theme_to_dom = (mode) => {
|
|
|
72
72
|
root.style.setProperty(`color-scheme`, color_scheme);
|
|
73
73
|
};
|
|
74
74
|
// Theme getters
|
|
75
|
-
export const light_theme = () => globalThis.MATTERVIZ_THEMES?.[COLOR_THEMES.light]
|
|
76
|
-
export const dark_theme = () => globalThis.MATTERVIZ_THEMES?.[COLOR_THEMES.dark]
|
|
77
|
-
export const white_theme = () => globalThis.MATTERVIZ_THEMES?.[COLOR_THEMES.white]
|
|
78
|
-
export const black_theme = () => globalThis.MATTERVIZ_THEMES?.[COLOR_THEMES.black]
|
|
79
|
-
export const get_theme_by_name = (name) => globalThis.MATTERVIZ_THEMES?.[name]
|
|
75
|
+
export const light_theme = () => globalThis.MATTERVIZ_THEMES?.[COLOR_THEMES.light] ?? {};
|
|
76
|
+
export const dark_theme = () => globalThis.MATTERVIZ_THEMES?.[COLOR_THEMES.dark] ?? {};
|
|
77
|
+
export const white_theme = () => globalThis.MATTERVIZ_THEMES?.[COLOR_THEMES.white] ?? {};
|
|
78
|
+
export const black_theme = () => globalThis.MATTERVIZ_THEMES?.[COLOR_THEMES.black] ?? {};
|
|
79
|
+
export const get_theme_by_name = (name) => globalThis.MATTERVIZ_THEMES?.[name] ?? {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Shared k-point coordinate rows for hover tooltips (Brillouin zone + Fermi surface)
|
|
3
|
+
import { format_vec3 } from '../labels'
|
|
4
|
+
import type { Vec3 } from '../math'
|
|
5
|
+
|
|
6
|
+
let { cartesian, fractional = null }: {
|
|
7
|
+
cartesian: Vec3
|
|
8
|
+
fractional?: Vec3 | null
|
|
9
|
+
} = $props()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div class="k-coord-row">
|
|
13
|
+
<span class="k-coord-label"><span class="vec">k</span> (Å⁻¹):</span>
|
|
14
|
+
<span>{format_vec3(cartesian)}</span>
|
|
15
|
+
</div>
|
|
16
|
+
{#if fractional}
|
|
17
|
+
<div class="k-coord-row">
|
|
18
|
+
<span class="k-coord-label"><span class="vec">k</span> (frac):</span>
|
|
19
|
+
<span>{format_vec3(fractional)}</span>
|
|
20
|
+
</div>
|
|
21
|
+
{/if}
|
|
22
|
+
|
|
23
|
+
<style>
|
|
24
|
+
.k-coord-row {
|
|
25
|
+
display: flex;
|
|
26
|
+
gap: 4px;
|
|
27
|
+
}
|
|
28
|
+
.k-coord-label {
|
|
29
|
+
opacity: 0.8;
|
|
30
|
+
min-width: 50px;
|
|
31
|
+
}
|
|
32
|
+
.vec {
|
|
33
|
+
position: relative;
|
|
34
|
+
font-style: italic;
|
|
35
|
+
}
|
|
36
|
+
.vec::after {
|
|
37
|
+
content: '→';
|
|
38
|
+
position: absolute;
|
|
39
|
+
left: 50%;
|
|
40
|
+
top: -0.85em;
|
|
41
|
+
transform: translateX(-50%);
|
|
42
|
+
font-size: 0.6em;
|
|
43
|
+
font-style: normal;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Vec3 } from '../math';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
cartesian: Vec3;
|
|
4
|
+
fractional?: Vec3 | null;
|
|
5
|
+
};
|
|
6
|
+
declare const KCoords: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type KCoords = ReturnType<typeof KCoords>;
|
|
8
|
+
export default KCoords;
|
package/dist/tooltip/index.d.ts
CHANGED
package/dist/tooltip/index.js
CHANGED