matterviz 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EmptyState.svelte +10 -4
- package/dist/FilePicker.svelte +12 -14
- package/dist/Icon.svelte +7 -4
- package/dist/MillerIndexInput.svelte +2 -2
- package/dist/app.css +53 -0
- package/dist/brillouin/BrillouinZone.svelte +132 -219
- package/dist/brillouin/BrillouinZone.svelte.d.ts +9 -20
- package/dist/brillouin/BrillouinZoneControls.svelte +3 -6
- package/dist/brillouin/BrillouinZoneExportPane.svelte +47 -96
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +15 -42
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +2 -3
- package/dist/brillouin/BrillouinZoneScene.svelte +63 -230
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +3 -23
- package/dist/brillouin/ReciprocalVectors.svelte +39 -0
- package/dist/brillouin/ReciprocalVectors.svelte.d.ts +9 -0
- package/dist/brillouin/compute.d.ts +2 -0
- package/dist/brillouin/compute.js +80 -77
- package/dist/brillouin/geometry.d.ts +8 -0
- package/dist/brillouin/geometry.js +57 -0
- package/dist/brillouin/index.d.ts +2 -0
- package/dist/brillouin/index.js +2 -0
- package/dist/brillouin/types.d.ts +2 -2
- package/dist/chempot-diagram/ChemPotDiagram.svelte +33 -38
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +143 -246
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +4 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +652 -976
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +7 -1
- package/dist/chempot-diagram/async-compute.svelte.js +1 -1
- package/dist/chempot-diagram/color.d.ts +3 -6
- package/dist/chempot-diagram/color.js +5 -5
- package/dist/chempot-diagram/compute.d.ts +3 -3
- package/dist/chempot-diagram/compute.js +3 -1
- package/dist/chempot-diagram/controls-state.svelte.d.ts +10 -0
- package/dist/chempot-diagram/controls-state.svelte.js +42 -0
- package/dist/chempot-diagram/export.d.ts +47 -0
- package/dist/chempot-diagram/export.js +133 -0
- package/dist/chempot-diagram/index.d.ts +1 -0
- package/dist/chempot-diagram/index.js +1 -0
- package/dist/chempot-diagram/pointer.d.ts +0 -10
- package/dist/chempot-diagram/pointer.js +4 -4
- package/dist/chempot-diagram/types.d.ts +3 -3
- package/dist/colors/index.d.ts +0 -4
- package/dist/colors/index.js +21 -22
- package/dist/composition/BarChart.svelte +37 -31
- package/dist/composition/BubbleChart.svelte +17 -17
- package/dist/composition/Composition.svelte +7 -11
- package/dist/composition/Formula.svelte +18 -25
- package/dist/composition/FormulaFilter.svelte +96 -98
- package/dist/composition/PieChart.svelte +60 -46
- package/dist/composition/chem-sys.js +3 -2
- package/dist/composition/format.js +4 -3
- package/dist/composition/index.d.ts +2 -0
- package/dist/composition/index.js +14 -0
- package/dist/composition/parse.d.ts +2 -3
- package/dist/composition/parse.js +27 -28
- package/dist/constants.js +11 -9
- package/dist/controls.d.ts +1 -0
- package/dist/controls.js +0 -1
- package/dist/convex-hull/ConvexHull.svelte +20 -25
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -4
- package/dist/convex-hull/ConvexHull2D.svelte +176 -256
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +269 -804
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +236 -755
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +264 -0
- package/dist/convex-hull/ConvexHullChrome.svelte.d.ts +30 -0
- package/dist/convex-hull/ConvexHullControls.svelte +128 -49
- package/dist/convex-hull/ConvexHullControls.svelte.d.ts +7 -6
- package/dist/convex-hull/ConvexHullInfoPane.svelte +18 -5
- package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +6 -5
- package/dist/convex-hull/ConvexHullStats.svelte +210 -351
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +3 -1
- package/dist/convex-hull/ConvexHullTooltip.svelte +16 -14
- package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +2 -1
- package/dist/convex-hull/GasPressureControls.svelte +5 -12
- package/dist/convex-hull/StructurePopup.svelte +17 -21
- package/dist/convex-hull/StructurePopup.svelte.d.ts +2 -0
- package/dist/convex-hull/TemperatureSlider.svelte +4 -10
- package/dist/convex-hull/barycentric-coords.d.ts +2 -4
- package/dist/convex-hull/barycentric-coords.js +6 -33
- package/dist/convex-hull/canvas-interactions.svelte.d.ts +79 -0
- package/dist/convex-hull/canvas-interactions.svelte.js +279 -0
- package/dist/convex-hull/helpers.d.ts +47 -17
- package/dist/convex-hull/helpers.js +186 -101
- package/dist/convex-hull/hull-state.svelte.d.ts +44 -0
- package/dist/convex-hull/hull-state.svelte.js +124 -0
- package/dist/convex-hull/index.d.ts +9 -7
- package/dist/convex-hull/index.js +7 -2
- package/dist/convex-hull/thermodynamics.js +109 -937
- package/dist/convex-hull/types.d.ts +12 -4
- package/dist/convex-hull/types.js +12 -0
- package/dist/coordination/CoordinationBarPlot.svelte +41 -43
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
- package/dist/coordination/calc-coordination.d.ts +1 -1
- package/dist/coordination/calc-coordination.js +28 -25
- package/dist/element/BohrAtom.svelte +6 -8
- package/dist/element/ElementHeading.svelte +4 -1
- package/dist/element/ElementPhoto.svelte +11 -9
- package/dist/element/ElementStats.svelte +12 -10
- package/dist/element/ElementTile.svelte +24 -29
- package/dist/element/ElementTile.svelte.d.ts +1 -1
- package/dist/element/Nucleus.svelte +4 -2
- package/dist/element/data.d.ts +1 -2
- package/dist/element/helpers.d.ts +4 -0
- package/dist/element/helpers.js +18 -0
- package/dist/element/index.d.ts +1 -0
- package/dist/element/index.js +3 -0
- package/dist/feedback/DragOverlay.svelte +5 -3
- package/dist/feedback/DragOverlay.svelte.d.ts +2 -1
- package/dist/feedback/StatusMessage.svelte +20 -7
- package/dist/fermi-surface/FermiSlice.svelte +21 -18
- package/dist/fermi-surface/FermiSurface.svelte +78 -165
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +9 -20
- package/dist/fermi-surface/FermiSurfaceControls.svelte +6 -20
- package/dist/fermi-surface/FermiSurfaceScene.svelte +93 -272
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +3 -23
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +9 -6
- package/dist/fermi-surface/compute.js +14 -13
- package/dist/fermi-surface/export.js +4 -15
- package/dist/fermi-surface/index.d.ts +0 -1
- package/dist/fermi-surface/index.js +0 -1
- package/dist/fermi-surface/parse.d.ts +1 -1
- package/dist/fermi-surface/parse.js +84 -97
- package/dist/fermi-surface/types.d.ts +2 -2
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +161 -185
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +6 -5
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +12 -9
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +5 -5
- package/dist/heatmap-matrix/index.d.ts +8 -2
- package/dist/icons.d.ts +4 -0
- package/dist/icons.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/io/ExportPane.svelte +170 -0
- package/dist/io/ExportPane.svelte.d.ts +17 -0
- package/dist/io/decompress.d.ts +2 -1
- package/dist/io/decompress.js +22 -36
- package/dist/io/export.d.ts +9 -1
- package/dist/io/export.js +37 -29
- package/dist/io/fetch.d.ts +2 -4
- package/dist/io/fetch.js +0 -11
- package/dist/io/file-drop.d.ts +7 -0
- package/dist/io/file-drop.js +13 -0
- package/dist/io/index.d.ts +1 -0
- package/dist/io/index.js +3 -0
- package/dist/io/is-binary.d.ts +9 -0
- package/dist/io/is-binary.js +45 -1
- package/dist/io/types.d.ts +13 -0
- package/dist/io/url-drop.js +13 -25
- package/dist/isosurface/Isosurface.svelte +17 -23
- package/dist/isosurface/IsosurfaceControls.svelte +37 -42
- package/dist/isosurface/parse-vaspwave.d.ts +3 -0
- package/dist/isosurface/parse-vaspwave.js +138 -0
- package/dist/isosurface/parse.js +50 -48
- package/dist/labels.d.ts +6 -2
- package/dist/labels.js +44 -14
- package/dist/layout/FullscreenButton.svelte +34 -0
- package/dist/layout/FullscreenButton.svelte.d.ts +10 -0
- package/dist/layout/FullscreenToggle.svelte +12 -12
- package/dist/layout/InfoCard.svelte +7 -18
- package/dist/layout/InfoTag.svelte +1 -3
- package/dist/layout/NumberRangeInput.svelte +46 -0
- package/dist/layout/NumberRangeInput.svelte.d.ts +12 -0
- package/dist/layout/PropertyFilter.svelte +2 -6
- package/dist/layout/SettingsSection.svelte +21 -17
- package/dist/layout/SubpageGrid.svelte +3 -1
- package/dist/layout/ViewerChrome.svelte +115 -0
- package/dist/layout/ViewerChrome.svelte.d.ts +18 -0
- package/dist/layout/fullscreen.d.ts +4 -0
- package/dist/layout/fullscreen.js +3 -5
- package/dist/layout/fullscreen.svelte.d.ts +8 -0
- package/dist/layout/fullscreen.svelte.js +36 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout/index.js +4 -0
- package/dist/layout/json-tree/JsonNode.svelte +8 -11
- package/dist/layout/json-tree/JsonTree.svelte +53 -77
- package/dist/layout/json-tree/JsonValue.svelte +7 -15
- package/dist/layout/json-tree/utils.js +14 -23
- package/dist/math.d.ts +9 -3
- package/dist/math.js +37 -21
- package/dist/overlays/ContextMenu.svelte +4 -2
- package/dist/overlays/CopyButton.svelte +11 -5
- package/dist/overlays/DragControlTab.svelte +6 -1
- package/dist/overlays/DraggablePane.svelte +81 -26
- package/dist/overlays/DraggablePane.svelte.d.ts +1 -0
- package/dist/overlays/GlassChip.svelte +30 -0
- package/dist/overlays/GlassChip.svelte.d.ts +8 -0
- package/dist/overlays/InfoPaneCards.svelte +11 -23
- package/dist/overlays/index.d.ts +11 -0
- package/dist/overlays/index.js +26 -0
- package/dist/overlays/portal.d.ts +2 -0
- package/dist/overlays/portal.js +14 -0
- package/dist/periodic-table/PeriodicTable.svelte +115 -146
- package/dist/periodic-table/PeriodicTable.svelte.d.ts +5 -3
- package/dist/periodic-table/PeriodicTableControls.svelte +11 -63
- package/dist/periodic-table/TableInset.svelte +9 -4
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +50 -71
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +6 -8
- package/dist/phase-diagram/PhaseDiagramControls.svelte +73 -96
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +4 -3
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +4 -2
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +2 -3
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +49 -134
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +3 -4
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +54 -58
- package/dist/phase-diagram/TdbInfoPanel.svelte +21 -15
- package/dist/phase-diagram/build-diagram.js +3 -3
- package/dist/phase-diagram/colors.js +1 -1
- package/dist/phase-diagram/diagram-input.d.ts +1 -2
- package/dist/phase-diagram/parse.d.ts +2 -1
- package/dist/phase-diagram/parse.js +15 -15
- package/dist/phase-diagram/svg-to-diagram.js +21 -15
- package/dist/phase-diagram/utils.js +2 -3
- package/dist/plot/bar/BarPlot.svelte +494 -692
- package/dist/plot/bar/BarPlot.svelte.d.ts +9 -15
- package/dist/plot/bar/BarPlotControls.svelte +1 -3
- package/dist/plot/bar/BarPlotControls.svelte.d.ts +5 -7
- package/dist/plot/bar/SpacegroupBarPlot.svelte +31 -37
- package/dist/plot/bar/data.d.ts +5 -4
- package/dist/plot/bar/data.js +2 -1
- package/dist/plot/box/BoxPlot.svelte +361 -439
- package/dist/plot/box/BoxPlot.svelte.d.ts +6 -3
- package/dist/plot/box/BoxPlotControls.svelte.d.ts +1 -1
- package/dist/plot/box/Violin.svelte.d.ts +2 -1
- package/dist/plot/box/box-plot.d.ts +3 -2
- package/dist/plot/box/box-plot.js +6 -3
- package/dist/plot/box/kde.d.ts +2 -1
- package/dist/plot/box/kde.js +4 -4
- package/dist/plot/core/auto-place.d.ts +1 -1
- package/dist/plot/core/auto-place.js +5 -2
- package/dist/plot/core/axis-utils.d.ts +12 -7
- package/dist/plot/core/axis-utils.js +48 -48
- package/dist/plot/core/components/AxisLabel.svelte +82 -20
- package/dist/plot/core/components/AxisLabel.svelte.d.ts +1 -0
- package/dist/plot/core/components/ColorBar.svelte +106 -111
- package/dist/plot/core/components/ColorBar.svelte.d.ts +5 -4
- package/dist/plot/core/components/ColorScaleSelect.svelte +1 -1
- package/dist/plot/core/components/FillArea.svelte +10 -17
- package/dist/plot/core/components/HierarchyControls.svelte +249 -0
- package/dist/plot/{sunburst/SunburstControls.svelte.d.ts → core/components/HierarchyControls.svelte.d.ts} +12 -8
- package/dist/plot/core/components/InteractiveAxisLabel.svelte +1 -1
- package/dist/plot/core/components/InteractiveAxisLabel.svelte.d.ts +1 -1
- package/dist/plot/core/components/Line.svelte +21 -11
- package/dist/plot/core/components/Line.svelte.d.ts +5 -2
- package/dist/plot/core/components/PlotAxis.svelte +42 -18
- package/dist/plot/core/components/PlotAxis.svelte.d.ts +2 -1
- package/dist/plot/core/components/PlotControls.svelte +65 -41
- package/dist/plot/core/components/PlotControls.svelte.d.ts +1 -1
- package/dist/plot/core/components/PlotLegend.svelte +31 -35
- package/dist/plot/core/components/PlotMarginals.svelte +616 -0
- package/dist/plot/core/components/PlotMarginals.svelte.d.ts +15 -0
- package/dist/plot/core/components/PlotTooltip.svelte +1 -1
- package/dist/plot/core/components/PortalSelect.svelte +4 -8
- package/dist/plot/core/components/ReferenceLine.svelte +27 -24
- package/dist/plot/core/components/ReferenceLine3D.svelte +56 -59
- package/dist/plot/core/components/ReferenceLine3D.svelte.d.ts +4 -4
- package/dist/plot/core/components/ReferencePlane.svelte +9 -10
- package/dist/plot/core/components/ReferencePlane.svelte.d.ts +4 -4
- package/dist/plot/core/components/ZeroLines.svelte +4 -8
- package/dist/plot/core/components/ZoomRect.svelte +1 -2
- package/dist/plot/core/components/index.d.ts +1 -0
- package/dist/plot/core/components/index.js +1 -0
- package/dist/plot/core/data-cleaning-signal.d.ts +46 -0
- package/dist/plot/core/data-cleaning-signal.js +467 -0
- package/dist/plot/core/data-cleaning.d.ts +2 -42
- package/dist/plot/core/data-cleaning.js +29 -476
- package/dist/plot/core/data-transform.js +9 -5
- package/dist/plot/core/fill-utils.d.ts +7 -4
- package/dist/plot/core/fill-utils.js +34 -9
- package/dist/plot/core/index.d.ts +1 -0
- package/dist/plot/core/index.js +1 -0
- package/dist/plot/core/interactions.d.ts +5 -1
- package/dist/plot/core/interactions.js +14 -2
- package/dist/plot/core/layout.d.ts +3 -1
- package/dist/plot/core/layout.js +22 -13
- package/dist/plot/core/marginals.d.ts +170 -0
- package/dist/plot/core/marginals.js +436 -0
- package/dist/plot/core/pan-zoom.svelte.d.ts +35 -0
- package/dist/plot/core/pan-zoom.svelte.js +221 -0
- package/dist/plot/core/placed-tween.svelte.d.ts +21 -0
- package/dist/plot/core/placed-tween.svelte.js +68 -0
- package/dist/plot/core/reference-line.d.ts +10 -10
- package/dist/plot/core/reference-line.js +7 -7
- package/dist/plot/core/scales.d.ts +40 -25
- package/dist/plot/core/scales.js +49 -21
- package/dist/plot/core/svg.d.ts +2 -1
- package/dist/plot/core/types/fills.d.ts +101 -0
- package/dist/plot/core/types/fills.js +15 -0
- package/dist/plot/core/types/plot-3d.d.ts +87 -0
- package/dist/plot/core/types/plot-3d.js +4 -0
- package/dist/plot/core/types/reference-lines.d.ts +140 -0
- package/dist/plot/core/types/reference-lines.js +9 -0
- package/dist/plot/core/types.d.ts +47 -331
- package/dist/plot/core/types.js +23 -20
- package/dist/plot/core/utils/hierarchy-chart.d.ts +51 -0
- package/dist/plot/core/utils/hierarchy-chart.js +179 -0
- package/dist/plot/core/utils/hierarchy-labels.d.ts +20 -0
- package/dist/plot/core/utils/hierarchy-labels.js +99 -0
- package/dist/plot/core/utils/label-placement.d.ts +1 -1
- package/dist/plot/core/utils/label-placement.js +5 -5
- package/dist/plot/core/utils.d.ts +2 -1
- package/dist/plot/histogram/Histogram.svelte +373 -631
- package/dist/plot/histogram/Histogram.svelte.d.ts +7 -7
- package/dist/plot/histogram/HistogramControls.svelte +30 -28
- package/dist/plot/histogram/HistogramControls.svelte.d.ts +1 -1
- package/dist/plot/histogram/histogram.d.ts +31 -0
- package/dist/plot/histogram/histogram.js +70 -0
- package/dist/plot/histogram/index.d.ts +1 -0
- package/dist/plot/histogram/index.js +1 -0
- package/dist/plot/index.d.ts +1 -0
- package/dist/plot/index.js +1 -0
- package/dist/plot/sankey/Sankey.svelte +79 -73
- package/dist/plot/sankey/Sankey.svelte.d.ts +3 -3
- package/dist/plot/sankey/SankeyControls.svelte +22 -16
- package/dist/plot/sankey/sankey.js +3 -1
- package/dist/plot/scatter/BinnedScatterPlot.svelte +264 -112
- package/dist/plot/scatter/BinnedScatterPlot.svelte.d.ts +11 -4
- package/dist/plot/scatter/ElementScatter.svelte +4 -1
- package/dist/plot/scatter/ScatterPlot.svelte +623 -821
- package/dist/plot/scatter/ScatterPlot.svelte.d.ts +9 -15
- package/dist/plot/scatter/ScatterPlotControls.svelte +18 -19
- package/dist/plot/scatter/ScatterPlotControls.svelte.d.ts +1 -1
- package/dist/plot/scatter/ScatterPoint.svelte +16 -9
- package/dist/plot/scatter/binned-scatter-types.d.ts +6 -12
- package/dist/plot/scatter/binned-scatter-types.js +6 -1
- package/dist/plot/scatter/index.d.ts +1 -1
- package/dist/plot/scatter/scatter-data.d.ts +1 -1
- package/dist/plot/scatter/scatter-data.js +8 -7
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte +40 -60
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte.d.ts +6 -14
- package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte +17 -15
- package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte.d.ts +5 -5
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte +232 -234
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte.d.ts +5 -14
- package/dist/plot/scatter-3d/Surface3D.svelte +9 -17
- package/dist/plot/scatter-3d/Surface3D.svelte.d.ts +4 -3
- package/dist/plot/sunburst/Sunburst.svelte +256 -338
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +4 -3
- package/dist/plot/sunburst/index.d.ts +1 -1
- package/dist/plot/sunburst/index.js +2 -1
- package/dist/plot/sunburst/render.d.ts +2 -2
- package/dist/plot/sunburst/render.js +47 -22
- package/dist/plot/sunburst/sunburst.d.ts +5 -1
- package/dist/plot/sunburst/sunburst.js +14 -4
- package/dist/plot/treemap/Treemap.svelte +907 -0
- package/dist/plot/treemap/Treemap.svelte.d.ts +84 -0
- package/dist/plot/treemap/index.d.ts +3 -0
- package/dist/plot/treemap/index.js +4 -0
- package/dist/plot/treemap/treemap.d.ts +26 -0
- package/dist/plot/treemap/treemap.js +99 -0
- package/dist/rdf/RdfPlot.svelte +22 -26
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/calc-rdf.js +4 -8
- package/dist/sanitize.js +14 -3
- package/dist/scene/SceneCamera.svelte +62 -0
- package/dist/scene/SceneCamera.svelte.d.ts +19 -0
- package/dist/scene/bind-renderer.svelte.d.ts +2 -0
- package/dist/scene/bind-renderer.svelte.js +22 -0
- package/dist/scene/index.d.ts +4 -0
- package/dist/scene/index.js +5 -0
- package/dist/scene/props.js +52 -0
- package/dist/scene/types.d.ts +26 -0
- package/dist/scene/types.js +1 -0
- package/dist/settings.d.ts +33 -11
- package/dist/settings.js +136 -51
- package/dist/spectral/Bands.svelte +231 -237
- package/dist/spectral/Bands.svelte.d.ts +3 -2
- package/dist/spectral/BandsAndDos.svelte +29 -29
- package/dist/spectral/BrillouinBandsDos.svelte +21 -29
- package/dist/spectral/Dos.svelte +75 -77
- package/dist/spectral/Dos.svelte.d.ts +2 -1
- package/dist/spectral/helpers.d.ts +9 -9
- package/dist/spectral/helpers.js +66 -70
- package/dist/state.svelte.d.ts +0 -7
- package/dist/state.svelte.js +5 -24
- package/dist/structure/Arrow.svelte +6 -21
- package/dist/structure/ArrowInstances.svelte +160 -0
- package/dist/structure/ArrowInstances.svelte.d.ts +16 -0
- package/dist/structure/AtomLegend.svelte +115 -75
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/Bond.svelte +31 -23
- package/dist/structure/CanvasTooltip.svelte +16 -3
- package/dist/structure/CellSelect.svelte +22 -29
- package/dist/structure/CellSelect.svelte.d.ts +2 -1
- package/dist/structure/Cylinder.svelte +24 -40
- package/dist/structure/InstancedAtoms.svelte +114 -0
- package/dist/structure/InstancedAtoms.svelte.d.ts +15 -0
- package/dist/structure/Lattice.svelte +85 -149
- package/dist/structure/SiteLabels.svelte +122 -0
- package/dist/structure/SiteLabels.svelte.d.ts +18 -0
- package/dist/structure/Structure.svelte +725 -735
- package/dist/structure/Structure.svelte.d.ts +8 -16
- package/dist/structure/StructureCarousel.svelte +630 -0
- package/dist/structure/StructureCarousel.svelte.d.ts +19 -0
- package/dist/structure/StructureControls.svelte +298 -325
- package/dist/structure/StructureControls.svelte.d.ts +5 -3
- package/dist/structure/StructureExportPane.svelte +62 -168
- package/dist/structure/StructureExportPane.svelte.d.ts +4 -5
- package/dist/structure/StructureInfoPane.svelte +77 -69
- package/dist/structure/StructureInfoPane.svelte.d.ts +6 -6
- package/dist/structure/StructureScene.svelte +758 -600
- package/dist/structure/StructureScene.svelte.d.ts +24 -20
- package/dist/structure/StructureViewport.svelte +386 -0
- package/dist/structure/StructureViewport.svelte.d.ts +63 -0
- package/dist/structure/atom-label-placement.d.ts +18 -0
- package/dist/structure/atom-label-placement.js +115 -0
- package/dist/structure/atom-properties.d.ts +3 -1
- package/dist/structure/atom-properties.js +115 -54
- package/dist/structure/bond-order-perception.js +2 -4
- package/dist/structure/bonding.d.ts +12 -2
- package/dist/structure/bonding.js +172 -73
- package/dist/structure/edit-history.d.ts +6 -0
- package/dist/structure/edit-history.js +27 -0
- package/dist/structure/export.d.ts +25 -4
- package/dist/structure/export.js +103 -153
- package/dist/structure/format-detect.d.ts +1 -0
- package/dist/structure/format-detect.js +22 -0
- package/dist/structure/geometry.d.ts +9 -0
- package/dist/structure/geometry.js +27 -0
- package/dist/structure/index.d.ts +18 -1
- package/dist/structure/index.js +15 -2
- package/dist/structure/measure.d.ts +1 -1
- package/dist/structure/measure.js +6 -12
- package/dist/structure/parse.d.ts +5 -3
- package/dist/structure/parse.js +551 -567
- package/dist/structure/partial-occupancy.d.ts +0 -1
- package/dist/structure/partial-occupancy.js +5 -3
- package/dist/structure/pbc.d.ts +1 -1
- package/dist/structure/pbc.js +204 -51
- package/dist/structure/polyhedra.d.ts +40 -0
- package/dist/structure/polyhedra.js +587 -0
- package/dist/structure/site.d.ts +4 -0
- package/dist/structure/site.js +1 -0
- package/dist/structure/supercell.d.ts +1 -2
- package/dist/structure/supercell.js +10 -15
- package/dist/structure/validation.js +5 -6
- package/dist/symmetry/SymmetryElementControls.svelte +69 -0
- package/dist/symmetry/SymmetryElementControls.svelte.d.ts +9 -0
- package/dist/symmetry/SymmetryElements.svelte +350 -0
- package/dist/symmetry/SymmetryElements.svelte.d.ts +24 -0
- package/dist/symmetry/SymmetryStats.svelte +142 -49
- package/dist/symmetry/WyckoffTable.svelte +58 -16
- package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -0
- package/dist/symmetry/cell-transform.js +8 -14
- package/dist/symmetry/index.d.ts +15 -4
- package/dist/symmetry/index.js +308 -81
- package/dist/symmetry/spacegroups.d.ts +5 -1
- package/dist/symmetry/spacegroups.js +18 -3
- package/dist/symmetry/symmetry-elements.d.ts +33 -0
- package/dist/symmetry/symmetry-elements.js +521 -0
- package/dist/symmetry/wyckoff-db.d.ts +9 -0
- package/dist/symmetry/wyckoff-db.js +87 -0
- package/dist/table/HeatmapTable.svelte +1104 -378
- package/dist/table/HeatmapTable.svelte.d.ts +12 -2
- package/dist/table/ToggleMenu.svelte +5 -12
- package/dist/table/index.d.ts +21 -6
- package/dist/table/index.js +34 -21
- package/dist/theme/ThemeControl.svelte +16 -8
- package/dist/theme/index.d.ts +1 -5
- package/dist/theme/index.js +4 -10
- package/dist/theme/themes.mjs +14 -7
- package/dist/tooltip/KCoords.svelte +4 -1
- package/dist/tooltip/TooltipContent.svelte +2 -5
- package/dist/trajectory/Trajectory.svelte +556 -352
- package/dist/trajectory/Trajectory.svelte.d.ts +10 -22
- package/dist/trajectory/TrajectoryError.svelte +11 -8
- package/dist/trajectory/TrajectoryExportPane.svelte +28 -54
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +4 -5
- package/dist/trajectory/TrajectoryInfoPane.svelte +88 -99
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -2
- package/dist/trajectory/constants.js +6 -2
- package/dist/trajectory/extract.js +73 -71
- package/dist/trajectory/format-detect.d.ts +0 -1
- package/dist/trajectory/format-detect.js +13 -17
- package/dist/trajectory/frame-reader.d.ts +2 -1
- package/dist/trajectory/frame-reader.js +74 -136
- package/dist/trajectory/helpers.d.ts +12 -2
- package/dist/trajectory/helpers.js +68 -37
- package/dist/trajectory/index.d.ts +1 -0
- package/dist/trajectory/index.js +3 -0
- package/dist/trajectory/parse/ase.d.ts +9 -1
- package/dist/trajectory/parse/ase.js +47 -32
- package/dist/trajectory/parse/diagnostics.d.ts +3 -0
- package/dist/trajectory/parse/diagnostics.js +14 -0
- package/dist/trajectory/parse/h5-utils.d.ts +13 -0
- package/dist/trajectory/parse/h5-utils.js +109 -0
- package/dist/trajectory/parse/hdf5.d.ts +1 -1
- package/dist/trajectory/parse/hdf5.js +116 -106
- package/dist/trajectory/parse/index.d.ts +3 -4
- package/dist/trajectory/parse/index.js +68 -119
- package/dist/trajectory/parse/lammps.d.ts +0 -2
- package/dist/trajectory/parse/lammps.js +14 -16
- package/dist/trajectory/parse/pymatgen.d.ts +2 -0
- package/dist/trajectory/parse/pymatgen.js +74 -0
- package/dist/trajectory/parse/vasp.js +13 -9
- package/dist/trajectory/parse/vaspout-electronic.d.ts +13 -0
- package/dist/trajectory/parse/vaspout-electronic.js +207 -0
- package/dist/trajectory/parse/vaspout-h5.d.ts +5 -0
- package/dist/trajectory/parse/vaspout-h5.js +284 -0
- package/dist/trajectory/parse/xyz.d.ts +9 -21
- package/dist/trajectory/parse/xyz.js +38 -39
- package/dist/trajectory/plotting.d.ts +8 -10
- package/dist/trajectory/plotting.js +102 -127
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +8 -1
- package/dist/xrd/XrdPlot.svelte +56 -85
- package/dist/xrd/broadening.d.ts +2 -1
- package/dist/xrd/broadening.js +2 -1
- package/dist/xrd/calc-xrd.js +8 -15
- package/dist/xrd/index.d.ts +2 -2
- package/dist/xrd/parse.d.ts +0 -1
- package/dist/xrd/parse.js +56 -73
- package/package.json +77 -36
- package/dist/api/mp.d.ts +0 -6
- package/dist/api/mp.js +0 -22
- package/dist/element/data.json +0 -11864
- package/dist/fermi-surface/marching-cubes.d.ts +0 -2
- package/dist/fermi-surface/marching-cubes.js +0 -2
- package/dist/plot/core/hover-lock.svelte.d.ts +0 -14
- package/dist/plot/core/hover-lock.svelte.js +0 -45
- package/dist/plot/sunburst/SunburstControls.svelte +0 -200
- package/dist/structure/label-placement.d.ts +0 -14
- package/dist/structure/label-placement.js +0 -72
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { 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" | "show_image_atoms" | "lattice_props" | "atom_color_config" | "volumetric_data" | "isosurface_settings" | "scene_props" | "supercell_scaling" | "cell_type" | "active_volume_idx" | "supercell_loading">;
|
|
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,42 +26,30 @@
|
|
|
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`,
|
|
43
36
|
format: `json`,
|
|
44
|
-
hint:
|
|
45
|
-
`<a href="https://pymatgen.org" target="_blank">Pymatgen</a> JSON format - Python Materials Genomics structure serialization, widely used in computational materials science`,
|
|
37
|
+
hint: `<a href="https://pymatgen.org" target="_blank">Pymatgen</a> JSON format - Python Materials Genomics structure serialization, widely used in computational materials science`,
|
|
46
38
|
},
|
|
47
39
|
{
|
|
48
40
|
label: `XYZ`,
|
|
49
41
|
format: `xyz`,
|
|
50
|
-
hint:
|
|
51
|
-
`<a href="https://wiki.fysik.dtu.dk/ase" target="_blank">ASE</a> extended XYZ format - human-readable atomic coordinates used by the Atomic Simulation Environment`,
|
|
42
|
+
hint: `<a href="https://wiki.fysik.dtu.dk/ase" target="_blank">ASE</a> extended XYZ format - human-readable atomic coordinates used by the Atomic Simulation Environment`,
|
|
52
43
|
},
|
|
53
44
|
{
|
|
54
45
|
label: `CIF`,
|
|
55
46
|
format: `cif`,
|
|
56
|
-
hint:
|
|
57
|
-
`Crystallographic Information File - standard format from the <a href="https://iucr.org" target="_blank">IUCr</a> for crystal structure data exchange`,
|
|
47
|
+
hint: `Crystallographic Information File - standard format from the <a href="https://iucr.org" target="_blank">IUCr</a> for crystal structure data exchange`,
|
|
58
48
|
},
|
|
59
49
|
{
|
|
60
50
|
label: `POSCAR`,
|
|
61
51
|
format: `poscar`,
|
|
62
|
-
hint:
|
|
63
|
-
`<a href="https://vasp.at" target="_blank">VASP</a> POSCAR format - input geometry file for the Vienna Ab initio Simulation Package`,
|
|
52
|
+
hint: `<a href="https://vasp.at" target="_blank">VASP</a> POSCAR format - input geometry file for the Vienna Ab initio Simulation Package`,
|
|
64
53
|
},
|
|
65
54
|
] as const
|
|
66
55
|
|
|
@@ -68,54 +57,23 @@
|
|
|
68
57
|
{
|
|
69
58
|
label: `GLB`,
|
|
70
59
|
format: `glb`,
|
|
71
|
-
hint:
|
|
72
|
-
`Export as GLB (binary GLTF) - preserves element colors and materials, ideal for visualization in Blender, Unity, web viewers`,
|
|
60
|
+
hint: `Export as GLB (binary GLTF) - preserves element colors and materials, ideal for visualization in Blender, Unity, web viewers`,
|
|
73
61
|
},
|
|
74
62
|
{
|
|
75
63
|
label: `OBJ`,
|
|
76
64
|
format: `obj`,
|
|
77
|
-
hint:
|
|
78
|
-
`Export as OBJ (Wavefront Object) - widely supported 3D format with material references, works in most 3D applications`,
|
|
65
|
+
hint: `Export as OBJ (Wavefront Object) - widely supported 3D format with material references, works in most 3D applications`,
|
|
79
66
|
},
|
|
80
67
|
] as const
|
|
81
68
|
|
|
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
|
-
|
|
69
|
+
// Clipboard content for a text format; must not throw (ExportPane evaluates on click)
|
|
70
|
+
function get_text_content(format: StructTextFormat): string | null {
|
|
71
|
+
if (!structure) return null
|
|
101
72
|
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)
|
|
73
|
+
return exports.STRUCT_TEXT_FORMATS[format].to_str(structure)
|
|
117
74
|
} catch (error) {
|
|
118
75
|
console.error(`Failed to copy ${format.toUpperCase()} to clipboard`, error)
|
|
76
|
+
return null
|
|
119
77
|
}
|
|
120
78
|
}
|
|
121
79
|
|
|
@@ -124,7 +82,6 @@
|
|
|
124
82
|
console.warn(`No scene available for ${format.toUpperCase()} export`)
|
|
125
83
|
return
|
|
126
84
|
}
|
|
127
|
-
|
|
128
85
|
try {
|
|
129
86
|
if (format === `glb`) exports.export_structure_as_glb(scene, structure)
|
|
130
87
|
else if (format === `obj`) exports.export_structure_as_obj(scene, structure)
|
|
@@ -135,118 +92,55 @@
|
|
|
135
92
|
|
|
136
93
|
let has_canvas = $state(false)
|
|
137
94
|
|
|
138
|
-
$effect(() =>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
95
|
+
$effect(() => observe_canvas_presence(wrapper, (val) => (has_canvas = val)))
|
|
96
|
+
|
|
97
|
+
const sections = $derived<ExportSection[]>([
|
|
98
|
+
{
|
|
99
|
+
title: `Export as text`,
|
|
100
|
+
items: text_export_formats.map(({ label, format, hint }) => ({
|
|
101
|
+
label,
|
|
102
|
+
hint,
|
|
103
|
+
disabled: !structure,
|
|
104
|
+
on_download: () => structure && exports.export_structure_as(format, structure),
|
|
105
|
+
copy_text: () => get_text_content(format),
|
|
106
|
+
})),
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
title: `Export as image`,
|
|
110
|
+
items: [
|
|
111
|
+
{
|
|
112
|
+
label: `PNG`,
|
|
113
|
+
disabled: !has_canvas,
|
|
114
|
+
show_dpi: true,
|
|
115
|
+
on_download: () => {
|
|
116
|
+
const canvas = wrapper?.querySelector(`canvas`)
|
|
117
|
+
if (canvas) export_canvas_as_png(canvas, structure, png_dpi, scene, camera)
|
|
118
|
+
else console.warn(`Canvas element not found for PNG export`)
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
title: `Export as 3D model`,
|
|
125
|
+
items: model_3d_formats.map(({ label, format, hint }) => ({
|
|
126
|
+
label,
|
|
127
|
+
hint,
|
|
128
|
+
disabled: !scene,
|
|
129
|
+
on_download: () => handle_3d_export(format),
|
|
130
|
+
})),
|
|
131
|
+
},
|
|
132
|
+
])
|
|
149
133
|
</script>
|
|
150
134
|
|
|
151
|
-
<
|
|
152
|
-
bind:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
135
|
+
<ExportPane
|
|
136
|
+
bind:export_pane_open
|
|
137
|
+
bind:png_dpi
|
|
138
|
+
{sections}
|
|
139
|
+
{pane_props}
|
|
156
140
|
toggle_props={{
|
|
157
141
|
title: export_pane_open ? `` : `Export Structure`,
|
|
158
142
|
...toggle_props,
|
|
159
143
|
class: `structure-export-toggle ${toggle_props?.class ?? ``}`,
|
|
160
144
|
}}
|
|
161
145
|
{...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>
|
|
146
|
+
/>
|
|
@@ -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;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { PaneProps, PaneToggleProps } from '../overlays'
|
|
2
3
|
import { get_electro_neg_formula } from '../composition'
|
|
3
4
|
import { element_data, type ElementSymbol } from '../element'
|
|
4
5
|
import Icon from '../Icon.svelte'
|
|
5
6
|
import { format_num } from '../labels'
|
|
6
7
|
import type { InfoItem } from '../layout'
|
|
8
|
+
import type { Vec2 } from '../math'
|
|
7
9
|
import CopyButton from '../overlays/CopyButton.svelte'
|
|
8
10
|
import DraggablePane from '../overlays/DraggablePane.svelte'
|
|
9
11
|
import { sanitize_html } from '../sanitize'
|
|
@@ -14,7 +16,7 @@
|
|
|
14
16
|
import type { MoyoDataset } from '@spglib/moyo-wasm'
|
|
15
17
|
import type { ComponentProps } from 'svelte'
|
|
16
18
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
17
|
-
import {
|
|
19
|
+
import { create_clipboard_feedback } from '../overlays'
|
|
18
20
|
|
|
19
21
|
type SiteDetail = {
|
|
20
22
|
label: string
|
|
@@ -39,8 +41,7 @@
|
|
|
39
41
|
},
|
|
40
42
|
{
|
|
41
43
|
label: `Atom Selection`,
|
|
42
|
-
value:
|
|
43
|
-
`Click atoms to select them, then pick distance or angle mode to measure all pairwise distances/angles`,
|
|
44
|
+
value: `Click atoms to select them, then pick distance or angle mode to measure all pairwise distances/angles`,
|
|
44
45
|
},
|
|
45
46
|
{
|
|
46
47
|
label: `Navigation`,
|
|
@@ -52,8 +53,7 @@
|
|
|
52
53
|
},
|
|
53
54
|
{
|
|
54
55
|
label: `Colors`,
|
|
55
|
-
value:
|
|
56
|
-
`Click legend labels to change colors, double-click to reset, right-click to remap elements`,
|
|
56
|
+
value: `Click legend labels to change colors, double-click to reset, right-click to remap elements`,
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
label: `Keyboard`,
|
|
@@ -75,37 +75,25 @@
|
|
|
75
75
|
}: Omit<HTMLAttributes<HTMLDivElement>, `onclose`> & {
|
|
76
76
|
structure: AnyStructure
|
|
77
77
|
pane_open?: boolean
|
|
78
|
-
atom_count_thresholds?:
|
|
79
|
-
toggle_props?:
|
|
80
|
-
pane_props?:
|
|
78
|
+
atom_count_thresholds?: Vec2 // if atom count is less than min_threshold, show sites, if atom count is greater than max_threshold, hide sites. in between, show sites behind a toggle button.
|
|
79
|
+
toggle_props?: PaneToggleProps
|
|
80
|
+
pane_props?: PaneProps
|
|
81
81
|
highlighted_sites?: number[] // Sites highlighted from Wyckoff table hover
|
|
82
82
|
hovered_site_idx?: number | null // Site hovered in this pane or in the 3D scene
|
|
83
83
|
selected_sites?: number[] // Sites selected from Wyckoff table click
|
|
84
84
|
sym_data?: MoyoDataset | null // Symmetry analysis data (bindable for external access)
|
|
85
85
|
} = $props()
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
const { copied, copy } = create_clipboard_feedback()
|
|
88
88
|
let sites_expanded = $state(false)
|
|
89
89
|
let site_filter = $state(``)
|
|
90
90
|
let site_window_start = $state(0)
|
|
91
91
|
let site_cards_el = $state<HTMLDivElement>()
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
await navigator.clipboard.writeText(`${label}: ${value}`)
|
|
96
|
-
copied_items.add(key)
|
|
97
|
-
setTimeout(() => copied_items.delete(key), 1000)
|
|
98
|
-
} catch (error) {
|
|
99
|
-
console.error(`Failed to copy to clipboard:`, error)
|
|
100
|
-
}
|
|
101
|
-
}
|
|
93
|
+
const copy_to_clipboard = (label: string, value: string, key: string): Promise<void> =>
|
|
94
|
+
copy(`${label}: ${value}`, key)
|
|
102
95
|
|
|
103
|
-
function copy_event(
|
|
104
|
-
event: MouseEvent,
|
|
105
|
-
label: string,
|
|
106
|
-
value: string,
|
|
107
|
-
key: string,
|
|
108
|
-
) {
|
|
96
|
+
function copy_event(event: MouseEvent, label: string, value: string, key: string) {
|
|
109
97
|
event.stopPropagation()
|
|
110
98
|
copy_to_clipboard(label, value, key)
|
|
111
99
|
}
|
|
@@ -126,9 +114,8 @@
|
|
|
126
114
|
: [...selected_sites, site_idx]
|
|
127
115
|
return
|
|
128
116
|
}
|
|
129
|
-
selected_sites =
|
|
130
|
-
? []
|
|
131
|
-
: [site_idx]
|
|
117
|
+
selected_sites =
|
|
118
|
+
selected_sites.length === 1 && selected_sites[0] === site_idx ? [] : [site_idx]
|
|
132
119
|
}
|
|
133
120
|
|
|
134
121
|
function update_site_filter(event: Event): void {
|
|
@@ -159,9 +146,10 @@
|
|
|
159
146
|
current_card.parentElement?.querySelectorAll<HTMLDivElement>(`.site-card`) ?? [],
|
|
160
147
|
)
|
|
161
148
|
const current_idx = sibling_cards.indexOf(current_card)
|
|
162
|
-
const next_idx =
|
|
163
|
-
|
|
164
|
-
|
|
149
|
+
const next_idx =
|
|
150
|
+
event.key === `ArrowDown`
|
|
151
|
+
? Math.min(current_idx + 1, sibling_cards.length - 1)
|
|
152
|
+
: Math.max(current_idx - 1, 0)
|
|
165
153
|
sibling_cards[next_idx]?.focus()
|
|
166
154
|
}
|
|
167
155
|
|
|
@@ -169,10 +157,9 @@
|
|
|
169
157
|
element_data?.find((element_record) => element_record.symbol === element)?.name || element
|
|
170
158
|
|
|
171
159
|
const site_summary = (card: SiteCard): string =>
|
|
172
|
-
[
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
].join(`; `)
|
|
160
|
+
[card.element_name, ...card.details.map(({ label, value }) => `${label}: ${value}`)].join(
|
|
161
|
+
`; `,
|
|
162
|
+
)
|
|
176
163
|
|
|
177
164
|
function format_site_property(prop_key: string, prop_value: unknown): SiteDetail | null {
|
|
178
165
|
if (prop_value == null) return null
|
|
@@ -185,14 +172,16 @@
|
|
|
185
172
|
let tooltip: string | undefined
|
|
186
173
|
|
|
187
174
|
if (
|
|
188
|
-
prop_key === `force` &&
|
|
189
|
-
|
|
175
|
+
prop_key === `force` &&
|
|
176
|
+
Array.isArray(prop_value) &&
|
|
177
|
+
prop_value.length === 3 &&
|
|
178
|
+
prop_value.every((value) => typeof value === `number`)
|
|
190
179
|
) {
|
|
191
180
|
const force_values = prop_value as [number, number, number]
|
|
192
181
|
const value = `${format_num(Math.hypot(...force_values), `.3~f`)} eV/Å`
|
|
193
|
-
tooltip = `Force vector: ${
|
|
194
|
-
|
|
195
|
-
|
|
182
|
+
tooltip = `Force vector: ${force_values
|
|
183
|
+
.map((force) => format_num(force, `.3~f`))
|
|
184
|
+
.join(`, `)} eV/Å`
|
|
196
185
|
return { label: prop_key, value, key: prop_key, tooltip }
|
|
197
186
|
}
|
|
198
187
|
if (prop_key === `magmom` || prop_key.includes(`magnet`)) {
|
|
@@ -204,7 +193,7 @@
|
|
|
204
193
|
|
|
205
194
|
const value = Array.isArray(prop_value)
|
|
206
195
|
? format_value_list(prop_value)
|
|
207
|
-
: format_numeric_value(prop_value) ?? String(prop_value)
|
|
196
|
+
: (format_numeric_value(prop_value) ?? String(prop_value))
|
|
208
197
|
return { label: prop_key, value, key: prop_key }
|
|
209
198
|
}
|
|
210
199
|
|
|
@@ -267,7 +256,9 @@
|
|
|
267
256
|
// Symmetry Info
|
|
268
257
|
if (`lattice` in structure && sym_data) {
|
|
269
258
|
const { operations } = sym_data
|
|
270
|
-
let translations = 0,
|
|
259
|
+
let translations = 0,
|
|
260
|
+
rotations = 0,
|
|
261
|
+
roto_translations = 0
|
|
271
262
|
for (const op of operations) {
|
|
272
263
|
const has_translation = op.translation.some((offset) => offset !== 0)
|
|
273
264
|
const is_identity = String(op.rotation) === `1,0,0,0,1,0,0,0,1`
|
|
@@ -276,14 +267,15 @@
|
|
|
276
267
|
else roto_translations++
|
|
277
268
|
}
|
|
278
269
|
|
|
279
|
-
const international_symbol = (
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
270
|
+
const international_symbol = (
|
|
271
|
+
sym_data as MoyoDataset & {
|
|
272
|
+
international_short?: string
|
|
273
|
+
}
|
|
274
|
+
).international_short
|
|
275
|
+
const space_group_symbol = (sym_data.hm_symbol ?? international_symbol)?.replaceAll(
|
|
276
|
+
/\s+/g,
|
|
277
|
+
``,
|
|
278
|
+
)
|
|
287
279
|
const space_group_value = space_group_symbol
|
|
288
280
|
? `${sym_data.number} (${space_group_symbol})`
|
|
289
281
|
: String(sym_data.number)
|
|
@@ -292,8 +284,16 @@
|
|
|
292
284
|
title: `Symmetry`,
|
|
293
285
|
items: [
|
|
294
286
|
{ label: `Space Group`, value: space_group_value, key: `symmetry-space-group` },
|
|
295
|
-
{
|
|
296
|
-
|
|
287
|
+
{
|
|
288
|
+
label: `Hall Number`,
|
|
289
|
+
value: String(sym_data.hall_number),
|
|
290
|
+
key: `symmetry-hall-number`,
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
label: `Pearson Symbol`,
|
|
294
|
+
value: sym_data.pearson_symbol,
|
|
295
|
+
key: `symmetry-pearson-symbol`,
|
|
296
|
+
},
|
|
297
297
|
{
|
|
298
298
|
label: `Symmetry Ops`,
|
|
299
299
|
value: `${operations.length} (${translations} trans, ${rotations} rot, ${roto_translations} roto-trans)`,
|
|
@@ -345,9 +345,9 @@
|
|
|
345
345
|
element_name,
|
|
346
346
|
title,
|
|
347
347
|
details,
|
|
348
|
-
search_text: `${title} ${element} ${element_name} ${
|
|
349
|
-
|
|
350
|
-
|
|
348
|
+
search_text: `${title} ${element} ${element_name} ${details
|
|
349
|
+
.map(({ label, value }) => `${label} ${value}`)
|
|
350
|
+
.join(` `)}`.toLowerCase(),
|
|
351
351
|
}
|
|
352
352
|
})
|
|
353
353
|
})
|
|
@@ -380,8 +380,7 @@
|
|
|
380
380
|
if (!pane_open || selected_site_idx === undefined) return
|
|
381
381
|
const visible_idx = visible_site_cards.findIndex(({ idx }) => idx === selected_site_idx)
|
|
382
382
|
if (visible_idx === -1) return
|
|
383
|
-
const selected_window_start = Math.floor(visible_idx / SITE_WINDOW_SIZE) *
|
|
384
|
-
SITE_WINDOW_SIZE
|
|
383
|
+
const selected_window_start = Math.floor(visible_idx / SITE_WINDOW_SIZE) * SITE_WINDOW_SIZE
|
|
385
384
|
if (selected_window_start !== site_window_start) {
|
|
386
385
|
site_window_start = selected_window_start
|
|
387
386
|
return
|
|
@@ -432,7 +431,7 @@
|
|
|
432
431
|
>
|
|
433
432
|
<span>{@html sanitize_html(label)}</span>
|
|
434
433
|
<span title={tooltip}>{@html sanitize_html(value)}</span>
|
|
435
|
-
{#if key &&
|
|
434
|
+
{#if key && copied.has(key)}
|
|
436
435
|
<Icon
|
|
437
436
|
icon="Check"
|
|
438
437
|
style="color: var(--success-color, #10b981); width: 12px; height: 12px"
|
|
@@ -445,8 +444,8 @@
|
|
|
445
444
|
{#if section.title === `Symmetry` && wyckoff_positions.length > 0}
|
|
446
445
|
<WyckoffTable
|
|
447
446
|
{wyckoff_positions}
|
|
448
|
-
on_hover={(site_indices) => highlighted_sites = site_indices ?? []}
|
|
449
|
-
on_click={(site_indices) => selected_sites = site_indices ?? []}
|
|
447
|
+
on_hover={(site_indices) => (highlighted_sites = site_indices ?? [])}
|
|
448
|
+
on_click={(site_indices) => (selected_sites = site_indices ?? [])}
|
|
450
449
|
style="width: 100%; margin-top: 0.5em; font-size: 0.8em"
|
|
451
450
|
/>
|
|
452
451
|
{/if}
|
|
@@ -470,7 +469,9 @@
|
|
|
470
469
|
{/if}
|
|
471
470
|
</div>
|
|
472
471
|
{#if sites_hidden_by_threshold}
|
|
473
|
-
<p class="sites-note">
|
|
472
|
+
<p class="sites-note">
|
|
473
|
+
Site list hidden for this {structure.sites.length}-site structure.
|
|
474
|
+
</p>
|
|
474
475
|
{:else if site_cards.length > 0}
|
|
475
476
|
<input
|
|
476
477
|
class="site-filter"
|
|
@@ -489,19 +490,21 @@
|
|
|
489
490
|
type="button"
|
|
490
491
|
disabled={site_window_start === 0}
|
|
491
492
|
onclick={() =>
|
|
492
|
-
site_window_start = Math.max(0, site_window_start - SITE_WINDOW_SIZE)}
|
|
493
|
+
(site_window_start = Math.max(0, site_window_start - SITE_WINDOW_SIZE))}
|
|
493
494
|
>
|
|
494
495
|
Previous
|
|
495
496
|
</button>
|
|
496
|
-
<span
|
|
497
|
+
<span
|
|
498
|
+
>{site_window_start + 1}-{site_window_end} of {visible_site_cards.length}</span
|
|
499
|
+
>
|
|
497
500
|
<button
|
|
498
501
|
type="button"
|
|
499
502
|
disabled={site_window_end >= visible_site_cards.length}
|
|
500
503
|
onclick={() =>
|
|
501
|
-
site_window_start = Math.min(
|
|
504
|
+
(site_window_start = Math.min(
|
|
502
505
|
Math.max(0, visible_site_cards.length - SITE_WINDOW_SIZE),
|
|
503
506
|
site_window_start + SITE_WINDOW_SIZE,
|
|
504
|
-
)}
|
|
507
|
+
))}
|
|
505
508
|
>
|
|
506
509
|
Next
|
|
507
510
|
</button>
|
|
@@ -509,8 +512,8 @@
|
|
|
509
512
|
{/if}
|
|
510
513
|
<div class="site-cards" bind:this={site_cards_el}>
|
|
511
514
|
{#each rendered_site_cards as card (card.idx)}
|
|
512
|
-
{@const is_highlighted =
|
|
513
|
-
hovered_site_idx === card.idx}
|
|
515
|
+
{@const is_highlighted =
|
|
516
|
+
highlighted_sites.includes(card.idx) || hovered_site_idx === card.idx}
|
|
514
517
|
{@const is_selected = selected_sites.includes(card.idx)}
|
|
515
518
|
<div
|
|
516
519
|
class="site-card"
|
|
@@ -537,9 +540,14 @@
|
|
|
537
540
|
<CopyButton
|
|
538
541
|
label="Copy {card.title}"
|
|
539
542
|
title="Copy {card.title}"
|
|
540
|
-
copied={
|
|
543
|
+
copied={copied.has(`site-${card.idx}-summary`)}
|
|
541
544
|
onclick={(event) =>
|
|
542
|
-
copy_event(
|
|
545
|
+
copy_event(
|
|
546
|
+
event,
|
|
547
|
+
card.title,
|
|
548
|
+
site_summary(card),
|
|
549
|
+
`site-${card.idx}-summary`,
|
|
550
|
+
)}
|
|
543
551
|
/>
|
|
544
552
|
</div>
|
|
545
553
|
<div class="site-card-details">
|
|
@@ -550,7 +558,7 @@
|
|
|
550
558
|
<CopyButton
|
|
551
559
|
label="Copy {card.title} {detail.label}"
|
|
552
560
|
title="Copy {detail.label}"
|
|
553
|
-
copied={
|
|
561
|
+
copied={copied.has(`site-${card.idx}-${detail.key}`)}
|
|
554
562
|
onclick={(event) =>
|
|
555
563
|
copy_event(
|
|
556
564
|
event,
|