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
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import type { FullscreenToggleProp } from './fullscreen'
|
|
3
3
|
import type { ShowControlsState } from '../controls'
|
|
4
4
|
// Shared control-buttons row (filename chip + fullscreen toggle + snippet buttons/panes) for BrillouinZone/FermiSurface/Structure viewers; themed via neutral --viewer-* CSS vars
|
|
5
|
-
//
|
|
5
|
+
// NOTE Trajectory.svelte intentionally keeps its own controls: its bar is a full playback strip (nav/step/FPS/info+export panes/view-mode) rather than this floating top-right cluster. It already shares FullscreenButton + sync_fullscreen.
|
|
6
6
|
import type { Snippet } from 'svelte'
|
|
7
7
|
import { createAttachmentKey } from 'svelte/attachments'
|
|
8
8
|
import { tooltip } from 'svelte-multiselect/attachments'
|
|
9
9
|
import FullscreenButton from './FullscreenButton.svelte'
|
|
10
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
10
11
|
|
|
11
12
|
let {
|
|
12
13
|
controls_config,
|
|
@@ -15,10 +16,10 @@
|
|
|
15
16
|
fullscreen_toggle = true,
|
|
16
17
|
fullscreen_btn_style = undefined,
|
|
17
18
|
wrapper = undefined,
|
|
18
|
-
style = undefined,
|
|
19
19
|
before = undefined,
|
|
20
20
|
children = undefined,
|
|
21
|
-
|
|
21
|
+
...rest
|
|
22
|
+
}: HTMLAttributes<HTMLElement> & {
|
|
22
23
|
controls_config: ShowControlsState
|
|
23
24
|
filename?: string
|
|
24
25
|
fullscreen?: boolean
|
|
@@ -35,8 +36,9 @@
|
|
|
35
36
|
</script>
|
|
36
37
|
|
|
37
38
|
<section
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
{...rest}
|
|
40
|
+
class={[`control-buttons`, controls_config.class, rest.class]}
|
|
41
|
+
style={[rest.style, controls_config.style].filter(Boolean).join(`; `)}
|
|
40
42
|
>
|
|
41
43
|
{#if controls_config.mode !== `never`}
|
|
42
44
|
{@render before?.()}
|
|
@@ -67,10 +69,7 @@
|
|
|
67
69
|
top: var(--viewer-buttons-top, var(--ctrl-btn-top, 1ex));
|
|
68
70
|
right: var(--viewer-buttons-right, var(--ctrl-btn-right, 1ex));
|
|
69
71
|
gap: var(--viewer-buttons-gap, clamp(6pt, 1cqmin, 9pt));
|
|
70
|
-
z-index: var(
|
|
71
|
-
--viewer-buttons-z-index,
|
|
72
|
-
var(--z-index-overlay-controls, 100000000)
|
|
73
|
-
);
|
|
72
|
+
z-index: var(--viewer-buttons-z-index, var(--z-index-overlay-controls, 100000000));
|
|
74
73
|
opacity: 0;
|
|
75
74
|
pointer-events: none;
|
|
76
75
|
transition: opacity 0.2s ease;
|
|
@@ -97,7 +96,7 @@
|
|
|
97
96
|
display: flex;
|
|
98
97
|
padding: var(--viewer-buttons-btn-padding, 4px);
|
|
99
98
|
border-radius: var(--border-radius, 3pt);
|
|
100
|
-
font-size: clamp(0.
|
|
99
|
+
font-size: var(--ctrl-btn-icon-size, clamp(0.7rem, 2cqmin, 0.85rem));
|
|
101
100
|
}
|
|
102
101
|
section.control-buttons :global(button:hover) {
|
|
103
102
|
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { FullscreenToggleProp } from './fullscreen';
|
|
2
2
|
import type { ShowControlsState } from '../controls';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
|
-
type
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
|
+
type $$ComponentProps = HTMLAttributes<HTMLElement> & {
|
|
5
6
|
controls_config: ShowControlsState;
|
|
6
7
|
filename?: string;
|
|
7
8
|
fullscreen?: boolean;
|
|
@@ -4,14 +4,12 @@ export async function toggle_fullscreen(wrapper) {
|
|
|
4
4
|
if (!wrapper || !wrapper.isConnected)
|
|
5
5
|
return;
|
|
6
6
|
try {
|
|
7
|
-
if (
|
|
8
|
-
await wrapper.requestFullscreen();
|
|
9
|
-
}
|
|
10
|
-
else if (document.fullscreenElement === wrapper) {
|
|
7
|
+
if (document.fullscreenElement === wrapper) {
|
|
11
8
|
await document.exitFullscreen();
|
|
12
9
|
}
|
|
13
10
|
else {
|
|
14
|
-
|
|
11
|
+
if (document.fullscreenElement)
|
|
12
|
+
await document.exitFullscreen();
|
|
15
13
|
await wrapper.requestFullscreen();
|
|
16
14
|
}
|
|
17
15
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { set_fullscreen_bg } from './fullscreen';
|
|
2
|
-
// Two-way sync between a bindable `fullscreen` flag, the browser fullscreen state of a wrapper, and the fullscreen background CSS var. Creates $effects (call during component init). Shared by BrillouinZone/FermiSurface/Structure viewers.
|
|
3
|
-
// TODO Trajectory.svelte still has its own fullscreen variant — migrate it here.
|
|
2
|
+
// Two-way sync between a bindable `fullscreen` flag, the browser fullscreen state of a wrapper, and the fullscreen background CSS var. Creates $effects (call during component init). Shared by BrillouinZone/FermiSurface/Structure/Trajectory viewers.
|
|
4
3
|
export function sync_fullscreen(opts) {
|
|
5
4
|
// Flag -> browser: enter/exit fullscreen when the bound flag changes
|
|
6
5
|
$effect(() => {
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { default as FullscreenButton } from './FullscreenButton.svelte';
|
|
|
4
4
|
export { default as FullscreenToggle } from './FullscreenToggle.svelte';
|
|
5
5
|
export { default as InfoCard } from './InfoCard.svelte';
|
|
6
6
|
export { default as InfoTag } from './InfoTag.svelte';
|
|
7
|
+
export { default as NumberRangeInput } from './NumberRangeInput.svelte';
|
|
7
8
|
export * from './json-tree';
|
|
8
9
|
export { default as PropertyFilter } from './PropertyFilter.svelte';
|
|
9
10
|
export { default as SettingsSection } from './SettingsSection.svelte';
|
package/dist/layout/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { default as FullscreenButton } from './FullscreenButton.svelte';
|
|
|
4
4
|
export { default as FullscreenToggle } from './FullscreenToggle.svelte';
|
|
5
5
|
export { default as InfoCard } from './InfoCard.svelte';
|
|
6
6
|
export { default as InfoTag } from './InfoTag.svelte';
|
|
7
|
+
export { default as NumberRangeInput } from './NumberRangeInput.svelte';
|
|
7
8
|
export * from './json-tree';
|
|
8
9
|
export { default as PropertyFilter } from './PropertyFilter.svelte';
|
|
9
10
|
export { default as SettingsSection } from './SettingsSection.svelte';
|
|
@@ -191,9 +191,7 @@
|
|
|
191
191
|
if (expandable && !is_collapsed) {
|
|
192
192
|
toggle_collapse()
|
|
193
193
|
}
|
|
194
|
-
} else if (
|
|
195
|
-
(event.key === `c` || event.key === `C`) && (event.ctrlKey || event.metaKey)
|
|
196
|
-
) {
|
|
194
|
+
} else if ((event.key === `c` || event.key === `C`) && (event.ctrlKey || event.metaKey)) {
|
|
197
195
|
// When nodes are selected, let the tree-level handler do bulk copy
|
|
198
196
|
if (ctx?.selected_paths.size) return
|
|
199
197
|
event.preventDefault()
|
|
@@ -299,10 +297,7 @@
|
|
|
299
297
|
{#if expandable && is_collapsed}
|
|
300
298
|
▸
|
|
301
299
|
{:else}
|
|
302
|
-
<Icon
|
|
303
|
-
icon="Copy"
|
|
304
|
-
style="width: 10px; height: 10px; vertical-align: baseline"
|
|
305
|
-
/>
|
|
300
|
+
<Icon icon="Copy" style="width: 10px; height: 10px; vertical-align: baseline" />
|
|
306
301
|
{/if}
|
|
307
302
|
</span>
|
|
308
303
|
</button>
|
|
@@ -371,9 +366,9 @@
|
|
|
371
366
|
{/if}
|
|
372
367
|
</span>
|
|
373
368
|
<span class="colon">:</span>
|
|
374
|
-
<span style="color: var(--jt-preview); font-style: italic"
|
|
375
|
-
format_preview(ghost.value)
|
|
376
|
-
|
|
369
|
+
<span style="color: var(--jt-preview); font-style: italic"
|
|
370
|
+
>{format_preview(ghost.value)}</span
|
|
371
|
+
>
|
|
377
372
|
</span>
|
|
378
373
|
</div>
|
|
379
374
|
{/each}
|
|
@@ -497,7 +492,9 @@
|
|
|
497
492
|
color: var(--jt-number, light-dark(#098658, #b5cea8));
|
|
498
493
|
}
|
|
499
494
|
}
|
|
500
|
-
.colon,
|
|
495
|
+
.colon,
|
|
496
|
+
.comma,
|
|
497
|
+
.bracket {
|
|
501
498
|
color: var(--jt-punctuation, light-dark(#000, #d4d4d4));
|
|
502
499
|
}
|
|
503
500
|
.colon {
|
|
@@ -7,12 +7,7 @@
|
|
|
7
7
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
8
8
|
import { SvelteSet } from 'svelte/reactivity'
|
|
9
9
|
import JsonNode from './JsonNode.svelte'
|
|
10
|
-
import type {
|
|
11
|
-
CopyEventPosition,
|
|
12
|
-
DiffEntry,
|
|
13
|
-
JsonTreeContext,
|
|
14
|
-
JsonTreeProps,
|
|
15
|
-
} from './types'
|
|
10
|
+
import type { CopyEventPosition, DiffEntry, JsonTreeContext, JsonTreeProps } from './types'
|
|
16
11
|
import { JSON_TREE_CONTEXT_KEY } from './types'
|
|
17
12
|
import {
|
|
18
13
|
build_ghost_map,
|
|
@@ -50,15 +45,14 @@
|
|
|
50
45
|
editable = false,
|
|
51
46
|
onchange,
|
|
52
47
|
...rest
|
|
53
|
-
}: JsonTreeProps & Omit<HTMLAttributes<HTMLDivElement>, `onselect` | `onchange`> =
|
|
54
|
-
$props()
|
|
48
|
+
}: JsonTreeProps & Omit<HTMLAttributes<HTMLDivElement>, `onselect` | `onchange`> = $props()
|
|
55
49
|
|
|
56
50
|
// Internal state
|
|
57
51
|
let search_query = $state(``)
|
|
58
52
|
let search_input_value = $state(``)
|
|
59
53
|
let focused_path = $state<string | null>(null)
|
|
60
54
|
// Use Set for O(1) lookup/add/delete instead of O(n) array operations
|
|
61
|
-
|
|
55
|
+
const registered_paths_set = new SvelteSet<string>()
|
|
62
56
|
let registered_paths_list = $state<string[]>([]) // ordered list for keyboard nav
|
|
63
57
|
let copy_feedback_path = $state<string | null>(null)
|
|
64
58
|
let copy_feedback_error = $state(false)
|
|
@@ -72,16 +66,14 @@
|
|
|
72
66
|
// Reference to the search input for focus management
|
|
73
67
|
let search_input_element: HTMLInputElement | undefined = $state()
|
|
74
68
|
// Context menu state (null when closed)
|
|
75
|
-
let context_menu_state = $state<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
} | null
|
|
84
|
-
>(null)
|
|
69
|
+
let context_menu_state = $state<{
|
|
70
|
+
x: number
|
|
71
|
+
y: number
|
|
72
|
+
path: string
|
|
73
|
+
value: unknown
|
|
74
|
+
expandable: boolean
|
|
75
|
+
is_collapsed: boolean
|
|
76
|
+
} | null>(null)
|
|
85
77
|
// Pinned paths for quick reference
|
|
86
78
|
let pinned_paths = $state(new SvelteSet<string>())
|
|
87
79
|
// Selection state for bulk operations
|
|
@@ -94,14 +86,16 @@
|
|
|
94
86
|
$effect.pre(() => {
|
|
95
87
|
if (!value_changed(value)) return
|
|
96
88
|
focused_path = null
|
|
97
|
-
registered_paths_set
|
|
89
|
+
registered_paths_set.clear()
|
|
98
90
|
registered_paths_list = []
|
|
99
91
|
copy_feedback_path = null
|
|
100
92
|
copy_feedback_error = false
|
|
101
93
|
context_menu_state = null
|
|
102
94
|
force_expanded = new SvelteSet()
|
|
103
95
|
const valid_paths = new SvelteSet(collect_all_paths(value, root_label ?? ``))
|
|
104
|
-
collapsed_paths = new SvelteSet(
|
|
96
|
+
collapsed_paths = new SvelteSet(
|
|
97
|
+
[...collapsed_paths].filter((path) => valid_paths.has(path)),
|
|
98
|
+
)
|
|
105
99
|
pinned_paths = new SvelteSet()
|
|
106
100
|
selected_paths = new SvelteSet()
|
|
107
101
|
last_selected_path = null
|
|
@@ -211,8 +205,8 @@
|
|
|
211
205
|
// Navigate to previous match
|
|
212
206
|
function go_to_prev_match(): void {
|
|
213
207
|
if (sorted_matches.length === 0) return
|
|
214
|
-
current_match_index =
|
|
215
|
-
sorted_matches.length
|
|
208
|
+
current_match_index =
|
|
209
|
+
(current_match_index - 1 + sorted_matches.length) % sorted_matches.length
|
|
216
210
|
scroll_to_current_match()
|
|
217
211
|
}
|
|
218
212
|
|
|
@@ -250,14 +244,16 @@
|
|
|
250
244
|
// Get all descendant paths of a given path (including the path itself)
|
|
251
245
|
function get_descendants(target_path: string): string[] {
|
|
252
246
|
const all_paths = collect_all_paths(value, root_path)
|
|
253
|
-
const descendants =
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
247
|
+
const descendants =
|
|
248
|
+
target_path === ``
|
|
249
|
+
? all_paths
|
|
250
|
+
: all_paths.filter(
|
|
251
|
+
(entry) =>
|
|
252
|
+
entry === target_path ||
|
|
253
|
+
entry.startsWith(`${target_path}.`) ||
|
|
254
|
+
entry.startsWith(`${target_path}[`),
|
|
255
|
+
)
|
|
256
|
+
return descendants.includes(target_path) ? descendants : [target_path, ...descendants]
|
|
261
257
|
}
|
|
262
258
|
|
|
263
259
|
function expand_all(): void {
|
|
@@ -277,9 +273,8 @@
|
|
|
277
273
|
|
|
278
274
|
for (const path of all_paths) {
|
|
279
275
|
const segments = parse_path(path)
|
|
280
|
-
const depth =
|
|
281
|
-
? segments.length - 1
|
|
282
|
-
: segments.length
|
|
276
|
+
const depth =
|
|
277
|
+
root_label && segments[0] === root_label ? segments.length - 1 : segments.length
|
|
283
278
|
;(depth >= level ? new_collapsed : new_expanded).add(path)
|
|
284
279
|
}
|
|
285
280
|
|
|
@@ -303,7 +298,8 @@
|
|
|
303
298
|
await navigator.clipboard.writeText(text)
|
|
304
299
|
copy_feedback_error = false
|
|
305
300
|
oncopy?.(path, text)
|
|
306
|
-
} catch {
|
|
301
|
+
} catch {
|
|
302
|
+
// Clipboard API failed - still show feedback but as error
|
|
307
303
|
copy_feedback_error = true
|
|
308
304
|
}
|
|
309
305
|
copy_feedback_path = path // Show feedback regardless of success/failure
|
|
@@ -421,9 +417,7 @@
|
|
|
421
417
|
const start_idx = registered_paths_list.indexOf(last_selected_path)
|
|
422
418
|
const end_idx = registered_paths_list.indexOf(select_path)
|
|
423
419
|
if (start_idx !== -1 && end_idx !== -1) {
|
|
424
|
-
const [from, to] = start_idx < end_idx
|
|
425
|
-
? [start_idx, end_idx]
|
|
426
|
-
: [end_idx, start_idx]
|
|
420
|
+
const [from, to] = start_idx < end_idx ? [start_idx, end_idx] : [end_idx, start_idx]
|
|
427
421
|
for (let idx = from; idx <= to; idx++) {
|
|
428
422
|
selected_paths.add(registered_paths_list[idx])
|
|
429
423
|
}
|
|
@@ -661,9 +655,7 @@
|
|
|
661
655
|
>
|
|
662
656
|
<Icon icon="ArrowDown" style="width: 12px; height: 12px" />
|
|
663
657
|
</button>
|
|
664
|
-
<span class="match-count">{current_match_index + 1} of {
|
|
665
|
-
sorted_matches.length
|
|
666
|
-
}</span>
|
|
658
|
+
<span class="match-count">{current_match_index + 1} of {sorted_matches.length}</span>
|
|
667
659
|
</div>
|
|
668
660
|
{/if}
|
|
669
661
|
<div class="controls">
|
|
@@ -691,12 +683,7 @@
|
|
|
691
683
|
<button type="button" onclick={expand_all} title="Expand all" {@attach tooltip()}>
|
|
692
684
|
<Icon icon="Expand" style="width: 14px; height: 14px" />
|
|
693
685
|
</button>
|
|
694
|
-
<button
|
|
695
|
-
type="button"
|
|
696
|
-
onclick={collapse_all}
|
|
697
|
-
title="Collapse all"
|
|
698
|
-
{@attach tooltip()}
|
|
699
|
-
>
|
|
686
|
+
<button type="button" onclick={collapse_all} title="Collapse all" {@attach tooltip()}>
|
|
700
687
|
<Icon icon="Collapse" style="width: 14px; height: 14px" />
|
|
701
688
|
</button>
|
|
702
689
|
<button
|
|
@@ -780,18 +767,16 @@
|
|
|
780
767
|
type="button"
|
|
781
768
|
class="pinned-path"
|
|
782
769
|
onclick={() =>
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
770
|
+
copy_to_clipboard(
|
|
771
|
+
pinned_path,
|
|
772
|
+
serialize_for_copy(get_value_at_path(pinned_path)),
|
|
773
|
+
)}
|
|
787
774
|
title="Click to copy value"
|
|
788
775
|
{@attach tooltip()}
|
|
789
776
|
>
|
|
790
777
|
{pinned_path}
|
|
791
778
|
</button>
|
|
792
|
-
<span class="pinned-value">{
|
|
793
|
-
format_preview(get_value_at_path(pinned_path))
|
|
794
|
-
}</span>
|
|
779
|
+
<span class="pinned-value">{format_preview(get_value_at_path(pinned_path))}</span>
|
|
795
780
|
<button
|
|
796
781
|
type="button"
|
|
797
782
|
class="unpin-btn"
|
|
@@ -821,8 +806,8 @@
|
|
|
821
806
|
class="copy-feedback"
|
|
822
807
|
class:error={copy_feedback_error}
|
|
823
808
|
style={copy_feedback_pos
|
|
824
|
-
|
|
825
|
-
|
|
809
|
+
? `left: ${copy_feedback_pos.x}px; top: ${copy_feedback_pos.y - 24}px`
|
|
810
|
+
: `right: 8px; top: 8px`}
|
|
826
811
|
>
|
|
827
812
|
{copy_feedback_error ? `Copy failed` : `Copied!`}
|
|
828
813
|
</div>
|
|
@@ -850,9 +835,7 @@
|
|
|
850
835
|
<button
|
|
851
836
|
type="button"
|
|
852
837
|
onclick={() =>
|
|
853
|
-
|
|
854
|
-
copy_to_clipboard(st.path, serialize_for_copy(st.value))
|
|
855
|
-
)}
|
|
838
|
+
ctx_menu_action((st) => copy_to_clipboard(st.path, serialize_for_copy(st.value)))}
|
|
856
839
|
>
|
|
857
840
|
<Icon icon="Copy" style="width: 12px; height: 12px" /> Copy value
|
|
858
841
|
</button>
|
|
@@ -871,11 +854,11 @@
|
|
|
871
854
|
<button
|
|
872
855
|
type="button"
|
|
873
856
|
onclick={() =>
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
857
|
+
ctx_menu_action((st) =>
|
|
858
|
+
st.is_collapsed
|
|
859
|
+
? toggle_collapse_recursive(st.path, false)
|
|
860
|
+
: collapse_children_only(st.path),
|
|
861
|
+
)}
|
|
879
862
|
>
|
|
880
863
|
{context_menu_state.is_collapsed ? `Expand` : `Collapse`} all children
|
|
881
864
|
</button>
|
|
@@ -883,10 +866,7 @@
|
|
|
883
866
|
<li class="separator"></li>
|
|
884
867
|
{/if}
|
|
885
868
|
<li>
|
|
886
|
-
<button
|
|
887
|
-
type="button"
|
|
888
|
-
onclick={() => ctx_menu_action((st) => toggle_pin(st.path))}
|
|
889
|
-
>
|
|
869
|
+
<button type="button" onclick={() => ctx_menu_action((st) => toggle_pin(st.path))}>
|
|
890
870
|
{pinned_paths.has(context_menu_state.path) ? `Unpin` : `Pin`} this path
|
|
891
871
|
</button>
|
|
892
872
|
</li>
|
|
@@ -1006,7 +986,9 @@
|
|
|
1006
986
|
font-weight: 500;
|
|
1007
987
|
color: inherit;
|
|
1008
988
|
opacity: 0.6;
|
|
1009
|
-
transition:
|
|
989
|
+
transition:
|
|
990
|
+
opacity 0.15s,
|
|
991
|
+
background 0.15s;
|
|
1010
992
|
}
|
|
1011
993
|
.controls button:hover {
|
|
1012
994
|
opacity: 1;
|
|
@@ -1144,18 +1126,12 @@
|
|
|
1144
1126
|
font: inherit;
|
|
1145
1127
|
}
|
|
1146
1128
|
.context-menu button:hover {
|
|
1147
|
-
background: var(
|
|
1148
|
-
--jt-ctx-hover,
|
|
1149
|
-
light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.1))
|
|
1150
|
-
);
|
|
1129
|
+
background: var(--jt-ctx-hover, light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.1)));
|
|
1151
1130
|
}
|
|
1152
1131
|
.context-menu .separator {
|
|
1153
1132
|
height: 1px;
|
|
1154
1133
|
margin: 4px 8px;
|
|
1155
|
-
background: var(
|
|
1156
|
-
--jt-ctx-border,
|
|
1157
|
-
light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))
|
|
1158
|
-
);
|
|
1134
|
+
background: var(--jt-ctx-border, light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1)));
|
|
1159
1135
|
}
|
|
1160
1136
|
.pinned-panel :where(button) {
|
|
1161
1137
|
background: none;
|
|
@@ -31,9 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
// Extract max_string_length threshold for reuse
|
|
33
33
|
let max_len = $derived(ctx?.settings.max_string_length ?? 200)
|
|
34
|
-
let is_long_string = $derived(
|
|
35
|
-
value_type === `string` && (value as string).length > max_len,
|
|
36
|
-
)
|
|
34
|
+
let is_long_string = $derived(value_type === `string` && (value as string).length > max_len)
|
|
37
35
|
|
|
38
36
|
// Check for changes on mount and when value changes
|
|
39
37
|
$effect(() => {
|
|
@@ -89,9 +87,7 @@
|
|
|
89
87
|
if (value_type === `circular`) return `[Circular]`
|
|
90
88
|
if (value_type === `string`) {
|
|
91
89
|
const str = value as string
|
|
92
|
-
return is_long_string && !is_expanded
|
|
93
|
-
? `"${str.slice(0, max_len)}..."`
|
|
94
|
-
: `"${str}"`
|
|
90
|
+
return is_long_string && !is_expanded ? `"${str.slice(0, max_len)}..."` : `"${str}"`
|
|
95
91
|
}
|
|
96
92
|
return format_preview(value)
|
|
97
93
|
})
|
|
@@ -200,17 +196,11 @@
|
|
|
200
196
|
...
|
|
201
197
|
</button>
|
|
202
198
|
{:else if is_long_string && is_expanded}
|
|
203
|
-
<button
|
|
204
|
-
type="button"
|
|
205
|
-
class="expand-btn"
|
|
206
|
-
onclick={toggle_expand}
|
|
207
|
-
title="Collapse string"
|
|
208
|
-
>
|
|
199
|
+
<button type="button" class="expand-btn" onclick={toggle_expand} title="Collapse string">
|
|
209
200
|
▲
|
|
210
201
|
</button>
|
|
211
202
|
{/if}
|
|
212
|
-
{#if ctx?.settings.show_data_types && value_type !== `null` &&
|
|
213
|
-
value_type !== `undefined`}
|
|
203
|
+
{#if ctx?.settings.show_data_types && value_type !== `null` && value_type !== `undefined`}
|
|
214
204
|
<span class="type-annotation">{value_type}</span>
|
|
215
205
|
{/if}
|
|
216
206
|
</span>
|
|
@@ -235,7 +225,9 @@
|
|
|
235
225
|
.json-value {
|
|
236
226
|
cursor: pointer;
|
|
237
227
|
border-radius: 2px;
|
|
238
|
-
transition:
|
|
228
|
+
transition:
|
|
229
|
+
background-color 0.15s,
|
|
230
|
+
color 0.15s;
|
|
239
231
|
&:hover {
|
|
240
232
|
background: var(
|
|
241
233
|
--jt-hover-bg,
|
|
@@ -299,8 +299,16 @@ export function parse_path(path) {
|
|
|
299
299
|
const segments = [];
|
|
300
300
|
let current = ``;
|
|
301
301
|
let in_bracket = false;
|
|
302
|
-
|
|
303
|
-
|
|
302
|
+
// Bracket tokens are numeric indices or quoted keys (quotes stripped, \" unescaped)
|
|
303
|
+
const push_bracket_token = (token) => {
|
|
304
|
+
const num = Number(token);
|
|
305
|
+
if (Number.isNaN(num)) {
|
|
306
|
+
segments.push(token.replaceAll(/^"|"$/g, ``).replaceAll(String.raw `\"`, `"`));
|
|
307
|
+
}
|
|
308
|
+
else
|
|
309
|
+
segments.push(num);
|
|
310
|
+
};
|
|
311
|
+
for (const char of path) {
|
|
304
312
|
if (char === `.` && !in_bracket) {
|
|
305
313
|
if (current)
|
|
306
314
|
segments.push(current);
|
|
@@ -313,17 +321,8 @@ export function parse_path(path) {
|
|
|
313
321
|
in_bracket = true;
|
|
314
322
|
}
|
|
315
323
|
else if (char === `]`) {
|
|
316
|
-
if (current)
|
|
317
|
-
|
|
318
|
-
const num = Number(current);
|
|
319
|
-
if (Number.isNaN(num)) {
|
|
320
|
-
// Remove surrounding quotes and unescape internal quotes
|
|
321
|
-
const unquoted = current.replaceAll(/^"|"$/g, ``).replaceAll('\\"', `"`);
|
|
322
|
-
segments.push(unquoted);
|
|
323
|
-
}
|
|
324
|
-
else
|
|
325
|
-
segments.push(num);
|
|
326
|
-
}
|
|
324
|
+
if (current)
|
|
325
|
+
push_bracket_token(current);
|
|
327
326
|
current = ``;
|
|
328
327
|
in_bracket = false;
|
|
329
328
|
}
|
|
@@ -332,16 +331,8 @@ export function parse_path(path) {
|
|
|
332
331
|
}
|
|
333
332
|
// Handle trailing content (e.g., unclosed bracket like "a[0")
|
|
334
333
|
if (current) {
|
|
335
|
-
if (in_bracket)
|
|
336
|
-
|
|
337
|
-
const num = Number(current);
|
|
338
|
-
if (Number.isNaN(num)) {
|
|
339
|
-
const unquoted = current.replaceAll(/^"|"$/g, ``).replaceAll('\\"', `"`);
|
|
340
|
-
segments.push(unquoted);
|
|
341
|
-
}
|
|
342
|
-
else
|
|
343
|
-
segments.push(num);
|
|
344
|
-
}
|
|
334
|
+
if (in_bracket)
|
|
335
|
+
push_bracket_token(current);
|
|
345
336
|
else
|
|
346
337
|
segments.push(current);
|
|
347
338
|
}
|
package/dist/math.d.ts
CHANGED
|
@@ -77,6 +77,8 @@ export declare function get_coefficient_of_variation(values: number[]): number;
|
|
|
77
77
|
export declare function det_4x4(matrix: Matrix4x4): number;
|
|
78
78
|
export declare function det_nxn(matrix: number[][]): number;
|
|
79
79
|
export declare const cross_3d: (vec1: Vec3, vec2: Vec3) => Vec3;
|
|
80
|
+
export declare function cell_heights(matrix: Matrix3x3): Vec3;
|
|
81
|
+
export declare const frac_cutoff_per_axis: (matrix: Matrix3x3, dist: number) => Vec3;
|
|
80
82
|
export declare const lerp: (start: number, end: number, t: number) => number;
|
|
81
83
|
export declare const lerp_vec3: (start: Vec3, end: Vec3, t: number) => Vec3;
|
|
82
84
|
export declare const centered_frac: (val: number) => number;
|
package/dist/math.js
CHANGED
|
@@ -426,6 +426,25 @@ export const cross_3d = (vec1, vec2) => [
|
|
|
426
426
|
vec1[2] * vec2[0] - vec1[0] * vec2[2],
|
|
427
427
|
vec1[0] * vec2[1] - vec1[1] * vec2[0],
|
|
428
428
|
];
|
|
429
|
+
// Perpendicular distance between opposite cell faces per axis: volume / opposite-
|
|
430
|
+
// face area. This (not the lattice vector length) is the correct denominator for
|
|
431
|
+
// per-axis fractional reach in oblique cells. Degenerate (zero-volume) cells →
|
|
432
|
+
// Infinity so callers' `dist / height` collapses to 0.
|
|
433
|
+
export function cell_heights(matrix) {
|
|
434
|
+
const [a_vec, b_vec, c_vec] = matrix;
|
|
435
|
+
const cross_bc = cross_3d(b_vec, c_vec);
|
|
436
|
+
const volume = Math.abs(dot(a_vec, cross_bc));
|
|
437
|
+
if (volume === 0)
|
|
438
|
+
return [Infinity, Infinity, Infinity];
|
|
439
|
+
// height along axis k = volume / area of the face spanned by the OTHER two vectors
|
|
440
|
+
const height_a = volume / Math.hypot(...cross_bc); // face b×c ⟂ a
|
|
441
|
+
const height_b = volume / Math.hypot(...cross_3d(a_vec, c_vec)); // face a×c ⟂ b
|
|
442
|
+
const height_c = volume / Math.hypot(...cross_3d(a_vec, b_vec)); // face a×b ⟂ c
|
|
443
|
+
return [height_a, height_b, height_c];
|
|
444
|
+
}
|
|
445
|
+
// `dist` Å of real-space reach as a fractional pad per axis (via cell heights,
|
|
446
|
+
// correct for oblique cells). Degenerate cells → 0 (no images).
|
|
447
|
+
export const frac_cutoff_per_axis = (matrix, dist) => cell_heights(matrix).map((height) => dist / height);
|
|
429
448
|
// Scalar linear interpolation
|
|
430
449
|
export const lerp = (start, end, t) => start + t * (end - start);
|
|
431
450
|
// Vec3 linear interpolation
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
{#if visible}
|
|
79
79
|
{@const { x, y } = get_smart_position()}
|
|
80
80
|
{@const style = `position: absolute; left: ${x}px; top: ${y}px; ${rest.style ?? ``}`}
|
|
81
|
-
<div {...rest} class=
|
|
81
|
+
<div {...rest} class={[`context-menu`, rest.class]} {style} bind:this={menu_element}>
|
|
82
82
|
{#each sections as { title, options } (title)}
|
|
83
83
|
<div class="section">
|
|
84
84
|
<div class="header">{title}</div>
|
|
@@ -104,7 +104,9 @@
|
|
|
104
104
|
background: var(--surface-bg);
|
|
105
105
|
border: 1px solid var(--border-color);
|
|
106
106
|
border-radius: var(--context-menu-border-radius, var(--border-radius, 3pt));
|
|
107
|
-
box-shadow:
|
|
107
|
+
box-shadow:
|
|
108
|
+
0 8px 16px -4px rgba(0, 0, 0, 0.3),
|
|
109
|
+
0 4px 8px -2px rgba(0, 0, 0, 0.1);
|
|
108
110
|
backdrop-filter: blur(4px);
|
|
109
111
|
min-width: var(--context-menu-min-width, 160px);
|
|
110
112
|
overflow: hidden;
|
|
@@ -2,16 +2,22 @@
|
|
|
2
2
|
import Icon from '../Icon.svelte'
|
|
3
3
|
import type { HTMLButtonAttributes } from 'svelte/elements'
|
|
4
4
|
|
|
5
|
-
let {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
let {
|
|
6
|
+
copied = false,
|
|
7
|
+
label,
|
|
8
|
+
title = label,
|
|
9
|
+
onclick,
|
|
10
|
+
...rest
|
|
11
|
+
}: Omit<HTMLButtonAttributes, `type` | `aria-label`> & {
|
|
12
|
+
copied?: boolean
|
|
13
|
+
label: string
|
|
14
|
+
} = $props()
|
|
9
15
|
</script>
|
|
10
16
|
|
|
11
17
|
<button
|
|
12
18
|
{...rest}
|
|
13
19
|
type="button"
|
|
14
|
-
class=
|
|
20
|
+
class={[`copy-button`, rest.class]}
|
|
15
21
|
aria-label={label}
|
|
16
22
|
{title}
|
|
17
23
|
{onclick}
|
|
@@ -13,7 +13,12 @@
|
|
|
13
13
|
} = $props()
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
|
-
{#snippet control_button(
|
|
16
|
+
{#snippet control_button(
|
|
17
|
+
callback: () => void,
|
|
18
|
+
css_class: string,
|
|
19
|
+
icon: IconName,
|
|
20
|
+
label: string,
|
|
21
|
+
)}
|
|
17
22
|
<button
|
|
18
23
|
type="button"
|
|
19
24
|
class={css_class}
|