matterviz 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EmptyState.svelte +10 -4
- package/dist/FilePicker.svelte +48 -60
- package/dist/Icon.svelte +7 -4
- package/dist/MillerIndexInput.svelte +2 -2
- package/dist/api/optimade.js +10 -7
- package/dist/app.css +68 -0
- package/dist/brillouin/BrillouinZone.svelte +90 -91
- package/dist/brillouin/BrillouinZone.svelte.d.ts +5 -7
- package/dist/brillouin/BrillouinZoneControls.svelte +3 -6
- package/dist/brillouin/BrillouinZoneExportPane.svelte +18 -14
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +6 -10
- package/dist/brillouin/BrillouinZoneScene.svelte +46 -68
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +1 -1
- package/dist/brillouin/compute.js +10 -16
- package/dist/brillouin/geometry.js +2 -2
- package/dist/chempot-diagram/ChemPotDiagram.svelte +48 -50
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +61 -169
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +559 -755
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +1 -1
- package/dist/chempot-diagram/async-compute.svelte.js +13 -14
- package/dist/chempot-diagram/color.d.ts +21 -1
- package/dist/chempot-diagram/color.js +70 -1
- package/dist/chempot-diagram/compute.d.ts +7 -0
- package/dist/chempot-diagram/compute.js +85 -26
- package/dist/chempot-diagram/controls-state.svelte.js +1 -1
- package/dist/chempot-diagram/export.js +1 -6
- package/dist/chempot-diagram/temperature.js +9 -10
- package/dist/colors/index.d.ts +0 -4
- package/dist/colors/index.js +19 -20
- package/dist/composition/BarChart.svelte +30 -26
- package/dist/composition/BubbleChart.svelte +17 -17
- package/dist/composition/Composition.svelte +10 -19
- package/dist/composition/Formula.svelte +20 -27
- package/dist/composition/FormulaFilter.svelte +115 -184
- package/dist/composition/PieChart.svelte +55 -41
- package/dist/composition/format.js +7 -9
- package/dist/composition/index.d.ts +2 -0
- package/dist/composition/index.js +14 -0
- package/dist/composition/parse.d.ts +2 -2
- package/dist/composition/parse.js +61 -115
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +17 -26
- package/dist/convex-hull/ConvexHull.svelte +12 -15
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull2D.svelte +93 -94
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +127 -186
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +131 -180
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +36 -40
- package/dist/convex-hull/ConvexHullControls.svelte +46 -48
- package/dist/convex-hull/ConvexHullStats.svelte +193 -195
- package/dist/convex-hull/ConvexHullTooltip.svelte +5 -12
- package/dist/convex-hull/GasPressureControls.svelte +5 -12
- package/dist/convex-hull/StructurePopup.svelte +18 -22
- package/dist/convex-hull/StructurePopup.svelte.d.ts +2 -0
- package/dist/convex-hull/TemperatureSlider.svelte +4 -10
- package/dist/convex-hull/canvas-interactions.svelte.js +2 -1
- package/dist/convex-hull/gas-thermodynamics.js +21 -53
- package/dist/convex-hull/helpers.d.ts +8 -10
- package/dist/convex-hull/helpers.js +37 -43
- package/dist/convex-hull/hull-state.svelte.d.ts +1 -1
- package/dist/convex-hull/thermodynamics.js +37 -44
- package/dist/coordination/CoordinationBarPlot.svelte +49 -53
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
- package/dist/coordination/calc-coordination.d.ts +1 -1
- package/dist/coordination/calc-coordination.js +28 -25
- package/dist/element/BohrAtom.svelte +5 -9
- package/dist/element/ElementHeading.svelte +4 -1
- package/dist/element/ElementPhoto.svelte +11 -9
- package/dist/element/ElementStats.svelte +12 -10
- package/dist/element/ElementTile.svelte +44 -67
- package/dist/element/Nucleus.svelte +4 -2
- package/dist/element/data.d.ts +3 -2
- package/dist/element/data.js +5 -1
- package/dist/element/helpers.d.ts +4 -0
- package/dist/element/helpers.js +18 -0
- package/dist/element/index.d.ts +2 -5
- package/dist/element/index.js +4 -19
- package/dist/feedback/DragOverlay.svelte +5 -5
- package/dist/feedback/DragOverlay.svelte.d.ts +2 -2
- package/dist/feedback/StatusMessage.svelte +7 -4
- package/dist/fermi-surface/FermiSlice.svelte +21 -18
- package/dist/fermi-surface/FermiSurface.svelte +35 -44
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +7 -13
- package/dist/fermi-surface/FermiSurfaceControls.svelte +6 -20
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +64 -136
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +9 -6
- package/dist/fermi-surface/compute.js +25 -58
- package/dist/fermi-surface/parse.js +54 -88
- package/dist/file-viewer/JsonBrowser.svelte +1043 -0
- package/dist/file-viewer/JsonBrowser.svelte.d.ts +9 -0
- package/dist/file-viewer/PlotPanel.svelte +350 -0
- package/dist/file-viewer/PlotPanel.svelte.d.ts +9 -0
- package/dist/file-viewer/TrajectoryWithDos.svelte +30 -0
- package/dist/file-viewer/TrajectoryWithDos.svelte.d.ts +10 -0
- package/dist/file-viewer/detect.d.ts +11 -0
- package/dist/file-viewer/detect.js +381 -0
- package/dist/file-viewer/eligibility.d.ts +4 -0
- package/dist/file-viewer/eligibility.js +53 -0
- package/dist/file-viewer/host-protocol.d.ts +50 -0
- package/dist/file-viewer/host-transfer.d.ts +25 -0
- package/dist/file-viewer/host-transfer.js +42 -0
- package/dist/file-viewer/index.d.ts +5 -0
- package/dist/file-viewer/index.js +5 -0
- package/dist/file-viewer/main.d.ts +44 -0
- package/dist/file-viewer/main.js +535 -0
- package/dist/file-viewer/parse.d.ts +9 -0
- package/dist/file-viewer/parse.js +170 -0
- package/dist/file-viewer/plot-utils.d.ts +24 -0
- package/dist/file-viewer/plot-utils.js +191 -0
- package/dist/file-viewer/types.d.ts +4 -0
- package/dist/file-viewer/types.js +5 -0
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +153 -219
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +2 -2
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +9 -7
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +1 -1
- package/dist/heatmap-matrix/index.d.ts +5 -0
- package/dist/icons.d.ts +4 -0
- package/dist/icons.js +4 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/io/ExportPane.svelte +11 -7
- package/dist/io/decompress.d.ts +4 -1
- package/dist/io/decompress.js +24 -36
- package/dist/io/export.d.ts +11 -4
- package/dist/io/export.js +75 -19
- package/dist/io/fetch.d.ts +0 -3
- package/dist/io/fetch.js +0 -11
- package/dist/io/file-drop.js +60 -35
- package/dist/io/index.d.ts +0 -1
- package/dist/io/index.js +2 -9
- package/dist/io/is-binary.d.ts +9 -0
- package/dist/io/is-binary.js +45 -1
- package/dist/io/url-drop.d.ts +2 -0
- package/dist/io/url-drop.js +40 -40
- package/dist/isosurface/Isosurface.svelte +700 -215
- package/dist/isosurface/Isosurface.svelte.d.ts +7 -1
- package/dist/isosurface/IsosurfaceControls.svelte +590 -116
- package/dist/isosurface/IsosurfaceControls.svelte.d.ts +1 -1
- package/dist/isosurface/VolumeSlice.svelte +224 -0
- package/dist/isosurface/VolumeSlice.svelte.d.ts +28 -0
- package/dist/isosurface/coloring.d.ts +20 -0
- package/dist/isosurface/coloring.js +118 -0
- package/dist/isosurface/geometry-worker-types.d.ts +38 -0
- package/dist/isosurface/geometry.worker.d.ts +1 -0
- package/dist/isosurface/geometry.worker.js +59 -0
- package/dist/isosurface/grid.d.ts +10 -0
- package/dist/isosurface/grid.js +31 -0
- package/dist/isosurface/index.d.ts +4 -0
- package/dist/isosurface/index.js +4 -0
- package/dist/isosurface/parse-vaspwave.d.ts +3 -0
- package/dist/isosurface/parse-vaspwave.js +138 -0
- package/dist/isosurface/parse.js +6 -6
- package/dist/isosurface/profile.d.ts +12 -0
- package/dist/isosurface/profile.js +19 -0
- package/dist/isosurface/sampling.d.ts +34 -0
- package/dist/isosurface/sampling.js +408 -0
- package/dist/isosurface/slice-rendering.d.ts +13 -0
- package/dist/isosurface/slice-rendering.js +79 -0
- package/dist/isosurface/slice.d.ts +22 -2
- package/dist/isosurface/slice.js +200 -116
- package/dist/isosurface/types.d.ts +24 -1
- package/dist/isosurface/types.js +120 -8
- package/dist/json-path.d.ts +4 -0
- package/dist/json-path.js +89 -0
- package/dist/labels.d.ts +6 -2
- package/dist/labels.js +44 -14
- package/dist/layout/FullscreenButton.svelte +2 -1
- package/dist/layout/FullscreenToggle.svelte +10 -4
- package/dist/layout/InfoCard.svelte +8 -21
- package/dist/layout/InfoTag.svelte +1 -3
- package/dist/layout/NumberRangeInput.svelte +46 -0
- package/dist/layout/NumberRangeInput.svelte.d.ts +12 -0
- package/dist/layout/PropertyFilter.svelte +2 -6
- package/dist/layout/SettingsSection.svelte +57 -62
- package/dist/layout/SettingsSection.svelte.d.ts +6 -7
- package/dist/layout/SubpageGrid.svelte +3 -1
- package/dist/layout/ViewerChrome.svelte +16 -11
- package/dist/layout/ViewerChrome.svelte.d.ts +2 -1
- package/dist/layout/fullscreen.js +3 -5
- package/dist/layout/fullscreen.svelte.js +1 -2
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.js +1 -0
- package/dist/layout/json-tree/JsonNode.svelte +22 -59
- package/dist/layout/json-tree/JsonTree.svelte +101 -172
- package/dist/layout/json-tree/JsonValue.svelte +9 -32
- package/dist/layout/json-tree/utils.d.ts +0 -3
- package/dist/layout/json-tree/utils.js +50 -188
- package/dist/marching-cubes.d.ts +8 -1
- package/dist/marching-cubes.js +115 -48
- package/dist/math.d.ts +5 -2
- package/dist/math.js +48 -38
- package/dist/overlays/ContextMenu.svelte +19 -34
- package/dist/overlays/CopyButton.svelte +11 -5
- package/dist/overlays/DragControlTab.svelte +6 -1
- package/dist/overlays/DraggablePane.svelte +110 -74
- package/dist/overlays/DraggablePane.svelte.d.ts +2 -1
- package/dist/overlays/GlassChip.svelte +32 -0
- package/dist/overlays/GlassChip.svelte.d.ts +8 -0
- package/dist/overlays/InfoPaneCards.svelte +11 -23
- package/dist/overlays/index.d.ts +7 -0
- package/dist/overlays/index.js +26 -0
- package/dist/overlays/portal.d.ts +2 -0
- package/dist/overlays/portal.js +14 -0
- package/dist/periodic-table/PeriodicTable.svelte +113 -145
- package/dist/periodic-table/PeriodicTable.svelte.d.ts +5 -3
- package/dist/periodic-table/PeriodicTableControls.svelte +37 -115
- package/dist/periodic-table/TableInset.svelte +9 -4
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +68 -105
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +6 -8
- package/dist/phase-diagram/PhaseDiagramControls.svelte +70 -94
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +2 -1
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +12 -12
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +54 -58
- package/dist/phase-diagram/TdbInfoPanel.svelte +21 -15
- package/dist/phase-diagram/build-diagram.js +4 -9
- package/dist/phase-diagram/diagram-input.d.ts +1 -2
- package/dist/phase-diagram/parse.js +15 -15
- package/dist/phase-diagram/svg-to-diagram.js +28 -27
- package/dist/phase-diagram/utils.js +2 -3
- package/dist/plot/bar/BarPlot.svelte +461 -426
- package/dist/plot/bar/BarPlot.svelte.d.ts +2 -0
- package/dist/plot/bar/BarPlotControls.svelte +1 -3
- package/dist/plot/bar/BarPlotControls.svelte.d.ts +4 -6
- package/dist/plot/bar/SpacegroupBarPlot.svelte +46 -77
- package/dist/plot/bar/data.d.ts +5 -4
- package/dist/plot/bar/data.js +2 -1
- package/dist/plot/box/BoxPlot.svelte +322 -226
- package/dist/plot/box/BoxPlot.svelte.d.ts +2 -0
- package/dist/plot/box/Violin.svelte.d.ts +1 -0
- package/dist/plot/box/box-plot.js +1 -1
- package/dist/plot/core/auto-place.d.ts +1 -1
- package/dist/plot/core/auto-place.js +2 -2
- package/dist/plot/core/axis-utils.d.ts +12 -7
- package/dist/plot/core/axis-utils.js +48 -48
- package/dist/plot/core/components/AxisLabel.svelte +82 -20
- package/dist/plot/core/components/AxisLabel.svelte.d.ts +1 -0
- package/dist/plot/core/components/ColorBar.svelte +101 -106
- package/dist/plot/core/components/ColorScaleSelect.svelte +1 -1
- package/dist/plot/core/components/FillArea.svelte +10 -17
- package/dist/plot/core/components/HierarchyControls.svelte +249 -0
- package/dist/plot/{sunburst/SunburstControls.svelte.d.ts → core/components/HierarchyControls.svelte.d.ts} +12 -8
- package/dist/plot/core/components/InteractiveAxisLabel.svelte +1 -1
- package/dist/plot/core/components/InteractiveAxisLabel.svelte.d.ts +1 -1
- package/dist/plot/core/components/Line.svelte +18 -9
- package/dist/plot/core/components/Line.svelte.d.ts +2 -0
- package/dist/plot/core/components/PlotAxis.svelte +40 -17
- package/dist/plot/core/components/PlotControls.svelte +65 -41
- package/dist/plot/core/components/PlotLegend.svelte +31 -35
- package/dist/plot/core/components/PlotMarginals.svelte +616 -0
- package/dist/plot/core/components/PlotMarginals.svelte.d.ts +15 -0
- package/dist/plot/core/components/PlotTooltip.svelte +1 -1
- package/dist/plot/core/components/PortalSelect.svelte +4 -8
- package/dist/plot/core/components/ReferenceLine.svelte +27 -24
- package/dist/plot/core/components/ReferenceLine3D.svelte +54 -57
- package/dist/plot/core/components/ReferencePlane.svelte +7 -8
- package/dist/plot/core/components/ZeroLines.svelte +4 -8
- package/dist/plot/core/components/ZoomRect.svelte +1 -2
- package/dist/plot/core/components/index.d.ts +1 -0
- package/dist/plot/core/components/index.js +1 -0
- package/dist/plot/core/data-cleaning-signal.d.ts +46 -0
- package/dist/plot/core/data-cleaning-signal.js +467 -0
- package/dist/plot/core/data-cleaning.d.ts +2 -42
- package/dist/plot/core/data-cleaning.js +27 -474
- package/dist/plot/core/data-transform.d.ts +1 -2
- package/dist/plot/core/data-transform.js +9 -15
- package/dist/plot/core/fill-utils.d.ts +3 -1
- package/dist/plot/core/fill-utils.js +28 -6
- package/dist/plot/core/index.d.ts +1 -0
- package/dist/plot/core/index.js +1 -0
- package/dist/plot/core/interactions.js +0 -2
- package/dist/plot/core/layout.d.ts +15 -6
- package/dist/plot/core/layout.js +57 -38
- package/dist/plot/core/marginals.d.ts +170 -0
- package/dist/plot/core/marginals.js +436 -0
- package/dist/plot/core/pan-zoom.svelte.d.ts +2 -4
- package/dist/plot/core/pan-zoom.svelte.js +34 -17
- package/dist/plot/core/placed-tween.svelte.d.ts +3 -0
- package/dist/plot/core/placed-tween.svelte.js +68 -21
- package/dist/plot/core/reference-line.js +1 -1
- package/dist/plot/core/scales.d.ts +23 -0
- package/dist/plot/core/scales.js +39 -13
- package/dist/plot/core/svg.js +0 -1
- package/dist/plot/core/types/fills.d.ts +101 -0
- package/dist/plot/core/types/fills.js +15 -0
- package/dist/plot/core/types/plot-3d.d.ts +87 -0
- package/dist/plot/core/types/plot-3d.js +4 -0
- package/dist/plot/core/types/reference-lines.d.ts +140 -0
- package/dist/plot/core/types/reference-lines.js +9 -0
- package/dist/plot/core/types.d.ts +29 -324
- package/dist/plot/core/types.js +23 -20
- package/dist/plot/core/utils/hierarchy-chart.d.ts +52 -0
- package/dist/plot/core/utils/hierarchy-chart.js +191 -0
- package/dist/plot/core/utils/hierarchy-labels.d.ts +20 -0
- package/dist/plot/core/utils/hierarchy-labels.js +100 -0
- package/dist/plot/core/utils/label-placement.js +2 -2
- package/dist/plot/histogram/Histogram.svelte +314 -340
- package/dist/plot/histogram/Histogram.svelte.d.ts +7 -7
- package/dist/plot/histogram/HistogramControls.svelte +30 -28
- package/dist/plot/histogram/histogram.d.ts +31 -0
- package/dist/plot/histogram/histogram.js +70 -0
- package/dist/plot/histogram/index.d.ts +1 -0
- package/dist/plot/histogram/index.js +1 -0
- package/dist/plot/index.d.ts +1 -0
- package/dist/plot/index.js +1 -0
- package/dist/plot/sankey/Sankey.svelte +78 -69
- package/dist/plot/sankey/Sankey.svelte.d.ts +2 -2
- package/dist/plot/sankey/SankeyControls.svelte +22 -16
- package/dist/plot/sankey/sankey.js +13 -9
- package/dist/plot/scatter/BinnedScatterPlot.svelte +311 -141
- package/dist/plot/scatter/BinnedScatterPlot.svelte.d.ts +7 -0
- package/dist/plot/scatter/ElementScatter.svelte +4 -1
- package/dist/plot/scatter/ScatterPlot.svelte +517 -410
- package/dist/plot/scatter/ScatterPlot.svelte.d.ts +2 -0
- package/dist/plot/scatter/ScatterPlotControls.svelte +18 -19
- package/dist/plot/scatter/ScatterPlotControls.svelte.d.ts +1 -1
- package/dist/plot/scatter/ScatterPoint.svelte +16 -9
- package/dist/plot/scatter/adaptive-density.d.ts +1 -1
- package/dist/plot/scatter/adaptive-density.js +36 -20
- package/dist/plot/scatter/binned-scatter-types.d.ts +3 -2
- package/dist/plot/scatter/binned-scatter-types.js +6 -1
- package/dist/plot/scatter/scatter-data.d.ts +1 -1
- package/dist/plot/scatter/scatter-data.js +8 -7
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte +25 -34
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte.d.ts +2 -2
- package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte +8 -5
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte +113 -116
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte.d.ts +2 -2
- package/dist/plot/scatter-3d/Surface3D.svelte +4 -13
- package/dist/plot/sunburst/Sunburst.svelte +269 -347
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +2 -2
- package/dist/plot/sunburst/index.d.ts +1 -1
- package/dist/plot/sunburst/index.js +2 -1
- package/dist/plot/sunburst/render.d.ts +2 -2
- package/dist/plot/sunburst/render.js +47 -22
- package/dist/plot/sunburst/sunburst.d.ts +5 -1
- package/dist/plot/sunburst/sunburst.js +10 -3
- package/dist/plot/treemap/Treemap.svelte +1022 -0
- package/dist/plot/treemap/Treemap.svelte.d.ts +90 -0
- package/dist/plot/treemap/index.d.ts +4 -0
- package/dist/plot/treemap/index.js +4 -0
- package/dist/plot/treemap/labels.d.ts +38 -0
- package/dist/plot/treemap/labels.js +80 -0
- package/dist/plot/treemap/treemap.d.ts +28 -0
- package/dist/plot/treemap/treemap.js +102 -0
- package/dist/rdf/RdfPlot.svelte +37 -59
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/calc-rdf.js +63 -52
- package/dist/rdf/index.d.ts +0 -1
- package/dist/sanitize.js +85 -27
- package/dist/scene/SceneCamera.svelte +1 -1
- package/dist/scene/SceneCamera.svelte.d.ts +1 -1
- package/dist/scene/bind-renderer.svelte.js +14 -6
- package/dist/scene/index.d.ts +1 -2
- package/dist/scene/index.js +1 -1
- package/dist/scene/{props.js → props.svelte.js} +15 -1
- package/dist/settings.d.ts +19 -9
- package/dist/settings.js +229 -525
- package/dist/spectral/Bands.svelte +207 -221
- package/dist/spectral/BandsAndDos.svelte +11 -9
- package/dist/spectral/BrillouinBandsDos.svelte +19 -42
- package/dist/spectral/Dos.svelte +92 -93
- package/dist/spectral/helpers.d.ts +3 -3
- package/dist/spectral/helpers.js +65 -140
- package/dist/state.svelte.js +5 -18
- package/dist/structure/Arrow.svelte +5 -18
- package/dist/structure/ArrowInstances.svelte +160 -0
- package/dist/structure/ArrowInstances.svelte.d.ts +16 -0
- package/dist/structure/AtomLegend.svelte +120 -85
- package/dist/structure/AtomLegend.svelte.d.ts +2 -3
- package/dist/structure/Bond.svelte +31 -23
- package/dist/structure/CanvasTooltip.svelte +15 -3
- package/dist/structure/CellSelect.svelte +45 -35
- package/dist/structure/Cylinder.svelte +24 -40
- package/dist/structure/InstancedAtoms.svelte +114 -0
- package/dist/structure/InstancedAtoms.svelte.d.ts +15 -0
- package/dist/structure/Lattice.svelte +85 -149
- package/dist/structure/SiteLabels.svelte +122 -0
- package/dist/structure/SiteLabels.svelte.d.ts +18 -0
- package/dist/structure/Structure.svelte +636 -504
- package/dist/structure/Structure.svelte.d.ts +4 -2
- package/dist/structure/StructureCarousel.svelte +637 -0
- package/dist/structure/StructureCarousel.svelte.d.ts +19 -0
- package/dist/structure/StructureControls.svelte +165 -425
- package/dist/structure/StructureControls.svelte.d.ts +1 -1
- package/dist/structure/StructureExportPane.svelte +17 -21
- package/dist/structure/StructureInfoPane.svelte +128 -133
- package/dist/structure/StructureInfoPane.svelte.d.ts +1 -1
- package/dist/structure/StructureScene.svelte +535 -578
- package/dist/structure/StructureScene.svelte.d.ts +6 -2
- package/dist/structure/StructureViewport.svelte +451 -0
- package/dist/structure/StructureViewport.svelte.d.ts +65 -0
- package/dist/structure/atom-label-placement.d.ts +16 -12
- package/dist/structure/atom-label-placement.js +70 -37
- package/dist/structure/atom-properties.d.ts +2 -0
- package/dist/structure/atom-properties.js +105 -38
- package/dist/structure/bond-order-perception.js +3 -8
- package/dist/structure/bonding.d.ts +9 -3
- package/dist/structure/bonding.js +95 -46
- package/dist/structure/edit-history.d.ts +6 -0
- package/dist/structure/edit-history.js +27 -0
- package/dist/structure/export.d.ts +1 -0
- package/dist/structure/export.js +89 -105
- package/dist/structure/format-detect.d.ts +1 -0
- package/dist/structure/format-detect.js +20 -0
- package/dist/structure/geometry.d.ts +9 -0
- package/dist/structure/geometry.js +27 -0
- package/dist/structure/index.d.ts +16 -1
- package/dist/structure/index.js +15 -10
- package/dist/structure/measure.d.ts +1 -1
- package/dist/structure/measure.js +6 -12
- package/dist/structure/parse.d.ts +2 -1
- package/dist/structure/parse.js +272 -313
- package/dist/structure/partial-occupancy.js +10 -5
- package/dist/structure/pbc.js +85 -107
- package/dist/structure/polyhedra.d.ts +0 -1
- package/dist/structure/polyhedra.js +7 -21
- package/dist/structure/prop-groups.d.ts +85 -0
- package/dist/structure/prop-groups.js +18 -0
- package/dist/structure/supercell.d.ts +1 -2
- package/dist/structure/supercell.js +7 -13
- package/dist/symmetry/SymmetryElements.svelte +11 -15
- package/dist/symmetry/SymmetryStats.svelte +55 -71
- package/dist/symmetry/WyckoffTable.svelte +10 -28
- package/dist/symmetry/cell-transform.js +6 -14
- package/dist/symmetry/index.d.ts +1 -0
- package/dist/symmetry/index.js +13 -10
- package/dist/symmetry/spacegroups.js +3 -2
- package/dist/table/HeatmapTable.svelte +1142 -447
- package/dist/table/HeatmapTable.svelte.d.ts +12 -2
- package/dist/table/ToggleMenu.svelte +168 -53
- package/dist/table/ToggleMenu.svelte.d.ts +1 -1
- package/dist/table/index.d.ts +21 -6
- package/dist/table/index.js +34 -21
- package/dist/theme/ThemeControl.svelte +16 -8
- package/dist/theme/embedded.d.ts +18 -0
- package/dist/theme/embedded.js +206 -0
- package/dist/theme/index.d.ts +5 -5
- package/dist/theme/index.js +5 -12
- package/dist/theme/themes.mjs +44 -66
- package/dist/tooltip/KCoords.svelte +4 -1
- package/dist/tooltip/TooltipContent.svelte +3 -6
- package/dist/tooltip/TooltipContent.svelte.d.ts +1 -1
- package/dist/tooltip/index.d.ts +8 -1
- package/dist/trajectory/Trajectory.svelte +613 -386
- package/dist/trajectory/Trajectory.svelte.d.ts +1 -1
- package/dist/trajectory/TrajectoryError.svelte +12 -74
- package/dist/trajectory/TrajectoryExportPane.svelte +14 -32
- package/dist/trajectory/TrajectoryInfoPane.svelte +127 -164
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +2 -1
- package/dist/trajectory/extract.js +61 -49
- package/dist/trajectory/format-detect.d.ts +2 -0
- package/dist/trajectory/format-detect.js +17 -13
- package/dist/trajectory/frame-reader.d.ts +2 -0
- package/dist/trajectory/frame-reader.js +35 -32
- package/dist/trajectory/helpers.d.ts +2 -0
- package/dist/trajectory/helpers.js +34 -56
- package/dist/trajectory/index.d.ts +1 -0
- package/dist/trajectory/index.js +5 -8
- package/dist/trajectory/parse/ase.js +1 -1
- package/dist/trajectory/parse/h5-utils.d.ts +13 -0
- package/dist/trajectory/parse/h5-utils.js +109 -0
- package/dist/trajectory/parse/hdf5.d.ts +1 -1
- package/dist/trajectory/parse/hdf5.js +116 -106
- package/dist/trajectory/parse/index.d.ts +6 -6
- package/dist/trajectory/parse/index.js +25 -33
- package/dist/trajectory/parse/lammps.js +8 -12
- package/dist/trajectory/parse/vasp.js +10 -7
- package/dist/trajectory/parse/vaspout-electronic.d.ts +13 -0
- package/dist/trajectory/parse/vaspout-electronic.js +207 -0
- package/dist/trajectory/parse/vaspout-h5.d.ts +4 -0
- package/dist/trajectory/parse/vaspout-h5.js +281 -0
- package/dist/trajectory/parse/xyz.js +59 -9
- package/dist/trajectory/plotting.d.ts +8 -9
- package/dist/trajectory/plotting.js +113 -64
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +7 -0
- package/dist/xrd/XrdPlot.svelte +79 -118
- package/dist/xrd/broadening.js +2 -1
- package/dist/xrd/calc-xrd.js +24 -62
- package/dist/xrd/parse.d.ts +0 -1
- package/dist/xrd/parse.js +69 -95
- package/package.json +94 -34
- package/readme.md +6 -5
- package/dist/api/mp.d.ts +0 -6
- package/dist/api/mp.js +0 -22
- package/dist/plot/sunburst/SunburstControls.svelte +0 -200
- package/dist/scene/types.d.ts +0 -26
- package/dist/tooltip/types.d.ts +0 -8
- package/dist/trajectory/constants.d.ts +0 -6
- package/dist/trajectory/constants.js +0 -11
- /package/dist/{scene/types.js → file-viewer/host-protocol.js} +0 -0
- /package/dist/{tooltip/types.js → isosurface/geometry-worker-types.js} +0 -0
|
@@ -102,40 +102,6 @@
|
|
|
102
102
|
}
|
|
103
103
|
})
|
|
104
104
|
|
|
105
|
-
// Generic reset function using simple object key access
|
|
106
|
-
function reset_property(prop: keyof typeof defaults): void {
|
|
107
|
-
const default_value = defaults[prop]
|
|
108
|
-
|
|
109
|
-
// Use simple assignment based on property name
|
|
110
|
-
if (prop === `tile_gap`) tile_gap = default_value as string
|
|
111
|
-
else if (prop === `symbol_font_size`) symbol_font_size = default_value as number
|
|
112
|
-
else if (prop === `number_font_size`) number_font_size = default_value as number
|
|
113
|
-
else if (prop === `name_font_size`) name_font_size = default_value as number
|
|
114
|
-
else if (prop === `value_font_size`) value_font_size = default_value as number
|
|
115
|
-
else if (prop === `tooltip_font_size`) tooltip_font_size = default_value as number
|
|
116
|
-
else if (prop === `tooltip_bg_color`) tooltip_bg_color = default_value as string
|
|
117
|
-
else if (prop === `tile_border_radius`) tile_border_radius = Number(default_value)
|
|
118
|
-
else if (prop === `inner_transition_offset`) {
|
|
119
|
-
inner_transition_offset = Number(default_value)
|
|
120
|
-
} else if (prop === `tile_font_color`) tile_font_color = String(default_value)
|
|
121
|
-
else if (prop === `tile_transition_duration`) {
|
|
122
|
-
tile_transition_duration = Number(default_value)
|
|
123
|
-
} else if (prop === `hover_border_width`) {
|
|
124
|
-
hover_border_width = Number(default_value)
|
|
125
|
-
} else if (prop === `symbol_font_weight`) {
|
|
126
|
-
symbol_font_weight = Number(default_value)
|
|
127
|
-
} else if (prop === `number_font_weight`) {
|
|
128
|
-
number_font_weight = Number(default_value)
|
|
129
|
-
} else if (prop === `tooltip_border_radius`) {
|
|
130
|
-
tooltip_border_radius = Number(default_value)
|
|
131
|
-
} else if (prop === `tooltip_padding`) tooltip_padding = String(default_value)
|
|
132
|
-
else if (prop === `tooltip_line_height`) {
|
|
133
|
-
tooltip_line_height = Number(default_value)
|
|
134
|
-
} else if (prop === `tooltip_text_align`) {
|
|
135
|
-
tooltip_text_align = String(default_value)
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
105
|
// Check if settings in each section have been modified from defaults
|
|
140
106
|
let category_colors_modified = $derived(
|
|
141
107
|
Object.keys(colors.category).some(
|
|
@@ -205,7 +171,7 @@
|
|
|
205
171
|
}
|
|
206
172
|
</script>
|
|
207
173
|
|
|
208
|
-
<div {...rest} class=
|
|
174
|
+
<div {...rest} class={[`controls-grid`, rest.class]}>
|
|
209
175
|
<section class="category-colors">
|
|
210
176
|
<h3 id="element-category-colors-reset" style="grid-column: span 2">
|
|
211
177
|
Element Category Colors
|
|
@@ -220,10 +186,7 @@
|
|
|
220
186
|
onmouseleave={() => (selected.category = null)}
|
|
221
187
|
onblur={() => (selected.category = null)}
|
|
222
188
|
>
|
|
223
|
-
<input
|
|
224
|
-
type="color"
|
|
225
|
-
bind:value={colors.category[category]}
|
|
226
|
-
/>
|
|
189
|
+
<input type="color" bind:value={colors.category[category]} />
|
|
227
190
|
<span>{category}</span>
|
|
228
191
|
{#if colors.category[category] !== DEFAULT_CATEGORY_COLORS[category]}
|
|
229
192
|
<button
|
|
@@ -250,44 +213,28 @@
|
|
|
250
213
|
<label>
|
|
251
214
|
<span>Gap between tiles</span>
|
|
252
215
|
<input type="text" bind:value={tile_gap} placeholder="0.3cqw" />
|
|
253
|
-
<button onclick={() =>
|
|
216
|
+
<button onclick={() => (tile_gap = defaults.tile_gap)}>reset</button>
|
|
254
217
|
</label>
|
|
255
218
|
|
|
256
219
|
<label>
|
|
257
220
|
<span>Border radius (pt)</span>
|
|
258
221
|
<input type="range" min="0" max="10" step="0.5" bind:value={tile_border_radius} />
|
|
259
222
|
<input type="number" min="0" max="10" step="0.5" bind:value={tile_border_radius} />
|
|
260
|
-
<button onclick={() =>
|
|
223
|
+
<button onclick={() => (tile_border_radius = defaults.tile_border_radius)}>reset</button>
|
|
261
224
|
</label>
|
|
262
225
|
|
|
263
226
|
<label>
|
|
264
227
|
<span>Inner transition offset</span>
|
|
265
|
-
<input
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
bind:value={inner_transition_offset}
|
|
271
|
-
/>
|
|
272
|
-
<input
|
|
273
|
-
type="number"
|
|
274
|
-
min="0.1"
|
|
275
|
-
max="2"
|
|
276
|
-
step="0.1"
|
|
277
|
-
bind:value={inner_transition_offset}
|
|
278
|
-
/>
|
|
279
|
-
<button onclick={() => reset_property(`inner_transition_offset`)}>reset</button>
|
|
228
|
+
<input type="range" min="0.1" max="2" step="0.1" bind:value={inner_transition_offset} />
|
|
229
|
+
<input type="number" min="0.1" max="2" step="0.1" bind:value={inner_transition_offset} />
|
|
230
|
+
<button onclick={() => (inner_transition_offset = defaults.inner_transition_offset)}
|
|
231
|
+
>reset</button
|
|
232
|
+
>
|
|
280
233
|
</label>
|
|
281
234
|
|
|
282
235
|
<label>
|
|
283
236
|
<span>Transition duration (s)</span>
|
|
284
|
-
<input
|
|
285
|
-
type="range"
|
|
286
|
-
min="0.1"
|
|
287
|
-
max="2"
|
|
288
|
-
step="0.1"
|
|
289
|
-
bind:value={tile_transition_duration}
|
|
290
|
-
/>
|
|
237
|
+
<input type="range" min="0.1" max="2" step="0.1" bind:value={tile_transition_duration} />
|
|
291
238
|
<input
|
|
292
239
|
type="number"
|
|
293
240
|
min="0.1"
|
|
@@ -295,20 +242,22 @@
|
|
|
295
242
|
step="0.1"
|
|
296
243
|
bind:value={tile_transition_duration}
|
|
297
244
|
/>
|
|
298
|
-
<button onclick={() =>
|
|
245
|
+
<button onclick={() => (tile_transition_duration = defaults.tile_transition_duration)}
|
|
246
|
+
>reset</button
|
|
247
|
+
>
|
|
299
248
|
</label>
|
|
300
249
|
|
|
301
250
|
<label>
|
|
302
251
|
<span>Hover border width (px)</span>
|
|
303
252
|
<input type="range" min="0" max="5" step="1" bind:value={hover_border_width} />
|
|
304
253
|
<input type="number" min="0" max="5" step="1" bind:value={hover_border_width} />
|
|
305
|
-
<button onclick={() =>
|
|
254
|
+
<button onclick={() => (hover_border_width = defaults.hover_border_width)}>reset</button>
|
|
306
255
|
</label>
|
|
307
256
|
|
|
308
257
|
<label>
|
|
309
258
|
<span>Font color</span>
|
|
310
259
|
<input type="color" bind:value={tile_font_color} />
|
|
311
|
-
<button onclick={() =>
|
|
260
|
+
<button onclick={() => (tile_font_color = defaults.tile_font_color)}>reset</button>
|
|
312
261
|
</label>
|
|
313
262
|
</section>
|
|
314
263
|
|
|
@@ -324,66 +273,42 @@
|
|
|
324
273
|
<span>Symbol size</span>
|
|
325
274
|
<input type="range" min="20" max="80" step="2" bind:value={symbol_font_size} />
|
|
326
275
|
<input type="number" min="20" max="80" step="2" bind:value={symbol_font_size} />
|
|
327
|
-
<button onclick={() =>
|
|
276
|
+
<button onclick={() => (symbol_font_size = defaults.symbol_font_size)}>reset</button>
|
|
328
277
|
</label>
|
|
329
278
|
|
|
330
279
|
<label>
|
|
331
280
|
<span>Number size</span>
|
|
332
281
|
<input type="range" min="10" max="40" step="1" bind:value={number_font_size} />
|
|
333
282
|
<input type="number" min="10" max="40" step="1" bind:value={number_font_size} />
|
|
334
|
-
<button onclick={() =>
|
|
283
|
+
<button onclick={() => (number_font_size = defaults.number_font_size)}>reset</button>
|
|
335
284
|
</label>
|
|
336
285
|
|
|
337
286
|
<label>
|
|
338
287
|
<span>Name size</span>
|
|
339
288
|
<input type="range" min="6" max="24" step="1" bind:value={name_font_size} />
|
|
340
289
|
<input type="number" min="6" max="24" step="1" bind:value={name_font_size} />
|
|
341
|
-
<button onclick={() =>
|
|
290
|
+
<button onclick={() => (name_font_size = defaults.name_font_size)}>reset</button>
|
|
342
291
|
</label>
|
|
343
292
|
|
|
344
293
|
<label>
|
|
345
294
|
<span>Value size</span>
|
|
346
295
|
<input type="range" min="10" max="30" step="1" bind:value={value_font_size} />
|
|
347
296
|
<input type="number" min="10" max="30" step="1" bind:value={value_font_size} />
|
|
348
|
-
<button onclick={() =>
|
|
297
|
+
<button onclick={() => (value_font_size = defaults.value_font_size)}>reset</button>
|
|
349
298
|
</label>
|
|
350
299
|
|
|
351
300
|
<label>
|
|
352
301
|
<span>Symbol weight</span>
|
|
353
|
-
<input
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
max="900"
|
|
357
|
-
step="100"
|
|
358
|
-
bind:value={symbol_font_weight}
|
|
359
|
-
/>
|
|
360
|
-
<input
|
|
361
|
-
type="number"
|
|
362
|
-
min="100"
|
|
363
|
-
max="900"
|
|
364
|
-
step="100"
|
|
365
|
-
bind:value={symbol_font_weight}
|
|
366
|
-
/>
|
|
367
|
-
<button onclick={() => reset_property(`symbol_font_weight`)}>reset</button>
|
|
302
|
+
<input type="range" min="100" max="900" step="100" bind:value={symbol_font_weight} />
|
|
303
|
+
<input type="number" min="100" max="900" step="100" bind:value={symbol_font_weight} />
|
|
304
|
+
<button onclick={() => (symbol_font_weight = defaults.symbol_font_weight)}>reset</button>
|
|
368
305
|
</label>
|
|
369
306
|
|
|
370
307
|
<label>
|
|
371
308
|
<span>Number weight</span>
|
|
372
|
-
<input
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
max="900"
|
|
376
|
-
step="100"
|
|
377
|
-
bind:value={number_font_weight}
|
|
378
|
-
/>
|
|
379
|
-
<input
|
|
380
|
-
type="number"
|
|
381
|
-
min="100"
|
|
382
|
-
max="900"
|
|
383
|
-
step="100"
|
|
384
|
-
bind:value={number_font_weight}
|
|
385
|
-
/>
|
|
386
|
-
<button onclick={() => reset_property(`number_font_weight`)}>reset</button>
|
|
309
|
+
<input type="range" min="100" max="900" step="100" bind:value={number_font_weight} />
|
|
310
|
+
<input type="number" min="100" max="900" step="100" bind:value={number_font_weight} />
|
|
311
|
+
<button onclick={() => (number_font_weight = defaults.number_font_weight)}>reset</button>
|
|
387
312
|
</label>
|
|
388
313
|
</section>
|
|
389
314
|
|
|
@@ -399,39 +324,37 @@
|
|
|
399
324
|
<span>Font size (px)</span>
|
|
400
325
|
<input type="range" min="8" max="24" step="1" bind:value={tooltip_font_size} />
|
|
401
326
|
<input type="number" min="8" max="24" step="1" bind:value={tooltip_font_size} />
|
|
402
|
-
<button onclick={() =>
|
|
327
|
+
<button onclick={() => (tooltip_font_size = defaults.tooltip_font_size)}>reset</button>
|
|
403
328
|
</label>
|
|
404
329
|
|
|
405
330
|
<label>
|
|
406
331
|
<span>Background color</span>
|
|
407
332
|
<input type="color" bind:value={tooltip_bg_color} />
|
|
408
|
-
<button onclick={() =>
|
|
333
|
+
<button onclick={() => (tooltip_bg_color = defaults.tooltip_bg_color)}>reset</button>
|
|
409
334
|
</label>
|
|
410
335
|
|
|
411
336
|
<label>
|
|
412
337
|
<span>Border radius (px)</span>
|
|
413
338
|
<input type="range" min="0" max="20" step="1" bind:value={tooltip_border_radius} />
|
|
414
339
|
<input type="number" min="0" max="20" step="1" bind:value={tooltip_border_radius} />
|
|
415
|
-
<button onclick={() =>
|
|
340
|
+
<button onclick={() => (tooltip_border_radius = defaults.tooltip_border_radius)}
|
|
341
|
+
>reset</button
|
|
342
|
+
>
|
|
416
343
|
</label>
|
|
417
344
|
|
|
418
345
|
<label>
|
|
419
346
|
<span>Padding</span>
|
|
420
347
|
<input type="text" bind:value={tooltip_padding} placeholder="4px 6px" />
|
|
421
|
-
<button onclick={() =>
|
|
348
|
+
<button onclick={() => (tooltip_padding = defaults.tooltip_padding)}>reset</button>
|
|
422
349
|
</label>
|
|
423
350
|
|
|
424
351
|
<label>
|
|
425
352
|
<span>Line height</span>
|
|
426
353
|
<input type="range" min="0.8" max="2" step="0.1" bind:value={tooltip_line_height} />
|
|
427
|
-
<input
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
step="0.1"
|
|
432
|
-
bind:value={tooltip_line_height}
|
|
433
|
-
/>
|
|
434
|
-
<button onclick={() => reset_property(`tooltip_line_height`)}>reset</button>
|
|
354
|
+
<input type="number" min="0.8" max="2" step="0.1" bind:value={tooltip_line_height} />
|
|
355
|
+
<button onclick={() => (tooltip_line_height = defaults.tooltip_line_height)}
|
|
356
|
+
>reset</button
|
|
357
|
+
>
|
|
435
358
|
</label>
|
|
436
359
|
|
|
437
360
|
<label>
|
|
@@ -441,7 +364,7 @@
|
|
|
441
364
|
<option value="center">Center</option>
|
|
442
365
|
<option value="right">Right</option>
|
|
443
366
|
</select>
|
|
444
|
-
<button onclick={() =>
|
|
367
|
+
<button onclick={() => (tooltip_text_align = defaults.tooltip_text_align)}>reset</button>
|
|
445
368
|
</label>
|
|
446
369
|
</section>
|
|
447
370
|
</div>
|
|
@@ -449,8 +372,7 @@
|
|
|
449
372
|
<style>
|
|
450
373
|
.controls-grid {
|
|
451
374
|
display: grid;
|
|
452
|
-
grid-template-columns:
|
|
453
|
-
var(--ptable-ctrl-columns, repeat(auto-fit, minmax(320px, 1fr)));
|
|
375
|
+
grid-template-columns: var(--ptable-ctrl-columns, repeat(auto-fit, minmax(320px, 1fr)));
|
|
454
376
|
gap: var(--ptable-ctrl-gap, 1.5em);
|
|
455
377
|
margin: var(--ptable-ctrl-margin, 2em auto);
|
|
456
378
|
padding: 0 1em;
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
3
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
4
4
|
|
|
5
|
-
let {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
let {
|
|
6
|
+
as = `aside`,
|
|
7
|
+
children,
|
|
8
|
+
...rest
|
|
9
|
+
}: HTMLAttributes<HTMLElementTagNameMap[`aside`]> & {
|
|
10
|
+
as?: keyof HTMLElementTagNameMap
|
|
11
|
+
children?: Snippet
|
|
12
|
+
} = $props()
|
|
8
13
|
</script>
|
|
9
14
|
|
|
10
|
-
<svelte:element this={as} {...rest} class=
|
|
15
|
+
<svelte:element this={as} {...rest} class={[`table-inset`, rest.class]}>
|
|
11
16
|
{@render children?.()}
|
|
12
17
|
</svelte:element>
|
|
13
18
|
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { format_num } from '../labels'
|
|
3
|
-
import {
|
|
4
|
-
FullscreenToggle,
|
|
5
|
-
set_fullscreen_bg,
|
|
6
|
-
setup_fullscreen_effect,
|
|
7
|
-
} from '../layout'
|
|
3
|
+
import { FullscreenToggle, set_fullscreen_bg, setup_fullscreen_effect } from '../layout'
|
|
8
4
|
import { sanitize_svg } from '../sanitize'
|
|
9
5
|
import { compute_bounding_box_2d, polygon_centroid, type Vec2 } from '../math'
|
|
10
6
|
import type { AxisConfig } from '../plot'
|
|
@@ -116,9 +112,7 @@
|
|
|
116
112
|
// Custom tooltip - can be a snippet (replaces default), config object (adds prefix/suffix),
|
|
117
113
|
// or false to disable tooltip entirely
|
|
118
114
|
tooltip?: Snippet<[PhaseHoverInfo]> | PhaseDiagramTooltipConfig | false
|
|
119
|
-
children?: Snippet<
|
|
120
|
-
[{ width: number; height: number; fullscreen: boolean }]
|
|
121
|
-
>
|
|
115
|
+
children?: Snippet<[{ width: number; height: number; fullscreen: boolean }]>
|
|
122
116
|
} = $props()
|
|
123
117
|
|
|
124
118
|
// Shared icon/toggle styling for controls and export panes
|
|
@@ -210,9 +204,7 @@
|
|
|
210
204
|
|
|
211
205
|
// y_scale maps data temperatures to SVG coordinates
|
|
212
206
|
// We keep this in data units so region vertices render correctly
|
|
213
|
-
const y_scale = $derived(
|
|
214
|
-
scaleLinear().domain(temp_range).range([bottom, top]),
|
|
215
|
-
)
|
|
207
|
+
const y_scale = $derived(scaleLinear().domain(temp_range).range([bottom, top]))
|
|
216
208
|
|
|
217
209
|
// y_scale_display maps display temperatures (after unit conversion) to SVG
|
|
218
210
|
// Used for axis labels and ticks
|
|
@@ -221,9 +213,7 @@
|
|
|
221
213
|
)
|
|
222
214
|
|
|
223
215
|
// Generate tick values using d3 scale's built-in ticks method
|
|
224
|
-
const x_ticks = $derived(
|
|
225
|
-
x_scale.ticks(typeof x_axis.ticks === `number` ? x_axis.ticks : 5),
|
|
226
|
-
)
|
|
216
|
+
const x_ticks = $derived(x_scale.ticks(typeof x_axis.ticks === `number` ? x_axis.ticks : 5))
|
|
227
217
|
// Use display scale for y ticks so they show converted temperatures
|
|
228
218
|
const y_ticks = $derived(
|
|
229
219
|
y_scale_display.ticks(typeof y_axis.ticks === `number` ? y_axis.ticks : 6),
|
|
@@ -262,9 +252,7 @@
|
|
|
262
252
|
const transformed_boundaries = $derived(
|
|
263
253
|
(effective_data?.boundaries ?? []).map((boundary) => ({
|
|
264
254
|
...boundary,
|
|
265
|
-
svg_path: generate_boundary_path(
|
|
266
|
-
transform_vertices(boundary.points, x_scale, y_scale),
|
|
267
|
-
),
|
|
255
|
+
svg_path: generate_boundary_path(transform_vertices(boundary.points, x_scale, y_scale)),
|
|
268
256
|
})),
|
|
269
257
|
)
|
|
270
258
|
|
|
@@ -354,11 +342,7 @@
|
|
|
354
342
|
})
|
|
355
343
|
|
|
356
344
|
// Find nearest special point within threshold (in SVG pixels)
|
|
357
|
-
function find_nearby_special_point(
|
|
358
|
-
svg_x: number,
|
|
359
|
-
svg_y: number,
|
|
360
|
-
threshold: number = 20,
|
|
361
|
-
) {
|
|
345
|
+
function find_nearby_special_point(svg_x: number, svg_y: number, threshold: number = 20) {
|
|
362
346
|
let nearest: (typeof transformed_special_points)[0] | null = null
|
|
363
347
|
let min_dist = threshold
|
|
364
348
|
for (const point of transformed_special_points) {
|
|
@@ -372,19 +356,14 @@
|
|
|
372
356
|
}
|
|
373
357
|
|
|
374
358
|
// Pointer move handler (unified mouse/touch via Pointer Events API)
|
|
375
|
-
function handle_pointer_move(
|
|
376
|
-
event: PointerEvent & { currentTarget: SVGElement },
|
|
377
|
-
) {
|
|
359
|
+
function handle_pointer_move(event: PointerEvent & { currentTarget: SVGElement }) {
|
|
378
360
|
const svg = event.currentTarget
|
|
379
361
|
const rect = svg.getBoundingClientRect()
|
|
380
362
|
const svg_x = event.clientX - rect.left
|
|
381
363
|
const svg_y = event.clientY - rect.top
|
|
382
364
|
|
|
383
365
|
// Check if within plot area
|
|
384
|
-
if (
|
|
385
|
-
svg_x < left || svg_x > right || svg_y < top || svg_y > bottom ||
|
|
386
|
-
!effective_data
|
|
387
|
-
) {
|
|
366
|
+
if (svg_x < left || svg_x > right || svg_y < top || svg_y > bottom || !effective_data) {
|
|
388
367
|
clear_hover()
|
|
389
368
|
return
|
|
390
369
|
}
|
|
@@ -395,9 +374,7 @@
|
|
|
395
374
|
const region = find_phase_at_point(composition, temperature, effective_data)
|
|
396
375
|
|
|
397
376
|
// Check for nearby special point
|
|
398
|
-
const nearby_special = show_special_points
|
|
399
|
-
? find_nearby_special_point(svg_x, svg_y)
|
|
400
|
-
: null
|
|
377
|
+
const nearby_special = show_special_points ? find_nearby_special_point(svg_x, svg_y) : null
|
|
401
378
|
|
|
402
379
|
if (region) {
|
|
403
380
|
hovered_region = region
|
|
@@ -406,11 +383,9 @@
|
|
|
406
383
|
composition,
|
|
407
384
|
temperature,
|
|
408
385
|
position: { x: event.clientX, y: event.clientY },
|
|
409
|
-
lever_rule: calculate_lever_rule(region, composition, temperature) ||
|
|
410
|
-
undefined,
|
|
386
|
+
lever_rule: calculate_lever_rule(region, composition, temperature) || undefined,
|
|
411
387
|
vertical_lever_rule:
|
|
412
|
-
calculate_vertical_lever_rule(region, composition, temperature) ||
|
|
413
|
-
undefined,
|
|
388
|
+
calculate_vertical_lever_rule(region, composition, temperature) || undefined,
|
|
414
389
|
special_point: nearby_special || undefined,
|
|
415
390
|
}
|
|
416
391
|
on_phase_hover?.(hover_info)
|
|
@@ -462,9 +437,7 @@
|
|
|
462
437
|
const comp_unit = $derived(effective_data?.composition_unit ?? `at%`)
|
|
463
438
|
|
|
464
439
|
// Pseudo-binary support: format compound names with subscripts when enabled
|
|
465
|
-
const use_subscripts = $derived(
|
|
466
|
-
effective_data?.pseudo_binary?.use_subscripts ?? true,
|
|
467
|
-
)
|
|
440
|
+
const use_subscripts = $derived(effective_data?.pseudo_binary?.use_subscripts ?? true)
|
|
468
441
|
|
|
469
442
|
// Formatted component labels for SVG axis labels (with tspan subscripts if compound)
|
|
470
443
|
const component_a_svg = $derived(format_formula_svg(component_a, use_subscripts))
|
|
@@ -545,7 +518,7 @@
|
|
|
545
518
|
|
|
546
519
|
<div
|
|
547
520
|
{...rest}
|
|
548
|
-
class=
|
|
521
|
+
class={[`binary-phase-diagram`, rest.class]}
|
|
549
522
|
class:fullscreen
|
|
550
523
|
bind:this={wrapper}
|
|
551
524
|
bind:clientWidth={width}
|
|
@@ -593,7 +566,7 @@
|
|
|
593
566
|
bind:editor_open
|
|
594
567
|
bind:diagram_input
|
|
595
568
|
data={effective_data}
|
|
596
|
-
ondata={(edited) => data_override = edited}
|
|
569
|
+
ondata={(edited) => (data_override = edited)}
|
|
597
570
|
icon_style={pane_icon_style}
|
|
598
571
|
toggle_props={pane_toggle_props}
|
|
599
572
|
/>
|
|
@@ -667,8 +640,8 @@
|
|
|
667
640
|
<path
|
|
668
641
|
d={region.svg_path}
|
|
669
642
|
fill={region.gradient
|
|
670
|
-
|
|
671
|
-
|
|
643
|
+
? `url(#${gradient_uid}-${region.id})`
|
|
644
|
+
: region.color || get_phase_color(region.name)}
|
|
672
645
|
stroke="none"
|
|
673
646
|
class:hovered={hovered_region?.id === region.id}
|
|
674
647
|
/>
|
|
@@ -683,7 +656,7 @@
|
|
|
683
656
|
d={boundary.svg_path}
|
|
684
657
|
fill="none"
|
|
685
658
|
stroke={boundary.style?.color ?? merged_config.colors.boundary}
|
|
686
|
-
stroke-width={boundary.style?.width
|
|
659
|
+
stroke-width={boundary.style?.width ?? 2}
|
|
687
660
|
stroke-dasharray={boundary.style?.dash || ``}
|
|
688
661
|
stroke-linecap="round"
|
|
689
662
|
stroke-linejoin="round"
|
|
@@ -698,7 +671,8 @@
|
|
|
698
671
|
{#each transformed_regions as region (region.id)}
|
|
699
672
|
{@const line_height = merged_config.font_size * 1.2}
|
|
700
673
|
<g
|
|
701
|
-
transform="translate({region.label_pos[0]}, {region
|
|
674
|
+
transform="translate({region.label_pos[0]}, {region
|
|
675
|
+
.label_pos[1]}) rotate({region.label_rotation}) scale({region.label_scale})"
|
|
702
676
|
>
|
|
703
677
|
{#each region.label_lines as line, line_idx (line_idx)}
|
|
704
678
|
<text
|
|
@@ -726,34 +700,34 @@
|
|
|
726
700
|
{@const y_bot = y_scale(vlr.bottom_temperature)}
|
|
727
701
|
{@const y_top = y_scale(vlr.top_temperature)}
|
|
728
702
|
{@render tie_line_viz(
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
703
|
+
cx,
|
|
704
|
+
y_bot,
|
|
705
|
+
cx,
|
|
706
|
+
y_top,
|
|
707
|
+
[
|
|
708
|
+
{ cx, cy: y_bot, color: get_phase_color(vlr.bottom_phase, `rgb`) },
|
|
709
|
+
{ cx, cy: y_top, color: get_phase_color(vlr.top_phase, `rgb`) },
|
|
710
|
+
],
|
|
711
|
+
cx,
|
|
712
|
+
y_scale(effective_hover_info.temperature),
|
|
713
|
+
)}
|
|
740
714
|
{:else if lever_rule_mode === `horizontal` && effective_hover_info?.lever_rule}
|
|
741
715
|
{@const lr = effective_hover_info.lever_rule}
|
|
742
716
|
{@const cy = y_scale(effective_hover_info.temperature)}
|
|
743
717
|
{@const x_l = x_scale(lr.left_composition)}
|
|
744
718
|
{@const x_r = x_scale(lr.right_composition)}
|
|
745
719
|
{@render tie_line_viz(
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
720
|
+
x_l,
|
|
721
|
+
cy,
|
|
722
|
+
x_r,
|
|
723
|
+
cy,
|
|
724
|
+
[
|
|
725
|
+
{ cx: x_l, cy, color: get_phase_color(lr.left_phase, `rgb`) },
|
|
726
|
+
{ cx: x_r, cy, color: get_phase_color(lr.right_phase, `rgb`) },
|
|
727
|
+
],
|
|
728
|
+
x_scale(effective_hover_info.composition),
|
|
729
|
+
cy,
|
|
730
|
+
)}
|
|
757
731
|
{/if}
|
|
758
732
|
|
|
759
733
|
<!-- Special points (rendered last for highest z-index) -->
|
|
@@ -828,13 +802,9 @@
|
|
|
828
802
|
fill={merged_config.colors.text}
|
|
829
803
|
font-size={merged_config.font_size + 2}
|
|
830
804
|
>
|
|
831
|
-
{
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
{@html sanitize_svg(effective_data.x_axis_label)}
|
|
835
|
-
{:else}
|
|
836
|
-
{@html sanitize_svg(default_x_axis_label)}
|
|
837
|
-
{/if}
|
|
805
|
+
{@html sanitize_svg(
|
|
806
|
+
x_axis.label || effective_data?.x_axis_label || default_x_axis_label,
|
|
807
|
+
)}
|
|
838
808
|
</text>
|
|
839
809
|
</g>
|
|
840
810
|
|
|
@@ -871,38 +841,26 @@
|
|
|
871
841
|
fill={merged_config.colors.text}
|
|
872
842
|
font-size={merged_config.font_size + 2}
|
|
873
843
|
>
|
|
874
|
-
{
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
{@html sanitize_svg(effective_data.y_axis_label)}
|
|
878
|
-
{:else}
|
|
879
|
-
Temperature ({temp_unit})
|
|
880
|
-
{/if}
|
|
844
|
+
{@html sanitize_svg(
|
|
845
|
+
y_axis.label || effective_data?.y_axis_label || `Temperature (${temp_unit})`,
|
|
846
|
+
)}
|
|
881
847
|
</text>
|
|
882
848
|
</g>
|
|
883
849
|
|
|
884
850
|
<!-- Component labels at corners (supports compound formulas with subscripts) -->
|
|
885
851
|
{#if show_component_labels}
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
y={bottom + 45}
|
|
899
|
-
text-anchor="middle"
|
|
900
|
-
fill={merged_config.colors.text}
|
|
901
|
-
font-size={merged_config.font_size + 2}
|
|
902
|
-
font-weight="bold"
|
|
903
|
-
>
|
|
904
|
-
{@html sanitize_svg(component_b_svg)}
|
|
905
|
-
</text>
|
|
852
|
+
{#each [component_a_svg, component_b_svg] as svg, idx (idx)}
|
|
853
|
+
<text
|
|
854
|
+
x={idx === 0 ? left : right}
|
|
855
|
+
y={bottom + 45}
|
|
856
|
+
text-anchor="middle"
|
|
857
|
+
fill={merged_config.colors.text}
|
|
858
|
+
font-size={merged_config.font_size + 2}
|
|
859
|
+
font-weight="bold"
|
|
860
|
+
>
|
|
861
|
+
{@html sanitize_svg(svg)}
|
|
862
|
+
</text>
|
|
863
|
+
{/each}
|
|
906
864
|
{/if}
|
|
907
865
|
</svg>
|
|
908
866
|
|
|
@@ -996,8 +954,7 @@
|
|
|
996
954
|
.binary-phase-diagram :global(.pd-editor-toggle) {
|
|
997
955
|
opacity: 1;
|
|
998
956
|
}
|
|
999
|
-
.binary-phase-diagram:is(:hover, :focus-within)
|
|
1000
|
-
:is(:global(.pane-toggle), .header-controls),
|
|
957
|
+
.binary-phase-diagram:is(:hover, :focus-within) :is(:global(.pane-toggle), .header-controls),
|
|
1001
958
|
.binary-phase-diagram :global(.pane-toggle:is(:focus-visible, [aria-expanded='true'])),
|
|
1002
959
|
.header-controls:has(:global(.pane-open)) {
|
|
1003
960
|
opacity: 1;
|
|
@@ -1024,7 +981,12 @@
|
|
|
1024
981
|
pointer-events: none; /* Let hit-area handle events */
|
|
1025
982
|
}
|
|
1026
983
|
/* Grouped pointer-events: none */
|
|
1027
|
-
.region-label,
|
|
984
|
+
.region-label,
|
|
985
|
+
.tie-line,
|
|
986
|
+
.tooltip-container,
|
|
987
|
+
.copy-feedback,
|
|
988
|
+
.grid,
|
|
989
|
+
.region-labels {
|
|
1028
990
|
pointer-events: none;
|
|
1029
991
|
}
|
|
1030
992
|
.region-label {
|
|
@@ -1081,7 +1043,8 @@
|
|
|
1081
1043
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
|
1082
1044
|
}
|
|
1083
1045
|
@keyframes copy-fade-up {
|
|
1084
|
-
0%,
|
|
1046
|
+
0%,
|
|
1047
|
+
70% {
|
|
1085
1048
|
opacity: 1;
|
|
1086
1049
|
}
|
|
1087
1050
|
100% {
|
|
@@ -31,14 +31,12 @@ type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
31
31
|
x_axis?: AxisConfig;
|
|
32
32
|
y_axis?: AxisConfig;
|
|
33
33
|
tooltip?: Snippet<[PhaseHoverInfo]> | PhaseDiagramTooltipConfig | false;
|
|
34
|
-
children?: Snippet<[
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
]>;
|
|
34
|
+
children?: Snippet<[{
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
fullscreen: boolean;
|
|
38
|
+
}]>;
|
|
41
39
|
};
|
|
42
|
-
declare const IsobaricBinaryPhaseDiagram: import("svelte").Component<$$ComponentProps, {}, "show_labels" | "y_axis" | "fullscreen" | "wrapper" | "controls_open" | "x_axis" | "
|
|
40
|
+
declare const IsobaricBinaryPhaseDiagram: import("svelte").Component<$$ComponentProps, {}, "show_labels" | "y_axis" | "fullscreen" | "wrapper" | "controls_open" | "x_axis" | "config" | "export_pane_open" | "png_dpi" | "show_grid" | "show_boundaries" | "show_special_points" | "show_component_labels" | "lever_rule_mode" | "editor_open" | "diagram_input" | "hovered_region" | "display_temp_unit">;
|
|
43
41
|
type IsobaricBinaryPhaseDiagram = ReturnType<typeof IsobaricBinaryPhaseDiagram>;
|
|
44
42
|
export default IsobaricBinaryPhaseDiagram;
|