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
|
@@ -14,11 +14,13 @@
|
|
|
14
14
|
title: string
|
|
15
15
|
current_values: Record<string, unknown>
|
|
16
16
|
children: Snippet<
|
|
17
|
-
[
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
[
|
|
18
|
+
{
|
|
19
|
+
current_values: Record<string, unknown>
|
|
20
|
+
has_changes: boolean
|
|
21
|
+
reference_values: Record<string, unknown>
|
|
22
|
+
},
|
|
23
|
+
]
|
|
22
24
|
>
|
|
23
25
|
on_reset?: () => void
|
|
24
26
|
} = $props()
|
|
@@ -30,23 +32,22 @@
|
|
|
30
32
|
if (obj instanceof RegExp) return new RegExp(obj)
|
|
31
33
|
if (Array.isArray(obj)) {
|
|
32
34
|
return obj.map((item) =>
|
|
33
|
-
typeof item === `object` && item !== null ? deep_copy(item) : item
|
|
35
|
+
typeof item === `object` && item !== null ? deep_copy(item) : item,
|
|
34
36
|
)
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
const copy: Record<string, unknown> = {}
|
|
38
40
|
for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {
|
|
39
|
-
copy[key] = typeof value === `object` && value !== null
|
|
40
|
-
? deep_copy(value)
|
|
41
|
-
: value
|
|
41
|
+
copy[key] = typeof value === `object` && value !== null ? deep_copy(value) : value
|
|
42
42
|
}
|
|
43
43
|
return copy
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
// Capture initial values once at mount - must NOT be $derived or it tracks changes
|
|
47
|
-
const reference_values = untrack(() =>
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const reference_values = untrack(() => deep_copy(current_values) as Record<string, unknown>)
|
|
48
|
+
|
|
49
|
+
// unique per-instance id so aria-labelledby stays valid with multiple sections on a page
|
|
50
|
+
const title_id = `settings-section-title-${crypto.randomUUID()}`
|
|
50
51
|
|
|
51
52
|
// Check if any values have changed from reference values
|
|
52
53
|
let has_changes = $derived.by(() => {
|
|
@@ -61,9 +62,12 @@
|
|
|
61
62
|
const curr_val = current_value[idx]
|
|
62
63
|
// Handle nested objects/arrays in arrays
|
|
63
64
|
if (
|
|
64
|
-
typeof val === `object` &&
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
typeof val === `object` &&
|
|
66
|
+
val !== null &&
|
|
67
|
+
typeof curr_val === `object` &&
|
|
68
|
+
curr_val !== null
|
|
69
|
+
)
|
|
70
|
+
return JSON.stringify(val) !== JSON.stringify(curr_val) // Quick deep comparison fallback
|
|
67
71
|
return val !== curr_val
|
|
68
72
|
})
|
|
69
73
|
) {
|
|
@@ -91,7 +95,7 @@
|
|
|
91
95
|
}
|
|
92
96
|
</script>
|
|
93
97
|
|
|
94
|
-
<h4 id=
|
|
98
|
+
<h4 id={title_id}>
|
|
95
99
|
{title}
|
|
96
100
|
|
|
97
101
|
{#if has_changes}
|
|
@@ -106,7 +110,7 @@
|
|
|
106
110
|
</button>
|
|
107
111
|
{/if}
|
|
108
112
|
</h4>
|
|
109
|
-
<section {...rest} aria-labelledby=
|
|
113
|
+
<section {...rest} aria-labelledby={title_id}>
|
|
110
114
|
{@render children?.({ current_values, has_changes, reference_values })}
|
|
111
115
|
</section>
|
|
112
116
|
|
|
@@ -52,7 +52,9 @@
|
|
|
52
52
|
border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
|
|
53
53
|
text-decoration: none;
|
|
54
54
|
color: inherit;
|
|
55
|
-
transition:
|
|
55
|
+
transition:
|
|
56
|
+
border-color 0.15s,
|
|
57
|
+
box-shadow 0.15s;
|
|
56
58
|
&:hover {
|
|
57
59
|
border-color: color-mix(in srgb, currentColor 35%, transparent);
|
|
58
60
|
box-shadow: 0 2px 12px color-mix(in srgb, currentColor 8%, transparent);
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { FullscreenToggleProp } from './fullscreen'
|
|
3
|
+
import type { ShowControlsState } from '../controls'
|
|
4
|
+
// Shared control-buttons row (filename chip + fullscreen toggle + snippet buttons/panes) for BrillouinZone/FermiSurface/Structure viewers; themed via neutral --viewer-* CSS vars
|
|
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
|
+
import type { Snippet } from 'svelte'
|
|
7
|
+
import { createAttachmentKey } from 'svelte/attachments'
|
|
8
|
+
import { tooltip } from 'svelte-multiselect/attachments'
|
|
9
|
+
import FullscreenButton from './FullscreenButton.svelte'
|
|
10
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
controls_config,
|
|
14
|
+
filename = undefined,
|
|
15
|
+
fullscreen = false,
|
|
16
|
+
fullscreen_toggle = true,
|
|
17
|
+
fullscreen_btn_style = undefined,
|
|
18
|
+
wrapper = undefined,
|
|
19
|
+
before = undefined,
|
|
20
|
+
children = undefined,
|
|
21
|
+
...rest
|
|
22
|
+
}: HTMLAttributes<HTMLElement> & {
|
|
23
|
+
controls_config: ShowControlsState
|
|
24
|
+
filename?: string
|
|
25
|
+
fullscreen?: boolean
|
|
26
|
+
fullscreen_toggle?: FullscreenToggleProp
|
|
27
|
+
fullscreen_btn_style?: string
|
|
28
|
+
wrapper?: HTMLDivElement
|
|
29
|
+
style?: string // extra styles/CSS vars for the section (user config style wins)
|
|
30
|
+
before?: Snippet // rendered before filename/fullscreen (e.g. reset-camera button)
|
|
31
|
+
children?: Snippet // rendered after the fullscreen toggle (panes, controls, ...)
|
|
32
|
+
} = $props()
|
|
33
|
+
|
|
34
|
+
// Styled tooltip (reads the button's title attr), forwarded as a spreadable attachment
|
|
35
|
+
const tooltip_attachment = { [createAttachmentKey()]: tooltip() }
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<section
|
|
39
|
+
{...rest}
|
|
40
|
+
class={[`control-buttons`, controls_config.class, rest.class]}
|
|
41
|
+
style={[rest.style, controls_config.style].filter(Boolean).join(`; `)}
|
|
42
|
+
>
|
|
43
|
+
{#if controls_config.mode !== `never`}
|
|
44
|
+
{@render before?.()}
|
|
45
|
+
|
|
46
|
+
{#if filename && controls_config.visible(`filename`)}
|
|
47
|
+
<span class="filename">{filename}</span>
|
|
48
|
+
{/if}
|
|
49
|
+
|
|
50
|
+
{#if fullscreen_toggle && controls_config.visible(`fullscreen`)}
|
|
51
|
+
<FullscreenButton
|
|
52
|
+
{fullscreen}
|
|
53
|
+
toggle={fullscreen_toggle}
|
|
54
|
+
{wrapper}
|
|
55
|
+
class="fullscreen-toggle"
|
|
56
|
+
style={fullscreen_btn_style}
|
|
57
|
+
{...tooltip_attachment}
|
|
58
|
+
/>
|
|
59
|
+
{/if}
|
|
60
|
+
|
|
61
|
+
{@render children?.()}
|
|
62
|
+
{/if}
|
|
63
|
+
</section>
|
|
64
|
+
|
|
65
|
+
<style>
|
|
66
|
+
section.control-buttons {
|
|
67
|
+
position: absolute;
|
|
68
|
+
display: flex;
|
|
69
|
+
top: var(--viewer-buttons-top, var(--ctrl-btn-top, 1ex));
|
|
70
|
+
right: var(--viewer-buttons-right, var(--ctrl-btn-right, 1ex));
|
|
71
|
+
gap: var(--viewer-buttons-gap, clamp(6pt, 1cqmin, 9pt));
|
|
72
|
+
z-index: var(--viewer-buttons-z-index, var(--z-index-overlay-controls, 100000000));
|
|
73
|
+
opacity: 0;
|
|
74
|
+
pointer-events: none;
|
|
75
|
+
transition: opacity 0.2s ease;
|
|
76
|
+
align-items: var(--viewer-buttons-align, center);
|
|
77
|
+
}
|
|
78
|
+
/* Mode: always - controls always visible */
|
|
79
|
+
section.control-buttons.always-visible {
|
|
80
|
+
opacity: 1;
|
|
81
|
+
pointer-events: auto;
|
|
82
|
+
}
|
|
83
|
+
/* Mode: hover - controls visible while the parent viewer is hovered/focused */
|
|
84
|
+
:global(.structure:hover) > section.control-buttons.hover-visible,
|
|
85
|
+
:global(.structure:focus-within) > section.control-buttons.hover-visible,
|
|
86
|
+
:global(.brillouin-zone:hover) > section.control-buttons.hover-visible,
|
|
87
|
+
:global(.brillouin-zone:focus-within) > section.control-buttons.hover-visible,
|
|
88
|
+
:global(.fermi-surface:hover) > section.control-buttons.hover-visible,
|
|
89
|
+
:global(.fermi-surface:focus-within) > section.control-buttons.hover-visible {
|
|
90
|
+
opacity: 1;
|
|
91
|
+
pointer-events: auto;
|
|
92
|
+
}
|
|
93
|
+
/* Mode: never - stays hidden (default state, no additional CSS needed) */
|
|
94
|
+
section.control-buttons > :global(button) {
|
|
95
|
+
background-color: transparent;
|
|
96
|
+
display: flex;
|
|
97
|
+
padding: var(--viewer-buttons-btn-padding, 4px);
|
|
98
|
+
border-radius: var(--border-radius, 3pt);
|
|
99
|
+
font-size: var(--ctrl-btn-icon-size, clamp(0.7rem, 2cqmin, 0.85rem));
|
|
100
|
+
}
|
|
101
|
+
section.control-buttons :global(button:hover) {
|
|
102
|
+
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
103
|
+
}
|
|
104
|
+
.filename {
|
|
105
|
+
font-family: monospace;
|
|
106
|
+
font-size: 0.9em;
|
|
107
|
+
background: var(--code-bg, rgba(0, 0, 0, 0.1));
|
|
108
|
+
padding: 3pt 6pt;
|
|
109
|
+
border-radius: 3pt;
|
|
110
|
+
max-width: 200px;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
text-overflow: ellipsis;
|
|
113
|
+
white-space: nowrap;
|
|
114
|
+
}
|
|
115
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FullscreenToggleProp } from './fullscreen';
|
|
2
|
+
import type { ShowControlsState } from '../controls';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
|
+
type $$ComponentProps = HTMLAttributes<HTMLElement> & {
|
|
6
|
+
controls_config: ShowControlsState;
|
|
7
|
+
filename?: string;
|
|
8
|
+
fullscreen?: boolean;
|
|
9
|
+
fullscreen_toggle?: FullscreenToggleProp;
|
|
10
|
+
fullscreen_btn_style?: string;
|
|
11
|
+
wrapper?: HTMLDivElement;
|
|
12
|
+
style?: string;
|
|
13
|
+
before?: Snippet;
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
};
|
|
16
|
+
declare const ViewerChrome: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
17
|
+
type ViewerChrome = ReturnType<typeof ViewerChrome>;
|
|
18
|
+
export default ViewerChrome;
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function sync_fullscreen(opts: {
|
|
2
|
+
get_wrapper: () => HTMLDivElement | undefined;
|
|
3
|
+
get_fullscreen: () => boolean;
|
|
4
|
+
set_fullscreen: (fullscreen: boolean) => void;
|
|
5
|
+
bg_css_var: string;
|
|
6
|
+
on_request_error?: (err: Error) => void;
|
|
7
|
+
on_change?: (fullscreen: boolean) => void;
|
|
8
|
+
}): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
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/Trajectory viewers.
|
|
3
|
+
export function sync_fullscreen(opts) {
|
|
4
|
+
// Flag -> browser: enter/exit fullscreen when the bound flag changes
|
|
5
|
+
$effect(() => {
|
|
6
|
+
if (typeof window === `undefined`)
|
|
7
|
+
return;
|
|
8
|
+
const wrapper = opts.get_wrapper();
|
|
9
|
+
const fullscreen = opts.get_fullscreen();
|
|
10
|
+
const fs_el = document.fullscreenElement;
|
|
11
|
+
if (fullscreen && fs_el !== wrapper && wrapper) {
|
|
12
|
+
wrapper.requestFullscreen().catch((err) => {
|
|
13
|
+
console.error(err);
|
|
14
|
+
opts.on_request_error?.(err);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
else if (!fullscreen && fs_el === wrapper) {
|
|
18
|
+
document.exitFullscreen().catch(console.error);
|
|
19
|
+
}
|
|
20
|
+
set_fullscreen_bg(wrapper, fullscreen, opts.bg_css_var);
|
|
21
|
+
});
|
|
22
|
+
// Browser -> flag: track fullscreenchange events (covers Esc key, programmatic exit, ...)
|
|
23
|
+
$effect(() => {
|
|
24
|
+
if (typeof document === `undefined`)
|
|
25
|
+
return () => { };
|
|
26
|
+
const handler = () => {
|
|
27
|
+
// tie state to this component's own wrapper so another element entering fullscreen
|
|
28
|
+
// doesn't flip every viewer's flag (would also trigger a requestFullscreen cascade)
|
|
29
|
+
const is_fullscreen = document.fullscreenElement === opts.get_wrapper();
|
|
30
|
+
opts.set_fullscreen(is_fullscreen);
|
|
31
|
+
opts.on_change?.(is_fullscreen);
|
|
32
|
+
};
|
|
33
|
+
document.addEventListener(`fullscreenchange`, handler);
|
|
34
|
+
return () => document.removeEventListener(`fullscreenchange`, handler);
|
|
35
|
+
});
|
|
36
|
+
}
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export * from './fullscreen';
|
|
2
|
+
export * from './fullscreen.svelte';
|
|
3
|
+
export { default as FullscreenButton } from './FullscreenButton.svelte';
|
|
2
4
|
export { default as FullscreenToggle } from './FullscreenToggle.svelte';
|
|
3
5
|
export { default as InfoCard } from './InfoCard.svelte';
|
|
4
6
|
export { default as InfoTag } from './InfoTag.svelte';
|
|
7
|
+
export { default as NumberRangeInput } from './NumberRangeInput.svelte';
|
|
5
8
|
export * from './json-tree';
|
|
6
9
|
export { default as PropertyFilter } from './PropertyFilter.svelte';
|
|
7
10
|
export { default as SettingsSection } from './SettingsSection.svelte';
|
|
8
11
|
export { default as SubpageGrid } from './SubpageGrid.svelte';
|
|
12
|
+
export { default as ViewerChrome } from './ViewerChrome.svelte';
|
|
9
13
|
export type InfoTagVariant = `default` | `success` | `warning` | `error` | `info`;
|
|
10
14
|
export type InfoTagSize = `sm` | `md` | `lg`;
|
package/dist/layout/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export * from './fullscreen';
|
|
2
|
+
export * from './fullscreen.svelte';
|
|
3
|
+
export { default as FullscreenButton } from './FullscreenButton.svelte';
|
|
2
4
|
export { default as FullscreenToggle } from './FullscreenToggle.svelte';
|
|
3
5
|
export { default as InfoCard } from './InfoCard.svelte';
|
|
4
6
|
export { default as InfoTag } from './InfoTag.svelte';
|
|
7
|
+
export { default as NumberRangeInput } from './NumberRangeInput.svelte';
|
|
5
8
|
export * from './json-tree';
|
|
6
9
|
export { default as PropertyFilter } from './PropertyFilter.svelte';
|
|
7
10
|
export { default as SettingsSection } from './SettingsSection.svelte';
|
|
8
11
|
export { default as SubpageGrid } from './SubpageGrid.svelte';
|
|
12
|
+
export { default as ViewerChrome } from './ViewerChrome.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;
|