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,7 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type ShowControlsProp } from '../controls';
|
|
2
|
+
import { type ElementSymbol } from '../element';
|
|
3
3
|
import Spinner from '../feedback/Spinner.svelte';
|
|
4
4
|
import type { IsosurfaceSettings, VolumetricData } from '../isosurface/types';
|
|
5
|
+
import { type FullscreenToggleProp } from '../layout';
|
|
5
6
|
import type { AnyStructure, BondEditMode, BondOrder, MeasureMode, StructureBond } from './';
|
|
6
7
|
import type { CellType, SymmetrySettings } from '../symmetry';
|
|
7
8
|
import type { MoyoDataset } from '@spglib/moyo-wasm';
|
|
@@ -17,15 +18,6 @@ type $$ComponentProps = {
|
|
|
17
18
|
structure?: AnyStructure;
|
|
18
19
|
bonds?: StructureBond[];
|
|
19
20
|
scene_props?: ComponentProps<typeof StructureScene>;
|
|
20
|
-
/**
|
|
21
|
-
* Controls visibility configuration.
|
|
22
|
-
* - 'always': controls always visible
|
|
23
|
-
* - 'hover': controls visible on component hover (default)
|
|
24
|
-
* - 'never': controls never visible
|
|
25
|
-
* - object: { mode, hidden, style } for fine-grained control
|
|
26
|
-
*
|
|
27
|
-
* Control names: 'reset-camera', 'fullscreen', 'measure-mode', 'info-pane', 'export-pane', 'controls'
|
|
28
|
-
*/
|
|
29
21
|
show_controls?: ShowControlsProp;
|
|
30
22
|
fullscreen?: boolean;
|
|
31
23
|
width?: number;
|
|
@@ -42,9 +34,7 @@ type $$ComponentProps = {
|
|
|
42
34
|
bond_edit_mode?: BondEditMode;
|
|
43
35
|
bond_edit_order?: BondOrder;
|
|
44
36
|
info_pane_open?: boolean;
|
|
45
|
-
fullscreen_toggle?:
|
|
46
|
-
fullscreen: boolean;
|
|
47
|
-
}]> | boolean;
|
|
37
|
+
fullscreen_toggle?: FullscreenToggleProp;
|
|
48
38
|
bottom_left?: Snippet<[{
|
|
49
39
|
structure?: AnyStructure;
|
|
50
40
|
}]>;
|
|
@@ -84,6 +74,6 @@ type $$ComponentProps = {
|
|
|
84
74
|
on_camera_reset?: EventHandler;
|
|
85
75
|
on_bonds_change?: (bonds: StructureBond[] | undefined) => void;
|
|
86
76
|
} & Omit<ComponentProps<typeof StructureControls>, `children` | `onclose`> & Omit<HTMLAttributes<HTMLDivElement>, `children`>;
|
|
87
|
-
declare const Structure: import("svelte").Component<$$ComponentProps, {}, "structure" | "height" | "width" | "dragover" | "
|
|
77
|
+
declare const Structure: import("svelte").Component<$$ComponentProps, {}, "structure" | "height" | "width" | "dragover" | "color_scheme" | "fullscreen" | "wrapper" | "hovered" | "controls_open" | "bonds" | "sym_data" | "background_color" | "background_opacity" | "atom_color_config" | "hidden_elements" | "hidden_prop_vals" | "element_mapping" | "element_radius_overrides" | "site_radius_overrides" | "selected_sites" | "supercell_scaling" | "cell_type" | "loading" | "active_volume_idx" | "measured_sites" | "bond_edit_mode" | "scene_props" | "lattice_props" | "show_image_atoms" | "volumetric_data" | "isosurface_settings" | "png_dpi" | "highlighted_sites" | "hovered_site_idx" | "measure_mode" | "bond_edit_order" | "info_pane_open" | "enable_measure_mode" | "error_msg" | "performance_mode" | "displayed_structure" | "symmetry_settings">;
|
|
88
78
|
type Structure = ReturnType<typeof Structure>;
|
|
89
79
|
export default Structure;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { PaneProps, PaneToggleProps } from '../overlays'
|
|
2
3
|
import type { ColorSchemeName, D3InterpolateName } from '../colors'
|
|
3
4
|
import { AXIS_COLORS, ELEMENT_COLOR_SCHEMES } from '../colors'
|
|
4
5
|
import IsosurfaceControls from '../isosurface/IsosurfaceControls.svelte'
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
VECTOR_PALETTE,
|
|
20
21
|
} from './'
|
|
21
22
|
import type { AtomColorConfig } from './atom-properties'
|
|
23
|
+
import { get_majority_element } from './bonding'
|
|
22
24
|
import { is_valid_supercell_input } from './supercell'
|
|
23
25
|
import type { CellType } from '../symmetry'
|
|
24
26
|
import type { MoyoDataset } from '@spglib/moyo-wasm'
|
|
@@ -54,6 +56,7 @@
|
|
|
54
56
|
volumetric_data = $bindable<VolumetricData[]>(),
|
|
55
57
|
isosurface_settings = $bindable<IsosurfaceSettings>(),
|
|
56
58
|
active_volume_idx = $bindable(0),
|
|
59
|
+
polyhedra_rendered_elements = [],
|
|
57
60
|
pane_props = {},
|
|
58
61
|
toggle_props = {},
|
|
59
62
|
...rest
|
|
@@ -74,8 +77,9 @@
|
|
|
74
77
|
volumetric_data?: VolumetricData[] // Volumetric data volumes for isosurface controls
|
|
75
78
|
isosurface_settings?: IsosurfaceSettings // Isosurface rendering settings
|
|
76
79
|
active_volume_idx?: number // Active volume index
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
polyhedra_rendered_elements?: string[] // elements currently anchoring polyhedra
|
|
81
|
+
pane_props?: PaneProps
|
|
82
|
+
toggle_props?: PaneToggleProps
|
|
79
83
|
} = $props()
|
|
80
84
|
|
|
81
85
|
// Color scheme selection state
|
|
@@ -112,6 +116,44 @@
|
|
|
112
116
|
}
|
|
113
117
|
})
|
|
114
118
|
|
|
119
|
+
// Unique majority elements in the structure, for polyhedra center toggles.
|
|
120
|
+
// Majority (not all) species so the list matches what compute_polyhedra can
|
|
121
|
+
// actually use as centers - minority occupancies of disordered sites never are.
|
|
122
|
+
let structure_elements = $derived(
|
|
123
|
+
[
|
|
124
|
+
...new Set(
|
|
125
|
+
(structure?.sites ?? []).flatMap((site) => get_majority_element(site) ?? []),
|
|
126
|
+
),
|
|
127
|
+
].sort(),
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
// An element counts as an enabled polyhedra center if it isn't excluded and is
|
|
131
|
+
// either force-included or currently rendered. Using configured intent (not just
|
|
132
|
+
// the transient render state) keeps the checkbox reversible: a force-included
|
|
133
|
+
// element that the CN/geometry filters can't render still shows checked, so the
|
|
134
|
+
// user can toggle it back off.
|
|
135
|
+
const is_polyhedra_center_enabled = (element: string): boolean => {
|
|
136
|
+
const excluded = scene_props.polyhedra_excluded_elements ?? []
|
|
137
|
+
const included = scene_props.polyhedra_included_elements ?? []
|
|
138
|
+
return !excluded.includes(element) &&
|
|
139
|
+
(included.includes(element) || polyhedra_rendered_elements.includes(element))
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Toggle an element as polyhedra center. Enabled elements get excluded; disabled
|
|
143
|
+
// ones get force-included (which also bypasses the automatic hiding of spectator
|
|
144
|
+
// cations like Li/Na/Ba).
|
|
145
|
+
function toggle_polyhedra_element(element: string) {
|
|
146
|
+
const excluded = scene_props.polyhedra_excluded_elements ?? []
|
|
147
|
+
const included = scene_props.polyhedra_included_elements ?? []
|
|
148
|
+
if (is_polyhedra_center_enabled(element)) {
|
|
149
|
+
scene_props.polyhedra_excluded_elements = [...new Set([...excluded, element])]
|
|
150
|
+
scene_props.polyhedra_included_elements = included.filter((el) => el !== element)
|
|
151
|
+
} else {
|
|
152
|
+
scene_props.polyhedra_excluded_elements = excluded.filter((el) => el !== element)
|
|
153
|
+
scene_props.polyhedra_included_elements = [...new Set([...included, element])]
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
115
157
|
const hex_color_pattern = /^#[0-9a-f]{3}([0-9a-f]{3})?$/i
|
|
116
158
|
const color_mix_pattern =
|
|
117
159
|
/^color-mix\(in srgb,\s*(#[0-9a-f]{3}(?:[0-9a-f]{3})?)\s+(\d+(?:\.\d+)?)%,\s*transparent\)$/i
|
|
@@ -293,6 +335,7 @@
|
|
|
293
335
|
current_values={{
|
|
294
336
|
show_atoms: scene_props.show_atoms,
|
|
295
337
|
show_bonds: scene_props.show_bonds,
|
|
338
|
+
show_polyhedra: scene_props.show_polyhedra,
|
|
296
339
|
show_image_atoms,
|
|
297
340
|
show_site_labels: scene_props.show_site_labels,
|
|
298
341
|
show_site_indices: scene_props.show_site_indices,
|
|
@@ -302,6 +345,7 @@
|
|
|
302
345
|
on_reset={() => {
|
|
303
346
|
scene_props.show_atoms = DEFAULTS.structure.show_atoms
|
|
304
347
|
scene_props.show_bonds = DEFAULTS.structure.show_bonds
|
|
348
|
+
scene_props.show_polyhedra = DEFAULTS.structure.show_polyhedra
|
|
305
349
|
scene_props.show_site_labels = DEFAULTS.structure.show_site_labels
|
|
306
350
|
scene_props.show_site_indices = DEFAULTS.structure.show_site_indices
|
|
307
351
|
scene_props.vector_configs = default_vector_configs(available_vector_keys)
|
|
@@ -394,6 +438,20 @@
|
|
|
394
438
|
{/each}
|
|
395
439
|
</select>
|
|
396
440
|
</label>
|
|
441
|
+
<label
|
|
442
|
+
{@attach tooltip({ content: SETTINGS_CONFIG.structure.show_polyhedra.description })}
|
|
443
|
+
style="gap: 6pt"
|
|
444
|
+
>
|
|
445
|
+
Polyhedra:
|
|
446
|
+
<select bind:value={scene_props.show_polyhedra}>
|
|
447
|
+
{#each Object.entries(SETTINGS_CONFIG.structure.show_polyhedra.enum ?? {}) as
|
|
448
|
+
[value, label]
|
|
449
|
+
(value)
|
|
450
|
+
}
|
|
451
|
+
<option {value}>{label}</option>
|
|
452
|
+
{/each}
|
|
453
|
+
</select>
|
|
454
|
+
</label>
|
|
397
455
|
</SettingsSection>
|
|
398
456
|
|
|
399
457
|
<SettingsSection
|
|
@@ -1215,6 +1273,163 @@
|
|
|
1215
1273
|
</label>
|
|
1216
1274
|
</SettingsSection>
|
|
1217
1275
|
{/if}
|
|
1276
|
+
|
|
1277
|
+
{#if scene_props.show_polyhedra && scene_props.show_polyhedra !== `never`}
|
|
1278
|
+
<SettingsSection
|
|
1279
|
+
title="Polyhedra"
|
|
1280
|
+
current_values={{
|
|
1281
|
+
polyhedra_opacity: scene_props.polyhedra_opacity,
|
|
1282
|
+
polyhedra_show_edges: scene_props.polyhedra_show_edges,
|
|
1283
|
+
polyhedra_edge_color: scene_props.polyhedra_edge_color,
|
|
1284
|
+
polyhedra_color_mode: scene_props.polyhedra_color_mode,
|
|
1285
|
+
polyhedra_color: scene_props.polyhedra_color,
|
|
1286
|
+
polyhedra_hide_center_atoms: scene_props.polyhedra_hide_center_atoms,
|
|
1287
|
+
polyhedra_min_neighbors: scene_props.polyhedra_min_neighbors,
|
|
1288
|
+
polyhedra_max_neighbors: scene_props.polyhedra_max_neighbors,
|
|
1289
|
+
polyhedra_excluded_elements: scene_props.polyhedra_excluded_elements,
|
|
1290
|
+
polyhedra_included_elements: scene_props.polyhedra_included_elements,
|
|
1291
|
+
}}
|
|
1292
|
+
on_reset={() => {
|
|
1293
|
+
scene_props.polyhedra_opacity = DEFAULTS.structure.polyhedra_opacity
|
|
1294
|
+
scene_props.polyhedra_show_edges = DEFAULTS.structure.polyhedra_show_edges
|
|
1295
|
+
scene_props.polyhedra_edge_color = DEFAULTS.structure.polyhedra_edge_color
|
|
1296
|
+
scene_props.polyhedra_color_mode = DEFAULTS.structure.polyhedra_color_mode
|
|
1297
|
+
scene_props.polyhedra_color = DEFAULTS.structure.polyhedra_color
|
|
1298
|
+
scene_props.polyhedra_hide_center_atoms =
|
|
1299
|
+
DEFAULTS.structure.polyhedra_hide_center_atoms
|
|
1300
|
+
scene_props.polyhedra_min_neighbors = DEFAULTS.structure.polyhedra_min_neighbors
|
|
1301
|
+
scene_props.polyhedra_max_neighbors = DEFAULTS.structure.polyhedra_max_neighbors
|
|
1302
|
+
scene_props.polyhedra_excluded_elements =
|
|
1303
|
+
DEFAULTS.structure.polyhedra_excluded_elements
|
|
1304
|
+
scene_props.polyhedra_included_elements =
|
|
1305
|
+
DEFAULTS.structure.polyhedra_included_elements
|
|
1306
|
+
}}
|
|
1307
|
+
>
|
|
1308
|
+
<label
|
|
1309
|
+
{@attach tooltip({
|
|
1310
|
+
content: SETTINGS_CONFIG.structure.polyhedra_opacity.description,
|
|
1311
|
+
})}
|
|
1312
|
+
>
|
|
1313
|
+
Opacity
|
|
1314
|
+
<input
|
|
1315
|
+
type="number"
|
|
1316
|
+
min={0}
|
|
1317
|
+
max={1}
|
|
1318
|
+
step={0.05}
|
|
1319
|
+
bind:value={scene_props.polyhedra_opacity}
|
|
1320
|
+
/>
|
|
1321
|
+
<input
|
|
1322
|
+
type="range"
|
|
1323
|
+
min={0}
|
|
1324
|
+
max={1}
|
|
1325
|
+
step={0.05}
|
|
1326
|
+
bind:value={scene_props.polyhedra_opacity}
|
|
1327
|
+
/>
|
|
1328
|
+
</label>
|
|
1329
|
+
<label
|
|
1330
|
+
{@attach tooltip({
|
|
1331
|
+
content: SETTINGS_CONFIG.structure.polyhedra_color_mode.description,
|
|
1332
|
+
})}
|
|
1333
|
+
>
|
|
1334
|
+
Color <select bind:value={scene_props.polyhedra_color_mode}>
|
|
1335
|
+
{#each Object.entries(
|
|
1336
|
+
SETTINGS_CONFIG.structure.polyhedra_color_mode.enum ?? {},
|
|
1337
|
+
) as
|
|
1338
|
+
[value, label]
|
|
1339
|
+
(value)
|
|
1340
|
+
}
|
|
1341
|
+
<option {value}>{label}</option>
|
|
1342
|
+
{/each}
|
|
1343
|
+
</select>
|
|
1344
|
+
{#if scene_props.polyhedra_color_mode === `uniform`}
|
|
1345
|
+
<input type="color" bind:value={scene_props.polyhedra_color} />
|
|
1346
|
+
{/if}
|
|
1347
|
+
</label>
|
|
1348
|
+
<label
|
|
1349
|
+
style="gap: 6pt"
|
|
1350
|
+
{@attach tooltip({
|
|
1351
|
+
content: SETTINGS_CONFIG.structure.polyhedra_show_edges.description,
|
|
1352
|
+
})}
|
|
1353
|
+
>
|
|
1354
|
+
<input type="checkbox" bind:checked={scene_props.polyhedra_show_edges} />
|
|
1355
|
+
Edges
|
|
1356
|
+
{#if scene_props.polyhedra_show_edges}
|
|
1357
|
+
<input type="color" bind:value={scene_props.polyhedra_edge_color} />
|
|
1358
|
+
{/if}
|
|
1359
|
+
</label>
|
|
1360
|
+
<label
|
|
1361
|
+
style="gap: 6pt"
|
|
1362
|
+
{@attach tooltip({
|
|
1363
|
+
content: SETTINGS_CONFIG.structure.polyhedra_hide_center_atoms.description,
|
|
1364
|
+
})}
|
|
1365
|
+
>
|
|
1366
|
+
<input type="checkbox" bind:checked={scene_props.polyhedra_hide_center_atoms} />
|
|
1367
|
+
Hide center atoms
|
|
1368
|
+
</label>
|
|
1369
|
+
<label
|
|
1370
|
+
{@attach tooltip({
|
|
1371
|
+
content: SETTINGS_CONFIG.structure.polyhedra_min_neighbors.description,
|
|
1372
|
+
})}
|
|
1373
|
+
>
|
|
1374
|
+
Min neighbors
|
|
1375
|
+
<input
|
|
1376
|
+
type="number"
|
|
1377
|
+
min={4}
|
|
1378
|
+
max={12}
|
|
1379
|
+
step={1}
|
|
1380
|
+
bind:value={scene_props.polyhedra_min_neighbors}
|
|
1381
|
+
/>
|
|
1382
|
+
<input
|
|
1383
|
+
type="range"
|
|
1384
|
+
min={4}
|
|
1385
|
+
max={12}
|
|
1386
|
+
step={1}
|
|
1387
|
+
bind:value={scene_props.polyhedra_min_neighbors}
|
|
1388
|
+
/>
|
|
1389
|
+
</label>
|
|
1390
|
+
<label
|
|
1391
|
+
{@attach tooltip({
|
|
1392
|
+
content: SETTINGS_CONFIG.structure.polyhedra_max_neighbors.description,
|
|
1393
|
+
})}
|
|
1394
|
+
>
|
|
1395
|
+
Max neighbors
|
|
1396
|
+
<input
|
|
1397
|
+
type="number"
|
|
1398
|
+
min={4}
|
|
1399
|
+
max={16}
|
|
1400
|
+
step={1}
|
|
1401
|
+
bind:value={scene_props.polyhedra_max_neighbors}
|
|
1402
|
+
/>
|
|
1403
|
+
<input
|
|
1404
|
+
type="range"
|
|
1405
|
+
min={4}
|
|
1406
|
+
max={16}
|
|
1407
|
+
step={1}
|
|
1408
|
+
bind:value={scene_props.polyhedra_max_neighbors}
|
|
1409
|
+
/>
|
|
1410
|
+
</label>
|
|
1411
|
+
{#if structure_elements.length > 0}
|
|
1412
|
+
<div
|
|
1413
|
+
style="display: flex; flex-wrap: wrap; gap: 8pt; align-items: center"
|
|
1414
|
+
{@attach tooltip({
|
|
1415
|
+
content: SETTINGS_CONFIG.structure.polyhedra_excluded_elements.description,
|
|
1416
|
+
})}
|
|
1417
|
+
>
|
|
1418
|
+
Centers:
|
|
1419
|
+
{#each structure_elements as element (element)}
|
|
1420
|
+
<label style="gap: 4pt">
|
|
1421
|
+
<input
|
|
1422
|
+
type="checkbox"
|
|
1423
|
+
checked={is_polyhedra_center_enabled(element)}
|
|
1424
|
+
onchange={() => toggle_polyhedra_element(element)}
|
|
1425
|
+
/>
|
|
1426
|
+
{element}
|
|
1427
|
+
</label>
|
|
1428
|
+
{/each}
|
|
1429
|
+
</div>
|
|
1430
|
+
{/if}
|
|
1431
|
+
</SettingsSection>
|
|
1432
|
+
{/if}
|
|
1218
1433
|
</DraggablePane>
|
|
1219
1434
|
|
|
1220
1435
|
<style>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PaneProps, PaneToggleProps } from '../overlays';
|
|
1
2
|
import type { IsosurfaceSettings, VolumetricData } from '../isosurface/types';
|
|
2
3
|
import DraggablePane from '../overlays/DraggablePane.svelte';
|
|
3
4
|
import type { AnyStructure } from './';
|
|
@@ -23,9 +24,10 @@ type $$ComponentProps = Omit<ComponentProps<typeof DraggablePane>, `children`> &
|
|
|
23
24
|
volumetric_data?: VolumetricData[];
|
|
24
25
|
isosurface_settings?: IsosurfaceSettings;
|
|
25
26
|
active_volume_idx?: number;
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
polyhedra_rendered_elements?: string[];
|
|
28
|
+
pane_props?: PaneProps;
|
|
29
|
+
toggle_props?: PaneToggleProps;
|
|
28
30
|
};
|
|
29
|
-
declare const StructureControls: import("svelte").Component<$$ComponentProps, {}, "
|
|
31
|
+
declare const StructureControls: import("svelte").Component<$$ComponentProps, {}, "color_scheme" | "controls_open" | "background_color" | "background_opacity" | "atom_color_config" | "supercell_scaling" | "cell_type" | "active_volume_idx" | "scene_props" | "lattice_props" | "show_image_atoms" | "supercell_loading" | "volumetric_data" | "isosurface_settings">;
|
|
30
32
|
type StructureControls = ReturnType<typeof StructureControls>;
|
|
31
33
|
export default StructureControls;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { PaneProps, PaneToggleProps } from '../overlays'
|
|
3
|
+
import type { ExportSection } from '../io'
|
|
4
|
+
import ExportPane from '../io/ExportPane.svelte'
|
|
5
|
+
import { export_canvas_as_png, observe_canvas_presence } from '../io/export'
|
|
2
6
|
import type { AnyStructure } from './'
|
|
3
|
-
import DraggablePane from '../overlays/DraggablePane.svelte'
|
|
4
|
-
import { export_canvas_as_png } from '../io/export'
|
|
5
|
-
import { sanitize_html } from '../sanitize'
|
|
6
7
|
import * as exports from './export'
|
|
8
|
+
import type { StructTextFormat } from './export'
|
|
7
9
|
import type { ComponentProps } from 'svelte'
|
|
8
|
-
import { tooltip } from 'svelte-multiselect/attachments'
|
|
9
10
|
import type { Camera, Scene } from 'three'
|
|
10
11
|
|
|
11
12
|
let {
|
|
@@ -25,18 +26,10 @@
|
|
|
25
26
|
scene?: Scene
|
|
26
27
|
camera?: Camera
|
|
27
28
|
png_dpi?: number
|
|
28
|
-
pane_props?:
|
|
29
|
-
toggle_props?:
|
|
29
|
+
pane_props?: PaneProps
|
|
30
|
+
toggle_props?: PaneToggleProps
|
|
30
31
|
} = $props()
|
|
31
32
|
|
|
32
|
-
// Copy button feedback state
|
|
33
|
-
let copy_status = $state<
|
|
34
|
-
{ json: boolean; xyz: boolean; cif: boolean; poscar: boolean }
|
|
35
|
-
>({ json: false, xyz: false, cif: false, poscar: false })
|
|
36
|
-
|
|
37
|
-
// Dynamic button text based on copy status
|
|
38
|
-
const copy_confirm = `✅`
|
|
39
|
-
|
|
40
33
|
const text_export_formats = [
|
|
41
34
|
{
|
|
42
35
|
label: `JSON`,
|
|
@@ -79,43 +72,14 @@
|
|
|
79
72
|
},
|
|
80
73
|
] as const
|
|
81
74
|
|
|
82
|
-
//
|
|
83
|
-
function
|
|
84
|
-
if (!structure) return
|
|
85
|
-
const export_fns = {
|
|
86
|
-
json: exports.export_structure_as_json,
|
|
87
|
-
xyz: exports.export_structure_as_xyz,
|
|
88
|
-
cif: exports.export_structure_as_cif,
|
|
89
|
-
poscar: exports.export_structure_as_poscar,
|
|
90
|
-
} as const
|
|
91
|
-
export_fns[format](structure)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Handle clipboard copy with user feedback
|
|
95
|
-
async function handle_copy(format: `json` | `xyz` | `cif` | `poscar`) {
|
|
96
|
-
if (!structure) {
|
|
97
|
-
console.warn(`No structure available for copying`)
|
|
98
|
-
return
|
|
99
|
-
}
|
|
100
|
-
|
|
75
|
+
// Clipboard content for a text format; must not throw (ExportPane evaluates on click)
|
|
76
|
+
function get_text_content(format: StructTextFormat): string | null {
|
|
77
|
+
if (!structure) return null
|
|
101
78
|
try {
|
|
102
|
-
|
|
103
|
-
if (format === `json`) content = exports.structure_to_json_str(structure)
|
|
104
|
-
else if (format === `xyz`) content = exports.structure_to_xyz_str(structure)
|
|
105
|
-
else if (format === `cif`) content = exports.structure_to_cif_str(structure)
|
|
106
|
-
else if (format === `poscar`) {
|
|
107
|
-
content = exports.structure_to_poscar_str(structure)
|
|
108
|
-
} else throw new Error(`Invalid format: ${format}`)
|
|
109
|
-
|
|
110
|
-
await navigator.clipboard.writeText(content)
|
|
111
|
-
|
|
112
|
-
// Show temporary feedback in button text
|
|
113
|
-
copy_status[format] = true
|
|
114
|
-
setTimeout(() => {
|
|
115
|
-
copy_status[format] = false
|
|
116
|
-
}, 1000)
|
|
79
|
+
return exports.STRUCT_TEXT_FORMATS[format].to_str(structure)
|
|
117
80
|
} catch (error) {
|
|
118
81
|
console.error(`Failed to copy ${format.toUpperCase()} to clipboard`, error)
|
|
82
|
+
return null
|
|
119
83
|
}
|
|
120
84
|
}
|
|
121
85
|
|
|
@@ -124,7 +88,6 @@
|
|
|
124
88
|
console.warn(`No scene available for ${format.toUpperCase()} export`)
|
|
125
89
|
return
|
|
126
90
|
}
|
|
127
|
-
|
|
128
91
|
try {
|
|
129
92
|
if (format === `glb`) exports.export_structure_as_glb(scene, structure)
|
|
130
93
|
else if (format === `obj`) exports.export_structure_as_obj(scene, structure)
|
|
@@ -135,118 +98,53 @@
|
|
|
135
98
|
|
|
136
99
|
let has_canvas = $state(false)
|
|
137
100
|
|
|
138
|
-
$effect(() =>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
101
|
+
$effect(() => observe_canvas_presence(wrapper, (val) => (has_canvas = val)))
|
|
102
|
+
|
|
103
|
+
const sections = $derived<ExportSection[]>([
|
|
104
|
+
{
|
|
105
|
+
title: `Export as text`,
|
|
106
|
+
items: text_export_formats.map(({ label, format, hint }) => ({
|
|
107
|
+
label,
|
|
108
|
+
hint,
|
|
109
|
+
disabled: !structure,
|
|
110
|
+
on_download: () => structure && exports.export_structure_as(format, structure),
|
|
111
|
+
copy_text: () => get_text_content(format),
|
|
112
|
+
})),
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
title: `Export as image`,
|
|
116
|
+
items: [{
|
|
117
|
+
label: `PNG`,
|
|
118
|
+
disabled: !has_canvas,
|
|
119
|
+
show_dpi: true,
|
|
120
|
+
on_download: () => {
|
|
121
|
+
const canvas = wrapper?.querySelector(`canvas`)
|
|
122
|
+
if (canvas) export_canvas_as_png(canvas, structure, png_dpi, scene, camera)
|
|
123
|
+
else console.warn(`Canvas element not found for PNG export`)
|
|
124
|
+
},
|
|
125
|
+
}],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
title: `Export as 3D model`,
|
|
129
|
+
items: model_3d_formats.map(({ label, format, hint }) => ({
|
|
130
|
+
label,
|
|
131
|
+
hint,
|
|
132
|
+
disabled: !scene,
|
|
133
|
+
on_download: () => handle_3d_export(format),
|
|
134
|
+
})),
|
|
135
|
+
},
|
|
136
|
+
])
|
|
149
137
|
</script>
|
|
150
138
|
|
|
151
|
-
<
|
|
152
|
-
bind:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
139
|
+
<ExportPane
|
|
140
|
+
bind:export_pane_open
|
|
141
|
+
bind:png_dpi
|
|
142
|
+
{sections}
|
|
143
|
+
{pane_props}
|
|
156
144
|
toggle_props={{
|
|
157
145
|
title: export_pane_open ? `` : `Export Structure`,
|
|
158
146
|
...toggle_props,
|
|
159
147
|
class: `structure-export-toggle ${toggle_props?.class ?? ``}`,
|
|
160
148
|
}}
|
|
161
149
|
{...rest}
|
|
162
|
-
|
|
163
|
-
<h4 id="export-as-text">Export as text</h4>
|
|
164
|
-
<div class="export-buttons">
|
|
165
|
-
{#each text_export_formats as { label, format, hint } (format)}
|
|
166
|
-
<div style="display: flex; align-items: center; gap: 4pt">
|
|
167
|
-
<span {@attach tooltip({ allow_html: true, content: sanitize_html(hint) })}>{label}</span>
|
|
168
|
-
<button
|
|
169
|
-
type="button"
|
|
170
|
-
onclick={() => export_structure(format)}
|
|
171
|
-
title="Download {label}"
|
|
172
|
-
>
|
|
173
|
-
⬇
|
|
174
|
-
</button>
|
|
175
|
-
<button
|
|
176
|
-
type="button"
|
|
177
|
-
onclick={() => handle_copy(format)}
|
|
178
|
-
title="Copy {label} to clipboard"
|
|
179
|
-
>
|
|
180
|
-
{copy_status[format] ? copy_confirm : `📋`}
|
|
181
|
-
</button>
|
|
182
|
-
</div>
|
|
183
|
-
{/each}
|
|
184
|
-
</div>
|
|
185
|
-
|
|
186
|
-
<h4 id="export-as-image">Export as image</h4>
|
|
187
|
-
<div class="export-buttons">
|
|
188
|
-
<label>
|
|
189
|
-
PNG
|
|
190
|
-
<button
|
|
191
|
-
type="button"
|
|
192
|
-
disabled={!has_canvas}
|
|
193
|
-
onclick={() => {
|
|
194
|
-
const canvas = wrapper?.querySelector(`canvas`) as HTMLCanvasElement
|
|
195
|
-
if (canvas) {
|
|
196
|
-
export_canvas_as_png(
|
|
197
|
-
canvas,
|
|
198
|
-
structure,
|
|
199
|
-
png_dpi,
|
|
200
|
-
scene,
|
|
201
|
-
camera,
|
|
202
|
-
)
|
|
203
|
-
} else console.warn(`Canvas element not found for PNG export`)
|
|
204
|
-
}}
|
|
205
|
-
title="PNG ({png_dpi} DPI)"
|
|
206
|
-
>
|
|
207
|
-
⬇
|
|
208
|
-
</button>
|
|
209
|
-
(DPI: <input
|
|
210
|
-
type="number"
|
|
211
|
-
min={50}
|
|
212
|
-
max={500}
|
|
213
|
-
bind:value={png_dpi}
|
|
214
|
-
title="Export resolution in dots per inch"
|
|
215
|
-
style="margin: 0 0 0 2pt"
|
|
216
|
-
/>)
|
|
217
|
-
</label>
|
|
218
|
-
</div>
|
|
219
|
-
|
|
220
|
-
<h4 id="export-as-3d-model">Export as 3D model</h4>
|
|
221
|
-
<div class="export-buttons">
|
|
222
|
-
{#each model_3d_formats as { label, format, hint } (format)}
|
|
223
|
-
<div style="display: flex; align-items: center; gap: 4pt">
|
|
224
|
-
<span {@attach tooltip({ content: hint })}>{label}</span>
|
|
225
|
-
<button
|
|
226
|
-
type="button"
|
|
227
|
-
onclick={() => handle_3d_export(format)}
|
|
228
|
-
disabled={!scene}
|
|
229
|
-
title="Download {label}"
|
|
230
|
-
>
|
|
231
|
-
⬇
|
|
232
|
-
</button>
|
|
233
|
-
</div>
|
|
234
|
-
{/each}
|
|
235
|
-
</div>
|
|
236
|
-
</DraggablePane>
|
|
237
|
-
|
|
238
|
-
<style>
|
|
239
|
-
.export-buttons {
|
|
240
|
-
display: flex;
|
|
241
|
-
flex-wrap: wrap;
|
|
242
|
-
gap: 9pt;
|
|
243
|
-
font-size: 0.95em;
|
|
244
|
-
}
|
|
245
|
-
.export-buttons button {
|
|
246
|
-
min-width: 1.9em;
|
|
247
|
-
height: 1.6em;
|
|
248
|
-
padding: 0 4pt;
|
|
249
|
-
margin: 0 0 0 4pt;
|
|
250
|
-
box-sizing: border-box;
|
|
251
|
-
}
|
|
252
|
-
</style>
|
|
150
|
+
/>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import type { PaneProps, PaneToggleProps } from '../overlays';
|
|
1
2
|
import type { AnyStructure } from './';
|
|
2
|
-
import DraggablePane from '../overlays/DraggablePane.svelte';
|
|
3
|
-
import type { ComponentProps } from 'svelte';
|
|
4
3
|
import type { Camera, Scene } from 'three';
|
|
5
4
|
type $$ComponentProps = {
|
|
6
5
|
export_pane_open?: boolean;
|
|
@@ -9,9 +8,9 @@ type $$ComponentProps = {
|
|
|
9
8
|
scene?: Scene;
|
|
10
9
|
camera?: Camera;
|
|
11
10
|
png_dpi?: number;
|
|
12
|
-
pane_props?:
|
|
13
|
-
toggle_props?:
|
|
11
|
+
pane_props?: PaneProps;
|
|
12
|
+
toggle_props?: PaneToggleProps;
|
|
14
13
|
};
|
|
15
|
-
declare const StructureExportPane: import("svelte").Component<$$ComponentProps, {}, "
|
|
14
|
+
declare const StructureExportPane: import("svelte").Component<$$ComponentProps, {}, "export_pane_open" | "png_dpi">;
|
|
16
15
|
type StructureExportPane = ReturnType<typeof StructureExportPane>;
|
|
17
16
|
export default StructureExportPane;
|