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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Shared draggable controls-pane shell (gear toggle + settings pane) used by plot/diagram
|
|
3
|
+
// controls components. Centralizes the toggle/pane styling and the `*-controls-toggle` /
|
|
4
|
+
// `*-controls-pane` class convention so it lives in one place instead of being re-typed in
|
|
5
|
+
// every *Controls component (PlotControls, SankeyControls, ...).
|
|
6
|
+
import { DraggablePane } from '../../../overlays'
|
|
7
|
+
import type { Snippet } from 'svelte'
|
|
8
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
controls_open = $bindable(false),
|
|
12
|
+
controls_class = `plot`,
|
|
13
|
+
title = controls_class || `plot`,
|
|
14
|
+
toggle_props = {},
|
|
15
|
+
pane_props = {},
|
|
16
|
+
children,
|
|
17
|
+
}: {
|
|
18
|
+
controls_open?: boolean
|
|
19
|
+
controls_class?: string // class prefix -> `${controls_class}-controls-{toggle,pane}`
|
|
20
|
+
title?: string // toggle button title text ("Open <title> controls")
|
|
21
|
+
toggle_props?: HTMLAttributes<HTMLButtonElement>
|
|
22
|
+
pane_props?: HTMLAttributes<HTMLDivElement>
|
|
23
|
+
children?: Snippet
|
|
24
|
+
} = $props()
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<DraggablePane
|
|
28
|
+
bind:show={controls_open}
|
|
29
|
+
closed_icon="Settings"
|
|
30
|
+
open_icon="Cross"
|
|
31
|
+
toggle_props={{
|
|
32
|
+
title: `${controls_open ? `Close` : `Open`} ${title} controls`,
|
|
33
|
+
...toggle_props,
|
|
34
|
+
class: `${controls_class}-controls-toggle ${toggle_props?.class ?? ``}`,
|
|
35
|
+
style:
|
|
36
|
+
`position: absolute; top: var(--ctrl-btn-top, 5pt); right: var(--ctrl-btn-right, 1ex);` +
|
|
37
|
+
(toggle_props?.style ?? ``),
|
|
38
|
+
}}
|
|
39
|
+
pane_props={{
|
|
40
|
+
...pane_props,
|
|
41
|
+
class: `${controls_class}-controls-pane ${pane_props?.class ?? ``}`,
|
|
42
|
+
style: `--pane-padding: 12px; --pane-gap: 4px; ${pane_props?.style ?? ``}`,
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
{@render children?.()}
|
|
46
|
+
</DraggablePane>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
controls_open?: boolean;
|
|
5
|
+
controls_class?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
toggle_props?: HTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
pane_props?: HTMLAttributes<HTMLDivElement>;
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
};
|
|
11
|
+
declare const ControlPane: import("svelte").Component<$$ComponentProps, {}, "controls_open">;
|
|
12
|
+
type ControlPane = ReturnType<typeof ControlPane>;
|
|
13
|
+
export default ControlPane;
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
FillGradient,
|
|
9
9
|
FillHandlerEvent,
|
|
10
10
|
FillRegion,
|
|
11
|
-
} from '
|
|
11
|
+
} from '../types'
|
|
12
|
+
import { unique_id } from '../utils'
|
|
12
13
|
|
|
13
14
|
let {
|
|
14
15
|
region,
|
|
@@ -35,14 +36,17 @@
|
|
|
35
36
|
} = $props()
|
|
36
37
|
|
|
37
38
|
// Stable instance ID for gradient uniqueness (generated once per component instance)
|
|
38
|
-
const instance_id =
|
|
39
|
+
const instance_id = unique_id()
|
|
39
40
|
let gradient_id = $derived(
|
|
40
41
|
`fill-gradient-${region.id ?? region_idx}-${instance_id}`,
|
|
41
42
|
)
|
|
42
43
|
|
|
44
|
+
// On hover (without an explicit hover_style), noticeably raise opacity. A faint fill (e.g. a
|
|
45
|
+
// low-alpha rgba color at the default 0.3 fill-opacity) is otherwise nearly invisible, so a mere
|
|
46
|
+
// brightness filter reads as "no change". An explicit hover_style.fill_opacity always wins.
|
|
43
47
|
let effective_opacity = $derived(
|
|
44
|
-
is_hovered
|
|
45
|
-
? region.hover_style.fill_opacity
|
|
48
|
+
is_hovered
|
|
49
|
+
? region.hover_style?.fill_opacity ?? Math.min(1, (region.fill_opacity ?? 0.3) + 0.4)
|
|
46
50
|
: region.fill_opacity ?? 0.3,
|
|
47
51
|
)
|
|
48
52
|
let effective_fill = $derived(
|
|
@@ -53,6 +57,8 @@
|
|
|
53
57
|
let path_fill = $derived(
|
|
54
58
|
typeof effective_fill === `object` ? `url(#${gradient_id})` : effective_fill,
|
|
55
59
|
)
|
|
60
|
+
// outline drawn only on hover when the user opted in via hover_style.stroke
|
|
61
|
+
let hover_stroke = $derived(is_hovered ? region.hover_style?.stroke : undefined)
|
|
56
62
|
let is_clickable = $derived(Boolean(on_click || region.on_click))
|
|
57
63
|
let cursor_style = $derived(
|
|
58
64
|
region.hover_style?.cursor ?? (is_clickable ? `pointer` : `default`),
|
|
@@ -205,11 +211,16 @@
|
|
|
205
211
|
</defs>
|
|
206
212
|
{/if}
|
|
207
213
|
|
|
208
|
-
<!-- Main fill path
|
|
214
|
+
<!-- Main fill path. On hover the opacity boost (effective_opacity) highlights the area. We do NOT
|
|
215
|
+
stroke by default: a fill-between region is one closed polygon, so stroking traces its whole
|
|
216
|
+
perimeter (both boundaries + the straight closing edges), which looks messy and doesn't follow
|
|
217
|
+
the visible area. Users can still opt into an outline via hover_style.stroke. -->
|
|
209
218
|
<path
|
|
210
219
|
d={tweened_path.current}
|
|
211
220
|
fill={path_fill}
|
|
212
221
|
fill-opacity={effective_opacity}
|
|
222
|
+
stroke={hover_stroke ?? `none`}
|
|
223
|
+
stroke-width={hover_stroke ? region.hover_style?.stroke_width ?? 1.5 : 0}
|
|
213
224
|
/>
|
|
214
225
|
</g>
|
|
215
226
|
|
|
@@ -218,6 +229,6 @@
|
|
|
218
229
|
transition: opacity 0.15s ease;
|
|
219
230
|
}
|
|
220
231
|
.fill-region.hovered {
|
|
221
|
-
filter: brightness(1.1);
|
|
232
|
+
filter: brightness(1.35) saturate(1.2);
|
|
222
233
|
}
|
|
223
234
|
</style>
|
package/dist/plot/{InteractiveAxisLabel.svelte → core/components/InteractiveAxisLabel.svelte}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Spinner from '
|
|
3
|
-
import { sanitize_html } from '
|
|
2
|
+
import Spinner from '../../../feedback/Spinner.svelte'
|
|
3
|
+
import { sanitize_html } from '../../../sanitize'
|
|
4
4
|
import PortalSelect from './PortalSelect.svelte'
|
|
5
|
-
import type { AxisOption } from '
|
|
5
|
+
import type { AxisOption } from '../types'
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
label = ``,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AxisOption } from '
|
|
1
|
+
import type { AxisOption } from '../types';
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
label?: string;
|
|
4
4
|
options?: AxisOption[];
|
|
@@ -9,6 +9,6 @@ type $$ComponentProps = {
|
|
|
9
9
|
on_select?: (key: string) => void;
|
|
10
10
|
[key: string]: unknown;
|
|
11
11
|
};
|
|
12
|
-
declare const InteractiveAxisLabel: import("svelte").Component<$$ComponentProps, {}, "color" | "
|
|
12
|
+
declare const InteractiveAxisLabel: import("svelte").Component<$$ComponentProps, {}, "color" | "loading" | "selected_key">;
|
|
13
13
|
type InteractiveAxisLabel = ReturnType<typeof InteractiveAxisLabel>;
|
|
14
14
|
export default InteractiveAxisLabel;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { Vec2 } from '../../../math'
|
|
3
|
+
import { DEFAULTS } from '../../../settings'
|
|
3
4
|
import { extent, min } from 'd3-array'
|
|
4
5
|
import { interpolatePath } from 'd3-interpolate-path'
|
|
5
6
|
import { curveMonotoneX, line } from 'd3-shape'
|
|
@@ -19,8 +20,8 @@
|
|
|
19
20
|
line_dash = DEFAULTS.scatter.line.dash,
|
|
20
21
|
...rest
|
|
21
22
|
}: Omit<SVGAttributes<SVGPathElement>, `origin` | `points`> & {
|
|
22
|
-
points: readonly [
|
|
23
|
-
origin:
|
|
23
|
+
points: readonly Vec2[]
|
|
24
|
+
origin: Vec2
|
|
24
25
|
line_color?: string
|
|
25
26
|
line_width?: number
|
|
26
27
|
area_color?: string
|
|
@@ -34,12 +35,20 @@
|
|
|
34
35
|
.y((point) => point[1])
|
|
35
36
|
.curve(curveMonotoneX)
|
|
36
37
|
|
|
38
|
+
// Only compute/render/tween the area fill when it is actually visible. Most line
|
|
39
|
+
// plots (e.g. every ScatterPlot line) pass a transparent area, so skipping it
|
|
40
|
+
// avoids a second expensive interpolatePath tween per line.
|
|
41
|
+
let show_area = $derived(
|
|
42
|
+
(Boolean(area_color) && area_color !== `transparent` && area_color !== `none`) ||
|
|
43
|
+
Boolean(area_stroke),
|
|
44
|
+
)
|
|
45
|
+
|
|
37
46
|
let [x_min, x_max] = $derived(extent(points.map((point) => point[0])))
|
|
38
47
|
let line_path = $derived(lineGenerator(points) ?? ``)
|
|
39
48
|
let ymin = $derived(origin[1] ?? min(points.map((point) => point[1])))
|
|
40
49
|
// Guard against NaN/Infinity in area_path coords (can happen during scale transitions)
|
|
41
50
|
let area_path = $derived(
|
|
42
|
-
line_path && isFinite(x_min ?? NaN) && isFinite(x_max ?? NaN) &&
|
|
51
|
+
show_area && line_path && isFinite(x_min ?? NaN) && isFinite(x_max ?? NaN) &&
|
|
43
52
|
isFinite(ymin ?? NaN)
|
|
44
53
|
? `${line_path}L${x_max},${ymin}L${x_min},${ymin}Z`
|
|
45
54
|
: ``,
|
|
@@ -50,32 +59,41 @@
|
|
|
50
59
|
easing: linear,
|
|
51
60
|
interpolate: interpolatePath,
|
|
52
61
|
}
|
|
62
|
+
// Path morphing via interpolatePath is costly (parse + resample + re-serialize
|
|
63
|
+
// every frame, per line). When the tween is disabled (duration <= 0) bind the
|
|
64
|
+
// path directly and skip the Tween entirely for zero per-frame cost.
|
|
65
|
+
let tween_disabled = $derived.by(() => {
|
|
66
|
+
const duration = line_tween.duration ?? default_tween.duration
|
|
67
|
+
return typeof duration === `number` && duration <= 0
|
|
68
|
+
})
|
|
69
|
+
|
|
53
70
|
// Tween objects are stateful - create once, update target via effect
|
|
54
71
|
// untrack() explicitly captures initial tween config (intentional - config set once at mount)
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
)
|
|
59
|
-
const tweened_area = new Tween(
|
|
60
|
-
``,
|
|
61
|
-
untrack(() => ({ ...default_tween, ...line_tween })),
|
|
62
|
-
)
|
|
72
|
+
const tween_opts = untrack(() => ({ ...default_tween, ...line_tween }))
|
|
73
|
+
const tweened_line = new Tween(``, tween_opts)
|
|
74
|
+
const tweened_area = new Tween(``, tween_opts)
|
|
63
75
|
|
|
64
76
|
$effect.pre(() => {
|
|
77
|
+
if (tween_disabled) return // paths bind line_path/area_path directly below
|
|
65
78
|
tweened_line.target = line_path
|
|
66
|
-
tweened_area.target = area_path
|
|
79
|
+
if (show_area) tweened_area.target = area_path
|
|
67
80
|
})
|
|
81
|
+
|
|
82
|
+
let line_d = $derived(tween_disabled ? line_path : tweened_line.current)
|
|
83
|
+
let area_d = $derived(
|
|
84
|
+
show_area ? (tween_disabled ? area_path : tweened_area.current) : ``,
|
|
85
|
+
)
|
|
68
86
|
</script>
|
|
69
87
|
|
|
70
88
|
<path
|
|
71
|
-
d={
|
|
89
|
+
d={line_d}
|
|
72
90
|
stroke={line_color}
|
|
73
91
|
stroke-width={line_width}
|
|
74
92
|
stroke-dasharray={line_dash && line_dash !== `solid` ? line_dash : null}
|
|
75
93
|
fill="none"
|
|
76
94
|
{...rest}
|
|
77
95
|
/>
|
|
78
|
-
<path d={
|
|
96
|
+
<path d={area_d} fill={area_color} stroke={area_stroke} {...rest} />
|
|
79
97
|
|
|
80
98
|
<style>
|
|
81
99
|
path {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { Vec2 } from '../../../math';
|
|
1
2
|
import type { SVGAttributes } from 'svelte/elements';
|
|
2
3
|
import { type TweenOptions } from 'svelte/motion';
|
|
3
4
|
type $$ComponentProps = Omit<SVGAttributes<SVGPathElement>, `origin` | `points`> & {
|
|
4
|
-
points: readonly [
|
|
5
|
-
origin:
|
|
5
|
+
points: readonly Vec2[];
|
|
6
|
+
origin: Vec2;
|
|
6
7
|
line_color?: string;
|
|
7
8
|
line_width?: number;
|
|
8
9
|
area_color?: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { format_value } from '
|
|
2
|
+
import { format_value } from '../../../labels'
|
|
3
|
+
import type { Vec2 } from '../../../math'
|
|
3
4
|
import AxisLabel from './AxisLabel.svelte'
|
|
4
|
-
import type { Sides } from '
|
|
5
|
-
import type { AxisConfig } from '
|
|
6
|
-
import { DEFAULT_GRID_STYLE } from '
|
|
5
|
+
import type { Sides } from '../layout'
|
|
6
|
+
import type { AxisConfig } from '../types'
|
|
7
|
+
import { DEFAULT_GRID_STYLE } from '../types'
|
|
7
8
|
|
|
8
9
|
type Side = `x` | `x2` | `y` | `y2`
|
|
9
10
|
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
show_grid = false,
|
|
22
23
|
show_baseline = true,
|
|
23
24
|
tick_label,
|
|
25
|
+
tick_color,
|
|
24
26
|
domain,
|
|
25
27
|
unit_on_first_tick = false,
|
|
26
28
|
label_x,
|
|
@@ -38,7 +40,8 @@
|
|
|
38
40
|
show_grid?: boolean
|
|
39
41
|
show_baseline?: boolean // axis spine line (ScatterPlot omits it)
|
|
40
42
|
tick_label?: (tick: number) => string | null | undefined // custom/categorical label
|
|
41
|
-
|
|
43
|
+
tick_color?: (tick: number) => string | undefined // per-tick label color (else axis.color)
|
|
44
|
+
domain?: Vec2 // when set, cull off-plot ticks and hide out-of-domain labels
|
|
42
45
|
unit_on_first_tick?: boolean // append axis.unit after the first tick label (ScatterPlot)
|
|
43
46
|
label_x?: number
|
|
44
47
|
label_y?: number
|
|
@@ -136,7 +139,7 @@
|
|
|
136
139
|
y={text_y}
|
|
137
140
|
text-anchor={text_anchor}
|
|
138
141
|
dominant-baseline={text_baseline}
|
|
139
|
-
fill={text_fill}
|
|
142
|
+
fill={tick_color?.(tick) ?? text_fill}
|
|
140
143
|
transform={text_transform}
|
|
141
144
|
>
|
|
142
145
|
{tick_text(tick)}{#if unit_on_first_tick && idx === 0 && axis.unit}‌ {axis
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { Vec2 } from '../../../math';
|
|
2
|
+
import type { Sides } from '../layout';
|
|
3
|
+
import type { AxisConfig } from '../types';
|
|
3
4
|
type Side = `x` | `x2` | `y` | `y2`;
|
|
4
5
|
type $$ComponentProps = {
|
|
5
6
|
side: Side;
|
|
@@ -12,7 +13,8 @@ type $$ComponentProps = {
|
|
|
12
13
|
show_grid?: boolean;
|
|
13
14
|
show_baseline?: boolean;
|
|
14
15
|
tick_label?: (tick: number) => string | null | undefined;
|
|
15
|
-
|
|
16
|
+
tick_color?: (tick: number) => string | undefined;
|
|
17
|
+
domain?: Vec2;
|
|
16
18
|
unit_on_first_tick?: boolean;
|
|
17
19
|
label_x?: number;
|
|
18
20
|
label_y?: number;
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
// NOTE: Axis config objects (x_axis, x2_axis, y_axis, y2_axis) must be reassigned (not mutated)
|
|
3
3
|
// to trigger $bindable reactivity propagation to parent components.
|
|
4
4
|
// Pattern: `x_axis = { ...x_axis, prop: value }` instead of `x_axis.prop = value`
|
|
5
|
-
import SettingsSection from '
|
|
6
|
-
import
|
|
7
|
-
import { DEFAULTS } from '
|
|
5
|
+
import SettingsSection from '../../../layout/SettingsSection.svelte'
|
|
6
|
+
import ControlPane from './ControlPane.svelte'
|
|
7
|
+
import { DEFAULTS } from '../../../settings'
|
|
8
8
|
import { format } from 'd3-format'
|
|
9
9
|
import { timeFormat } from 'd3-time-format'
|
|
10
10
|
import { tooltip } from 'svelte-multiselect/attachments'
|
|
11
|
-
import type { Vec2 } from '
|
|
12
|
-
import type { AxisKey, PlotControlsProps } from '
|
|
13
|
-
import { normalize_y2_sync } from '
|
|
14
|
-
import { get_scale_type_name, is_scale_type_name, is_y2_sync_mode } from '
|
|
11
|
+
import type { Vec2 } from '../../../math'
|
|
12
|
+
import type { AxisKey, PlotControlsProps } from '../types'
|
|
13
|
+
import { normalize_y2_sync } from '../interactions'
|
|
14
|
+
import { get_scale_type_name, is_scale_type_name, is_y2_sync_mode } from '../types'
|
|
15
15
|
|
|
16
16
|
let {
|
|
17
17
|
show_controls = $bindable(false),
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
has_y2_points = false,
|
|
32
32
|
show_ticks = false,
|
|
33
33
|
controls_title = `plot`,
|
|
34
|
-
controls_class =
|
|
34
|
+
controls_class = `plot`,
|
|
35
35
|
toggle_props = {},
|
|
36
36
|
pane_props = {},
|
|
37
37
|
}: PlotControlsProps = $props()
|
|
@@ -80,10 +80,9 @@
|
|
|
80
80
|
if (format_string.startsWith(`%`)) {
|
|
81
81
|
timeFormat(format_string)(new Date())
|
|
82
82
|
return true
|
|
83
|
-
} else {
|
|
84
|
-
format(format_string)(123.456)
|
|
85
|
-
return true
|
|
86
83
|
}
|
|
84
|
+
format(format_string)(123.456)
|
|
85
|
+
return true
|
|
87
86
|
} catch {
|
|
88
87
|
return false
|
|
89
88
|
}
|
|
@@ -148,23 +147,12 @@
|
|
|
148
147
|
</script>
|
|
149
148
|
|
|
150
149
|
{#if show_controls}
|
|
151
|
-
<
|
|
152
|
-
bind:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
toggle_props
|
|
156
|
-
|
|
157
|
-
...toggle_props,
|
|
158
|
-
class: `${controls_class}-controls-toggle ${toggle_props?.class ?? ``}`,
|
|
159
|
-
style:
|
|
160
|
-
`position: absolute; top: var(--ctrl-btn-top, 5pt); right: var(--ctrl-btn-right, 1ex);` +
|
|
161
|
-
(toggle_props?.style ?? ``),
|
|
162
|
-
}}
|
|
163
|
-
pane_props={{
|
|
164
|
-
...pane_props,
|
|
165
|
-
class: `${controls_class}-controls-pane ${pane_props?.class ?? ``}`,
|
|
166
|
-
style: `--pane-padding: 12px; --pane-gap: 4px; ${pane_props?.style ?? ``}`,
|
|
167
|
-
}}
|
|
150
|
+
<ControlPane
|
|
151
|
+
bind:controls_open
|
|
152
|
+
controls_class={controls_class}
|
|
153
|
+
title={controls_title}
|
|
154
|
+
{toggle_props}
|
|
155
|
+
{pane_props}
|
|
168
156
|
>
|
|
169
157
|
{@render children?.(ctrl_state)}
|
|
170
158
|
|
|
@@ -533,5 +521,5 @@
|
|
|
533
521
|
|
|
534
522
|
<!-- Custom controls after base controls -->
|
|
535
523
|
{@render post_children?.(ctrl_state)}
|
|
536
|
-
</
|
|
524
|
+
</ControlPane>
|
|
537
525
|
{/if}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PlotControlsProps } from '../types';
|
|
2
|
+
declare const PlotControls: import("svelte").Component<PlotControlsProps, {}, "display" | "show_controls" | "x2_axis" | "y_axis" | "y2_axis" | "controls_open" | "x_axis">;
|
|
3
|
+
type PlotControls = ReturnType<typeof PlotControls>;
|
|
4
|
+
export default PlotControls;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { add_alpha } from '../../../colors'
|
|
3
|
+
import type { LegendItem, Orientation } from '../..'
|
|
4
|
+
import { unique_id } from '../utils'
|
|
5
|
+
import { sanitize_html } from '../../../sanitize'
|
|
6
|
+
import { strip_html } from '../../../table'
|
|
5
7
|
import { onDestroy } from 'svelte'
|
|
6
8
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
7
9
|
import { SvelteMap, SvelteSet } from 'svelte/reactivity'
|
|
8
10
|
|
|
9
11
|
// Unique instance ID to prevent gradient ID collisions when multiple legends render on the same page
|
|
10
|
-
const instance_id =
|
|
12
|
+
const instance_id = unique_id()
|
|
11
13
|
|
|
12
14
|
let {
|
|
13
15
|
series_data = [],
|
|
@@ -28,6 +30,7 @@
|
|
|
28
30
|
on_hover_change,
|
|
29
31
|
on_item_hover,
|
|
30
32
|
active_series_idx = null,
|
|
33
|
+
active_fill_idx = null,
|
|
31
34
|
filterable = true,
|
|
32
35
|
filter_threshold = 12,
|
|
33
36
|
draggable = true,
|
|
@@ -58,8 +61,9 @@
|
|
|
58
61
|
on_drag_end?: (event: MouseEvent) => void
|
|
59
62
|
// Callback when hover state changes (for placement stability)
|
|
60
63
|
on_hover_change?: (is_hovered: boolean) => void
|
|
61
|
-
on_item_hover?: (
|
|
64
|
+
on_item_hover?: (item: LegendItem | null) => void
|
|
62
65
|
active_series_idx?: number | null
|
|
66
|
+
active_fill_idx?: number | null // highlight the fill legend item with this fill_idx
|
|
63
67
|
filterable?: boolean
|
|
64
68
|
filter_threshold?: number
|
|
65
69
|
draggable?: boolean
|
|
@@ -214,10 +218,13 @@
|
|
|
214
218
|
|
|
215
219
|
{#snippet legend_item(series: LegendItem, indent: boolean = false)}
|
|
216
220
|
{@const is_fill_item = series.item_type === `fill`}
|
|
221
|
+
{@const is_active = is_fill_item
|
|
222
|
+
? active_fill_idx === series.fill_idx
|
|
223
|
+
: active_series_idx === series.series_idx}
|
|
217
224
|
<div
|
|
218
225
|
class="legend-item"
|
|
219
226
|
class:hidden={!series.visible}
|
|
220
|
-
class:active={
|
|
227
|
+
class:active={is_active}
|
|
221
228
|
class:indented={indent}
|
|
222
229
|
class:fill-item={is_fill_item}
|
|
223
230
|
style={item_style}
|
|
@@ -237,9 +244,9 @@
|
|
|
237
244
|
toggle_item(series)
|
|
238
245
|
}
|
|
239
246
|
}}
|
|
240
|
-
onmouseenter={() => on_item_hover?.(series
|
|
247
|
+
onmouseenter={() => on_item_hover?.(series)}
|
|
241
248
|
onmouseleave={() => on_item_hover?.(null)}
|
|
242
|
-
onfocus={() => on_item_hover?.(series
|
|
249
|
+
onfocus={() => on_item_hover?.(series)}
|
|
243
250
|
onblur={() => on_item_hover?.(null)}
|
|
244
251
|
role="button"
|
|
245
252
|
tabindex="0"
|
|
@@ -286,8 +293,8 @@
|
|
|
286
293
|
rx="2"
|
|
287
294
|
fill={gradient
|
|
288
295
|
? `url(#${gradient_id})`
|
|
289
|
-
: (series.display_style.fill_color ?? `steelblue
|
|
290
|
-
fill-opacity=
|
|
296
|
+
: add_alpha(series.display_style.fill_color ?? `steelblue`, 1)}
|
|
297
|
+
fill-opacity="0.7"
|
|
291
298
|
stroke={series.display_style.edge_color ?? `none`}
|
|
292
299
|
stroke-width="1"
|
|
293
300
|
/>
|
|
@@ -454,6 +461,10 @@
|
|
|
454
461
|
font-size: var(--plot-legend-font-size, 0.8em);
|
|
455
462
|
max-width: var(--plot-legend-max-width);
|
|
456
463
|
width: fit-content;
|
|
464
|
+
/* cap height so legends with many series don't overflow the plot; scroll the rest.
|
|
465
|
+
% resolves against the (position: relative) plot wrapper's height. */
|
|
466
|
+
max-height: var(--plot-legend-max-height, 80%);
|
|
467
|
+
overflow-y: auto;
|
|
457
468
|
z-index: var(--plot-legend-z-index, 2);
|
|
458
469
|
box-sizing: border-box;
|
|
459
470
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LegendItem, Orientation } from '
|
|
1
|
+
import type { LegendItem, Orientation } from '../..';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `style`> & {
|
|
4
4
|
series_data: LegendItem[];
|
|
@@ -17,8 +17,9 @@ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `style`> & {
|
|
|
17
17
|
on_drag?: (event: MouseEvent) => void;
|
|
18
18
|
on_drag_end?: (event: MouseEvent) => void;
|
|
19
19
|
on_hover_change?: (is_hovered: boolean) => void;
|
|
20
|
-
on_item_hover?: (
|
|
20
|
+
on_item_hover?: (item: LegendItem | null) => void;
|
|
21
21
|
active_series_idx?: number | null;
|
|
22
|
+
active_fill_idx?: number | null;
|
|
22
23
|
filterable?: boolean;
|
|
23
24
|
filter_threshold?: number;
|
|
24
25
|
draggable?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { luminance } from '
|
|
2
|
+
import { luminance } from '../../../colors'
|
|
3
|
+
import { constrain_tooltip_position } from '../layout'
|
|
3
4
|
import type { Snippet } from 'svelte'
|
|
4
5
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
5
6
|
|
|
@@ -9,6 +10,8 @@
|
|
|
9
10
|
bg_color,
|
|
10
11
|
offset = { x: 6, y: 0 },
|
|
11
12
|
fixed = false,
|
|
13
|
+
constrain_to,
|
|
14
|
+
fallback_size,
|
|
12
15
|
wrapper = $bindable(),
|
|
13
16
|
children,
|
|
14
17
|
...rest
|
|
@@ -18,6 +21,8 @@
|
|
|
18
21
|
bg_color?: string | null
|
|
19
22
|
offset?: { x: number; y: number }
|
|
20
23
|
fixed?: boolean // Use position: fixed (for viewport coords) vs absolute
|
|
24
|
+
constrain_to?: { width: number; height: number } // flip/clamp within these bounds (offset consumed by constraining)
|
|
25
|
+
fallback_size?: { width: number; height: number } // size estimate before first measure
|
|
21
26
|
wrapper?: HTMLDivElement // Bindable reference for measuring tooltip size
|
|
22
27
|
children: Snippet
|
|
23
28
|
} = $props()
|
|
@@ -29,6 +34,17 @@
|
|
|
29
34
|
|
|
30
35
|
// For fixed positioning (viewport coords), flip to opposite side when near viewport edges
|
|
31
36
|
const pos = $derived.by(() => {
|
|
37
|
+
if (constrain_to) {
|
|
38
|
+
return constrain_tooltip_position(
|
|
39
|
+
x,
|
|
40
|
+
y,
|
|
41
|
+
wrapper?.offsetWidth ?? fallback_size?.width ?? 0,
|
|
42
|
+
wrapper?.offsetHeight ?? fallback_size?.height ?? 0,
|
|
43
|
+
constrain_to.width,
|
|
44
|
+
constrain_to.height,
|
|
45
|
+
{ offset_x: offset.x, offset_y: offset.y },
|
|
46
|
+
)
|
|
47
|
+
}
|
|
32
48
|
const raw_x = x + offset.x
|
|
33
49
|
const raw_y = y + offset.y
|
|
34
50
|
if (!fixed) return { x: raw_x, y: raw_y }
|
|
@@ -9,6 +9,14 @@ type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
9
9
|
y: number;
|
|
10
10
|
};
|
|
11
11
|
fixed?: boolean;
|
|
12
|
+
constrain_to?: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
fallback_size?: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
};
|
|
12
20
|
wrapper?: HTMLDivElement;
|
|
13
21
|
children: Snippet;
|
|
14
22
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<script lang="ts">
|
|
7
|
-
import { sanitize_html } from '
|
|
7
|
+
import { sanitize_html } from '../../../sanitize'
|
|
8
8
|
import type { HTMLButtonAttributes } from 'svelte/elements'
|
|
9
9
|
|
|
10
10
|
type Option = { key: string; label: string; unit?: string }
|
|
@@ -115,12 +115,12 @@
|
|
|
115
115
|
btn.setAttribute(`aria-selected`, `true`)
|
|
116
116
|
selected_btn = btn
|
|
117
117
|
}
|
|
118
|
-
li.
|
|
119
|
-
ul.
|
|
118
|
+
li.append(btn)
|
|
119
|
+
ul.append(li)
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
portal_el.
|
|
123
|
-
document.body.
|
|
122
|
+
portal_el.append(ul)
|
|
123
|
+
document.body.append(portal_el)
|
|
124
124
|
update_position()
|
|
125
125
|
dropdown_open = true
|
|
126
126
|
active_close_fn = close_dropdown
|
|
@@ -181,8 +181,8 @@
|
|
|
181
181
|
buttons[(idx + 1) % len]?.focus()
|
|
182
182
|
} else if (evt.key === `ArrowUp`) {
|
|
183
183
|
evt.preventDefault()
|
|
184
|
-
buttons[idx
|
|
185
|
-
} else if (evt.key === `Enter` && idx
|
|
184
|
+
buttons[idx === -1 ? len - 1 : (idx - 1 + len) % len]?.focus()
|
|
185
|
+
} else if (evt.key === `Enter` && idx !== -1) {
|
|
186
186
|
evt.preventDefault()
|
|
187
187
|
buttons[idx].click()
|
|
188
188
|
}
|
|
@@ -223,6 +223,8 @@
|
|
|
223
223
|
border-radius: 3px;
|
|
224
224
|
padding: 2px 4px;
|
|
225
225
|
font: inherit;
|
|
226
|
+
/* hug the text: `font: inherit` pulls in the page's loose line-height, inflating the hover bg */
|
|
227
|
+
line-height: 1.2;
|
|
226
228
|
color: inherit;
|
|
227
229
|
cursor: pointer;
|
|
228
230
|
}
|
|
@@ -235,6 +237,8 @@
|
|
|
235
237
|
}
|
|
236
238
|
.arrow {
|
|
237
239
|
font-size: 1.4em;
|
|
240
|
+
/* keep the larger glyph from inflating the trigger height (and thus the hover bg) */
|
|
241
|
+
line-height: 1;
|
|
238
242
|
opacity: 0.8;
|
|
239
243
|
}
|
|
240
244
|
.portal-select-trigger :global(:is(sub, sup)) {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import {
|
|
4
4
|
calculate_annotation_position,
|
|
5
5
|
resolve_line_endpoints,
|
|
6
|
-
} from '
|
|
7
|
-
import type { RefLine, RefLineEvent, RefLineStyle } from '
|
|
8
|
-
import { REF_LINE_STYLE_DEFAULTS } from '
|
|
6
|
+
} from '../reference-line'
|
|
7
|
+
import type { RefLine, RefLineEvent, RefLineStyle } from '../types'
|
|
8
|
+
import { REF_LINE_STYLE_DEFAULTS } from '../types'
|
|
9
9
|
|
|
10
10
|
let {
|
|
11
11
|
ref_line,
|