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,5 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ShowControlsProp } from '../controls';
|
|
2
2
|
import Spinner from '../feedback/Spinner.svelte';
|
|
3
|
+
import type { Vec2 } from '../math';
|
|
4
|
+
import { type FullscreenToggleProp } from '../layout';
|
|
3
5
|
import type { Orientation } from '../plot';
|
|
4
6
|
import { Histogram, ScatterPlot } from '../plot';
|
|
5
7
|
import Structure from '../structure/Structure.svelte';
|
|
@@ -42,37 +44,23 @@ type $$ComponentProps = EventHandlers & HTMLAttributes<HTMLDivElement> & {
|
|
|
42
44
|
on_dismiss: () => void;
|
|
43
45
|
}]>;
|
|
44
46
|
show_controls?: ShowControlsProp;
|
|
45
|
-
fullscreen_toggle?:
|
|
46
|
-
fullscreen: boolean;
|
|
47
|
-
}]> | boolean;
|
|
47
|
+
fullscreen_toggle?: FullscreenToggleProp;
|
|
48
48
|
auto_play?: boolean;
|
|
49
49
|
display_mode?: `structure+scatter` | `structure` | `scatter` | `histogram` | `structure+histogram`;
|
|
50
50
|
step_labels?: number | number[];
|
|
51
51
|
visible_properties?: string[];
|
|
52
52
|
ELEM_PROPERTY_LABELS?: Record<string, string>;
|
|
53
|
-
|
|
54
|
-
energy?: string;
|
|
55
|
-
energy_per_atom?: string;
|
|
56
|
-
force_max?: string;
|
|
57
|
-
force_norm?: string;
|
|
58
|
-
stress_max?: string;
|
|
59
|
-
volume?: string;
|
|
60
|
-
density?: string;
|
|
61
|
-
temperature?: string;
|
|
62
|
-
pressure?: string;
|
|
63
|
-
length?: string;
|
|
64
|
-
a?: string;
|
|
65
|
-
b?: string;
|
|
66
|
-
c?: string;
|
|
67
|
-
[key: string]: string | undefined;
|
|
68
|
-
};
|
|
69
|
-
fps_range?: [number, number];
|
|
53
|
+
fps_range?: Vec2;
|
|
70
54
|
fps?: number;
|
|
71
55
|
loading_options?: LoadingOptions;
|
|
72
56
|
atom_type_mapping?: AtomTypeMapping;
|
|
73
57
|
plot_skimming?: boolean;
|
|
74
58
|
hovered?: boolean;
|
|
59
|
+
controls_open?: boolean;
|
|
60
|
+
info_pane_open?: boolean;
|
|
61
|
+
wrapper?: HTMLDivElement;
|
|
62
|
+
fullscreen?: boolean;
|
|
75
63
|
};
|
|
76
|
-
declare const Trajectory: import("svelte").Component<$$ComponentProps, {}, "
|
|
64
|
+
declare const Trajectory: import("svelte").Component<$$ComponentProps, {}, "fullscreen" | "wrapper" | "hovered" | "controls_open" | "trajectory" | "fps" | "info_pane_open" | "display_mode" | "current_step_idx" | "visible_properties">;
|
|
77
65
|
type Trajectory = ReturnType<typeof Trajectory>;
|
|
78
66
|
export default Trajectory;
|
|
@@ -3,14 +3,17 @@
|
|
|
3
3
|
import type { Snippet } from 'svelte'
|
|
4
4
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
5
5
|
|
|
6
|
-
let {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
let {
|
|
7
|
+
error_msg,
|
|
8
|
+
on_dismiss,
|
|
9
|
+
error_snippet,
|
|
10
|
+
...rest
|
|
11
|
+
}: HTMLAttributes<HTMLDivElement> & {
|
|
12
|
+
error_msg: string
|
|
13
|
+
on_dismiss: () => void
|
|
14
|
+
// Custom error snippet for advanced error handling
|
|
15
|
+
error_snippet?: Snippet<[{ error_msg: string; on_dismiss: () => void }]>
|
|
16
|
+
} = $props()
|
|
14
17
|
</script>
|
|
15
18
|
|
|
16
19
|
<div {...rest}>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { PaneProps, PaneToggleProps } from '../overlays'
|
|
2
3
|
import {
|
|
4
|
+
estimate_video_bitrate,
|
|
3
5
|
export_trajectory_video,
|
|
4
6
|
get_ffmpeg_conversion_command,
|
|
7
|
+
observe_canvas_presence,
|
|
5
8
|
} from '../io/export'
|
|
9
|
+
import ExportPane from '../io/ExportPane.svelte'
|
|
6
10
|
import SettingsSection from '../layout/SettingsSection.svelte'
|
|
7
|
-
import DraggablePane from '../overlays/DraggablePane.svelte'
|
|
8
11
|
import type { TrajectoryType } from './'
|
|
9
12
|
import type { ComponentProps } from 'svelte'
|
|
10
13
|
import { tooltip } from 'svelte-multiselect/attachments'
|
|
@@ -36,8 +39,8 @@
|
|
|
36
39
|
// Function to change trajectory step during export
|
|
37
40
|
on_step_change?: (step_idx: number) => Promise<void> | void
|
|
38
41
|
// Pane customization
|
|
39
|
-
pane_props?:
|
|
40
|
-
toggle_props?:
|
|
42
|
+
pane_props?: PaneProps
|
|
43
|
+
toggle_props?: PaneToggleProps
|
|
41
44
|
} = $props()
|
|
42
45
|
|
|
43
46
|
let is_exporting = $state(false)
|
|
@@ -58,8 +61,8 @@
|
|
|
58
61
|
let file_size_mb = $derived.by(() => {
|
|
59
62
|
if (!canvas) return 0
|
|
60
63
|
const pixels = canvas.width * canvas.height * resolution_multiplier ** 2
|
|
61
|
-
const bitrate =
|
|
62
|
-
return (bitrate * export_frame_count / video_fps
|
|
64
|
+
const bitrate = estimate_video_bitrate(pixels, video_fps)
|
|
65
|
+
return (bitrate * export_frame_count) / video_fps / 8 / 1024 / 1024
|
|
63
66
|
})
|
|
64
67
|
|
|
65
68
|
// Initialize end_frame when trajectory changes
|
|
@@ -81,9 +84,7 @@
|
|
|
81
84
|
}
|
|
82
85
|
})
|
|
83
86
|
|
|
84
|
-
let export_frame_count = $derived(
|
|
85
|
-
end_frame >= start_frame ? end_frame - start_frame + 1 : 0,
|
|
86
|
-
)
|
|
87
|
+
let export_frame_count = $derived(end_frame >= start_frame ? end_frame - start_frame + 1 : 0)
|
|
87
88
|
|
|
88
89
|
async function handle_video_export(format: `webm` | `mp4` = `webm`) {
|
|
89
90
|
export_error = null
|
|
@@ -93,8 +94,8 @@
|
|
|
93
94
|
export_error = !trajectory
|
|
94
95
|
? `No trajectory`
|
|
95
96
|
: !canvas
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
? `Canvas not ready`
|
|
98
|
+
: `Invalid frame range`
|
|
98
99
|
return
|
|
99
100
|
}
|
|
100
101
|
|
|
@@ -138,24 +139,12 @@
|
|
|
138
139
|
|
|
139
140
|
let has_canvas = $state(false)
|
|
140
141
|
|
|
141
|
-
$effect(() =>
|
|
142
|
-
if (!wrapper) {
|
|
143
|
-
has_canvas = false
|
|
144
|
-
return
|
|
145
|
-
}
|
|
146
|
-
const check = () => (has_canvas = Boolean(wrapper.querySelector(`canvas`)))
|
|
147
|
-
check()
|
|
148
|
-
const observer = new MutationObserver(check)
|
|
149
|
-
observer.observe(wrapper, { childList: true, subtree: true })
|
|
150
|
-
return () => observer.disconnect()
|
|
151
|
-
})
|
|
142
|
+
$effect(() => observe_canvas_presence(wrapper, (val) => (has_canvas = val)))
|
|
152
143
|
</script>
|
|
153
144
|
|
|
154
|
-
<
|
|
155
|
-
bind:
|
|
156
|
-
|
|
157
|
-
closed_icon="Export"
|
|
158
|
-
pane_props={{ ...pane_props, class: `export-pane ${pane_props?.class ?? ``}` }}
|
|
145
|
+
<ExportPane
|
|
146
|
+
bind:export_pane_open
|
|
147
|
+
{pane_props}
|
|
159
148
|
toggle_props={{
|
|
160
149
|
title: export_pane_open ? `` : `Export Trajectory`,
|
|
161
150
|
...toggle_props,
|
|
@@ -181,27 +170,23 @@
|
|
|
181
170
|
<label>
|
|
182
171
|
Frame Rate (FPS)
|
|
183
172
|
<input type="number" min={10} max={60} bind:value={video_fps} />
|
|
184
|
-
<input
|
|
185
|
-
type="range"
|
|
186
|
-
min={10}
|
|
187
|
-
max={60}
|
|
188
|
-
bind:value={video_fps}
|
|
189
|
-
style="accent-color: var(--accent-color)"
|
|
190
|
-
/>
|
|
173
|
+
<input type="range" min={10} max={60} bind:value={video_fps} />
|
|
191
174
|
</label>
|
|
192
175
|
|
|
193
176
|
<span class="field-label">
|
|
194
177
|
Resolution
|
|
195
178
|
<div class="resolution-buttons">
|
|
196
179
|
{#each [0.5, 1, 2, 4, 8] as multiplier (multiplier)}
|
|
197
|
-
{@const
|
|
198
|
-
{@const
|
|
180
|
+
{@const width_px = canvas ? Math.round(canvas.width * multiplier) : 0}
|
|
181
|
+
{@const height_px = canvas ? Math.round(canvas.height * multiplier) : 0}
|
|
199
182
|
<button
|
|
200
183
|
type="button"
|
|
201
184
|
class:active={resolution_multiplier === multiplier}
|
|
202
185
|
onclick={() => (resolution_multiplier = multiplier)}
|
|
203
186
|
{@attach tooltip({
|
|
204
|
-
content: canvas
|
|
187
|
+
content: canvas
|
|
188
|
+
? `${multiplier}x (${width_px}×${height_px})`
|
|
189
|
+
: `${multiplier}x`,
|
|
205
190
|
})}
|
|
206
191
|
>
|
|
207
192
|
{multiplier}x
|
|
@@ -223,7 +208,6 @@
|
|
|
223
208
|
min={0}
|
|
224
209
|
max={Math.max(0, total_frames_available - 1)}
|
|
225
210
|
bind:value={start_frame}
|
|
226
|
-
style="accent-color: var(--accent-color)"
|
|
227
211
|
/>
|
|
228
212
|
</label>
|
|
229
213
|
|
|
@@ -240,7 +224,6 @@
|
|
|
240
224
|
min={start_frame}
|
|
241
225
|
max={Math.max(0, total_frames_available - 1)}
|
|
242
226
|
bind:value={end_frame}
|
|
243
|
-
style="accent-color: var(--accent-color)"
|
|
244
227
|
/>
|
|
245
228
|
</label>
|
|
246
229
|
</SettingsSection>
|
|
@@ -252,13 +235,7 @@
|
|
|
252
235
|
{/if}
|
|
253
236
|
|
|
254
237
|
<div class="export-buttons">
|
|
255
|
-
{#each [
|
|
256
|
-
{ label: `WebM`, format: `webm`, hint: `Export as WebM video` },
|
|
257
|
-
{ label: `MP4`, format: `mp4`, hint: `WebM + ffmpeg command` },
|
|
258
|
-
] as const as
|
|
259
|
-
{ label, format, hint }
|
|
260
|
-
(format)
|
|
261
|
-
}
|
|
238
|
+
{#each [{ label: `WebM`, format: `webm`, hint: `Export as WebM video` }, { label: `MP4`, format: `mp4`, hint: `WebM + ffmpeg command` }] as const as { label, format, hint } (format)}
|
|
262
239
|
<div style="display: flex; align-items: center; gap: 4pt">
|
|
263
240
|
{label}
|
|
264
241
|
<button
|
|
@@ -276,15 +253,11 @@
|
|
|
276
253
|
</div>
|
|
277
254
|
|
|
278
255
|
<div class="export-info">
|
|
279
|
-
{(export_frame_count / video_fps).toFixed(1)}s ({export_frame_count} frames: {
|
|
280
|
-
start_frame
|
|
281
|
-
}–{end_frame})
|
|
256
|
+
{(export_frame_count / video_fps).toFixed(1)}s ({export_frame_count} frames: {start_frame}–{end_frame})
|
|
282
257
|
{#if file_size_mb > 0}
|
|
283
|
-
• ~{
|
|
284
|
-
file_size_mb < 1
|
|
258
|
+
• ~{file_size_mb < 1
|
|
285
259
|
? `${(file_size_mb * 1024).toFixed(0)} KB`
|
|
286
|
-
: `${file_size_mb.toFixed(1)} MB`
|
|
287
|
-
}
|
|
260
|
+
: `${file_size_mb.toFixed(1)} MB`}
|
|
288
261
|
{/if}
|
|
289
262
|
</div>
|
|
290
263
|
|
|
@@ -292,7 +265,7 @@
|
|
|
292
265
|
<div class="warning">Waiting for canvas...</div>
|
|
293
266
|
{/if}
|
|
294
267
|
{/if}
|
|
295
|
-
</
|
|
268
|
+
</ExportPane>
|
|
296
269
|
|
|
297
270
|
<style>
|
|
298
271
|
.field-label {
|
|
@@ -301,7 +274,8 @@
|
|
|
301
274
|
gap: 6pt;
|
|
302
275
|
white-space: nowrap;
|
|
303
276
|
}
|
|
304
|
-
.warning,
|
|
277
|
+
.warning,
|
|
278
|
+
.error-message {
|
|
305
279
|
padding: 1ex;
|
|
306
280
|
border-radius: var(--traj-border-radius, var(--border-radius, 3pt));
|
|
307
281
|
font-size: 0.9em;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { PaneProps, PaneToggleProps } from '../overlays';
|
|
2
2
|
import type { TrajectoryType } from './';
|
|
3
|
-
import type { ComponentProps } from 'svelte';
|
|
4
3
|
type $$ComponentProps = {
|
|
5
4
|
export_pane_open?: boolean;
|
|
6
5
|
trajectory?: TrajectoryType;
|
|
@@ -9,9 +8,9 @@ type $$ComponentProps = {
|
|
|
9
8
|
video_fps?: number;
|
|
10
9
|
resolution_multiplier?: number;
|
|
11
10
|
on_step_change?: (step_idx: number) => Promise<void> | void;
|
|
12
|
-
pane_props?:
|
|
13
|
-
toggle_props?:
|
|
11
|
+
pane_props?: PaneProps;
|
|
12
|
+
toggle_props?: PaneToggleProps;
|
|
14
13
|
};
|
|
15
|
-
declare const TrajectoryExportPane: import("svelte").Component<$$ComponentProps, {}, "
|
|
14
|
+
declare const TrajectoryExportPane: import("svelte").Component<$$ComponentProps, {}, "resolution_multiplier" | "export_pane_open" | "video_fps">;
|
|
16
15
|
type TrajectoryExportPane = ReturnType<typeof TrajectoryExportPane>;
|
|
17
16
|
export default TrajectoryExportPane;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { PaneProps, PaneToggleProps } from '../overlays'
|
|
2
3
|
import type { InfoItem } from '../layout'
|
|
3
4
|
import InfoPaneCards from '../overlays/InfoPaneCards.svelte'
|
|
4
|
-
import { format_num } from '../labels'
|
|
5
|
+
import { format_bytes, format_num } from '../labels'
|
|
5
6
|
import DraggablePane from '../overlays/DraggablePane.svelte'
|
|
6
7
|
import { get_electro_neg_formula } from '../composition'
|
|
7
8
|
import { SETTINGS_CONFIG } from '../settings'
|
|
@@ -28,16 +29,11 @@
|
|
|
28
29
|
file_size?: number | null
|
|
29
30
|
file_object?: File | null
|
|
30
31
|
pane_open?: boolean
|
|
31
|
-
toggle_props?:
|
|
32
|
-
pane_props?:
|
|
32
|
+
toggle_props?: PaneToggleProps
|
|
33
|
+
pane_props?: PaneProps
|
|
33
34
|
} = $props()
|
|
34
35
|
|
|
35
36
|
// Helper functions
|
|
36
|
-
const format_size = (bytes: number) =>
|
|
37
|
-
bytes > 1024 * 1024
|
|
38
|
-
? `${format_num(bytes / (1024 * 1024), `.2~f`)} MB`
|
|
39
|
-
: `${format_num(bytes / 1024, `.2~f`)} KB`
|
|
40
|
-
|
|
41
37
|
const is_valid_number = (val: unknown): val is number =>
|
|
42
38
|
typeof val === `number` && isFinite(val)
|
|
43
39
|
|
|
@@ -50,8 +46,7 @@
|
|
|
50
46
|
return `${format_num(values[0], decimals)} ${unit}`.trim()
|
|
51
47
|
}
|
|
52
48
|
const [min, max] = [Math.min(...values), Math.max(...values)]
|
|
53
|
-
return `${format_num(min, decimals)} - ${format_num(max, decimals)} ${unit}
|
|
54
|
-
.trim()
|
|
49
|
+
return `${format_num(min, decimals)} - ${format_num(max, decimals)} ${unit}`.trim()
|
|
55
50
|
}
|
|
56
51
|
|
|
57
52
|
const safe_item = (
|
|
@@ -59,7 +54,7 @@
|
|
|
59
54
|
value: string | null,
|
|
60
55
|
key?: string,
|
|
61
56
|
tooltip?: string,
|
|
62
|
-
): InfoItem | null => value ? { label, value, key, tooltip } : null
|
|
57
|
+
): InfoItem | null => (value ? { label, value, key, tooltip } : null)
|
|
63
58
|
|
|
64
59
|
// oxlint-disable-next-line eslint-plugin-unicorn/prefer-native-coercion-functions -- type predicate needed for narrowing
|
|
65
60
|
const is_info_item = (item: unknown): item is InfoItem => Boolean(item)
|
|
@@ -78,7 +73,8 @@
|
|
|
78
73
|
(!trajectory?.frames?.length && !trajectory?.total_frames) ||
|
|
79
74
|
current_step_idx < 0 ||
|
|
80
75
|
current_step_idx >= (trajectory.total_frames ?? trajectory.frames?.length ?? 0)
|
|
81
|
-
)
|
|
76
|
+
)
|
|
77
|
+
return []
|
|
82
78
|
|
|
83
79
|
// For indexed trajectories, we might not have the current frame loaded
|
|
84
80
|
const current_frame = trajectory.frames?.[current_step_idx]
|
|
@@ -89,22 +85,18 @@
|
|
|
89
85
|
// File info section
|
|
90
86
|
const file_items = [
|
|
91
87
|
current_filename &&
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
`file-
|
|
96
|
-
current_file_path || undefined,
|
|
97
|
-
),
|
|
98
|
-
file_size && file_size > 0 &&
|
|
99
|
-
safe_item(`File Size`, format_size(file_size), `file-size`),
|
|
88
|
+
safe_item(`Name`, current_filename, `file-name`, current_file_path || undefined),
|
|
89
|
+
file_size &&
|
|
90
|
+
file_size > 0 &&
|
|
91
|
+
safe_item(`File Size`, format_bytes(file_size), `file-size`),
|
|
100
92
|
file_object?.lastModified &&
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
93
|
+
safe_item(
|
|
94
|
+
`Modified`,
|
|
95
|
+
new Date(file_object.lastModified).toLocaleString(),
|
|
96
|
+
`file-modified`,
|
|
97
|
+
),
|
|
106
98
|
trajectory.metadata?.source_format &&
|
|
107
|
-
|
|
99
|
+
safe_item(`Format`, String(trajectory.metadata.source_format), `file-format`),
|
|
108
100
|
].filter(is_info_item)
|
|
109
101
|
|
|
110
102
|
if (file_items.length > 0) {
|
|
@@ -115,32 +107,33 @@
|
|
|
115
107
|
const traj_items = [
|
|
116
108
|
safe_item(
|
|
117
109
|
`Total Frames`,
|
|
118
|
-
`${format_num(total_frames, `.3~s`)} (current: ${
|
|
119
|
-
|
|
120
|
-
|
|
110
|
+
`${format_num(total_frames, `.3~s`)} (current: ${format_num(
|
|
111
|
+
current_step_idx + 1,
|
|
112
|
+
`.3~s`,
|
|
113
|
+
)})`,
|
|
121
114
|
`total-frames`,
|
|
122
115
|
),
|
|
123
116
|
trajectory.is_indexed &&
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
117
|
+
safe_item(
|
|
118
|
+
`Indexed`,
|
|
119
|
+
`Yes`,
|
|
120
|
+
`indexed-mode`,
|
|
121
|
+
SETTINGS_CONFIG.trajectory.use_indexing.description,
|
|
122
|
+
),
|
|
130
123
|
trajectory.indexed_frames &&
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
124
|
+
safe_item(
|
|
125
|
+
`Index Points`,
|
|
126
|
+
`${trajectory.indexed_frames.length}`,
|
|
127
|
+
`index-points`,
|
|
128
|
+
`Number of frames indexed for fast seeking`,
|
|
129
|
+
),
|
|
137
130
|
trajectory.plot_metadata &&
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
131
|
+
safe_item(
|
|
132
|
+
`Plot Metadata`,
|
|
133
|
+
`${trajectory.plot_metadata.length} frames`,
|
|
134
|
+
`plot-metadata`,
|
|
135
|
+
`Pre-extracted metadata for plotting`,
|
|
136
|
+
),
|
|
144
137
|
].filter(is_info_item)
|
|
145
138
|
|
|
146
139
|
if (traj_items.length > 0) {
|
|
@@ -157,30 +150,35 @@
|
|
|
157
150
|
const structure_items = [
|
|
158
151
|
safe_item(`Atoms`, `${structure.sites.length}`, `atoms`),
|
|
159
152
|
formula && safe_item(`Formula`, String(formula), `formula`),
|
|
160
|
-
is_valid_number(volume) &&
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
153
|
+
is_valid_number(volume) &&
|
|
154
|
+
volume > 0 &&
|
|
155
|
+
safe_item(`Volume`, `${format_num(volume, `.3~s`)} ų`, `volume`),
|
|
156
|
+
is_valid_number(volume) &&
|
|
157
|
+
volume > 0 &&
|
|
158
|
+
structure.sites.length > 0 &&
|
|
159
|
+
safe_item(
|
|
160
|
+
`Density`,
|
|
161
|
+
`${format_num(structure.sites.length / volume, `.4~s`)} atoms/ų`,
|
|
162
|
+
`density`,
|
|
163
|
+
),
|
|
168
164
|
[a, b, c].every(is_valid_number) &&
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
165
|
+
safe_item(
|
|
166
|
+
`Cell Lengths`,
|
|
167
|
+
`${format_num(a as number, `.3~f`)}, ${format_num(b as number, `.3~f`)}, ${format_num(
|
|
168
|
+
c as number,
|
|
169
|
+
`.3~f`,
|
|
170
|
+
)} Å`,
|
|
171
|
+
`cell-lengths`,
|
|
172
|
+
),
|
|
176
173
|
[alpha, beta, gamma].every(is_valid_number) &&
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
174
|
+
safe_item(
|
|
175
|
+
`Cell Angles`,
|
|
176
|
+
`${format_num(alpha as number, `.2~f`)}°, ${format_num(
|
|
177
|
+
beta as number,
|
|
178
|
+
`.2~f`,
|
|
179
|
+
)}°, ${format_num(gamma as number, `.2~f`)}°`,
|
|
180
|
+
`cell-angles`,
|
|
181
|
+
),
|
|
184
182
|
].filter(is_info_item)
|
|
185
183
|
|
|
186
184
|
if (structure_items.length > 0) {
|
|
@@ -211,11 +209,11 @@
|
|
|
211
209
|
|
|
212
210
|
const energy_items = [
|
|
213
211
|
is_valid_number(current_energy) &&
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
212
|
+
safe_item(
|
|
213
|
+
`Current Energy`,
|
|
214
|
+
`${format_num(current_energy, `.3~s`)} eV`,
|
|
215
|
+
`energy-current`,
|
|
216
|
+
),
|
|
219
217
|
energy_range && safe_item(`Energy Range`, energy_range, `energy-range`),
|
|
220
218
|
].filter(is_info_item)
|
|
221
219
|
|
|
@@ -234,11 +232,11 @@
|
|
|
234
232
|
|
|
235
233
|
const force_items = [
|
|
236
234
|
is_valid_number(current_force) &&
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
235
|
+
safe_item(
|
|
236
|
+
`Max Force`,
|
|
237
|
+
`${format_num(current_force, `.3~s`)} eV/Å`,
|
|
238
|
+
`force-current`,
|
|
239
|
+
),
|
|
242
240
|
force_range && safe_item(`Force Range`, force_range, `force-range`),
|
|
243
241
|
].filter(is_info_item)
|
|
244
242
|
|
|
@@ -249,29 +247,22 @@
|
|
|
249
247
|
}
|
|
250
248
|
|
|
251
249
|
// Volume change section (only for regular trajectories)
|
|
252
|
-
if (
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
) {
|
|
256
|
-
const lattice = `lattice` in current_frame.structure
|
|
257
|
-
? current_frame.structure.lattice
|
|
258
|
-
: null
|
|
250
|
+
if (!trajectory.is_indexed && current_frame?.structure && trajectory.frames.length > 1) {
|
|
251
|
+
const lattice =
|
|
252
|
+
`lattice` in current_frame.structure ? current_frame.structure.lattice : null
|
|
259
253
|
if (lattice) {
|
|
260
|
-
const volumes = trajectory.frames
|
|
261
|
-
{ structure }
|
|
262
|
-
) => (`lattice` in structure && structure.lattice?.volume))
|
|
254
|
+
const volumes = trajectory.frames
|
|
255
|
+
.map(({ structure }) => `lattice` in structure && structure.lattice?.volume)
|
|
263
256
|
.filter(is_valid_number)
|
|
264
257
|
.filter((volume) => volume > 0)
|
|
265
258
|
|
|
266
259
|
if (volumes.length > 1) {
|
|
267
|
-
const vol_change =
|
|
268
|
-
Math.min(...volumes)
|
|
260
|
+
const vol_change =
|
|
261
|
+
(Math.max(...volumes) - Math.min(...volumes)) / Math.min(...volumes)
|
|
269
262
|
if (Math.abs(vol_change) > 0.1 && is_valid_number(vol_change)) {
|
|
270
|
-
const vol_items = [
|
|
271
|
-
`Volume Change`,
|
|
272
|
-
|
|
273
|
-
`vol-change`,
|
|
274
|
-
)].filter(is_info_item)
|
|
263
|
+
const vol_items = [
|
|
264
|
+
safe_item(`Volume Change`, `${format_num(vol_change, `.2~%`)}`, `vol-change`),
|
|
265
|
+
].filter(is_info_item)
|
|
275
266
|
|
|
276
267
|
if (vol_items.length > 0) {
|
|
277
268
|
sections.push({ title: `Volume`, items: vol_items })
|
|
@@ -283,9 +274,7 @@
|
|
|
283
274
|
return sections
|
|
284
275
|
})
|
|
285
276
|
|
|
286
|
-
let info_cards = $derived(
|
|
287
|
-
info_pane_data.map(({ title, items }) => ({ title, rows: items })),
|
|
288
|
-
)
|
|
277
|
+
let info_cards = $derived(info_pane_data.map(({ title, items }) => ({ title, rows: items })))
|
|
289
278
|
let n_info_items = $derived(
|
|
290
279
|
info_pane_data.reduce((count, { items }) => count + items.length, 0),
|
|
291
280
|
)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PaneProps, PaneToggleProps } from '../overlays';
|
|
1
2
|
import DraggablePane from '../overlays/DraggablePane.svelte';
|
|
2
3
|
import type { ComponentProps } from 'svelte';
|
|
3
4
|
import type { TrajectoryType } from './index';
|
|
@@ -9,8 +10,8 @@ type $$ComponentProps = Omit<ComponentProps<typeof DraggablePane>, `children`> &
|
|
|
9
10
|
file_size?: number | null;
|
|
10
11
|
file_object?: File | null;
|
|
11
12
|
pane_open?: boolean;
|
|
12
|
-
toggle_props?:
|
|
13
|
-
pane_props?:
|
|
13
|
+
toggle_props?: PaneToggleProps;
|
|
14
|
+
pane_props?: PaneProps;
|
|
14
15
|
};
|
|
15
16
|
declare const TrajectoryInfoPane: import("svelte").Component<$$ComponentProps, {}, "pane_open">;
|
|
16
17
|
type TrajectoryInfoPane = ReturnType<typeof TrajectoryInfoPane>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
// Constants for trajectory parsing and large file handling
|
|
2
|
+
import { DEFAULTS } from '../settings';
|
|
2
3
|
export const MAX_SAFE_STRING_LENGTH = 0x1fffffe8 * 0.5; // 50% of JS max string length as safety
|
|
3
4
|
export const MAX_METADATA_SIZE = 50 * 1024 * 1024; // 50MB limit for metadata
|
|
4
5
|
export const LARGE_FILE_THRESHOLD = 400 * 1024 * 1024; // 400MB
|
|
5
6
|
export const INDEX_SAMPLE_RATE = 100; // Default sample rate for frame indexing
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
// Fallback thresholds for component usage without loading_options, derived from the
|
|
8
|
+
// settings schema so settings-driven contexts (e.g. the VSCode extension) and direct
|
|
9
|
+
// component use agree on when large-file/indexed loading kicks in.
|
|
10
|
+
export const MAX_BIN_FILE_SIZE = DEFAULTS.trajectory.bin_file_threshold; // 50MB
|
|
11
|
+
export const MAX_TEXT_FILE_SIZE = DEFAULTS.trajectory.text_file_threshold; // 25MB
|