matterviz 0.4.1 → 0.4.3
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 +48 -60
- package/dist/Icon.svelte +7 -4
- package/dist/MillerIndexInput.svelte +2 -2
- package/dist/api/optimade.js +10 -7
- package/dist/app.css +68 -0
- package/dist/brillouin/BrillouinZone.svelte +90 -91
- package/dist/brillouin/BrillouinZone.svelte.d.ts +5 -7
- package/dist/brillouin/BrillouinZoneControls.svelte +3 -6
- package/dist/brillouin/BrillouinZoneExportPane.svelte +18 -14
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +6 -10
- package/dist/brillouin/BrillouinZoneScene.svelte +46 -68
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +1 -1
- package/dist/brillouin/compute.js +10 -16
- package/dist/brillouin/geometry.js +2 -2
- package/dist/chempot-diagram/ChemPotDiagram.svelte +48 -50
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +61 -169
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +559 -755
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +1 -1
- package/dist/chempot-diagram/async-compute.svelte.js +13 -14
- package/dist/chempot-diagram/color.d.ts +21 -1
- package/dist/chempot-diagram/color.js +70 -1
- package/dist/chempot-diagram/compute.d.ts +7 -0
- package/dist/chempot-diagram/compute.js +85 -26
- package/dist/chempot-diagram/controls-state.svelte.js +1 -1
- package/dist/chempot-diagram/export.js +1 -6
- package/dist/chempot-diagram/temperature.js +9 -10
- package/dist/colors/index.d.ts +0 -4
- package/dist/colors/index.js +19 -20
- package/dist/composition/BarChart.svelte +30 -26
- package/dist/composition/BubbleChart.svelte +17 -17
- package/dist/composition/Composition.svelte +10 -19
- package/dist/composition/Formula.svelte +20 -27
- package/dist/composition/FormulaFilter.svelte +115 -184
- package/dist/composition/PieChart.svelte +55 -41
- package/dist/composition/format.js +7 -9
- package/dist/composition/index.d.ts +2 -0
- package/dist/composition/index.js +14 -0
- package/dist/composition/parse.d.ts +2 -2
- package/dist/composition/parse.js +61 -115
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +17 -26
- package/dist/convex-hull/ConvexHull.svelte +12 -15
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull2D.svelte +93 -94
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +127 -186
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +131 -180
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +36 -40
- package/dist/convex-hull/ConvexHullControls.svelte +46 -48
- package/dist/convex-hull/ConvexHullStats.svelte +193 -195
- package/dist/convex-hull/ConvexHullTooltip.svelte +5 -12
- package/dist/convex-hull/GasPressureControls.svelte +5 -12
- package/dist/convex-hull/StructurePopup.svelte +18 -22
- package/dist/convex-hull/StructurePopup.svelte.d.ts +2 -0
- package/dist/convex-hull/TemperatureSlider.svelte +4 -10
- package/dist/convex-hull/canvas-interactions.svelte.js +2 -1
- package/dist/convex-hull/gas-thermodynamics.js +21 -53
- package/dist/convex-hull/helpers.d.ts +8 -10
- package/dist/convex-hull/helpers.js +37 -43
- package/dist/convex-hull/hull-state.svelte.d.ts +1 -1
- package/dist/convex-hull/thermodynamics.js +37 -44
- package/dist/coordination/CoordinationBarPlot.svelte +49 -53
- 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 +5 -9
- 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 +44 -67
- package/dist/element/Nucleus.svelte +4 -2
- package/dist/element/data.d.ts +3 -2
- package/dist/element/data.js +5 -1
- package/dist/element/helpers.d.ts +4 -0
- package/dist/element/helpers.js +18 -0
- package/dist/element/index.d.ts +2 -5
- package/dist/element/index.js +4 -19
- package/dist/feedback/DragOverlay.svelte +5 -5
- package/dist/feedback/DragOverlay.svelte.d.ts +2 -2
- package/dist/feedback/StatusMessage.svelte +7 -4
- package/dist/fermi-surface/FermiSlice.svelte +21 -18
- package/dist/fermi-surface/FermiSurface.svelte +35 -44
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +7 -13
- package/dist/fermi-surface/FermiSurfaceControls.svelte +6 -20
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +64 -136
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +9 -6
- package/dist/fermi-surface/compute.js +25 -58
- package/dist/fermi-surface/parse.js +54 -88
- package/dist/file-viewer/JsonBrowser.svelte +1043 -0
- package/dist/file-viewer/JsonBrowser.svelte.d.ts +9 -0
- package/dist/file-viewer/PlotPanel.svelte +350 -0
- package/dist/file-viewer/PlotPanel.svelte.d.ts +9 -0
- package/dist/file-viewer/TrajectoryWithDos.svelte +30 -0
- package/dist/file-viewer/TrajectoryWithDos.svelte.d.ts +10 -0
- package/dist/file-viewer/detect.d.ts +11 -0
- package/dist/file-viewer/detect.js +381 -0
- package/dist/file-viewer/eligibility.d.ts +4 -0
- package/dist/file-viewer/eligibility.js +53 -0
- package/dist/file-viewer/host-protocol.d.ts +50 -0
- package/dist/file-viewer/host-transfer.d.ts +25 -0
- package/dist/file-viewer/host-transfer.js +42 -0
- package/dist/file-viewer/index.d.ts +5 -0
- package/dist/file-viewer/index.js +5 -0
- package/dist/file-viewer/main.d.ts +44 -0
- package/dist/file-viewer/main.js +535 -0
- package/dist/file-viewer/parse.d.ts +9 -0
- package/dist/file-viewer/parse.js +170 -0
- package/dist/file-viewer/plot-utils.d.ts +24 -0
- package/dist/file-viewer/plot-utils.js +191 -0
- package/dist/file-viewer/types.d.ts +4 -0
- package/dist/file-viewer/types.js +5 -0
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +153 -219
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +2 -2
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +9 -7
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +1 -1
- package/dist/heatmap-matrix/index.d.ts +5 -0
- package/dist/icons.d.ts +4 -0
- package/dist/icons.js +4 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/io/ExportPane.svelte +11 -7
- package/dist/io/decompress.d.ts +4 -1
- package/dist/io/decompress.js +24 -36
- package/dist/io/export.d.ts +11 -4
- package/dist/io/export.js +75 -19
- package/dist/io/fetch.d.ts +0 -3
- package/dist/io/fetch.js +0 -11
- package/dist/io/file-drop.js +60 -35
- package/dist/io/index.d.ts +0 -1
- package/dist/io/index.js +2 -9
- package/dist/io/is-binary.d.ts +9 -0
- package/dist/io/is-binary.js +45 -1
- package/dist/io/url-drop.d.ts +2 -0
- package/dist/io/url-drop.js +40 -40
- package/dist/isosurface/Isosurface.svelte +700 -215
- package/dist/isosurface/Isosurface.svelte.d.ts +7 -1
- package/dist/isosurface/IsosurfaceControls.svelte +590 -116
- package/dist/isosurface/IsosurfaceControls.svelte.d.ts +1 -1
- package/dist/isosurface/VolumeSlice.svelte +224 -0
- package/dist/isosurface/VolumeSlice.svelte.d.ts +28 -0
- package/dist/isosurface/coloring.d.ts +20 -0
- package/dist/isosurface/coloring.js +118 -0
- package/dist/isosurface/geometry-worker-types.d.ts +38 -0
- package/dist/isosurface/geometry.worker.d.ts +1 -0
- package/dist/isosurface/geometry.worker.js +59 -0
- package/dist/isosurface/grid.d.ts +10 -0
- package/dist/isosurface/grid.js +31 -0
- package/dist/isosurface/index.d.ts +4 -0
- package/dist/isosurface/index.js +4 -0
- package/dist/isosurface/parse-vaspwave.d.ts +3 -0
- package/dist/isosurface/parse-vaspwave.js +138 -0
- package/dist/isosurface/parse.js +6 -6
- package/dist/isosurface/profile.d.ts +12 -0
- package/dist/isosurface/profile.js +19 -0
- package/dist/isosurface/sampling.d.ts +34 -0
- package/dist/isosurface/sampling.js +408 -0
- package/dist/isosurface/slice-rendering.d.ts +13 -0
- package/dist/isosurface/slice-rendering.js +79 -0
- package/dist/isosurface/slice.d.ts +22 -2
- package/dist/isosurface/slice.js +200 -116
- package/dist/isosurface/types.d.ts +24 -1
- package/dist/isosurface/types.js +120 -8
- package/dist/json-path.d.ts +4 -0
- package/dist/json-path.js +89 -0
- package/dist/labels.d.ts +6 -2
- package/dist/labels.js +44 -14
- package/dist/layout/FullscreenButton.svelte +2 -1
- package/dist/layout/FullscreenToggle.svelte +10 -4
- package/dist/layout/InfoCard.svelte +8 -21
- 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 +57 -62
- package/dist/layout/SettingsSection.svelte.d.ts +6 -7
- package/dist/layout/SubpageGrid.svelte +3 -1
- package/dist/layout/ViewerChrome.svelte +16 -11
- package/dist/layout/ViewerChrome.svelte.d.ts +2 -1
- package/dist/layout/fullscreen.js +3 -5
- package/dist/layout/fullscreen.svelte.js +1 -2
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.js +1 -0
- package/dist/layout/json-tree/JsonNode.svelte +22 -59
- package/dist/layout/json-tree/JsonTree.svelte +101 -172
- package/dist/layout/json-tree/JsonValue.svelte +9 -32
- package/dist/layout/json-tree/utils.d.ts +0 -3
- package/dist/layout/json-tree/utils.js +50 -188
- package/dist/marching-cubes.d.ts +8 -1
- package/dist/marching-cubes.js +115 -48
- package/dist/math.d.ts +5 -2
- package/dist/math.js +48 -38
- package/dist/overlays/ContextMenu.svelte +19 -34
- package/dist/overlays/CopyButton.svelte +11 -5
- package/dist/overlays/DragControlTab.svelte +6 -1
- package/dist/overlays/DraggablePane.svelte +110 -74
- package/dist/overlays/DraggablePane.svelte.d.ts +2 -1
- package/dist/overlays/GlassChip.svelte +32 -0
- package/dist/overlays/GlassChip.svelte.d.ts +8 -0
- package/dist/overlays/InfoPaneCards.svelte +11 -23
- package/dist/overlays/index.d.ts +7 -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 +113 -145
- package/dist/periodic-table/PeriodicTable.svelte.d.ts +5 -3
- package/dist/periodic-table/PeriodicTableControls.svelte +37 -115
- package/dist/periodic-table/TableInset.svelte +9 -4
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +68 -105
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +6 -8
- package/dist/phase-diagram/PhaseDiagramControls.svelte +70 -94
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +2 -1
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +12 -12
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +54 -58
- package/dist/phase-diagram/TdbInfoPanel.svelte +21 -15
- package/dist/phase-diagram/build-diagram.js +4 -9
- package/dist/phase-diagram/diagram-input.d.ts +1 -2
- package/dist/phase-diagram/parse.js +15 -15
- package/dist/phase-diagram/svg-to-diagram.js +28 -27
- package/dist/phase-diagram/utils.js +2 -3
- package/dist/plot/bar/BarPlot.svelte +461 -426
- package/dist/plot/bar/BarPlot.svelte.d.ts +2 -0
- package/dist/plot/bar/BarPlotControls.svelte +1 -3
- package/dist/plot/bar/BarPlotControls.svelte.d.ts +4 -6
- package/dist/plot/bar/SpacegroupBarPlot.svelte +46 -77
- package/dist/plot/bar/data.d.ts +5 -4
- package/dist/plot/bar/data.js +2 -1
- package/dist/plot/box/BoxPlot.svelte +322 -226
- package/dist/plot/box/BoxPlot.svelte.d.ts +2 -0
- package/dist/plot/box/Violin.svelte.d.ts +1 -0
- package/dist/plot/box/box-plot.js +1 -1
- package/dist/plot/core/auto-place.d.ts +1 -1
- package/dist/plot/core/auto-place.js +2 -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 +101 -106
- 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 +18 -9
- package/dist/plot/core/components/Line.svelte.d.ts +2 -0
- package/dist/plot/core/components/PlotAxis.svelte +40 -17
- package/dist/plot/core/components/PlotControls.svelte +65 -41
- 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 +54 -57
- package/dist/plot/core/components/ReferencePlane.svelte +7 -8
- 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 +27 -474
- package/dist/plot/core/data-transform.d.ts +1 -2
- package/dist/plot/core/data-transform.js +9 -15
- package/dist/plot/core/fill-utils.d.ts +3 -1
- package/dist/plot/core/fill-utils.js +28 -6
- package/dist/plot/core/index.d.ts +1 -0
- package/dist/plot/core/index.js +1 -0
- package/dist/plot/core/interactions.js +0 -2
- package/dist/plot/core/layout.d.ts +15 -6
- package/dist/plot/core/layout.js +57 -38
- 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 +2 -4
- package/dist/plot/core/pan-zoom.svelte.js +34 -17
- package/dist/plot/core/placed-tween.svelte.d.ts +3 -0
- package/dist/plot/core/placed-tween.svelte.js +68 -21
- package/dist/plot/core/reference-line.js +1 -1
- package/dist/plot/core/scales.d.ts +23 -0
- package/dist/plot/core/scales.js +39 -13
- package/dist/plot/core/svg.js +0 -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 +29 -324
- package/dist/plot/core/types.js +23 -20
- package/dist/plot/core/utils/hierarchy-chart.d.ts +52 -0
- package/dist/plot/core/utils/hierarchy-chart.js +191 -0
- package/dist/plot/core/utils/hierarchy-labels.d.ts +20 -0
- package/dist/plot/core/utils/hierarchy-labels.js +100 -0
- package/dist/plot/core/utils/label-placement.js +2 -2
- package/dist/plot/histogram/Histogram.svelte +314 -340
- package/dist/plot/histogram/Histogram.svelte.d.ts +7 -7
- package/dist/plot/histogram/HistogramControls.svelte +30 -28
- 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 +78 -69
- package/dist/plot/sankey/Sankey.svelte.d.ts +2 -2
- package/dist/plot/sankey/SankeyControls.svelte +22 -16
- package/dist/plot/sankey/sankey.js +13 -9
- package/dist/plot/scatter/BinnedScatterPlot.svelte +311 -141
- package/dist/plot/scatter/BinnedScatterPlot.svelte.d.ts +7 -0
- package/dist/plot/scatter/ElementScatter.svelte +4 -1
- package/dist/plot/scatter/ScatterPlot.svelte +517 -410
- package/dist/plot/scatter/ScatterPlot.svelte.d.ts +2 -0
- 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/adaptive-density.d.ts +1 -1
- package/dist/plot/scatter/adaptive-density.js +36 -20
- package/dist/plot/scatter/binned-scatter-types.d.ts +3 -2
- package/dist/plot/scatter/binned-scatter-types.js +6 -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 +25 -34
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte.d.ts +2 -2
- package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte +8 -5
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte +113 -116
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte.d.ts +2 -2
- package/dist/plot/scatter-3d/Surface3D.svelte +4 -13
- package/dist/plot/sunburst/Sunburst.svelte +269 -347
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +2 -2
- 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 +10 -3
- package/dist/plot/treemap/Treemap.svelte +1022 -0
- package/dist/plot/treemap/Treemap.svelte.d.ts +90 -0
- package/dist/plot/treemap/index.d.ts +4 -0
- package/dist/plot/treemap/index.js +4 -0
- package/dist/plot/treemap/labels.d.ts +38 -0
- package/dist/plot/treemap/labels.js +80 -0
- package/dist/plot/treemap/treemap.d.ts +28 -0
- package/dist/plot/treemap/treemap.js +102 -0
- package/dist/rdf/RdfPlot.svelte +37 -59
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/calc-rdf.js +63 -52
- package/dist/rdf/index.d.ts +0 -1
- package/dist/sanitize.js +85 -27
- package/dist/scene/SceneCamera.svelte +1 -1
- package/dist/scene/SceneCamera.svelte.d.ts +1 -1
- package/dist/scene/bind-renderer.svelte.js +14 -6
- package/dist/scene/index.d.ts +1 -2
- package/dist/scene/index.js +1 -1
- package/dist/scene/{props.js → props.svelte.js} +15 -1
- package/dist/settings.d.ts +19 -9
- package/dist/settings.js +229 -525
- package/dist/spectral/Bands.svelte +207 -221
- package/dist/spectral/BandsAndDos.svelte +11 -9
- package/dist/spectral/BrillouinBandsDos.svelte +19 -42
- package/dist/spectral/Dos.svelte +92 -93
- package/dist/spectral/helpers.d.ts +3 -3
- package/dist/spectral/helpers.js +65 -140
- package/dist/state.svelte.js +5 -18
- package/dist/structure/Arrow.svelte +5 -18
- package/dist/structure/ArrowInstances.svelte +160 -0
- package/dist/structure/ArrowInstances.svelte.d.ts +16 -0
- package/dist/structure/AtomLegend.svelte +120 -85
- package/dist/structure/AtomLegend.svelte.d.ts +2 -3
- package/dist/structure/Bond.svelte +31 -23
- package/dist/structure/CanvasTooltip.svelte +15 -3
- package/dist/structure/CellSelect.svelte +45 -35
- 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 +636 -504
- package/dist/structure/Structure.svelte.d.ts +4 -2
- package/dist/structure/StructureCarousel.svelte +637 -0
- package/dist/structure/StructureCarousel.svelte.d.ts +19 -0
- package/dist/structure/StructureControls.svelte +165 -425
- package/dist/structure/StructureControls.svelte.d.ts +1 -1
- package/dist/structure/StructureExportPane.svelte +17 -21
- package/dist/structure/StructureInfoPane.svelte +128 -133
- package/dist/structure/StructureInfoPane.svelte.d.ts +1 -1
- package/dist/structure/StructureScene.svelte +535 -578
- package/dist/structure/StructureScene.svelte.d.ts +6 -2
- package/dist/structure/StructureViewport.svelte +451 -0
- package/dist/structure/StructureViewport.svelte.d.ts +65 -0
- package/dist/structure/atom-label-placement.d.ts +16 -12
- package/dist/structure/atom-label-placement.js +70 -37
- package/dist/structure/atom-properties.d.ts +2 -0
- package/dist/structure/atom-properties.js +105 -38
- package/dist/structure/bond-order-perception.js +3 -8
- package/dist/structure/bonding.d.ts +9 -3
- package/dist/structure/bonding.js +95 -46
- package/dist/structure/edit-history.d.ts +6 -0
- package/dist/structure/edit-history.js +27 -0
- package/dist/structure/export.d.ts +1 -0
- package/dist/structure/export.js +89 -105
- package/dist/structure/format-detect.d.ts +1 -0
- package/dist/structure/format-detect.js +20 -0
- package/dist/structure/geometry.d.ts +9 -0
- package/dist/structure/geometry.js +27 -0
- package/dist/structure/index.d.ts +16 -1
- package/dist/structure/index.js +15 -10
- package/dist/structure/measure.d.ts +1 -1
- package/dist/structure/measure.js +6 -12
- package/dist/structure/parse.d.ts +2 -1
- package/dist/structure/parse.js +272 -313
- package/dist/structure/partial-occupancy.js +10 -5
- package/dist/structure/pbc.js +85 -107
- package/dist/structure/polyhedra.d.ts +0 -1
- package/dist/structure/polyhedra.js +7 -21
- package/dist/structure/prop-groups.d.ts +85 -0
- package/dist/structure/prop-groups.js +18 -0
- package/dist/structure/supercell.d.ts +1 -2
- package/dist/structure/supercell.js +7 -13
- package/dist/symmetry/SymmetryElements.svelte +11 -15
- package/dist/symmetry/SymmetryStats.svelte +55 -71
- package/dist/symmetry/WyckoffTable.svelte +10 -28
- package/dist/symmetry/cell-transform.js +6 -14
- package/dist/symmetry/index.d.ts +1 -0
- package/dist/symmetry/index.js +13 -10
- package/dist/symmetry/spacegroups.js +3 -2
- package/dist/table/HeatmapTable.svelte +1142 -447
- package/dist/table/HeatmapTable.svelte.d.ts +12 -2
- package/dist/table/ToggleMenu.svelte +168 -53
- package/dist/table/ToggleMenu.svelte.d.ts +1 -1
- 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/embedded.d.ts +18 -0
- package/dist/theme/embedded.js +206 -0
- package/dist/theme/index.d.ts +5 -5
- package/dist/theme/index.js +5 -12
- package/dist/theme/themes.mjs +44 -66
- package/dist/tooltip/KCoords.svelte +4 -1
- package/dist/tooltip/TooltipContent.svelte +3 -6
- package/dist/tooltip/TooltipContent.svelte.d.ts +1 -1
- package/dist/tooltip/index.d.ts +8 -1
- package/dist/trajectory/Trajectory.svelte +613 -386
- package/dist/trajectory/Trajectory.svelte.d.ts +1 -1
- package/dist/trajectory/TrajectoryError.svelte +12 -74
- package/dist/trajectory/TrajectoryExportPane.svelte +14 -32
- package/dist/trajectory/TrajectoryInfoPane.svelte +127 -164
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +2 -1
- package/dist/trajectory/extract.js +61 -49
- package/dist/trajectory/format-detect.d.ts +2 -0
- package/dist/trajectory/format-detect.js +17 -13
- package/dist/trajectory/frame-reader.d.ts +2 -0
- package/dist/trajectory/frame-reader.js +35 -32
- package/dist/trajectory/helpers.d.ts +2 -0
- package/dist/trajectory/helpers.js +34 -56
- package/dist/trajectory/index.d.ts +1 -0
- package/dist/trajectory/index.js +5 -8
- package/dist/trajectory/parse/ase.js +1 -1
- 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 +6 -6
- package/dist/trajectory/parse/index.js +25 -33
- package/dist/trajectory/parse/lammps.js +8 -12
- package/dist/trajectory/parse/vasp.js +10 -7
- 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 +4 -0
- package/dist/trajectory/parse/vaspout-h5.js +281 -0
- package/dist/trajectory/parse/xyz.js +59 -9
- package/dist/trajectory/plotting.d.ts +8 -9
- package/dist/trajectory/plotting.js +113 -64
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +7 -0
- package/dist/xrd/XrdPlot.svelte +79 -118
- package/dist/xrd/broadening.js +2 -1
- package/dist/xrd/calc-xrd.js +24 -62
- package/dist/xrd/parse.d.ts +0 -1
- package/dist/xrd/parse.js +69 -95
- package/package.json +94 -34
- package/readme.md +6 -5
- package/dist/api/mp.d.ts +0 -6
- package/dist/api/mp.js +0 -22
- package/dist/plot/sunburst/SunburstControls.svelte +0 -200
- package/dist/scene/types.d.ts +0 -26
- package/dist/tooltip/types.d.ts +0 -8
- package/dist/trajectory/constants.d.ts +0 -6
- package/dist/trajectory/constants.js +0 -11
- /package/dist/{scene/types.js → file-viewer/host-protocol.js} +0 -0
- /package/dist/{tooltip/types.js → isosurface/geometry-worker-types.js} +0 -0
|
@@ -28,6 +28,6 @@ type $$ComponentProps = Omit<ComponentProps<typeof DraggablePane>, `children`> &
|
|
|
28
28
|
pane_props?: PaneProps;
|
|
29
29
|
toggle_props?: PaneToggleProps;
|
|
30
30
|
};
|
|
31
|
-
declare const StructureControls: import("svelte").Component<$$ComponentProps, {}, "color_scheme" | "controls_open" | "
|
|
31
|
+
declare const StructureControls: import("svelte").Component<$$ComponentProps, {}, "color_scheme" | "controls_open" | "active_volume_idx" | "background_color" | "background_opacity" | "show_image_atoms" | "lattice_props" | "atom_color_config" | "volumetric_data" | "isosurface_settings" | "scene_props" | "supercell_scaling" | "cell_type" | "supercell_loading">;
|
|
32
32
|
type StructureControls = ReturnType<typeof StructureControls>;
|
|
33
33
|
export default StructureControls;
|
|
@@ -34,26 +34,22 @@
|
|
|
34
34
|
{
|
|
35
35
|
label: `JSON`,
|
|
36
36
|
format: `json`,
|
|
37
|
-
hint:
|
|
38
|
-
`<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`,
|
|
39
38
|
},
|
|
40
39
|
{
|
|
41
40
|
label: `XYZ`,
|
|
42
41
|
format: `xyz`,
|
|
43
|
-
hint:
|
|
44
|
-
`<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`,
|
|
45
43
|
},
|
|
46
44
|
{
|
|
47
45
|
label: `CIF`,
|
|
48
46
|
format: `cif`,
|
|
49
|
-
hint:
|
|
50
|
-
`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`,
|
|
51
48
|
},
|
|
52
49
|
{
|
|
53
50
|
label: `POSCAR`,
|
|
54
51
|
format: `poscar`,
|
|
55
|
-
hint:
|
|
56
|
-
`<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`,
|
|
57
53
|
},
|
|
58
54
|
] as const
|
|
59
55
|
|
|
@@ -61,14 +57,12 @@
|
|
|
61
57
|
{
|
|
62
58
|
label: `GLB`,
|
|
63
59
|
format: `glb`,
|
|
64
|
-
hint:
|
|
65
|
-
`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`,
|
|
66
61
|
},
|
|
67
62
|
{
|
|
68
63
|
label: `OBJ`,
|
|
69
64
|
format: `obj`,
|
|
70
|
-
hint:
|
|
71
|
-
`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`,
|
|
72
66
|
},
|
|
73
67
|
] as const
|
|
74
68
|
|
|
@@ -113,16 +107,18 @@
|
|
|
113
107
|
},
|
|
114
108
|
{
|
|
115
109
|
title: `Export as image`,
|
|
116
|
-
items: [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
+
},
|
|
124
120
|
},
|
|
125
|
-
|
|
121
|
+
],
|
|
126
122
|
},
|
|
127
123
|
{
|
|
128
124
|
title: `Export as 3D model`,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { PaneProps, PaneToggleProps } from '../overlays'
|
|
3
3
|
import { get_electro_neg_formula } from '../composition'
|
|
4
|
-
import {
|
|
4
|
+
import { element_by_symbol, type ElementSymbol } from '../element'
|
|
5
5
|
import Icon from '../Icon.svelte'
|
|
6
6
|
import { format_num } from '../labels'
|
|
7
7
|
import type { InfoItem } from '../layout'
|
|
8
8
|
import type { Vec2 } from '../math'
|
|
9
|
-
import CopyButton from '../overlays/CopyButton.svelte'
|
|
10
9
|
import DraggablePane from '../overlays/DraggablePane.svelte'
|
|
11
10
|
import { sanitize_html } from '../sanitize'
|
|
12
11
|
import { colors } from '../state.svelte'
|
|
@@ -16,7 +15,7 @@
|
|
|
16
15
|
import type { MoyoDataset } from '@spglib/moyo-wasm'
|
|
17
16
|
import type { ComponentProps } from 'svelte'
|
|
18
17
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
19
|
-
import {
|
|
18
|
+
import { create_clipboard_feedback } from '../overlays'
|
|
20
19
|
|
|
21
20
|
type SiteDetail = {
|
|
22
21
|
label: string
|
|
@@ -41,8 +40,7 @@
|
|
|
41
40
|
},
|
|
42
41
|
{
|
|
43
42
|
label: `Atom Selection`,
|
|
44
|
-
value:
|
|
45
|
-
`Click atoms to select them, then pick distance or angle mode to measure all pairwise distances/angles`,
|
|
43
|
+
value: `Click atoms to select them, then pick distance or angle mode to measure all pairwise distances/angles`,
|
|
46
44
|
},
|
|
47
45
|
{
|
|
48
46
|
label: `Navigation`,
|
|
@@ -54,8 +52,7 @@
|
|
|
54
52
|
},
|
|
55
53
|
{
|
|
56
54
|
label: `Colors`,
|
|
57
|
-
value:
|
|
58
|
-
`Click legend labels to change colors, double-click to reset, right-click to remap elements`,
|
|
55
|
+
value: `Click legend labels to change colors, double-click to reset, right-click to remap elements`,
|
|
59
56
|
},
|
|
60
57
|
{
|
|
61
58
|
label: `Keyboard`,
|
|
@@ -86,31 +83,14 @@
|
|
|
86
83
|
sym_data?: MoyoDataset | null // Symmetry analysis data (bindable for external access)
|
|
87
84
|
} = $props()
|
|
88
85
|
|
|
89
|
-
|
|
86
|
+
const { copied, copy } = create_clipboard_feedback()
|
|
90
87
|
let sites_expanded = $state(false)
|
|
91
88
|
let site_filter = $state(``)
|
|
92
89
|
let site_window_start = $state(0)
|
|
93
90
|
let site_cards_el = $state<HTMLDivElement>()
|
|
94
91
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
await navigator.clipboard.writeText(`${label}: ${value}`)
|
|
98
|
-
copied_items.add(key)
|
|
99
|
-
setTimeout(() => copied_items.delete(key), 1000)
|
|
100
|
-
} catch (error) {
|
|
101
|
-
console.error(`Failed to copy to clipboard:`, error)
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function copy_event(
|
|
106
|
-
event: MouseEvent,
|
|
107
|
-
label: string,
|
|
108
|
-
value: string,
|
|
109
|
-
key: string,
|
|
110
|
-
) {
|
|
111
|
-
event.stopPropagation()
|
|
112
|
-
copy_to_clipboard(label, value, key)
|
|
113
|
-
}
|
|
92
|
+
const copy_to_clipboard = (label: string, value: string, key: string): Promise<void> =>
|
|
93
|
+
copy(`${label}: ${value}`, key)
|
|
114
94
|
|
|
115
95
|
function copy_info_item(item: InfoItem) {
|
|
116
96
|
copy_to_clipboard(item.label, String(item.value), item.key ?? item.label)
|
|
@@ -128,9 +108,8 @@
|
|
|
128
108
|
: [...selected_sites, site_idx]
|
|
129
109
|
return
|
|
130
110
|
}
|
|
131
|
-
selected_sites =
|
|
132
|
-
? []
|
|
133
|
-
: [site_idx]
|
|
111
|
+
selected_sites =
|
|
112
|
+
selected_sites.length === 1 && selected_sites[0] === site_idx ? [] : [site_idx]
|
|
134
113
|
}
|
|
135
114
|
|
|
136
115
|
function update_site_filter(event: Event): void {
|
|
@@ -161,40 +140,45 @@
|
|
|
161
140
|
current_card.parentElement?.querySelectorAll<HTMLDivElement>(`.site-card`) ?? [],
|
|
162
141
|
)
|
|
163
142
|
const current_idx = sibling_cards.indexOf(current_card)
|
|
164
|
-
const next_idx =
|
|
165
|
-
|
|
166
|
-
|
|
143
|
+
const next_idx =
|
|
144
|
+
event.key === `ArrowDown`
|
|
145
|
+
? Math.min(current_idx + 1, sibling_cards.length - 1)
|
|
146
|
+
: Math.max(current_idx - 1, 0)
|
|
167
147
|
sibling_cards[next_idx]?.focus()
|
|
168
148
|
}
|
|
169
149
|
|
|
170
|
-
const get_element_name = (element: string): string =>
|
|
171
|
-
element_data?.find((element_record) => element_record.symbol === element)?.name || element
|
|
172
|
-
|
|
173
150
|
const site_summary = (card: SiteCard): string =>
|
|
174
|
-
[
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
151
|
+
[card.element_name, ...card.details.map(({ label, value }) => `${label}: ${value}`)].join(
|
|
152
|
+
`; `,
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
function compact_site_detail_label(detail: SiteDetail): string {
|
|
156
|
+
if (detail.key === `fractional`) return `Frac.`
|
|
157
|
+
if (detail.key === `cartesian`) return `Cart.`
|
|
158
|
+
return detail.label
|
|
159
|
+
}
|
|
178
160
|
|
|
179
161
|
function format_site_property(prop_key: string, prop_value: unknown): SiteDetail | null {
|
|
180
162
|
if (prop_value == null) return null
|
|
181
|
-
const format_numeric_value = (value: unknown
|
|
163
|
+
const format_numeric_value = (value: unknown): string | null => {
|
|
182
164
|
const numeric_value = Number(value)
|
|
183
|
-
return Number.isNaN(numeric_value) ? null : format_num(numeric_value,
|
|
165
|
+
return Number.isNaN(numeric_value) ? null : format_num(numeric_value, `.3~f`)
|
|
184
166
|
}
|
|
185
167
|
const format_value_list = (values: unknown[]): string =>
|
|
186
168
|
`(${values.map((value) => format_numeric_value(value) ?? String(value)).join(`, `)})`
|
|
187
169
|
let tooltip: string | undefined
|
|
188
170
|
|
|
189
171
|
if (
|
|
190
|
-
prop_key === `force` &&
|
|
191
|
-
|
|
172
|
+
prop_key === `force` &&
|
|
173
|
+
Array.isArray(prop_value) &&
|
|
174
|
+
prop_value.length === 3 &&
|
|
175
|
+
prop_value.every((value) => typeof value === `number`)
|
|
192
176
|
) {
|
|
193
177
|
const force_values = prop_value as [number, number, number]
|
|
194
178
|
const value = `${format_num(Math.hypot(...force_values), `.3~f`)} eV/Å`
|
|
195
|
-
tooltip = `Force vector: ${
|
|
196
|
-
|
|
197
|
-
|
|
179
|
+
tooltip = `Force vector: ${force_values
|
|
180
|
+
.map((force) => format_num(force, `.3~f`))
|
|
181
|
+
.join(`, `)} eV/Å`
|
|
198
182
|
return { label: prop_key, value, key: prop_key, tooltip }
|
|
199
183
|
}
|
|
200
184
|
if (prop_key === `magmom` || prop_key.includes(`magnet`)) {
|
|
@@ -206,7 +190,7 @@
|
|
|
206
190
|
|
|
207
191
|
const value = Array.isArray(prop_value)
|
|
208
192
|
? format_value_list(prop_value)
|
|
209
|
-
: format_numeric_value(prop_value) ?? String(prop_value)
|
|
193
|
+
: (format_numeric_value(prop_value) ?? String(prop_value))
|
|
210
194
|
return { label: prop_key, value, key: prop_key }
|
|
211
195
|
}
|
|
212
196
|
|
|
@@ -254,7 +238,7 @@
|
|
|
254
238
|
},
|
|
255
239
|
{
|
|
256
240
|
label: `a, b, c`,
|
|
257
|
-
value: `${format_num(a, `.
|
|
241
|
+
value: `${format_num(a, `.3~f`)}, ${format_num(b, `.3~f`)}, ${format_num(c, `.3~f`)} Å`,
|
|
258
242
|
key: `cell-abc`,
|
|
259
243
|
},
|
|
260
244
|
{
|
|
@@ -269,7 +253,9 @@
|
|
|
269
253
|
// Symmetry Info
|
|
270
254
|
if (`lattice` in structure && sym_data) {
|
|
271
255
|
const { operations } = sym_data
|
|
272
|
-
let translations = 0,
|
|
256
|
+
let translations = 0,
|
|
257
|
+
rotations = 0,
|
|
258
|
+
roto_translations = 0
|
|
273
259
|
for (const op of operations) {
|
|
274
260
|
const has_translation = op.translation.some((offset) => offset !== 0)
|
|
275
261
|
const is_identity = String(op.rotation) === `1,0,0,0,1,0,0,0,1`
|
|
@@ -278,14 +264,15 @@
|
|
|
278
264
|
else roto_translations++
|
|
279
265
|
}
|
|
280
266
|
|
|
281
|
-
const international_symbol = (
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
267
|
+
const international_symbol = (
|
|
268
|
+
sym_data as MoyoDataset & {
|
|
269
|
+
international_short?: string
|
|
270
|
+
}
|
|
271
|
+
).international_short
|
|
272
|
+
const space_group_symbol = (sym_data.hm_symbol ?? international_symbol)?.replaceAll(
|
|
273
|
+
/\s+/g,
|
|
274
|
+
``,
|
|
275
|
+
)
|
|
289
276
|
const space_group_value = space_group_symbol
|
|
290
277
|
? `${sym_data.number} (${space_group_symbol})`
|
|
291
278
|
: String(sym_data.number)
|
|
@@ -294,8 +281,16 @@
|
|
|
294
281
|
title: `Symmetry`,
|
|
295
282
|
items: [
|
|
296
283
|
{ label: `Space Group`, value: space_group_value, key: `symmetry-space-group` },
|
|
297
|
-
{
|
|
298
|
-
|
|
284
|
+
{
|
|
285
|
+
label: `Hall Number`,
|
|
286
|
+
value: String(sym_data.hall_number),
|
|
287
|
+
key: `symmetry-hall-number`,
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
label: `Pearson Symbol`,
|
|
291
|
+
value: sym_data.pearson_symbol,
|
|
292
|
+
key: `symmetry-pearson-symbol`,
|
|
293
|
+
},
|
|
299
294
|
{
|
|
300
295
|
label: `Symmetry Ops`,
|
|
301
296
|
value: `${operations.length} (${translations} trans, ${rotations} rot, ${roto_translations} roto-trans)`,
|
|
@@ -321,7 +316,7 @@
|
|
|
321
316
|
if (!structure || !site_cards_visible) return []
|
|
322
317
|
return structure.sites.map((site: Site, idx: number) => {
|
|
323
318
|
const element = site.species?.[0]?.element || `Unknown`
|
|
324
|
-
const element_name =
|
|
319
|
+
const element_name = element_by_symbol.get(element as ElementSymbol)?.name ?? element
|
|
325
320
|
const details: SiteDetail[] = []
|
|
326
321
|
for (const [label, key, coords, unit] of [
|
|
327
322
|
[`Fractional`, `fractional`, site.abc, ``],
|
|
@@ -331,7 +326,7 @@
|
|
|
331
326
|
details.push({
|
|
332
327
|
label,
|
|
333
328
|
key,
|
|
334
|
-
value: `(${coords.map((coord) => format_num(coord, `.
|
|
329
|
+
value: `(${coords.map((coord) => format_num(coord, `.3~f`)).join(`, `)})${unit}`,
|
|
335
330
|
})
|
|
336
331
|
}
|
|
337
332
|
if (site.properties) {
|
|
@@ -347,9 +342,9 @@
|
|
|
347
342
|
element_name,
|
|
348
343
|
title,
|
|
349
344
|
details,
|
|
350
|
-
search_text: `${title} ${element} ${element_name} ${
|
|
351
|
-
|
|
352
|
-
|
|
345
|
+
search_text: `${title} ${element} ${element_name} ${details
|
|
346
|
+
.map(({ label, value }) => `${label} ${value}`)
|
|
347
|
+
.join(` `)}`.toLowerCase(),
|
|
353
348
|
}
|
|
354
349
|
})
|
|
355
350
|
})
|
|
@@ -382,8 +377,7 @@
|
|
|
382
377
|
if (!pane_open || selected_site_idx === undefined) return
|
|
383
378
|
const visible_idx = visible_site_cards.findIndex(({ idx }) => idx === selected_site_idx)
|
|
384
379
|
if (visible_idx === -1) return
|
|
385
|
-
const selected_window_start = Math.floor(visible_idx / SITE_WINDOW_SIZE) *
|
|
386
|
-
SITE_WINDOW_SIZE
|
|
380
|
+
const selected_window_start = Math.floor(visible_idx / SITE_WINDOW_SIZE) * SITE_WINDOW_SIZE
|
|
387
381
|
if (selected_window_start !== site_window_start) {
|
|
388
382
|
site_window_start = selected_window_start
|
|
389
383
|
return
|
|
@@ -407,7 +401,12 @@
|
|
|
407
401
|
}}
|
|
408
402
|
open_icon="Cross"
|
|
409
403
|
closed_icon="Info"
|
|
410
|
-
|
|
404
|
+
icon_style="transform: scale(1.15)"
|
|
405
|
+
pane_props={{
|
|
406
|
+
...pane_props,
|
|
407
|
+
class: `structure-info-pane ${pane_props?.class ?? ``}`,
|
|
408
|
+
style: `--pane-padding: 4pt; --pane-gap: 2pt; ${pane_props?.style ?? ``}`,
|
|
409
|
+
}}
|
|
411
410
|
{...rest}
|
|
412
411
|
>
|
|
413
412
|
<h4 id="structure-info" style="margin-top: 0">Structure Info</h4>
|
|
@@ -434,7 +433,7 @@
|
|
|
434
433
|
>
|
|
435
434
|
<span>{@html sanitize_html(label)}</span>
|
|
436
435
|
<span title={tooltip}>{@html sanitize_html(value)}</span>
|
|
437
|
-
{#if key &&
|
|
436
|
+
{#if key && copied.has(key)}
|
|
438
437
|
<Icon
|
|
439
438
|
icon="Check"
|
|
440
439
|
style="color: var(--success-color, #10b981); width: 12px; height: 12px"
|
|
@@ -447,9 +446,9 @@
|
|
|
447
446
|
{#if section.title === `Symmetry` && wyckoff_positions.length > 0}
|
|
448
447
|
<WyckoffTable
|
|
449
448
|
{wyckoff_positions}
|
|
450
|
-
on_hover={(site_indices) => highlighted_sites = site_indices ?? []}
|
|
451
|
-
on_click={(site_indices) => selected_sites = site_indices ?? []}
|
|
452
|
-
style="width: 100%; margin-top:
|
|
449
|
+
on_hover={(site_indices) => (highlighted_sites = site_indices ?? [])}
|
|
450
|
+
on_click={(site_indices) => (selected_sites = site_indices ?? [])}
|
|
451
|
+
style="width: 100%; margin-top: 2pt; font-size: 0.8em"
|
|
453
452
|
/>
|
|
454
453
|
{/if}
|
|
455
454
|
</section>
|
|
@@ -472,7 +471,9 @@
|
|
|
472
471
|
{/if}
|
|
473
472
|
</div>
|
|
474
473
|
{#if sites_hidden_by_threshold}
|
|
475
|
-
<p class="sites-note">
|
|
474
|
+
<p class="sites-note">
|
|
475
|
+
Site list hidden for this {structure.sites.length}-site structure.
|
|
476
|
+
</p>
|
|
476
477
|
{:else if site_cards.length > 0}
|
|
477
478
|
<input
|
|
478
479
|
class="site-filter"
|
|
@@ -491,19 +492,21 @@
|
|
|
491
492
|
type="button"
|
|
492
493
|
disabled={site_window_start === 0}
|
|
493
494
|
onclick={() =>
|
|
494
|
-
site_window_start = Math.max(0, site_window_start - SITE_WINDOW_SIZE)}
|
|
495
|
+
(site_window_start = Math.max(0, site_window_start - SITE_WINDOW_SIZE))}
|
|
495
496
|
>
|
|
496
497
|
Previous
|
|
497
498
|
</button>
|
|
498
|
-
<span
|
|
499
|
+
<span
|
|
500
|
+
>{site_window_start + 1}-{site_window_end} of {visible_site_cards.length}</span
|
|
501
|
+
>
|
|
499
502
|
<button
|
|
500
503
|
type="button"
|
|
501
504
|
disabled={site_window_end >= visible_site_cards.length}
|
|
502
505
|
onclick={() =>
|
|
503
|
-
site_window_start = Math.min(
|
|
506
|
+
(site_window_start = Math.min(
|
|
504
507
|
Math.max(0, visible_site_cards.length - SITE_WINDOW_SIZE),
|
|
505
508
|
site_window_start + SITE_WINDOW_SIZE,
|
|
506
|
-
)}
|
|
509
|
+
))}
|
|
507
510
|
>
|
|
508
511
|
Next
|
|
509
512
|
</button>
|
|
@@ -511,8 +514,8 @@
|
|
|
511
514
|
{/if}
|
|
512
515
|
<div class="site-cards" bind:this={site_cards_el}>
|
|
513
516
|
{#each rendered_site_cards as card (card.idx)}
|
|
514
|
-
{@const is_highlighted =
|
|
515
|
-
hovered_site_idx === card.idx}
|
|
517
|
+
{@const is_highlighted =
|
|
518
|
+
highlighted_sites.includes(card.idx) || hovered_site_idx === card.idx}
|
|
516
519
|
{@const is_selected = selected_sites.includes(card.idx)}
|
|
517
520
|
<div
|
|
518
521
|
class="site-card"
|
|
@@ -530,37 +533,18 @@
|
|
|
530
533
|
onclick={(event) => select_site(card.idx, event)}
|
|
531
534
|
onkeydown={(event) => handle_site_keydown(event, card)}
|
|
532
535
|
>
|
|
533
|
-
<
|
|
534
|
-
<span class="site-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
</span>
|
|
539
|
-
<CopyButton
|
|
540
|
-
label="Copy {card.title}"
|
|
541
|
-
title="Copy {card.title}"
|
|
542
|
-
copied={copied_items.has(`site-${card.idx}-summary`)}
|
|
543
|
-
onclick={(event) =>
|
|
544
|
-
copy_event(event, card.title, site_summary(card), `site-${card.idx}-summary`)}
|
|
545
|
-
/>
|
|
546
|
-
</div>
|
|
536
|
+
<span class="site-title">
|
|
537
|
+
<span class="site-color" aria-hidden="true"></span>
|
|
538
|
+
<strong>{card.title}</strong>
|
|
539
|
+
<span>{card.element_name}</span>
|
|
540
|
+
</span>
|
|
547
541
|
<div class="site-card-details">
|
|
548
542
|
{#each card.details as detail (`site-${card.idx}-${detail.key}`)}
|
|
549
543
|
<div class="site-detail">
|
|
550
|
-
<span
|
|
544
|
+
<span title={detail.label}
|
|
545
|
+
>{@html sanitize_html(compact_site_detail_label(detail))}</span
|
|
546
|
+
>
|
|
551
547
|
<span title={detail.tooltip}>{@html sanitize_html(detail.value)}</span>
|
|
552
|
-
<CopyButton
|
|
553
|
-
label="Copy {card.title} {detail.label}"
|
|
554
|
-
title="Copy {detail.label}"
|
|
555
|
-
copied={copied_items.has(`site-${card.idx}-${detail.key}`)}
|
|
556
|
-
onclick={(event) =>
|
|
557
|
-
copy_event(
|
|
558
|
-
event,
|
|
559
|
-
`${card.title} ${detail.label}`,
|
|
560
|
-
detail.value,
|
|
561
|
-
`site-${card.idx}-${detail.key}`,
|
|
562
|
-
)}
|
|
563
|
-
/>
|
|
564
548
|
</div>
|
|
565
549
|
{/each}
|
|
566
550
|
</div>
|
|
@@ -585,13 +569,20 @@
|
|
|
585
569
|
</DraggablePane>
|
|
586
570
|
|
|
587
571
|
<style>
|
|
588
|
-
|
|
589
|
-
|
|
572
|
+
h4 {
|
|
573
|
+
margin: 2pt 0;
|
|
574
|
+
font-size: 0.95em;
|
|
575
|
+
}
|
|
576
|
+
hr {
|
|
577
|
+
margin: 2pt 0;
|
|
578
|
+
}
|
|
579
|
+
.info-row {
|
|
590
580
|
display: flex;
|
|
591
581
|
justify-content: space-between;
|
|
592
|
-
gap:
|
|
593
|
-
padding: 1pt;
|
|
594
|
-
|
|
582
|
+
gap: 4pt;
|
|
583
|
+
padding: 0 1pt;
|
|
584
|
+
font-size: 0.9em;
|
|
585
|
+
line-height: 1.3;
|
|
595
586
|
}
|
|
596
587
|
.info-row.clickable {
|
|
597
588
|
cursor: pointer;
|
|
@@ -604,10 +595,7 @@
|
|
|
604
595
|
display: flex;
|
|
605
596
|
align-items: center;
|
|
606
597
|
justify-content: space-between;
|
|
607
|
-
gap:
|
|
608
|
-
h4 {
|
|
609
|
-
margin: 0.5em 0;
|
|
610
|
-
}
|
|
598
|
+
gap: 4pt;
|
|
611
599
|
}
|
|
612
600
|
.sites-toggle,
|
|
613
601
|
.site-window-controls button {
|
|
@@ -624,8 +612,8 @@
|
|
|
624
612
|
.site-filter {
|
|
625
613
|
box-sizing: border-box;
|
|
626
614
|
width: 100%;
|
|
627
|
-
margin-bottom:
|
|
628
|
-
padding:
|
|
615
|
+
margin-bottom: 3pt;
|
|
616
|
+
padding: 3pt 5pt;
|
|
629
617
|
border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
|
|
630
618
|
border-radius: var(--border-radius, 3pt);
|
|
631
619
|
background: color-mix(in srgb, var(--pane-bg, Canvas) 88%, currentColor);
|
|
@@ -640,8 +628,8 @@
|
|
|
640
628
|
display: flex;
|
|
641
629
|
align-items: center;
|
|
642
630
|
justify-content: space-between;
|
|
643
|
-
gap:
|
|
644
|
-
margin-bottom:
|
|
631
|
+
gap: 4pt;
|
|
632
|
+
margin-bottom: 3pt;
|
|
645
633
|
font-size: 0.8em;
|
|
646
634
|
button {
|
|
647
635
|
padding: 2pt 5pt;
|
|
@@ -653,13 +641,12 @@
|
|
|
653
641
|
}
|
|
654
642
|
.site-cards {
|
|
655
643
|
display: grid;
|
|
656
|
-
gap:
|
|
644
|
+
gap: 6pt;
|
|
657
645
|
}
|
|
658
646
|
.site-card {
|
|
659
647
|
border-left: 3px solid var(--site-color, #888);
|
|
660
|
-
border-radius: var(--border-radius, 3pt);
|
|
661
648
|
background: color-mix(in srgb, currentColor 4%, transparent);
|
|
662
|
-
padding:
|
|
649
|
+
padding: 4pt 8pt;
|
|
663
650
|
cursor: pointer;
|
|
664
651
|
outline: none;
|
|
665
652
|
&:is(:hover, :focus-visible, .highlighted) {
|
|
@@ -670,16 +657,12 @@
|
|
|
670
657
|
background: color-mix(in srgb, var(--site-color, currentColor) 25%, transparent);
|
|
671
658
|
}
|
|
672
659
|
}
|
|
673
|
-
.site-card-header,
|
|
674
660
|
.site-title,
|
|
675
661
|
.site-detail {
|
|
676
662
|
display: flex;
|
|
677
663
|
align-items: center;
|
|
678
664
|
gap: 5pt;
|
|
679
665
|
}
|
|
680
|
-
.site-card-header {
|
|
681
|
-
justify-content: space-between;
|
|
682
|
-
}
|
|
683
666
|
.site-title {
|
|
684
667
|
min-width: 0;
|
|
685
668
|
span:last-child {
|
|
@@ -694,13 +677,17 @@
|
|
|
694
677
|
background: var(--site-color, #888);
|
|
695
678
|
}
|
|
696
679
|
.site-card-details {
|
|
697
|
-
display:
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
680
|
+
display: flex;
|
|
681
|
+
flex-wrap: wrap;
|
|
682
|
+
gap: 1pt 4pt;
|
|
683
|
+
margin-top: 2pt;
|
|
684
|
+
font-size: 0.73em;
|
|
685
|
+
line-height: 1.3;
|
|
701
686
|
}
|
|
702
687
|
.site-detail {
|
|
703
|
-
|
|
688
|
+
gap: 2pt;
|
|
689
|
+
min-width: 0;
|
|
690
|
+
max-width: 100%;
|
|
704
691
|
span:first-child {
|
|
705
692
|
opacity: 0.75;
|
|
706
693
|
}
|
|
@@ -729,8 +716,16 @@
|
|
|
729
716
|
}
|
|
730
717
|
}
|
|
731
718
|
.tips-item {
|
|
732
|
-
|
|
733
|
-
|
|
719
|
+
display: grid;
|
|
720
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
721
|
+
gap: 4pt;
|
|
722
|
+
padding: 1pt 0;
|
|
723
|
+
font-size: 0.8em;
|
|
724
|
+
line-height: 1.25;
|
|
725
|
+
span:first-child {
|
|
726
|
+
font-weight: 600;
|
|
727
|
+
text-align: right;
|
|
728
|
+
}
|
|
734
729
|
span:last-child {
|
|
735
730
|
opacity: 0.8;
|
|
736
731
|
}
|
|
@@ -14,6 +14,6 @@ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `onclose`> & {
|
|
|
14
14
|
selected_sites?: number[];
|
|
15
15
|
sym_data?: MoyoDataset | null;
|
|
16
16
|
};
|
|
17
|
-
declare const StructureInfoPane: import("svelte").Component<$$ComponentProps, {}, "selected_sites" | "
|
|
17
|
+
declare const StructureInfoPane: import("svelte").Component<$$ComponentProps, {}, "selected_sites" | "hovered_site_idx" | "pane_open" | "highlighted_sites">;
|
|
18
18
|
type StructureInfoPane = ReturnType<typeof StructureInfoPane>;
|
|
19
19
|
export default StructureInfoPane;
|