matterviz 0.4.1 → 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 +75 -85
- 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 +26 -39
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram.svelte +33 -38
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +62 -74
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +511 -547
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +1 -1
- package/dist/chempot-diagram/async-compute.svelte.js +1 -1
- package/dist/chempot-diagram/controls-state.svelte.js +1 -1
- package/dist/colors/index.d.ts +0 -4
- package/dist/colors/index.js +19 -20
- 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 +92 -95
- package/dist/composition/PieChart.svelte +55 -41
- package/dist/composition/format.js +1 -1
- 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 +11 -10
- package/dist/constants.js +11 -9
- 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 -92
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +109 -140
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +75 -94
- 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 +17 -21
- 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/helpers.d.ts +8 -10
- package/dist/convex-hull/helpers.js +36 -36
- package/dist/convex-hull/hull-state.svelte.d.ts +1 -1
- package/dist/convex-hull/thermodynamics.js +18 -17
- package/dist/coordination/CoordinationBarPlot.svelte +38 -33
- 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 -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/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 -4
- package/dist/element/index.js +3 -18
- 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 +14 -22
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +5 -7
- package/dist/fermi-surface/FermiSurfaceControls.svelte +6 -20
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +37 -64
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +9 -6
- package/dist/fermi-surface/compute.js +3 -3
- package/dist/fermi-surface/parse.js +22 -24
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +109 -148
- 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/io/ExportPane.svelte +10 -6
- package/dist/io/decompress.d.ts +2 -1
- package/dist/io/decompress.js +22 -35
- package/dist/io/export.d.ts +4 -0
- package/dist/io/export.js +5 -1
- package/dist/io/fetch.d.ts +0 -3
- package/dist/io/fetch.js +0 -11
- 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.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 +6 -6
- package/dist/labels.d.ts +6 -2
- package/dist/labels.js +43 -13
- package/dist/layout/FullscreenButton.svelte +2 -1
- package/dist/layout/FullscreenToggle.svelte +10 -4
- 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 +9 -10
- 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 +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 +2 -0
- package/dist/math.js +19 -0
- 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 +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 +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 +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 +3 -3
- 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 +21 -15
- package/dist/phase-diagram/utils.js +2 -3
- package/dist/plot/bar/BarPlot.svelte +430 -391
- 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 +29 -36
- package/dist/plot/bar/data.d.ts +5 -4
- package/dist/plot/bar/data.js +2 -1
- package/dist/plot/box/BoxPlot.svelte +301 -209
- 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.js +1 -1
- 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.js +9 -5
- 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 +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/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/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 +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.js +2 -2
- package/dist/plot/histogram/Histogram.svelte +304 -325
- 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/scatter/BinnedScatterPlot.svelte +263 -109
- package/dist/plot/scatter/BinnedScatterPlot.svelte.d.ts +7 -0
- package/dist/plot/scatter/ElementScatter.svelte +4 -1
- package/dist/plot/scatter/ScatterPlot.svelte +477 -385
- 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/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 +251 -329
- 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 +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 +1 -1
- package/dist/scene/bind-renderer.svelte.js +14 -6
- package/dist/settings.d.ts +19 -9
- package/dist/settings.js +77 -50
- package/dist/spectral/Bands.svelte +223 -230
- package/dist/spectral/BandsAndDos.svelte +11 -9
- package/dist/spectral/BrillouinBandsDos.svelte +19 -27
- package/dist/spectral/Dos.svelte +70 -73
- package/dist/spectral/helpers.d.ts +3 -3
- package/dist/spectral/helpers.js +25 -35
- 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 +115 -75
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/Bond.svelte +31 -23
- package/dist/structure/CanvasTooltip.svelte +15 -3
- package/dist/structure/CellSelect.svelte +11 -26
- 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 +473 -419
- package/dist/structure/Structure.svelte.d.ts +4 -2
- package/dist/structure/StructureCarousel.svelte +630 -0
- package/dist/structure/StructureCarousel.svelte.d.ts +19 -0
- package/dist/structure/StructureControls.svelte +157 -399
- package/dist/structure/StructureControls.svelte.d.ts +1 -1
- package/dist/structure/StructureExportPane.svelte +17 -21
- package/dist/structure/StructureInfoPane.svelte +72 -66
- package/dist/structure/StructureInfoPane.svelte.d.ts +1 -1
- package/dist/structure/StructureScene.svelte +467 -476
- package/dist/structure/StructureScene.svelte.d.ts +3 -1
- package/dist/structure/StructureViewport.svelte +386 -0
- package/dist/structure/StructureViewport.svelte.d.ts +63 -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 +104 -38
- package/dist/structure/bonding.d.ts +10 -3
- package/dist/structure/bonding.js +84 -28
- 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 +39 -31
- 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 +16 -1
- package/dist/structure/index.js +13 -2
- 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 +243 -222
- package/dist/structure/partial-occupancy.js +4 -2
- package/dist/structure/pbc.js +78 -98
- package/dist/structure/polyhedra.d.ts +0 -1
- package/dist/structure/polyhedra.js +3 -18
- 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 +56 -68
- package/dist/symmetry/WyckoffTable.svelte +5 -24
- package/dist/symmetry/cell-transform.js +1 -0
- package/dist/symmetry/index.d.ts +1 -0
- package/dist/symmetry/index.js +8 -2
- package/dist/symmetry/spacegroups.js +3 -2
- package/dist/table/HeatmapTable.svelte +1102 -365
- 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 +515 -308
- package/dist/trajectory/Trajectory.svelte.d.ts +1 -1
- package/dist/trajectory/TrajectoryError.svelte +11 -8
- package/dist/trajectory/TrajectoryExportPane.svelte +14 -31
- package/dist/trajectory/TrajectoryInfoPane.svelte +85 -97
- package/dist/trajectory/extract.js +56 -34
- package/dist/trajectory/format-detect.js +11 -9
- package/dist/trajectory/frame-reader.d.ts +2 -0
- package/dist/trajectory/frame-reader.js +33 -29
- package/dist/trajectory/helpers.d.ts +2 -0
- package/dist/trajectory/helpers.js +18 -7
- package/dist/trajectory/index.d.ts +1 -0
- package/dist/trajectory/index.js +3 -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 +2 -3
- package/dist/trajectory/parse/index.js +17 -20
- 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 +5 -0
- package/dist/trajectory/parse/vaspout-h5.js +284 -0
- package/dist/trajectory/parse/xyz.js +11 -7
- package/dist/trajectory/plotting.d.ts +8 -9
- package/dist/trajectory/plotting.js +99 -27
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +7 -0
- package/dist/xrd/XrdPlot.svelte +47 -61
- package/dist/xrd/broadening.js +2 -1
- package/dist/xrd/calc-xrd.js +2 -4
- package/dist/xrd/parse.d.ts +0 -1
- package/dist/xrd/parse.js +56 -73
- package/package.json +61 -33
- package/dist/api/mp.d.ts +0 -6
- package/dist/api/mp.js +0 -22
- package/dist/plot/sunburst/SunburstControls.svelte +0 -200
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Vec2 } from '../../math';
|
|
2
2
|
import type { BandwidthOption, BasePlotProps, BoxHandlerProps, BoxPlotSeries, LegendConfig, Orientation, PanConfig, PlotConfig, RefLine, RefLineEvent, UserContentProps, ViolinKind, ViolinSide, WhiskerMode } from '..';
|
|
3
|
+
import type { MarginalsProp } from '../core/marginals';
|
|
3
4
|
import type { Snippet } from 'svelte';
|
|
4
5
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
6
|
declare function $$render<Metadata extends Record<string, unknown> = Record<string, unknown>>(): {
|
|
@@ -70,6 +71,7 @@ declare function $$render<Metadata extends Record<string, unknown> = Record<stri
|
|
|
70
71
|
on_ref_line_click?: (event: RefLineEvent) => void;
|
|
71
72
|
on_ref_line_hover?: (event: RefLineEvent | null) => void;
|
|
72
73
|
pan?: PanConfig;
|
|
74
|
+
marginals?: MarginalsProp;
|
|
73
75
|
};
|
|
74
76
|
exports: {};
|
|
75
77
|
bindings: "display" | "orientation" | "show_controls" | "x2_axis" | "y_axis" | "y2_axis" | "fullscreen" | "series" | "hovered" | "ref_lines" | "controls_open" | "x_axis" | "kind" | "side" | "whisker_mode" | "show_outliers" | "show_mean";
|
|
@@ -65,6 +65,7 @@ declare const Violin: import("svelte").Component<import("svelte/elements").HTMLA
|
|
|
65
65
|
on_ref_line_click?: ((event: import("..").RefLineEvent) => void) | undefined;
|
|
66
66
|
on_ref_line_hover?: ((event: import("..").RefLineEvent | null) => void) | undefined;
|
|
67
67
|
pan?: import("..").PanConfig;
|
|
68
|
+
marginals?: import("..").MarginalsProp;
|
|
68
69
|
}, {}, "series" | "kind">;
|
|
69
70
|
type Violin = ReturnType<typeof Violin>;
|
|
70
71
|
export default Violin;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { ascending } from 'd3-array';
|
|
4
4
|
import { quantile_unordered } from './quantile';
|
|
5
5
|
import { DEFAULTS } from '../../settings';
|
|
6
|
+
import { clamp01 } from '../../utils';
|
|
6
7
|
export const WHISKER_MODES = [`tukey`, `minmax`, `percentile`, `std`];
|
|
7
8
|
const WHISKER_MODE_SET = new Set(WHISKER_MODES);
|
|
8
9
|
export const is_whisker_mode = (val) => WHISKER_MODE_SET.has(val);
|
|
@@ -18,7 +19,6 @@ const EMPTY_STATS = {
|
|
|
18
19
|
outliers: [],
|
|
19
20
|
n: 0,
|
|
20
21
|
};
|
|
21
|
-
const clamp01 = (val) => Math.max(0, Math.min(1, val));
|
|
22
22
|
function collect_outliers_by_scan(values, low_bound, high_bound, collect) {
|
|
23
23
|
if (!collect)
|
|
24
24
|
return [];
|
|
@@ -7,7 +7,7 @@ const DECOR_GAP = 8; // px gap between an outside decoration and the plot edge
|
|
|
7
7
|
export const placed_coords = (auto_outside, outside, placement, tweened, fallback) => (auto_outside ? outside : placement ? tweened : fallback);
|
|
8
8
|
// True when the user pinned a decoration via its style (an edge property or position:absolute),
|
|
9
9
|
// in which case auto-placement must leave it alone.
|
|
10
|
-
export const has_explicit_position = (style) => /(
|
|
10
|
+
export const has_explicit_position = (style) => /(?:^|[;{]\s*)(?:top|bottom|left|right)\s*:|position\s*:\s*absolute/.test(style ?? ``);
|
|
11
11
|
// A decoration's pixel footprint: its rendered box once laid out, else `fallback` (offset dims read
|
|
12
12
|
// 0 before first render). Used to decide crowding before the real size is known.
|
|
13
13
|
export const measured_footprint = (el, fallback) => el?.offsetWidth && el?.offsetHeight
|
|
@@ -21,14 +21,19 @@ export declare const AXIS_DEFAULTS: {
|
|
|
21
21
|
type AxisType = `x` | `x2` | `y` | `y2`;
|
|
22
22
|
export declare function merge_series_state<T extends DataSeries | BarSeries>(old_series: T[], new_series: T[]): T[];
|
|
23
23
|
export interface AxisChangeState<T extends DataSeries | BarSeries> {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
axes: Record<AxisType, {
|
|
25
|
+
get: () => AxisConfig;
|
|
26
|
+
set: (config: AxisConfig) => void;
|
|
27
|
+
}>;
|
|
28
|
+
series: {
|
|
29
|
+
get: () => T[];
|
|
30
|
+
set: (series: T[]) => void;
|
|
31
|
+
};
|
|
32
|
+
loading: {
|
|
33
|
+
get: () => AxisType | null;
|
|
34
|
+
set: (axis: AxisType | null) => void;
|
|
35
|
+
};
|
|
30
36
|
}
|
|
31
|
-
export declare const create_axis_change_handler: <T extends DataSeries | BarSeries>(state: AxisChangeState<T>, data_loader: DataLoaderFn<Record<string, unknown>, T> | undefined, on_axis_change?: (axis: AxisType, key: string, new_series: T[]) => void, on_error?: (error: AxisLoadError) => void) => ((axis: AxisType, key: string) => Promise<void>);
|
|
32
37
|
export declare function create_axis_loader<T extends DataSeries | BarSeries>(state: AxisChangeState<T>, get_props: () => {
|
|
33
38
|
data_loader?: DataLoaderFn<Record<string, unknown>, T>;
|
|
34
39
|
on_axis_change?: (axis: AxisType, key: string, new_series: T[]) => void;
|
|
@@ -36,61 +36,61 @@ export function merge_series_state(old_series, new_series) {
|
|
|
36
36
|
return result;
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return;
|
|
44
|
-
const axis_config = state.get_axis(axis);
|
|
45
|
-
const prev_key = axis_config.selected_key;
|
|
46
|
-
// Skip if key unchanged AND series already loaded (allows initial load when series empty)
|
|
47
|
-
if (prev_key === key && state.get_series().length > 0)
|
|
48
|
-
return;
|
|
49
|
-
// Update selected_key immediately for UI feedback
|
|
50
|
-
state.set_axis(axis, { ...axis_config, selected_key: key });
|
|
51
|
-
state.set_loading(axis);
|
|
52
|
-
try {
|
|
53
|
-
const result = await data_loader(axis, key, state.get_series());
|
|
54
|
-
// Merge new series with preserved state from old series
|
|
55
|
-
const merged = merge_series_state(state.get_series(), result.series);
|
|
56
|
-
state.set_series(merged);
|
|
57
|
-
// Update axis label/unit if provided
|
|
58
|
-
if (result.axis_label || result.axis_unit) {
|
|
59
|
-
const current = state.get_axis(axis);
|
|
60
|
-
state.set_axis(axis, {
|
|
61
|
-
...current,
|
|
62
|
-
label: result.axis_label ?? current.label,
|
|
63
|
-
unit: result.axis_unit ?? current.unit,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
on_axis_change?.(axis, key, merged);
|
|
67
|
-
}
|
|
68
|
-
catch (err) {
|
|
69
|
-
console.error(`Failed to load data for ${axis}=${key}:`, err);
|
|
70
|
-
// Revert selection
|
|
71
|
-
state.set_axis(axis, { ...state.get_axis(axis), selected_key: prev_key });
|
|
72
|
-
const message = to_error(err).message;
|
|
73
|
-
on_error?.({ axis, key, message });
|
|
74
|
-
}
|
|
75
|
-
finally {
|
|
76
|
-
state.set_loading(null);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
// Bundle axis change handler with one-shot auto-load of the first axis option.
|
|
80
|
-
// get_props keeps callback props fresh; try_auto_load reads series/axis configs
|
|
81
|
-
// through state getters so a component `$effect(try_auto_load)` tracks them reactively.
|
|
39
|
+
// Axis-change loader: `handle_axis_change` loads new data for an axis property change via the
|
|
40
|
+
// data_loader (reading `get_props` fresh each call so callbacks stay current), and `try_auto_load`
|
|
41
|
+
// loads the first axis option once when series start empty. Reads state through getters so a
|
|
42
|
+
// component `$effect(try_auto_load)` tracks them reactively.
|
|
82
43
|
export function create_axis_loader(state, get_props) {
|
|
83
44
|
let auto_load_attempted = false; // prevent infinite retries on failure
|
|
84
|
-
|
|
45
|
+
// No-op when already loading, or when the key is unchanged and series are already present
|
|
46
|
+
const handle_axis_change = async (axis, key) => {
|
|
85
47
|
const { data_loader, on_axis_change, on_error } = get_props();
|
|
86
|
-
|
|
48
|
+
if (!data_loader || state.loading.get())
|
|
49
|
+
return;
|
|
50
|
+
const axis_config = state.axes[axis].get();
|
|
51
|
+
const prev_key = axis_config.selected_key;
|
|
52
|
+
if (prev_key === key && state.series.get().length > 0)
|
|
53
|
+
return;
|
|
54
|
+
state.axes[axis].set({ ...axis_config, selected_key: key }); // immediate UI feedback
|
|
55
|
+
state.loading.set(axis);
|
|
56
|
+
let merged = state.series.get();
|
|
57
|
+
let load_error;
|
|
58
|
+
try {
|
|
59
|
+
const result = await data_loader(axis, key, state.series.get());
|
|
60
|
+
merged = merge_series_state(state.series.get(), result.series);
|
|
61
|
+
state.series.set(merged);
|
|
62
|
+
// !== undefined (not truthiness) so a loader can intentionally clear a label/unit to ``
|
|
63
|
+
if (result.axis_label !== undefined || result.axis_unit !== undefined) {
|
|
64
|
+
const current = state.axes[axis].get();
|
|
65
|
+
state.axes[axis].set({
|
|
66
|
+
...current,
|
|
67
|
+
label: result.axis_label ?? current.label,
|
|
68
|
+
unit: result.axis_unit ?? current.unit,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
console.error(`Failed to load data for ${axis}=${key}:`, err);
|
|
74
|
+
state.axes[axis].set(axis_config); // revert every axis field mutated above, not just selected_key
|
|
75
|
+
load_error = { axis, key, message: to_error(err).message };
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
state.loading.set(null); // always clears, even if a consumer callback below throws
|
|
79
|
+
}
|
|
80
|
+
// callbacks run only after internal state is fully settled, so a throwing consumer callback
|
|
81
|
+
// can neither leave `loading` stuck nor trigger the loader rollback
|
|
82
|
+
if (load_error) {
|
|
83
|
+
on_error?.(load_error);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
on_axis_change?.(axis, key, merged);
|
|
87
87
|
};
|
|
88
|
-
// Auto-load
|
|
88
|
+
// Auto-load once if series is empty but options exist (x-axis first, then y)
|
|
89
89
|
const try_auto_load = () => {
|
|
90
|
-
if (state.
|
|
90
|
+
if (state.series.get().length > 0 || !get_props().data_loader || auto_load_attempted)
|
|
91
91
|
return;
|
|
92
92
|
for (const axis of [`x`, `y`]) {
|
|
93
|
-
const config = state.
|
|
93
|
+
const config = state.axes[axis].get();
|
|
94
94
|
if (config.options?.length) {
|
|
95
95
|
auto_load_attempted = true;
|
|
96
96
|
handle_axis_change(axis, config.selected_key ?? config.options[0].key).catch(() => { });
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
loading = false,
|
|
15
15
|
axis_type,
|
|
16
16
|
on_select,
|
|
17
|
+
width = AXIS_LABEL_CONTAINER.width,
|
|
17
18
|
}: {
|
|
18
19
|
x: number
|
|
19
20
|
y: number
|
|
@@ -25,27 +26,88 @@
|
|
|
25
26
|
loading?: boolean
|
|
26
27
|
axis_type: `x` | `x2` | `y` | `y2`
|
|
27
28
|
on_select?: (key: string) => void
|
|
29
|
+
// container width for centering/wrapping; wider lets long horizontal titles fit on one line
|
|
30
|
+
width?: number
|
|
28
31
|
} = $props()
|
|
32
|
+
|
|
33
|
+
interface LabelSegment {
|
|
34
|
+
text: string
|
|
35
|
+
shift?: `sub` | `super`
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const decode_text = (value: string, textarea?: HTMLTextAreaElement): string => {
|
|
39
|
+
// Strip only sub/sup markup so literal angle-bracket text like <100> survives
|
|
40
|
+
const without_tags = value.replaceAll(/<\/?(?:sub|sup)\b[^>]*>/gi, ``)
|
|
41
|
+
if (!textarea) return without_tags
|
|
42
|
+
textarea.innerHTML = without_tags
|
|
43
|
+
return textarea.value
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const label_segments = (value: string): LabelSegment[] => {
|
|
47
|
+
const segments: LabelSegment[] = []
|
|
48
|
+
const tag_pattern = /<(?<tag>sub|sup)\b[^>]*>(?<inner>.*?)<\/\k<tag>>/gis
|
|
49
|
+
const textarea =
|
|
50
|
+
typeof document === `undefined` ? undefined : document.createElement(`textarea`)
|
|
51
|
+
let cursor = 0
|
|
52
|
+
for (const match of value.matchAll(tag_pattern)) {
|
|
53
|
+
const start = match.index ?? 0
|
|
54
|
+
const plain_text = decode_text(value.slice(cursor, start), textarea)
|
|
55
|
+
if (plain_text) segments.push({ text: plain_text })
|
|
56
|
+
const shifted_text = decode_text(match.groups?.inner ?? ``, textarea)
|
|
57
|
+
if (shifted_text) {
|
|
58
|
+
segments.push({
|
|
59
|
+
text: shifted_text,
|
|
60
|
+
shift: match.groups?.tag?.toLowerCase() === `sub` ? `sub` : `super`,
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
cursor = start + match[0].length
|
|
64
|
+
}
|
|
65
|
+
const tail_text = decode_text(value.slice(cursor), textarea)
|
|
66
|
+
if (tail_text) segments.push({ text: tail_text })
|
|
67
|
+
return segments
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
let use_svg_text = $derived(rotate && !options?.length && !loading)
|
|
71
|
+
let segments = $derived(use_svg_text ? label_segments(label) : [])
|
|
29
72
|
</script>
|
|
30
73
|
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
width={AXIS_LABEL_CONTAINER.width}
|
|
35
|
-
height={AXIS_LABEL_CONTAINER.height}
|
|
36
|
-
style="overflow: visible; pointer-events: none"
|
|
37
|
-
transform={rotate ? `rotate(-90, ${x}, ${y})` : undefined}
|
|
38
|
-
>
|
|
39
|
-
<div xmlns="http://www.w3.org/1999/xhtml" style="pointer-events: auto">
|
|
40
|
-
<InteractiveAxisLabel
|
|
41
|
-
{label}
|
|
42
|
-
{options}
|
|
43
|
-
{selected_key}
|
|
44
|
-
{loading}
|
|
45
|
-
{axis_type}
|
|
46
|
-
{color}
|
|
47
|
-
{on_select}
|
|
74
|
+
<g transform={rotate ? `rotate(-90, ${x}, ${y})` : undefined}>
|
|
75
|
+
{#if use_svg_text}
|
|
76
|
+
<text
|
|
48
77
|
class="axis-label {axis_type}-label"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
78
|
+
dominant-baseline="central"
|
|
79
|
+
fill={color ?? `currentColor`}
|
|
80
|
+
pointer-events="none"
|
|
81
|
+
text-anchor="middle"
|
|
82
|
+
{x}
|
|
83
|
+
{y}
|
|
84
|
+
>
|
|
85
|
+
{#each segments as segment}
|
|
86
|
+
<tspan baseline-shift={segment.shift} font-size={segment.shift ? `75%` : undefined}
|
|
87
|
+
>{segment.text}</tspan
|
|
88
|
+
>
|
|
89
|
+
{/each}
|
|
90
|
+
</text>
|
|
91
|
+
{:else}
|
|
92
|
+
<foreignObject
|
|
93
|
+
x={x - width / 2}
|
|
94
|
+
y={y - AXIS_LABEL_CONTAINER.y_offset}
|
|
95
|
+
{width}
|
|
96
|
+
height={AXIS_LABEL_CONTAINER.height}
|
|
97
|
+
style="overflow: visible; pointer-events: none"
|
|
98
|
+
>
|
|
99
|
+
<div xmlns="http://www.w3.org/1999/xhtml" style="pointer-events: auto">
|
|
100
|
+
<InteractiveAxisLabel
|
|
101
|
+
{label}
|
|
102
|
+
{options}
|
|
103
|
+
{selected_key}
|
|
104
|
+
{loading}
|
|
105
|
+
{axis_type}
|
|
106
|
+
{color}
|
|
107
|
+
{on_select}
|
|
108
|
+
class="axis-label {axis_type}-label"
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
</foreignObject>
|
|
112
|
+
{/if}
|
|
113
|
+
</g>
|
|
@@ -10,6 +10,7 @@ type $$ComponentProps = {
|
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
axis_type: `x` | `x2` | `y` | `y2`;
|
|
12
12
|
on_select?: (key: string) => void;
|
|
13
|
+
width?: number;
|
|
13
14
|
};
|
|
14
15
|
declare const AxisLabel: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
15
16
|
type AxisLabel = ReturnType<typeof AxisLabel>;
|