matterviz 0.3.7 → 0.4.1
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/Icon.svelte +7 -4
- package/dist/MillerIndexInput.svelte +1 -1
- package/dist/api/optimade.js +32 -26
- package/dist/app.css +0 -3
- package/dist/brillouin/BrillouinZone.svelte +76 -148
- package/dist/brillouin/BrillouinZone.svelte.d.ts +6 -14
- package/dist/brillouin/BrillouinZoneExportPane.svelte +43 -96
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +9 -32
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +2 -3
- package/dist/brillouin/BrillouinZoneScene.svelte +97 -205
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +4 -23
- package/dist/brillouin/BrillouinZoneTooltip.svelte +16 -25
- 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 +89 -90
- 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 +14 -13
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +109 -203
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +4 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +180 -470
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +7 -1
- package/dist/chempot-diagram/async-compute.svelte.js +3 -1
- package/dist/chempot-diagram/chempot-worker.js +2 -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 +4 -4
- package/dist/chempot-diagram/compute.js +20 -20
- 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.js +8 -7
- package/dist/composition/FormulaFilter.svelte +18 -11
- package/dist/composition/PieChart.svelte +11 -10
- package/dist/composition/chem-sys.d.ts +8 -0
- package/dist/composition/chem-sys.js +86 -0
- package/dist/composition/format.js +7 -4
- package/dist/composition/index.d.ts +1 -0
- package/dist/composition/index.js +1 -0
- package/dist/composition/parse.d.ts +0 -1
- package/dist/composition/parse.js +41 -31
- package/dist/controls.d.ts +1 -0
- package/dist/controls.js +0 -1
- package/dist/convex-hull/ConvexHull.svelte +8 -10
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -4
- package/dist/convex-hull/ConvexHull2D.svelte +106 -185
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +179 -683
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +183 -687
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +268 -0
- package/dist/convex-hull/ConvexHullChrome.svelte.d.ts +30 -0
- package/dist/convex-hull/ConvexHullControls.svelte +88 -7
- 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 +36 -175
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +3 -1
- package/dist/convex-hull/ConvexHullTooltip.svelte +11 -2
- package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +2 -1
- package/dist/convex-hull/GasPressureControls.svelte +4 -4
- package/dist/convex-hull/TemperatureSlider.svelte +2 -2
- 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 +278 -0
- package/dist/convex-hull/demo-temperature.d.ts +1 -1
- package/dist/convex-hull/demo-temperature.js +20 -22
- package/dist/convex-hull/gas-thermodynamics.d.ts +2 -2
- package/dist/convex-hull/gas-thermodynamics.js +22 -30
- package/dist/convex-hull/helpers.d.ts +42 -7
- package/dist/convex-hull/helpers.js +171 -78
- 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 +10 -8
- package/dist/convex-hull/index.js +7 -2
- package/dist/convex-hull/thermodynamics.js +136 -960
- package/dist/convex-hull/types.d.ts +13 -5
- package/dist/convex-hull/types.js +12 -0
- package/dist/coordination/CoordinationBarPlot.svelte +27 -34
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
- package/dist/element/BohrAtom.svelte +2 -1
- package/dist/element/index.d.ts +4 -0
- package/dist/element/index.js +18 -0
- package/dist/feedback/DragOverlay.svelte +3 -1
- package/dist/feedback/DragOverlay.svelte.d.ts +1 -0
- package/dist/feedback/StatusMessage.svelte +13 -3
- package/dist/fermi-surface/FermiSlice.svelte +13 -5
- package/dist/fermi-surface/FermiSurface.svelte +78 -151
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +5 -14
- package/dist/fermi-surface/FermiSurfaceControls.svelte +1 -1
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +72 -221
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +3 -23
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +8 -34
- package/dist/fermi-surface/compute.js +67 -66
- package/dist/fermi-surface/export.js +6 -16
- 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 +71 -79
- package/dist/fermi-surface/types.d.ts +3 -2
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +69 -52
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +4 -3
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +3 -2
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +5 -5
- package/dist/heatmap-matrix/index.d.ts +3 -2
- package/dist/heatmap-matrix/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/io/ExportPane.svelte +166 -0
- package/dist/io/ExportPane.svelte.d.ts +17 -0
- package/dist/io/decompress.js +5 -4
- package/dist/io/export.d.ts +9 -5
- package/dist/io/export.js +77 -51
- package/dist/io/fetch.d.ts +2 -1
- package/dist/io/fetch.js +5 -1
- package/dist/io/file-drop.d.ts +8 -1
- package/dist/io/file-drop.js +48 -36
- package/dist/io/index.d.ts +2 -0
- package/dist/io/index.js +10 -0
- package/dist/io/types.d.ts +13 -0
- package/dist/io/url-drop.js +64 -33
- package/dist/isosurface/parse.js +52 -51
- package/dist/isosurface/slice.js +5 -4
- package/dist/isosurface/types.js +1 -1
- package/dist/keyboard.d.ts +3 -0
- package/dist/keyboard.js +23 -0
- package/dist/labels.d.ts +1 -1
- package/dist/labels.js +9 -8
- package/dist/layout/FullscreenButton.svelte +33 -0
- package/dist/layout/FullscreenButton.svelte.d.ts +10 -0
- package/dist/layout/FullscreenToggle.svelte +8 -14
- package/dist/layout/PropertyFilter.svelte +3 -2
- package/dist/layout/SettingsSection.svelte +1 -1
- package/dist/layout/ViewerChrome.svelte +116 -0
- package/dist/layout/ViewerChrome.svelte.d.ts +17 -0
- package/dist/layout/fullscreen.d.ts +4 -0
- package/dist/layout/fullscreen.svelte.d.ts +8 -0
- package/dist/layout/fullscreen.svelte.js +37 -0
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.js +3 -0
- package/dist/layout/json-tree/JsonNode.svelte +1 -1
- package/dist/layout/json-tree/JsonTree.svelte +2 -2
- package/dist/layout/json-tree/utils.js +5 -4
- package/dist/marching-cubes.js +8 -13
- package/dist/math.d.ts +12 -4
- package/dist/math.js +42 -30
- package/dist/overlays/DraggablePane.svelte +4 -4
- package/dist/overlays/index.d.ts +4 -0
- package/dist/periodic-table/PeriodicTable.svelte +27 -15
- package/dist/periodic-table/PropertySelect.svelte +1 -0
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +9 -3
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramControls.svelte +3 -2
- 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 +47 -132
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +3 -4
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +1 -1
- package/dist/phase-diagram/build-diagram.js +2 -2
- package/dist/phase-diagram/colors.js +1 -1
- package/dist/phase-diagram/parse.d.ts +2 -1
- package/dist/phase-diagram/parse.js +6 -5
- package/dist/phase-diagram/types.d.ts +1 -1
- package/dist/phase-diagram/utils.d.ts +3 -3
- package/dist/phase-diagram/utils.js +8 -12
- package/dist/plot/{BarPlot.svelte → bar/BarPlot.svelte} +246 -841
- package/dist/plot/{BarPlot.svelte.d.ts → bar/BarPlot.svelte.d.ts} +8 -16
- package/dist/plot/{BarPlotControls.svelte → bar/BarPlotControls.svelte} +6 -5
- package/dist/plot/{BarPlotControls.svelte.d.ts → bar/BarPlotControls.svelte.d.ts} +3 -3
- package/dist/plot/{SpacegroupBarPlot.svelte → bar/SpacegroupBarPlot.svelte} +8 -7
- package/dist/plot/{SpacegroupBarPlot.svelte.d.ts → bar/SpacegroupBarPlot.svelte.d.ts} +1 -1
- package/dist/plot/bar/data.d.ts +40 -0
- package/dist/plot/bar/data.js +154 -0
- package/dist/plot/bar/geometry.d.ts +39 -0
- package/dist/plot/bar/geometry.js +60 -0
- package/dist/plot/bar/index.d.ts +3 -0
- package/dist/plot/bar/index.js +3 -0
- package/dist/plot/box/BoxPlot.svelte +1292 -0
- package/dist/plot/box/BoxPlot.svelte.d.ts +95 -0
- package/dist/plot/box/BoxPlotControls.svelte +109 -0
- package/dist/plot/box/BoxPlotControls.svelte.d.ts +19 -0
- package/dist/plot/box/Violin.svelte +14 -0
- package/dist/plot/box/Violin.svelte.d.ts +70 -0
- package/dist/plot/box/box-plot.d.ts +56 -0
- package/dist/plot/box/box-plot.js +129 -0
- package/dist/plot/box/index.d.ts +5 -0
- package/dist/plot/box/index.js +5 -0
- package/dist/plot/box/kde.d.ts +17 -0
- package/dist/plot/box/kde.js +160 -0
- package/dist/plot/box/quantile.d.ts +3 -0
- package/dist/plot/box/quantile.js +53 -0
- package/dist/plot/{auto-place.d.ts → core/auto-place.d.ts} +1 -1
- package/dist/plot/{auto-place.js → core/auto-place.js} +6 -3
- package/dist/plot/core/axis-utils.d.ts +46 -0
- package/dist/plot/core/axis-utils.js +110 -0
- package/dist/plot/{AxisLabel.svelte → core/components/AxisLabel.svelte} +2 -2
- package/dist/plot/{AxisLabel.svelte.d.ts → core/components/AxisLabel.svelte.d.ts} +1 -1
- package/dist/plot/{ColorBar.svelte → core/components/ColorBar.svelte} +41 -38
- package/dist/plot/{ColorBar.svelte.d.ts → core/components/ColorBar.svelte.d.ts} +7 -6
- package/dist/plot/{ColorScaleSelect.svelte → core/components/ColorScaleSelect.svelte} +4 -3
- package/dist/plot/{ColorScaleSelect.svelte.d.ts → core/components/ColorScaleSelect.svelte.d.ts} +2 -2
- package/dist/plot/core/components/ControlPane.svelte +46 -0
- package/dist/plot/core/components/ControlPane.svelte.d.ts +13 -0
- package/dist/plot/{FillArea.svelte → core/components/FillArea.svelte} +17 -6
- package/dist/plot/{FillArea.svelte.d.ts → core/components/FillArea.svelte.d.ts} +1 -1
- package/dist/plot/{InteractiveAxisLabel.svelte → core/components/InteractiveAxisLabel.svelte} +3 -3
- package/dist/plot/{InteractiveAxisLabel.svelte.d.ts → core/components/InteractiveAxisLabel.svelte.d.ts} +2 -2
- package/dist/plot/{Line.svelte → core/components/Line.svelte} +33 -15
- package/dist/plot/{Line.svelte.d.ts → core/components/Line.svelte.d.ts} +3 -2
- package/dist/plot/{PlotAxis.svelte → core/components/PlotAxis.svelte} +9 -6
- package/dist/plot/{PlotAxis.svelte.d.ts → core/components/PlotAxis.svelte.d.ts} +5 -3
- package/dist/plot/{PlotControls.svelte → core/components/PlotControls.svelte} +17 -29
- package/dist/plot/core/components/PlotControls.svelte.d.ts +4 -0
- package/dist/plot/{PlotLegend.svelte → core/components/PlotLegend.svelte} +21 -10
- package/dist/plot/{PlotLegend.svelte.d.ts → core/components/PlotLegend.svelte.d.ts} +3 -2
- package/dist/plot/{PlotTooltip.svelte → core/components/PlotTooltip.svelte} +17 -1
- package/dist/plot/{PlotTooltip.svelte.d.ts → core/components/PlotTooltip.svelte.d.ts} +8 -0
- package/dist/plot/{PortalSelect.svelte → core/components/PortalSelect.svelte} +11 -7
- package/dist/plot/{ReferenceLine.svelte → core/components/ReferenceLine.svelte} +3 -3
- package/dist/plot/{ReferenceLine.svelte.d.ts → core/components/ReferenceLine.svelte.d.ts} +1 -1
- package/dist/plot/{ReferenceLine3D.svelte → core/components/ReferenceLine3D.svelte} +5 -5
- package/dist/plot/{ReferenceLine3D.svelte.d.ts → core/components/ReferenceLine3D.svelte.d.ts} +5 -5
- package/dist/plot/{ReferencePlane.svelte → core/components/ReferencePlane.svelte} +8 -8
- package/dist/plot/{ReferencePlane.svelte.d.ts → core/components/ReferencePlane.svelte.d.ts} +5 -5
- package/dist/plot/{ZeroLines.svelte → core/components/ZeroLines.svelte} +3 -3
- package/dist/plot/{ZeroLines.svelte.d.ts → core/components/ZeroLines.svelte.d.ts} +3 -3
- package/dist/plot/{ZoomRect.svelte → core/components/ZoomRect.svelte} +1 -1
- package/dist/plot/{ZoomRect.svelte.d.ts → core/components/ZoomRect.svelte.d.ts} +1 -1
- package/dist/plot/core/components/index.d.ts +17 -0
- package/dist/plot/core/components/index.js +17 -0
- package/dist/plot/{data-cleaning.d.ts → core/data-cleaning.d.ts} +71 -1
- package/dist/plot/{data-cleaning.js → core/data-cleaning.js} +21 -23
- package/dist/plot/{data-transform.d.ts → core/data-transform.d.ts} +2 -2
- package/dist/plot/{data-transform.js → core/data-transform.js} +3 -3
- package/dist/plot/core/fill-utils.d.ts +34 -0
- package/dist/plot/core/fill-utils.js +391 -0
- package/dist/plot/core/index.d.ts +10 -0
- package/dist/plot/core/index.js +11 -0
- package/dist/plot/core/interactions.d.ts +39 -0
- package/dist/plot/core/interactions.js +209 -0
- package/dist/plot/{layout.d.ts → core/layout.d.ts} +1 -0
- package/dist/plot/{layout.js → core/layout.js} +16 -8
- 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/{reference-line.d.ts → core/reference-line.d.ts} +11 -11
- package/dist/plot/{reference-line.js → core/reference-line.js} +29 -42
- package/dist/plot/core/scales.d.ts +40 -0
- package/dist/plot/{scales.js → core/scales.js} +94 -93
- package/dist/plot/core/svg.d.ts +3 -0
- package/dist/plot/core/svg.js +41 -0
- package/dist/plot/{types.d.ts → core/types.d.ts} +36 -85
- package/dist/plot/{types.js → core/types.js} +1 -1
- package/dist/plot/{utils → core/utils}/label-placement.d.ts +3 -3
- package/dist/plot/{utils → core/utils}/label-placement.js +3 -3
- package/dist/plot/core/utils/series-visibility.d.ts +26 -0
- package/dist/plot/{utils → core/utils}/series-visibility.js +29 -2
- package/dist/plot/core/utils.d.ts +12 -0
- package/dist/plot/core/utils.js +27 -0
- package/dist/plot/{Histogram.svelte → histogram/Histogram.svelte} +174 -551
- package/dist/plot/{Histogram.svelte.d.ts → histogram/Histogram.svelte.d.ts} +2 -2
- package/dist/plot/{HistogramControls.svelte → histogram/HistogramControls.svelte} +6 -6
- package/dist/plot/{HistogramControls.svelte.d.ts → histogram/HistogramControls.svelte.d.ts} +4 -4
- package/dist/plot/histogram/index.d.ts +2 -0
- package/dist/plot/histogram/index.js +2 -0
- package/dist/plot/index.d.ts +8 -41
- package/dist/plot/index.js +10 -39
- package/dist/plot/sankey/Sankey.svelte +697 -0
- package/dist/plot/sankey/Sankey.svelte.d.ts +74 -0
- package/dist/plot/sankey/SankeyControls.svelte +98 -0
- package/dist/plot/sankey/SankeyControls.svelte.d.ts +19 -0
- package/dist/plot/sankey/index.d.ts +4 -0
- package/dist/plot/sankey/index.js +3 -0
- package/dist/plot/sankey/sankey-types.d.ts +42 -0
- package/dist/plot/sankey/sankey-types.js +4 -0
- package/dist/plot/sankey/sankey.d.ts +52 -0
- package/dist/plot/sankey/sankey.js +189 -0
- package/dist/plot/{BinnedScatterPlot.svelte → scatter/BinnedScatterPlot.svelte} +64 -64
- package/dist/plot/{BinnedScatterPlot.svelte.d.ts → scatter/BinnedScatterPlot.svelte.d.ts} +6 -6
- package/dist/plot/{ElementScatter.svelte → scatter/ElementScatter.svelte} +6 -6
- package/dist/plot/{ElementScatter.svelte.d.ts → scatter/ElementScatter.svelte.d.ts} +2 -2
- package/dist/plot/{ScatterPlot.svelte → scatter/ScatterPlot.svelte} +297 -1008
- package/dist/plot/{ScatterPlot.svelte.d.ts → scatter/ScatterPlot.svelte.d.ts} +10 -18
- package/dist/plot/{ScatterPlotControls.svelte → scatter/ScatterPlotControls.svelte} +6 -5
- package/dist/plot/{ScatterPlotControls.svelte.d.ts → scatter/ScatterPlotControls.svelte.d.ts} +2 -2
- package/dist/plot/{ScatterPoint.svelte → scatter/ScatterPoint.svelte} +7 -7
- package/dist/plot/{ScatterPoint.svelte.d.ts → scatter/ScatterPoint.svelte.d.ts} +3 -3
- package/dist/plot/{adaptive-density.d.ts → scatter/adaptive-density.d.ts} +14 -4
- package/dist/plot/{adaptive-density.js → scatter/adaptive-density.js} +46 -20
- package/dist/plot/{binned-scatter-types.d.ts → scatter/binned-scatter-types.d.ts} +5 -12
- package/dist/plot/scatter/index.d.ts +7 -0
- package/dist/plot/scatter/index.js +5 -0
- package/dist/plot/scatter/scatter-data.d.ts +19 -0
- package/dist/plot/scatter/scatter-data.js +212 -0
- package/dist/plot/{ScatterPlot3D.svelte → scatter-3d/ScatterPlot3D.svelte} +25 -34
- package/dist/plot/{ScatterPlot3D.svelte.d.ts → scatter-3d/ScatterPlot3D.svelte.d.ts} +9 -17
- package/dist/plot/{ScatterPlot3DControls.svelte → scatter-3d/ScatterPlot3DControls.svelte} +14 -14
- package/dist/plot/{ScatterPlot3DControls.svelte.d.ts → scatter-3d/ScatterPlot3DControls.svelte.d.ts} +6 -6
- package/dist/plot/{ScatterPlot3DScene.svelte → scatter-3d/ScatterPlot3DScene.svelte} +129 -128
- package/dist/plot/{ScatterPlot3DScene.svelte.d.ts → scatter-3d/ScatterPlot3DScene.svelte.d.ts} +6 -15
- package/dist/plot/{Surface3D.svelte → scatter-3d/Surface3D.svelte} +7 -6
- package/dist/plot/{Surface3D.svelte.d.ts → scatter-3d/Surface3D.svelte.d.ts} +5 -4
- package/dist/plot/scatter-3d/index.d.ts +4 -0
- package/dist/plot/scatter-3d/index.js +4 -0
- package/dist/plot/sunburst/Sunburst.svelte +1041 -0
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +97 -0
- package/dist/plot/sunburst/SunburstControls.svelte +200 -0
- package/dist/plot/sunburst/SunburstControls.svelte.d.ts +26 -0
- package/dist/plot/sunburst/index.d.ts +4 -0
- package/dist/plot/sunburst/index.js +4 -0
- package/dist/plot/sunburst/render.d.ts +34 -0
- package/dist/plot/sunburst/render.js +122 -0
- package/dist/plot/sunburst/sunburst.d.ts +62 -0
- package/dist/plot/sunburst/sunburst.js +269 -0
- package/dist/rdf/RdfPlot.svelte +2 -1
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/calc-rdf.js +11 -24
- 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 +14 -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 +79 -3
- package/dist/settings.js +321 -1
- package/dist/spectral/Bands.svelte +47 -36
- package/dist/spectral/Bands.svelte.d.ts +6 -6
- package/dist/spectral/BandsAndDos.svelte +23 -25
- package/dist/spectral/BrillouinBandsDos.svelte +42 -30
- package/dist/spectral/Dos.svelte +15 -23
- package/dist/spectral/Dos.svelte.d.ts +4 -3
- package/dist/spectral/helpers.d.ts +8 -6
- package/dist/spectral/helpers.js +137 -65
- package/dist/state.svelte.d.ts +0 -7
- package/dist/state.svelte.js +0 -6
- package/dist/structure/Arrow.svelte +2 -4
- package/dist/structure/AtomLegend.svelte +8 -9
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/CanvasTooltip.svelte +1 -0
- package/dist/structure/CellSelect.svelte +12 -5
- package/dist/structure/CellSelect.svelte.d.ts +2 -1
- package/dist/structure/Cylinder.svelte +12 -8
- package/dist/structure/Cylinder.svelte.d.ts +4 -1
- package/dist/structure/Lattice.svelte +2 -2
- package/dist/structure/Structure.svelte +365 -423
- package/dist/structure/Structure.svelte.d.ts +5 -15
- package/dist/structure/StructureControls.svelte +217 -2
- package/dist/structure/StructureControls.svelte.d.ts +5 -3
- package/dist/structure/StructureExportPane.svelte +54 -156
- package/dist/structure/StructureExportPane.svelte.d.ts +4 -5
- package/dist/structure/StructureInfoPane.svelte +10 -9
- package/dist/structure/StructureInfoPane.svelte.d.ts +5 -5
- package/dist/structure/StructureScene.svelte +376 -208
- package/dist/structure/StructureScene.svelte.d.ts +22 -20
- package/dist/structure/{label-placement.d.ts → atom-label-placement.d.ts} +3 -3
- package/dist/structure/{label-placement.js → atom-label-placement.js} +15 -5
- package/dist/structure/atom-properties.d.ts +1 -1
- package/dist/structure/atom-properties.js +17 -22
- package/dist/structure/bond-order-perception.js +3 -5
- package/dist/structure/bonding.d.ts +4 -0
- package/dist/structure/bonding.js +134 -63
- package/dist/structure/export.d.ts +24 -4
- package/dist/structure/export.js +89 -143
- package/dist/structure/index.d.ts +4 -4
- package/dist/structure/index.js +3 -3
- package/dist/structure/measure.d.ts +3 -2
- package/dist/structure/measure.js +6 -5
- package/dist/structure/parse.d.ts +3 -2
- package/dist/structure/parse.js +419 -438
- package/dist/structure/partial-occupancy.d.ts +0 -1
- package/dist/structure/partial-occupancy.js +1 -1
- package/dist/structure/pbc.d.ts +1 -1
- package/dist/structure/pbc.js +190 -13
- package/dist/structure/polyhedra.d.ts +41 -0
- package/dist/structure/polyhedra.js +602 -0
- package/dist/structure/site.d.ts +4 -0
- package/dist/structure/site.js +1 -0
- package/dist/structure/supercell.js +3 -2
- 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 +354 -0
- package/dist/symmetry/SymmetryElements.svelte.d.ts +24 -0
- package/dist/symmetry/SymmetryStats.svelte +113 -8
- package/dist/symmetry/WyckoffTable.svelte +68 -7
- package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -0
- package/dist/symmetry/cell-transform.js +7 -14
- package/dist/symmetry/index.d.ts +14 -4
- package/dist/symmetry/index.js +291 -72
- package/dist/symmetry/spacegroups.d.ts +12 -1
- package/dist/symmetry/spacegroups.js +63 -14
- 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 +66 -25
- package/dist/table/HeatmapTable.svelte.d.ts +1 -1
- package/dist/table/index.d.ts +1 -3
- package/dist/table/index.js +1 -1
- package/dist/theme/index.js +8 -8
- package/dist/tooltip/KCoords.svelte +45 -0
- package/dist/tooltip/KCoords.svelte.d.ts +8 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/trajectory/Trajectory.svelte +123 -100
- package/dist/trajectory/Trajectory.svelte.d.ts +11 -22
- package/dist/trajectory/TrajectoryExportPane.svelte +17 -25
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +4 -5
- package/dist/trajectory/TrajectoryInfoPane.svelte +5 -3
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -2
- package/dist/trajectory/constants.js +6 -2
- package/dist/trajectory/extract.js +17 -37
- package/dist/trajectory/format-detect.d.ts +1 -1
- package/dist/trajectory/format-detect.js +27 -19
- package/dist/trajectory/frame-reader.d.ts +0 -1
- package/dist/trajectory/frame-reader.js +63 -162
- package/dist/trajectory/helpers.d.ts +10 -2
- package/dist/trajectory/helpers.js +56 -36
- package/dist/trajectory/index.js +1 -1
- 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/hdf5.js +1 -1
- package/dist/trajectory/parse/index.d.ts +1 -1
- package/dist/trajectory/parse/index.js +65 -105
- package/dist/trajectory/parse/lammps.d.ts +0 -2
- package/dist/trajectory/parse/lammps.js +8 -6
- package/dist/trajectory/parse/pymatgen.d.ts +2 -0
- package/dist/trajectory/parse/pymatgen.js +74 -0
- package/dist/trajectory/parse/vasp.js +38 -18
- package/dist/trajectory/parse/xyz.d.ts +13 -1
- package/dist/trajectory/parse/xyz.js +102 -94
- package/dist/trajectory/plotting.d.ts +1 -2
- package/dist/trajectory/plotting.js +16 -113
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +7 -5
- package/dist/xrd/XrdPlot.svelte +16 -30
- package/dist/xrd/broadening.d.ts +2 -1
- package/dist/xrd/calc-xrd.js +18 -20
- package/dist/xrd/index.d.ts +2 -2
- package/dist/xrd/parse.js +2 -2
- package/package.json +43 -26
- 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/PlotControls.svelte.d.ts +0 -4
- package/dist/plot/axis-utils.d.ts +0 -19
- package/dist/plot/axis-utils.js +0 -78
- package/dist/plot/defaults.d.ts +0 -19
- package/dist/plot/defaults.js +0 -9
- package/dist/plot/fill-utils.d.ts +0 -46
- package/dist/plot/fill-utils.js +0 -322
- package/dist/plot/hover-lock.svelte.d.ts +0 -14
- package/dist/plot/hover-lock.svelte.js +0 -46
- package/dist/plot/interactions.d.ts +0 -12
- package/dist/plot/interactions.js +0 -101
- package/dist/plot/scales.d.ts +0 -48
- package/dist/plot/svg.d.ts +0 -1
- package/dist/plot/svg.js +0 -11
- package/dist/plot/utils/series-visibility.d.ts +0 -15
- package/dist/plot/utils.d.ts +0 -1
- package/dist/plot/utils.js +0 -14
- /package/dist/plot/{PortalSelect.svelte.d.ts → core/components/PortalSelect.svelte.d.ts} +0 -0
- /package/dist/plot/{binned-scatter-types.js → scatter/binned-scatter-types.js} +0 -0
package/dist/isosurface/parse.js
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
// Parsers for volumetric data file formats (VASP CHGCAR, Gaussian .cube)
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ATOMIC_NUMBER_TO_SYMBOL } from '../composition/parse';
|
|
3
|
+
import { VASP_VOLUMETRIC_REGEX } from '../constants';
|
|
4
|
+
import { coerce_elem_symbol, FALLBACK_ELEMENTS } from '../element';
|
|
5
|
+
import { strip_compression_extensions } from '../io';
|
|
4
6
|
import * as math from '../math';
|
|
5
7
|
import { wrap_to_unit_cell } from '../structure/pbc';
|
|
8
|
+
import { make_site } from '../structure/site';
|
|
6
9
|
// Bohr radius in Angstroms (for Gaussian .cube unit conversion)
|
|
7
10
|
const BOHR_TO_ANGSTROM = 0.529177249;
|
|
11
|
+
// === Parse error contract ===
|
|
12
|
+
// parse_chgcar/parse_cube return null and record reasons here (mirrored to console.error).
|
|
13
|
+
// parse_volumetric_file resets per call and throws when the FILENAME identifies a volumetric
|
|
14
|
+
// format that fails to parse, but returns null when content doesn't look volumetric at all
|
|
15
|
+
// (probe semantics — callers then fall back to structure parsing).
|
|
16
|
+
let vol_parse_errors = [];
|
|
17
|
+
const vol_error = (message) => {
|
|
18
|
+
vol_parse_errors.push(message);
|
|
19
|
+
console.error(message);
|
|
20
|
+
};
|
|
8
21
|
// === Fast number parsing utilities ===
|
|
9
22
|
// Parse whitespace-separated numbers directly from a string, starting at `pos`.
|
|
10
23
|
// Writes into a pre-allocated Float64Array and returns { count, end_pos }.
|
|
@@ -43,8 +56,8 @@ function parse_float_block(text, pos, max_count, data, data_offset = 0) {
|
|
|
43
56
|
const start = pos;
|
|
44
57
|
while (pos < len && text.charCodeAt(pos) > 32)
|
|
45
58
|
pos++;
|
|
46
|
-
// Parse number
|
|
47
|
-
const num =
|
|
59
|
+
// Parse number (handles scientific notation)
|
|
60
|
+
const num = Number(text.slice(start, pos));
|
|
48
61
|
if (!Number.isNaN(num)) {
|
|
49
62
|
data[idx++] = num;
|
|
50
63
|
}
|
|
@@ -68,7 +81,7 @@ function read_line(text, pos) {
|
|
|
68
81
|
let end = pos;
|
|
69
82
|
while (end < text.length && text.charCodeAt(end) !== 10 && text.charCodeAt(end) !== 13)
|
|
70
83
|
end++;
|
|
71
|
-
const line = text.
|
|
84
|
+
const line = text.slice(pos, end);
|
|
72
85
|
let next = end;
|
|
73
86
|
if (next < text.length && text.charCodeAt(next) === 13)
|
|
74
87
|
next++; // skip \r
|
|
@@ -177,7 +190,7 @@ export function parse_chgcar(content) {
|
|
|
177
190
|
cur = read_line(content, pos);
|
|
178
191
|
const scale_factor = parseFloat(cur.line);
|
|
179
192
|
if (isNaN(scale_factor)) {
|
|
180
|
-
|
|
193
|
+
vol_error(`Invalid scaling factor in CHGCAR`);
|
|
181
194
|
return null;
|
|
182
195
|
}
|
|
183
196
|
pos = cur.next;
|
|
@@ -195,31 +208,29 @@ export function parse_chgcar(content) {
|
|
|
195
208
|
let atom_counts = [];
|
|
196
209
|
cur = read_line(content, pos);
|
|
197
210
|
if (pos >= content.length) {
|
|
198
|
-
|
|
211
|
+
vol_error(`CHGCAR: file ends before element/count lines`);
|
|
199
212
|
return null;
|
|
200
213
|
}
|
|
201
214
|
// Detect VASP 5+ format (has element symbols before counts)
|
|
202
215
|
const first_token = cur.line.trim().split(/\s+/)[0];
|
|
203
|
-
const has_element_symbols = isNaN(parseInt(first_token));
|
|
216
|
+
const has_element_symbols = isNaN(parseInt(first_token, 10));
|
|
204
217
|
if (has_element_symbols) {
|
|
205
218
|
element_symbols = cur.line.trim().split(/\s+/);
|
|
206
219
|
pos = cur.next;
|
|
207
220
|
cur = read_line(content, pos);
|
|
208
221
|
if (pos >= content.length) {
|
|
209
|
-
|
|
222
|
+
vol_error(`CHGCAR: file ends before atom counts line`);
|
|
210
223
|
return null;
|
|
211
224
|
}
|
|
212
225
|
atom_counts = cur.line.trim().split(/\s+/).map(Number);
|
|
213
|
-
pos = cur.next;
|
|
214
226
|
}
|
|
215
227
|
else {
|
|
216
228
|
atom_counts = cur.line.trim().split(/\s+/).map(Number);
|
|
217
|
-
|
|
218
|
-
element_symbols = atom_counts.map((_count, idx) => fallback_elements[idx % fallback_elements.length]);
|
|
219
|
-
pos = cur.next;
|
|
229
|
+
element_symbols = atom_counts.map((_count, idx) => FALLBACK_ELEMENTS[idx % FALLBACK_ELEMENTS.length]);
|
|
220
230
|
}
|
|
231
|
+
pos = cur.next;
|
|
221
232
|
if (pos >= content.length) {
|
|
222
|
-
|
|
233
|
+
vol_error(`CHGCAR: file ends before coordinate mode line`);
|
|
223
234
|
return null;
|
|
224
235
|
}
|
|
225
236
|
// Check for selective dynamics line
|
|
@@ -229,7 +240,7 @@ export function parse_chgcar(content) {
|
|
|
229
240
|
cur = read_line(content, pos);
|
|
230
241
|
}
|
|
231
242
|
if (pos >= content.length) {
|
|
232
|
-
|
|
243
|
+
vol_error(`CHGCAR: file ends before coordinate mode line`);
|
|
233
244
|
return null;
|
|
234
245
|
}
|
|
235
246
|
// Coordinate mode line
|
|
@@ -243,18 +254,18 @@ export function parse_chgcar(content) {
|
|
|
243
254
|
({ cart_to_frac, frac_to_cart } = math.create_lattice_converters(lattice));
|
|
244
255
|
}
|
|
245
256
|
catch {
|
|
246
|
-
|
|
257
|
+
vol_error(`CHGCAR: lattice matrix is singular; cannot convert coordinates`);
|
|
247
258
|
return null;
|
|
248
259
|
}
|
|
249
260
|
const sites = [];
|
|
250
261
|
let atom_idx = 0;
|
|
251
262
|
for (let elem_idx = 0; elem_idx < element_symbols.length; elem_idx++) {
|
|
252
263
|
const symbol = element_symbols[elem_idx].split(/[_/]/)[0];
|
|
253
|
-
const element = (
|
|
264
|
+
const element = coerce_elem_symbol(symbol) ?? `H`;
|
|
254
265
|
const count = atom_counts[elem_idx];
|
|
255
266
|
for (let count_idx = 0; count_idx < count; count_idx++) {
|
|
256
267
|
if (pos >= content.length) {
|
|
257
|
-
|
|
268
|
+
vol_error(`CHGCAR: file ends before all atom coordinates are read`);
|
|
258
269
|
return null;
|
|
259
270
|
}
|
|
260
271
|
cur = read_line(content, pos);
|
|
@@ -271,13 +282,7 @@ export function parse_chgcar(content) {
|
|
|
271
282
|
const raw = cart_to_frac(xyz);
|
|
272
283
|
abc = wrap_to_unit_cell(raw);
|
|
273
284
|
}
|
|
274
|
-
sites.push({
|
|
275
|
-
species: [{ element, occu: 1, oxidation_state: 0 }],
|
|
276
|
-
abc,
|
|
277
|
-
xyz,
|
|
278
|
-
label: `${element}${atom_idx + count_idx + 1}`,
|
|
279
|
-
properties: {},
|
|
280
|
-
});
|
|
285
|
+
sites.push(make_site(element, abc, xyz, `${element}${atom_idx + count_idx + 1}`));
|
|
281
286
|
}
|
|
282
287
|
atom_idx += count;
|
|
283
288
|
}
|
|
@@ -349,7 +354,7 @@ export function parse_chgcar(content) {
|
|
|
349
354
|
}
|
|
350
355
|
}
|
|
351
356
|
if (volumes.length === 0) {
|
|
352
|
-
|
|
357
|
+
vol_error(`No volumetric data found in CHGCAR`);
|
|
353
358
|
return null;
|
|
354
359
|
}
|
|
355
360
|
return { structure, volumes };
|
|
@@ -366,7 +371,7 @@ export function parse_cube(content, options = {}) {
|
|
|
366
371
|
line_count++;
|
|
367
372
|
}
|
|
368
373
|
if (line_count < 6) {
|
|
369
|
-
|
|
374
|
+
vol_error(`.cube file too short`);
|
|
370
375
|
return null;
|
|
371
376
|
}
|
|
372
377
|
// Parse header (first 6 lines + atom lines)
|
|
@@ -377,7 +382,7 @@ export function parse_cube(content, options = {}) {
|
|
|
377
382
|
// (negative n_atoms indicates orbital data with extra header line)
|
|
378
383
|
const line2 = header.lines[2].split(/\s+/).map(Number);
|
|
379
384
|
if (line2.length < 4 || line2.some(isNaN)) {
|
|
380
|
-
|
|
385
|
+
vol_error(`.cube header line 3 malformed: expected 4 numbers`);
|
|
381
386
|
return null;
|
|
382
387
|
}
|
|
383
388
|
const n_atoms = Math.abs(line2[0]);
|
|
@@ -391,7 +396,7 @@ export function parse_cube(content, options = {}) {
|
|
|
391
396
|
header.lines[5].split(/\s+/).map(Number),
|
|
392
397
|
];
|
|
393
398
|
if (voxel_lines.some((line) => line.length < 4 || line.some(isNaN))) {
|
|
394
|
-
|
|
399
|
+
vol_error(`.cube voxel lines malformed: expected 4 numbers per line`);
|
|
395
400
|
return null;
|
|
396
401
|
}
|
|
397
402
|
const n_grid = [
|
|
@@ -424,7 +429,7 @@ export function parse_cube(content, options = {}) {
|
|
|
424
429
|
}
|
|
425
430
|
catch {
|
|
426
431
|
// Non-periodic system (molecule), use identity
|
|
427
|
-
cube_cart_to_frac = (
|
|
432
|
+
cube_cart_to_frac = (vec) => [vec[0], vec[1], vec[2]];
|
|
428
433
|
}
|
|
429
434
|
for (let atom_idx = 0; atom_idx < n_atoms; atom_idx++) {
|
|
430
435
|
const cur = read_line(content, pos);
|
|
@@ -445,13 +450,7 @@ export function parse_cube(content, options = {}) {
|
|
|
445
450
|
const xyz = math.subtract(raw_xyz, origin);
|
|
446
451
|
const abc = cube_cart_to_frac(xyz);
|
|
447
452
|
const element = atomic_number_to_symbol(atom_line[0]);
|
|
448
|
-
sites.push({
|
|
449
|
-
species: [{ element, occu: 1, oxidation_state: 0 }],
|
|
450
|
-
abc,
|
|
451
|
-
xyz,
|
|
452
|
-
label: `${element}${atom_idx + 1}`,
|
|
453
|
-
properties: {},
|
|
454
|
-
});
|
|
453
|
+
sites.push(make_site(element, abc, xyz, `${element}${atom_idx + 1}`));
|
|
455
454
|
}
|
|
456
455
|
// Build structure
|
|
457
456
|
const lattice_params = math.calc_lattice_params(lattice);
|
|
@@ -475,7 +474,7 @@ export function parse_cube(content, options = {}) {
|
|
|
475
474
|
if (parsed_count < total_points) {
|
|
476
475
|
console.warn(`.cube: expected ${total_points} data values, got ${parsed_count}`);
|
|
477
476
|
if (parsed_count === 0) {
|
|
478
|
-
|
|
477
|
+
vol_error(`No volumetric data found in .cube file`);
|
|
479
478
|
return null;
|
|
480
479
|
}
|
|
481
480
|
}
|
|
@@ -500,26 +499,28 @@ export function parse_cube(content, options = {}) {
|
|
|
500
499
|
];
|
|
501
500
|
return { structure, volumes };
|
|
502
501
|
}
|
|
503
|
-
// Convert atomic number to element symbol
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
const idx = atomic_number - 1;
|
|
507
|
-
return idx >= 0 && idx < ELEM_SYMBOLS.length ? ELEM_SYMBOLS[idx] : `H`;
|
|
508
|
-
}
|
|
509
|
-
// Auto-detect and parse volumetric file format based on filename and content
|
|
502
|
+
// Convert atomic number to element symbol (falls back to H for unknown numbers)
|
|
503
|
+
const atomic_number_to_symbol = (atomic_number) => ATOMIC_NUMBER_TO_SYMBOL[atomic_number] ?? `H`;
|
|
504
|
+
// Auto-detect and parse volumetric file by filename + content (see parse error contract at top)
|
|
510
505
|
export function parse_volumetric_file(content, filename) {
|
|
506
|
+
vol_parse_errors = [];
|
|
507
|
+
const fail = (format) => {
|
|
508
|
+
const detail = vol_parse_errors.length ? `: ${vol_parse_errors.join(`; `)}` : ``;
|
|
509
|
+
throw new Error(`Failed to parse ${format} file${filename ? ` '${filename}'` : ``}${detail}`);
|
|
510
|
+
};
|
|
511
511
|
// Strip compression suffixes so "CHGCAR.gz" and "molecule.cube.bz2" match correctly
|
|
512
|
-
const lower_name = (filename ?? ``)
|
|
513
|
-
// Extension-based detection
|
|
512
|
+
const lower_name = strip_compression_extensions(filename ?? ``);
|
|
513
|
+
// Extension-based detection (filename is authoritative: parse failure throws)
|
|
514
514
|
if (lower_name.endsWith(`.cube`))
|
|
515
|
-
return parse_cube(content);
|
|
515
|
+
return parse_cube(content) ?? fail(`.cube`);
|
|
516
516
|
// VASP volumetric file detection by filename
|
|
517
|
-
if (VASP_VOLUMETRIC_REGEX.test(lower_name))
|
|
518
|
-
return parse_chgcar(content);
|
|
517
|
+
if (VASP_VOLUMETRIC_REGEX.test(lower_name)) {
|
|
518
|
+
return parse_chgcar(content) ?? fail(`VASP volumetric (CHGCAR-like)`);
|
|
519
|
+
}
|
|
519
520
|
// Content-based detection (only parse first few lines, not the whole file)
|
|
520
521
|
// Find enough lines for detection without splitting the entire string
|
|
521
522
|
const detection_end = find_line_offset(content, 10);
|
|
522
|
-
const detection_text = content.
|
|
523
|
+
const detection_text = content.slice(0, detection_end);
|
|
523
524
|
const lines = detection_text.split(/\r?\n/);
|
|
524
525
|
// .cube detection: line 3 has 4 numbers (n_atoms + origin), line 4 has 4 numbers (grid dim + voxel)
|
|
525
526
|
if (lines.length > 4) {
|
package/dist/isosurface/slice.js
CHANGED
|
@@ -32,9 +32,10 @@ export function trilinear_interpolate(grid, fx, fy, fz, periodic) {
|
|
|
32
32
|
const x1 = periodic ? (x0 + 1) % nx : Math.min(x0 + 1, nx - 1);
|
|
33
33
|
const y1 = periodic ? (y0 + 1) % ny : Math.min(y0 + 1, ny - 1);
|
|
34
34
|
const z1 = periodic ? (z0 + 1) % nz : Math.min(z0 + 1, nz - 1);
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
const
|
|
35
|
+
// deltas from clamped lower index (non-periodic x0 clamps to nx-2 so floor(gx) may != x0)
|
|
36
|
+
const xd = periodic ? gx - Math.floor(gx) : gx - x0;
|
|
37
|
+
const yd = periodic ? gy - Math.floor(gy) : gy - y0;
|
|
38
|
+
const zd = periodic ? gz - Math.floor(gz) : gz - z0;
|
|
38
39
|
// 8-point interpolation
|
|
39
40
|
const c000 = grid[x0][y0][z0];
|
|
40
41
|
const c001 = grid[x0][y0][z1];
|
|
@@ -71,7 +72,7 @@ export function sample_hkl_slice(volume, miller_indices, distance, n_points) {
|
|
|
71
72
|
];
|
|
72
73
|
if (Math.hypot(...plane_normal) < 1e-12)
|
|
73
74
|
return null; // degenerate normal
|
|
74
|
-
const unit_normal = math.
|
|
75
|
+
const unit_normal = math.normalize_vec(plane_normal);
|
|
75
76
|
// In-plane basis vectors
|
|
76
77
|
const [u_vec, v_vec] = math.compute_in_plane_basis(unit_normal);
|
|
77
78
|
const cart_to_frac = math.create_cart_to_frac(lattice);
|
package/dist/isosurface/types.js
CHANGED
|
@@ -13,7 +13,7 @@ export const LAYER_COLORS = [
|
|
|
13
13
|
// Compute min/max/abs_max/mean of a 3D grid.
|
|
14
14
|
// Prefer using the precomputed `data_range` field on VolumetricData when available.
|
|
15
15
|
export function grid_data_range(grid) {
|
|
16
|
-
if (
|
|
16
|
+
if (grid.length === 0 || !grid[0]?.length || !grid[0][0]?.length) {
|
|
17
17
|
return { min: 0, max: 0, abs_max: 0, mean: 0 };
|
|
18
18
|
}
|
|
19
19
|
let [min_val, max_val] = [Infinity, -Infinity];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type KeydownHandler = (event: KeyboardEvent) => boolean;
|
|
2
|
+
export declare const handle_and_prevent: (handle: KeydownHandler) => (event: KeyboardEvent) => void;
|
|
3
|
+
export declare const forward_window_keydown: (is_hovered: () => boolean, handle: KeydownHandler) => (event: KeyboardEvent) => void;
|
package/dist/keyboard.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Shared helpers for wiring viewer keyboard shortcuts consistently across
|
|
2
|
+
// components (Structure, Trajectory, ...). A handler returns `true` when it
|
|
3
|
+
// handled the event, so the browser default is suppressed in exactly one place
|
|
4
|
+
// instead of scattered `preventDefault()` calls.
|
|
5
|
+
// Wrap a handler for an element-level `onkeydown` binding: run it and suppress
|
|
6
|
+
// the browser default (page scroll, find, ...) when it reports it handled the key.
|
|
7
|
+
export const handle_and_prevent = (handle) => (event) => {
|
|
8
|
+
if (handle(event))
|
|
9
|
+
event.preventDefault();
|
|
10
|
+
};
|
|
11
|
+
// Wrap a handler for a `<svelte:window onkeydown>` binding: forward keydowns to a
|
|
12
|
+
// viewer only while it's hovered and focus is on <body>. This lets shortcuts work
|
|
13
|
+
// without first clicking the viewer, while keeping multiple viewers on one page
|
|
14
|
+
// from all responding and never hijacking keys from a focused input/pane.
|
|
15
|
+
// Suppresses the browser default when the handler reports it handled the key.
|
|
16
|
+
export const forward_window_keydown = (is_hovered, handle) => {
|
|
17
|
+
const run = handle_and_prevent(handle);
|
|
18
|
+
return (event) => {
|
|
19
|
+
const active = document.activeElement;
|
|
20
|
+
if (is_hovered() && (!active || active === document.body))
|
|
21
|
+
run(event);
|
|
22
|
+
};
|
|
23
|
+
};
|
package/dist/labels.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare const ELEM_PROPERTY_LABELS: Partial<Record<keyof ChemicalElement,
|
|
|
11
11
|
export declare const ELEM_HEATMAP_KEYS: (keyof ChemicalElement)[];
|
|
12
12
|
export declare const ELEM_HEATMAP_LABELS: Partial<Record<string, keyof ChemicalElement>>;
|
|
13
13
|
export declare const DEFAULT_FMT: [string, string];
|
|
14
|
-
export declare const FRACTION_GLYPHS:
|
|
14
|
+
export declare const FRACTION_GLYPHS: readonly (readonly [number, string])[];
|
|
15
15
|
export declare const format_num: (num: number, fmt?: string | number) => string;
|
|
16
16
|
export declare const format_vec3: (vec: Readonly<Vec3>, fmt_spec?: string) => string;
|
|
17
17
|
export declare const format_bytes: (bytes?: number) => string;
|
package/dist/labels.js
CHANGED
|
@@ -5,7 +5,7 @@ const is_d3_symbol_name = (name) => Object.hasOwn(d3_symbols, `symbol${name}`);
|
|
|
5
5
|
function name_for_symbol(sym) {
|
|
6
6
|
for (const [key, symbol] of Object.entries(d3_symbols)) {
|
|
7
7
|
if (symbol === sym && /^symbol[A-Z]/.test(key)) {
|
|
8
|
-
const name = key.
|
|
8
|
+
const name = key.slice(6);
|
|
9
9
|
if (is_d3_symbol_name(name))
|
|
10
10
|
return name;
|
|
11
11
|
}
|
|
@@ -16,7 +16,7 @@ export const symbol_names = [
|
|
|
16
16
|
...new Set([...d3_symbols.symbolsFill, ...d3_symbols.symbolsStroke]),
|
|
17
17
|
]
|
|
18
18
|
.map(name_for_symbol)
|
|
19
|
-
.filter((
|
|
19
|
+
.filter((name) => name !== null);
|
|
20
20
|
export const symbol_map = Object.fromEntries(
|
|
21
21
|
// Symbol lookup from d3-shape
|
|
22
22
|
symbol_names.map((name) => [name, d3_symbols[`symbol${name}`]]));
|
|
@@ -34,7 +34,7 @@ export function format_value(value, formatter) {
|
|
|
34
34
|
if (Number.isNaN(value))
|
|
35
35
|
return `NaN`;
|
|
36
36
|
// Format and normalize unicode minus
|
|
37
|
-
const formatted = format(formatter)(value).
|
|
37
|
+
const formatted = format(formatter)(value).replaceAll('−', `-`);
|
|
38
38
|
// Handle percentage formatting - remove trailing zeros
|
|
39
39
|
if (formatter.includes(`%`)) {
|
|
40
40
|
return formatted.includes(`.`)
|
|
@@ -157,9 +157,10 @@ export function parse_si_float(value) {
|
|
|
157
157
|
if (typeof value !== `string`)
|
|
158
158
|
return value;
|
|
159
159
|
// Remove whitespace and commas
|
|
160
|
-
const cleaned = value.trim().
|
|
161
|
-
//
|
|
162
|
-
|
|
160
|
+
const cleaned = value.trim().replaceAll(/(\d),(\d)/g, `$1$2`);
|
|
161
|
+
// SI-formatted number (e.g. "1.23k", "789µ"). Suffixes are case-sensitive (m=milli vs
|
|
162
|
+
// M=mega), so no `i` flag: mismatched-case suffixes return the string as-is.
|
|
163
|
+
const match = /^([-+]?\d*\.?\d+)\s*([yzafpnµmkMGTPEZY])?$/.exec(cleaned);
|
|
163
164
|
if (match) {
|
|
164
165
|
const [, num_part, suffix] = match;
|
|
165
166
|
let multiplier = 1;
|
|
@@ -167,7 +168,7 @@ export function parse_si_float(value) {
|
|
|
167
168
|
const suffixes = `yzafpnµm kMGTPEZY`;
|
|
168
169
|
const index = suffixes.indexOf(suffix);
|
|
169
170
|
if (index !== -1) {
|
|
170
|
-
multiplier =
|
|
171
|
+
multiplier = 1000 ** (index - 8);
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
174
|
return parseFloat(num_part) * multiplier;
|
|
@@ -232,7 +233,7 @@ export const SUBSCRIPT_MAP = {
|
|
|
232
233
|
'9': `₉`,
|
|
233
234
|
};
|
|
234
235
|
// replaces all signs and digits with their unicode superscript equivalent
|
|
235
|
-
export const superscript_digits = (input) => input.
|
|
236
|
+
export const superscript_digits = (input) => input.replaceAll(/[\d+-]/g, (match) => is_superscript_key(match) ? SUPERSCRIPT_MAP[match] : match);
|
|
236
237
|
// Trajectory property configuration: clean labels and units as structured data
|
|
237
238
|
export const trajectory_property_config = {
|
|
238
239
|
// Energy properties
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Fullscreen toggle button (default Icon or custom snippet content), shared by the
|
|
3
|
+
// Trajectory/ChemPotDiagram3D/ConvexHull viewer chromes
|
|
4
|
+
import Icon from '../Icon.svelte'
|
|
5
|
+
import type { HTMLButtonAttributes } from 'svelte/elements'
|
|
6
|
+
import { type FullscreenToggleProp, toggle_fullscreen } from './fullscreen'
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
fullscreen = false,
|
|
10
|
+
toggle = true, // pass a snippet to render custom button content
|
|
11
|
+
wrapper = undefined, // element sent fullscreen
|
|
12
|
+
...rest
|
|
13
|
+
}: HTMLButtonAttributes & {
|
|
14
|
+
fullscreen?: boolean
|
|
15
|
+
toggle?: FullscreenToggleProp
|
|
16
|
+
wrapper?: HTMLDivElement
|
|
17
|
+
} = $props()
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<button
|
|
21
|
+
type="button"
|
|
22
|
+
onclick={() => toggle_fullscreen(wrapper)}
|
|
23
|
+
title="{fullscreen ? `Exit` : `Enter`} fullscreen"
|
|
24
|
+
aria-pressed={fullscreen}
|
|
25
|
+
{...rest}
|
|
26
|
+
class="fullscreen-btn {rest.class ?? ``}"
|
|
27
|
+
>
|
|
28
|
+
{#if typeof toggle === `function`}
|
|
29
|
+
{@render toggle({ fullscreen })}
|
|
30
|
+
{:else}
|
|
31
|
+
<Icon icon={fullscreen ? `ExitFullscreen` : `Fullscreen`} />
|
|
32
|
+
{/if}
|
|
33
|
+
</button>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
import { type FullscreenToggleProp } from './fullscreen';
|
|
3
|
+
type $$ComponentProps = HTMLButtonAttributes & {
|
|
4
|
+
fullscreen?: boolean;
|
|
5
|
+
toggle?: FullscreenToggleProp;
|
|
6
|
+
wrapper?: HTMLDivElement;
|
|
7
|
+
};
|
|
8
|
+
declare const FullscreenButton: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type FullscreenButton = ReturnType<typeof FullscreenButton>;
|
|
10
|
+
export default FullscreenButton;
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
// Toggles a bindable `fullscreen` flag (plot components manage browser fullscreen
|
|
3
|
+
// themselves). For chromes that call the browser API directly, use FullscreenButton.
|
|
2
4
|
import Icon from '../Icon.svelte'
|
|
3
5
|
import type { HTMLButtonAttributes } from 'svelte/elements'
|
|
4
6
|
|
|
5
|
-
let {
|
|
6
|
-
fullscreen = $bindable(false),
|
|
7
|
-
class: className,
|
|
8
|
-
...rest
|
|
9
|
-
}: HTMLButtonAttributes & {
|
|
7
|
+
let { fullscreen = $bindable(false), ...rest }: HTMLButtonAttributes & {
|
|
10
8
|
fullscreen?: boolean
|
|
11
9
|
} = $props()
|
|
12
10
|
</script>
|
|
13
11
|
|
|
14
12
|
<button
|
|
15
|
-
|
|
13
|
+
{...rest}
|
|
14
|
+
class="fullscreen-toggle {rest.class ?? ``}"
|
|
16
15
|
onclick={() => (fullscreen = !fullscreen)}
|
|
17
16
|
aria-label={fullscreen ? `Exit fullscreen` : `Enter fullscreen`}
|
|
18
17
|
type="button"
|
|
19
|
-
{...rest}
|
|
20
18
|
>
|
|
21
|
-
<Icon
|
|
22
|
-
icon={fullscreen ? `ExitFullscreen` : `Fullscreen`}
|
|
23
|
-
width="18"
|
|
24
|
-
height="18"
|
|
25
|
-
/>
|
|
19
|
+
<Icon icon="{fullscreen ? `Exit` : ``}Fullscreen" width="18" height="18" />
|
|
26
20
|
</button>
|
|
27
21
|
|
|
28
22
|
<style>
|
|
@@ -45,6 +39,6 @@
|
|
|
45
39
|
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
46
40
|
opacity: var(--fullscreen-btn-hover-opacity, 1);
|
|
47
41
|
}
|
|
48
|
-
/* Note: Parent component should add styles to show on parent hover
|
|
49
|
-
|
|
42
|
+
/* Note: Parent component should add styles to show on parent hover
|
|
43
|
+
Example: .parent:hover :global(.fullscreen-toggle) { opacity: 1; } */
|
|
50
44
|
</style>
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
// Active when either bound is set (undefined = unbounded)
|
|
48
48
|
let active = $derived(min_value !== undefined || max_value !== undefined)
|
|
49
|
-
let plain_label = $derived(label.
|
|
49
|
+
let plain_label = $derived(label.replaceAll(/<[^>]*>/g, ``))
|
|
50
50
|
|
|
51
51
|
let filtered_data = $derived.by(() => {
|
|
52
52
|
if (!histogram_data) return []
|
|
@@ -69,7 +69,8 @@
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
function clear_filter(): void {
|
|
72
|
-
min_value =
|
|
72
|
+
min_value = undefined
|
|
73
|
+
max_value = undefined
|
|
73
74
|
onclear?.()
|
|
74
75
|
onchange?.(undefined, undefined)
|
|
75
76
|
}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
// Create a deep copy of current_values on mount to use as reference values
|
|
27
27
|
function deep_copy(obj: unknown): unknown {
|
|
28
28
|
if (obj === null || typeof obj !== `object`) return obj
|
|
29
|
-
if (obj instanceof Date) return new Date(obj
|
|
29
|
+
if (obj instanceof Date) return new Date(obj)
|
|
30
30
|
if (obj instanceof RegExp) return new RegExp(obj)
|
|
31
31
|
if (Array.isArray(obj)) {
|
|
32
32
|
return obj.map((item) =>
|
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
// TODO Trajectory.svelte still has its own control-buttons variant — migrate it here.
|
|
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
|
+
|
|
11
|
+
let {
|
|
12
|
+
controls_config,
|
|
13
|
+
filename = undefined,
|
|
14
|
+
fullscreen = false,
|
|
15
|
+
fullscreen_toggle = true,
|
|
16
|
+
fullscreen_btn_style = undefined,
|
|
17
|
+
wrapper = undefined,
|
|
18
|
+
style = undefined,
|
|
19
|
+
before = undefined,
|
|
20
|
+
children = undefined,
|
|
21
|
+
}: {
|
|
22
|
+
controls_config: ShowControlsState
|
|
23
|
+
filename?: string
|
|
24
|
+
fullscreen?: boolean
|
|
25
|
+
fullscreen_toggle?: FullscreenToggleProp
|
|
26
|
+
fullscreen_btn_style?: string
|
|
27
|
+
wrapper?: HTMLDivElement
|
|
28
|
+
style?: string // extra styles/CSS vars for the section (user config style wins)
|
|
29
|
+
before?: Snippet // rendered before filename/fullscreen (e.g. reset-camera button)
|
|
30
|
+
children?: Snippet // rendered after the fullscreen toggle (panes, controls, ...)
|
|
31
|
+
} = $props()
|
|
32
|
+
|
|
33
|
+
// Styled tooltip (reads the button's title attr), forwarded as a spreadable attachment
|
|
34
|
+
const tooltip_attachment = { [createAttachmentKey()]: tooltip() }
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<section
|
|
38
|
+
class="control-buttons {controls_config.class}"
|
|
39
|
+
style={[style, controls_config.style].filter(Boolean).join(`; `)}
|
|
40
|
+
>
|
|
41
|
+
{#if controls_config.mode !== `never`}
|
|
42
|
+
{@render before?.()}
|
|
43
|
+
|
|
44
|
+
{#if filename && controls_config.visible(`filename`)}
|
|
45
|
+
<span class="filename">{filename}</span>
|
|
46
|
+
{/if}
|
|
47
|
+
|
|
48
|
+
{#if fullscreen_toggle && controls_config.visible(`fullscreen`)}
|
|
49
|
+
<FullscreenButton
|
|
50
|
+
{fullscreen}
|
|
51
|
+
toggle={fullscreen_toggle}
|
|
52
|
+
{wrapper}
|
|
53
|
+
class="fullscreen-toggle"
|
|
54
|
+
style={fullscreen_btn_style}
|
|
55
|
+
{...tooltip_attachment}
|
|
56
|
+
/>
|
|
57
|
+
{/if}
|
|
58
|
+
|
|
59
|
+
{@render children?.()}
|
|
60
|
+
{/if}
|
|
61
|
+
</section>
|
|
62
|
+
|
|
63
|
+
<style>
|
|
64
|
+
section.control-buttons {
|
|
65
|
+
position: absolute;
|
|
66
|
+
display: flex;
|
|
67
|
+
top: var(--viewer-buttons-top, var(--ctrl-btn-top, 1ex));
|
|
68
|
+
right: var(--viewer-buttons-right, var(--ctrl-btn-right, 1ex));
|
|
69
|
+
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
|
+
);
|
|
74
|
+
opacity: 0;
|
|
75
|
+
pointer-events: none;
|
|
76
|
+
transition: opacity 0.2s ease;
|
|
77
|
+
align-items: var(--viewer-buttons-align, center);
|
|
78
|
+
}
|
|
79
|
+
/* Mode: always - controls always visible */
|
|
80
|
+
section.control-buttons.always-visible {
|
|
81
|
+
opacity: 1;
|
|
82
|
+
pointer-events: auto;
|
|
83
|
+
}
|
|
84
|
+
/* Mode: hover - controls visible while the parent viewer is hovered/focused */
|
|
85
|
+
:global(.structure:hover) > section.control-buttons.hover-visible,
|
|
86
|
+
:global(.structure:focus-within) > section.control-buttons.hover-visible,
|
|
87
|
+
:global(.brillouin-zone:hover) > section.control-buttons.hover-visible,
|
|
88
|
+
:global(.brillouin-zone:focus-within) > section.control-buttons.hover-visible,
|
|
89
|
+
:global(.fermi-surface:hover) > section.control-buttons.hover-visible,
|
|
90
|
+
:global(.fermi-surface:focus-within) > section.control-buttons.hover-visible {
|
|
91
|
+
opacity: 1;
|
|
92
|
+
pointer-events: auto;
|
|
93
|
+
}
|
|
94
|
+
/* Mode: never - stays hidden (default state, no additional CSS needed) */
|
|
95
|
+
section.control-buttons > :global(button) {
|
|
96
|
+
background-color: transparent;
|
|
97
|
+
display: flex;
|
|
98
|
+
padding: var(--viewer-buttons-btn-padding, 4px);
|
|
99
|
+
border-radius: var(--border-radius, 3pt);
|
|
100
|
+
font-size: clamp(0.85em, 2cqmin, 1.3em);
|
|
101
|
+
}
|
|
102
|
+
section.control-buttons :global(button:hover) {
|
|
103
|
+
background-color: color-mix(in srgb, currentColor 8%, transparent);
|
|
104
|
+
}
|
|
105
|
+
.filename {
|
|
106
|
+
font-family: monospace;
|
|
107
|
+
font-size: 0.9em;
|
|
108
|
+
background: var(--code-bg, rgba(0, 0, 0, 0.1));
|
|
109
|
+
padding: 3pt 6pt;
|
|
110
|
+
border-radius: 3pt;
|
|
111
|
+
max-width: 200px;
|
|
112
|
+
overflow: hidden;
|
|
113
|
+
text-overflow: ellipsis;
|
|
114
|
+
white-space: nowrap;
|
|
115
|
+
}
|
|
116
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FullscreenToggleProp } from './fullscreen';
|
|
2
|
+
import type { ShowControlsState } from '../controls';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
type $$ComponentProps = {
|
|
5
|
+
controls_config: ShowControlsState;
|
|
6
|
+
filename?: string;
|
|
7
|
+
fullscreen?: boolean;
|
|
8
|
+
fullscreen_toggle?: FullscreenToggleProp;
|
|
9
|
+
fullscreen_btn_style?: string;
|
|
10
|
+
wrapper?: HTMLDivElement;
|
|
11
|
+
style?: string;
|
|
12
|
+
before?: Snippet;
|
|
13
|
+
children?: Snippet;
|
|
14
|
+
};
|
|
15
|
+
declare const ViewerChrome: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
16
|
+
type ViewerChrome = ReturnType<typeof ViewerChrome>;
|
|
17
|
+
export default ViewerChrome;
|
|
@@ -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;
|