matterviz 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EmptyState.svelte +10 -4
- package/dist/FilePicker.svelte +12 -14
- package/dist/Icon.svelte +7 -4
- package/dist/MillerIndexInput.svelte +2 -2
- package/dist/app.css +53 -0
- package/dist/brillouin/BrillouinZone.svelte +75 -85
- package/dist/brillouin/BrillouinZone.svelte.d.ts +5 -7
- package/dist/brillouin/BrillouinZoneControls.svelte +3 -6
- package/dist/brillouin/BrillouinZoneExportPane.svelte +18 -14
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +6 -10
- package/dist/brillouin/BrillouinZoneScene.svelte +26 -39
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram.svelte +33 -38
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +62 -74
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +511 -547
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +1 -1
- package/dist/chempot-diagram/async-compute.svelte.js +1 -1
- package/dist/chempot-diagram/controls-state.svelte.js +1 -1
- package/dist/colors/index.d.ts +0 -4
- package/dist/colors/index.js +19 -20
- package/dist/composition/BarChart.svelte +37 -31
- package/dist/composition/BubbleChart.svelte +17 -17
- package/dist/composition/Composition.svelte +7 -11
- package/dist/composition/Formula.svelte +18 -25
- package/dist/composition/FormulaFilter.svelte +92 -95
- package/dist/composition/PieChart.svelte +55 -41
- package/dist/composition/format.js +1 -1
- package/dist/composition/index.d.ts +2 -0
- package/dist/composition/index.js +14 -0
- package/dist/composition/parse.d.ts +2 -2
- package/dist/composition/parse.js +11 -10
- package/dist/constants.js +11 -9
- package/dist/convex-hull/ConvexHull.svelte +12 -15
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull2D.svelte +93 -92
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +109 -140
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +75 -94
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +36 -40
- package/dist/convex-hull/ConvexHullControls.svelte +46 -48
- package/dist/convex-hull/ConvexHullStats.svelte +193 -195
- package/dist/convex-hull/ConvexHullTooltip.svelte +5 -12
- package/dist/convex-hull/GasPressureControls.svelte +5 -12
- package/dist/convex-hull/StructurePopup.svelte +17 -21
- package/dist/convex-hull/StructurePopup.svelte.d.ts +2 -0
- package/dist/convex-hull/TemperatureSlider.svelte +4 -10
- package/dist/convex-hull/canvas-interactions.svelte.js +2 -1
- package/dist/convex-hull/helpers.d.ts +8 -10
- package/dist/convex-hull/helpers.js +36 -36
- package/dist/convex-hull/hull-state.svelte.d.ts +1 -1
- package/dist/convex-hull/thermodynamics.js +18 -17
- package/dist/coordination/CoordinationBarPlot.svelte +38 -33
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
- package/dist/coordination/calc-coordination.d.ts +1 -1
- package/dist/coordination/calc-coordination.js +28 -25
- package/dist/element/BohrAtom.svelte +5 -8
- package/dist/element/ElementHeading.svelte +4 -1
- package/dist/element/ElementPhoto.svelte +11 -9
- package/dist/element/ElementStats.svelte +12 -10
- package/dist/element/ElementTile.svelte +24 -29
- package/dist/element/Nucleus.svelte +4 -2
- package/dist/element/data.d.ts +1 -2
- package/dist/element/helpers.d.ts +4 -0
- package/dist/element/helpers.js +18 -0
- package/dist/element/index.d.ts +1 -4
- package/dist/element/index.js +3 -18
- package/dist/feedback/DragOverlay.svelte +5 -5
- package/dist/feedback/DragOverlay.svelte.d.ts +2 -2
- package/dist/feedback/StatusMessage.svelte +7 -4
- package/dist/fermi-surface/FermiSlice.svelte +21 -18
- package/dist/fermi-surface/FermiSurface.svelte +14 -22
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +5 -7
- package/dist/fermi-surface/FermiSurfaceControls.svelte +6 -20
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +37 -64
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +9 -6
- package/dist/fermi-surface/compute.js +3 -3
- package/dist/fermi-surface/parse.js +22 -24
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +109 -148
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +2 -2
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +9 -7
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +1 -1
- package/dist/heatmap-matrix/index.d.ts +5 -0
- package/dist/icons.d.ts +4 -0
- package/dist/icons.js +4 -0
- package/dist/io/ExportPane.svelte +10 -6
- package/dist/io/decompress.d.ts +2 -1
- package/dist/io/decompress.js +22 -35
- package/dist/io/export.d.ts +4 -0
- package/dist/io/export.js +5 -1
- package/dist/io/fetch.d.ts +0 -3
- package/dist/io/fetch.js +0 -11
- package/dist/io/index.d.ts +0 -1
- package/dist/io/index.js +2 -9
- package/dist/io/is-binary.d.ts +9 -0
- package/dist/io/is-binary.js +45 -1
- package/dist/io/url-drop.js +13 -25
- package/dist/isosurface/Isosurface.svelte +17 -23
- package/dist/isosurface/IsosurfaceControls.svelte +37 -42
- package/dist/isosurface/parse-vaspwave.d.ts +3 -0
- package/dist/isosurface/parse-vaspwave.js +138 -0
- package/dist/isosurface/parse.js +6 -6
- package/dist/labels.d.ts +6 -2
- package/dist/labels.js +43 -13
- package/dist/layout/FullscreenButton.svelte +2 -1
- package/dist/layout/FullscreenToggle.svelte +10 -4
- package/dist/layout/InfoCard.svelte +7 -18
- package/dist/layout/InfoTag.svelte +1 -3
- package/dist/layout/NumberRangeInput.svelte +46 -0
- package/dist/layout/NumberRangeInput.svelte.d.ts +12 -0
- package/dist/layout/PropertyFilter.svelte +2 -6
- package/dist/layout/SettingsSection.svelte +21 -17
- package/dist/layout/SubpageGrid.svelte +3 -1
- package/dist/layout/ViewerChrome.svelte +9 -10
- package/dist/layout/ViewerChrome.svelte.d.ts +2 -1
- package/dist/layout/fullscreen.js +3 -5
- package/dist/layout/fullscreen.svelte.js +1 -2
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.js +1 -0
- package/dist/layout/json-tree/JsonNode.svelte +8 -11
- package/dist/layout/json-tree/JsonTree.svelte +53 -77
- package/dist/layout/json-tree/JsonValue.svelte +7 -15
- package/dist/layout/json-tree/utils.js +14 -23
- package/dist/math.d.ts +2 -0
- package/dist/math.js +19 -0
- package/dist/overlays/ContextMenu.svelte +4 -2
- package/dist/overlays/CopyButton.svelte +11 -5
- package/dist/overlays/DragControlTab.svelte +6 -1
- package/dist/overlays/DraggablePane.svelte +81 -26
- package/dist/overlays/DraggablePane.svelte.d.ts +1 -0
- package/dist/overlays/GlassChip.svelte +30 -0
- package/dist/overlays/GlassChip.svelte.d.ts +8 -0
- package/dist/overlays/InfoPaneCards.svelte +11 -23
- package/dist/overlays/index.d.ts +7 -0
- package/dist/overlays/index.js +26 -0
- package/dist/overlays/portal.d.ts +2 -0
- package/dist/overlays/portal.js +14 -0
- package/dist/periodic-table/PeriodicTable.svelte +113 -145
- package/dist/periodic-table/PeriodicTable.svelte.d.ts +5 -3
- package/dist/periodic-table/PeriodicTableControls.svelte +11 -63
- package/dist/periodic-table/TableInset.svelte +9 -4
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +50 -71
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +6 -8
- package/dist/phase-diagram/PhaseDiagramControls.svelte +70 -94
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +2 -1
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +12 -12
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +54 -58
- package/dist/phase-diagram/TdbInfoPanel.svelte +21 -15
- package/dist/phase-diagram/build-diagram.js +3 -3
- package/dist/phase-diagram/diagram-input.d.ts +1 -2
- package/dist/phase-diagram/parse.js +15 -15
- package/dist/phase-diagram/svg-to-diagram.js +21 -15
- package/dist/phase-diagram/utils.js +2 -3
- package/dist/plot/bar/BarPlot.svelte +430 -391
- package/dist/plot/bar/BarPlot.svelte.d.ts +2 -0
- package/dist/plot/bar/BarPlotControls.svelte +1 -3
- package/dist/plot/bar/BarPlotControls.svelte.d.ts +4 -6
- package/dist/plot/bar/SpacegroupBarPlot.svelte +29 -36
- package/dist/plot/bar/data.d.ts +5 -4
- package/dist/plot/bar/data.js +2 -1
- package/dist/plot/box/BoxPlot.svelte +301 -209
- package/dist/plot/box/BoxPlot.svelte.d.ts +2 -0
- package/dist/plot/box/Violin.svelte.d.ts +1 -0
- package/dist/plot/box/box-plot.js +1 -1
- package/dist/plot/core/auto-place.js +1 -1
- package/dist/plot/core/axis-utils.d.ts +12 -7
- package/dist/plot/core/axis-utils.js +48 -48
- package/dist/plot/core/components/AxisLabel.svelte +82 -20
- package/dist/plot/core/components/AxisLabel.svelte.d.ts +1 -0
- package/dist/plot/core/components/ColorBar.svelte +101 -106
- package/dist/plot/core/components/ColorScaleSelect.svelte +1 -1
- package/dist/plot/core/components/FillArea.svelte +10 -17
- package/dist/plot/core/components/HierarchyControls.svelte +249 -0
- package/dist/plot/{sunburst/SunburstControls.svelte.d.ts → core/components/HierarchyControls.svelte.d.ts} +12 -8
- package/dist/plot/core/components/InteractiveAxisLabel.svelte +1 -1
- package/dist/plot/core/components/InteractiveAxisLabel.svelte.d.ts +1 -1
- package/dist/plot/core/components/Line.svelte +18 -9
- package/dist/plot/core/components/Line.svelte.d.ts +2 -0
- package/dist/plot/core/components/PlotAxis.svelte +40 -17
- package/dist/plot/core/components/PlotControls.svelte +65 -41
- package/dist/plot/core/components/PlotLegend.svelte +31 -35
- package/dist/plot/core/components/PlotMarginals.svelte +616 -0
- package/dist/plot/core/components/PlotMarginals.svelte.d.ts +15 -0
- package/dist/plot/core/components/PlotTooltip.svelte +1 -1
- package/dist/plot/core/components/PortalSelect.svelte +4 -8
- package/dist/plot/core/components/ReferenceLine.svelte +27 -24
- package/dist/plot/core/components/ReferenceLine3D.svelte +54 -57
- package/dist/plot/core/components/ReferencePlane.svelte +7 -8
- package/dist/plot/core/components/ZeroLines.svelte +4 -8
- package/dist/plot/core/components/ZoomRect.svelte +1 -2
- package/dist/plot/core/components/index.d.ts +1 -0
- package/dist/plot/core/components/index.js +1 -0
- package/dist/plot/core/data-cleaning-signal.d.ts +46 -0
- package/dist/plot/core/data-cleaning-signal.js +467 -0
- package/dist/plot/core/data-cleaning.d.ts +2 -42
- package/dist/plot/core/data-cleaning.js +27 -474
- package/dist/plot/core/data-transform.js +9 -5
- package/dist/plot/core/fill-utils.d.ts +3 -1
- package/dist/plot/core/fill-utils.js +28 -6
- package/dist/plot/core/index.d.ts +1 -0
- package/dist/plot/core/index.js +1 -0
- package/dist/plot/core/interactions.js +0 -2
- package/dist/plot/core/layout.d.ts +3 -1
- package/dist/plot/core/layout.js +22 -13
- package/dist/plot/core/marginals.d.ts +170 -0
- package/dist/plot/core/marginals.js +436 -0
- package/dist/plot/core/reference-line.js +1 -1
- package/dist/plot/core/scales.d.ts +23 -0
- package/dist/plot/core/scales.js +39 -13
- package/dist/plot/core/types/fills.d.ts +101 -0
- package/dist/plot/core/types/fills.js +15 -0
- package/dist/plot/core/types/plot-3d.d.ts +87 -0
- package/dist/plot/core/types/plot-3d.js +4 -0
- package/dist/plot/core/types/reference-lines.d.ts +140 -0
- package/dist/plot/core/types/reference-lines.js +9 -0
- package/dist/plot/core/types.d.ts +29 -324
- package/dist/plot/core/types.js +23 -20
- package/dist/plot/core/utils/hierarchy-chart.d.ts +51 -0
- package/dist/plot/core/utils/hierarchy-chart.js +179 -0
- package/dist/plot/core/utils/hierarchy-labels.d.ts +20 -0
- package/dist/plot/core/utils/hierarchy-labels.js +99 -0
- package/dist/plot/core/utils/label-placement.js +2 -2
- package/dist/plot/histogram/Histogram.svelte +304 -325
- package/dist/plot/histogram/Histogram.svelte.d.ts +7 -7
- package/dist/plot/histogram/HistogramControls.svelte +30 -28
- package/dist/plot/histogram/histogram.d.ts +31 -0
- package/dist/plot/histogram/histogram.js +70 -0
- package/dist/plot/histogram/index.d.ts +1 -0
- package/dist/plot/histogram/index.js +1 -0
- package/dist/plot/index.d.ts +1 -0
- package/dist/plot/index.js +1 -0
- package/dist/plot/sankey/Sankey.svelte +78 -69
- package/dist/plot/sankey/Sankey.svelte.d.ts +2 -2
- package/dist/plot/sankey/SankeyControls.svelte +22 -16
- package/dist/plot/scatter/BinnedScatterPlot.svelte +263 -109
- package/dist/plot/scatter/BinnedScatterPlot.svelte.d.ts +7 -0
- package/dist/plot/scatter/ElementScatter.svelte +4 -1
- package/dist/plot/scatter/ScatterPlot.svelte +477 -385
- package/dist/plot/scatter/ScatterPlot.svelte.d.ts +2 -0
- package/dist/plot/scatter/ScatterPlotControls.svelte +18 -19
- package/dist/plot/scatter/ScatterPlotControls.svelte.d.ts +1 -1
- package/dist/plot/scatter/ScatterPoint.svelte +16 -9
- package/dist/plot/scatter/binned-scatter-types.d.ts +3 -2
- package/dist/plot/scatter/binned-scatter-types.js +6 -1
- package/dist/plot/scatter/scatter-data.d.ts +1 -1
- package/dist/plot/scatter/scatter-data.js +8 -7
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte +25 -34
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte.d.ts +2 -2
- package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte +8 -5
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte +113 -116
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte.d.ts +2 -2
- package/dist/plot/scatter-3d/Surface3D.svelte +4 -13
- package/dist/plot/sunburst/Sunburst.svelte +251 -329
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +2 -2
- package/dist/plot/sunburst/index.d.ts +1 -1
- package/dist/plot/sunburst/index.js +2 -1
- package/dist/plot/sunburst/render.d.ts +2 -2
- package/dist/plot/sunburst/render.js +47 -22
- package/dist/plot/sunburst/sunburst.d.ts +5 -1
- package/dist/plot/sunburst/sunburst.js +10 -3
- package/dist/plot/treemap/Treemap.svelte +907 -0
- package/dist/plot/treemap/Treemap.svelte.d.ts +84 -0
- package/dist/plot/treemap/index.d.ts +3 -0
- package/dist/plot/treemap/index.js +4 -0
- package/dist/plot/treemap/treemap.d.ts +26 -0
- package/dist/plot/treemap/treemap.js +99 -0
- package/dist/rdf/RdfPlot.svelte +22 -26
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/calc-rdf.js +4 -8
- package/dist/sanitize.js +1 -1
- package/dist/scene/bind-renderer.svelte.js +14 -6
- package/dist/settings.d.ts +19 -9
- package/dist/settings.js +77 -50
- package/dist/spectral/Bands.svelte +223 -230
- package/dist/spectral/BandsAndDos.svelte +11 -9
- package/dist/spectral/BrillouinBandsDos.svelte +19 -27
- package/dist/spectral/Dos.svelte +70 -73
- package/dist/spectral/helpers.d.ts +3 -3
- package/dist/spectral/helpers.js +25 -35
- package/dist/state.svelte.js +5 -18
- package/dist/structure/Arrow.svelte +5 -18
- package/dist/structure/ArrowInstances.svelte +160 -0
- package/dist/structure/ArrowInstances.svelte.d.ts +16 -0
- package/dist/structure/AtomLegend.svelte +115 -75
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/Bond.svelte +31 -23
- package/dist/structure/CanvasTooltip.svelte +15 -3
- package/dist/structure/CellSelect.svelte +11 -26
- package/dist/structure/Cylinder.svelte +24 -40
- package/dist/structure/InstancedAtoms.svelte +114 -0
- package/dist/structure/InstancedAtoms.svelte.d.ts +15 -0
- package/dist/structure/Lattice.svelte +85 -149
- package/dist/structure/SiteLabels.svelte +122 -0
- package/dist/structure/SiteLabels.svelte.d.ts +18 -0
- package/dist/structure/Structure.svelte +473 -419
- package/dist/structure/Structure.svelte.d.ts +4 -2
- package/dist/structure/StructureCarousel.svelte +630 -0
- package/dist/structure/StructureCarousel.svelte.d.ts +19 -0
- package/dist/structure/StructureControls.svelte +157 -399
- package/dist/structure/StructureControls.svelte.d.ts +1 -1
- package/dist/structure/StructureExportPane.svelte +17 -21
- package/dist/structure/StructureInfoPane.svelte +72 -66
- package/dist/structure/StructureInfoPane.svelte.d.ts +1 -1
- package/dist/structure/StructureScene.svelte +467 -476
- package/dist/structure/StructureScene.svelte.d.ts +3 -1
- package/dist/structure/StructureViewport.svelte +386 -0
- package/dist/structure/StructureViewport.svelte.d.ts +63 -0
- package/dist/structure/atom-label-placement.d.ts +16 -12
- package/dist/structure/atom-label-placement.js +70 -37
- package/dist/structure/atom-properties.d.ts +2 -0
- package/dist/structure/atom-properties.js +104 -38
- package/dist/structure/bonding.d.ts +10 -3
- package/dist/structure/bonding.js +84 -28
- package/dist/structure/edit-history.d.ts +6 -0
- package/dist/structure/edit-history.js +27 -0
- package/dist/structure/export.d.ts +1 -0
- package/dist/structure/export.js +39 -31
- package/dist/structure/format-detect.d.ts +1 -0
- package/dist/structure/format-detect.js +22 -0
- package/dist/structure/geometry.d.ts +9 -0
- package/dist/structure/geometry.js +27 -0
- package/dist/structure/index.d.ts +16 -1
- package/dist/structure/index.js +13 -2
- package/dist/structure/measure.d.ts +1 -1
- package/dist/structure/measure.js +6 -12
- package/dist/structure/parse.d.ts +2 -1
- package/dist/structure/parse.js +243 -222
- package/dist/structure/partial-occupancy.js +4 -2
- package/dist/structure/pbc.js +78 -98
- package/dist/structure/polyhedra.d.ts +0 -1
- package/dist/structure/polyhedra.js +3 -18
- package/dist/structure/supercell.d.ts +1 -2
- package/dist/structure/supercell.js +7 -13
- package/dist/symmetry/SymmetryElements.svelte +11 -15
- package/dist/symmetry/SymmetryStats.svelte +56 -68
- package/dist/symmetry/WyckoffTable.svelte +5 -24
- package/dist/symmetry/cell-transform.js +1 -0
- package/dist/symmetry/index.d.ts +1 -0
- package/dist/symmetry/index.js +8 -2
- package/dist/symmetry/spacegroups.js +3 -2
- package/dist/table/HeatmapTable.svelte +1102 -365
- package/dist/table/HeatmapTable.svelte.d.ts +12 -2
- package/dist/table/ToggleMenu.svelte +5 -12
- package/dist/table/index.d.ts +21 -6
- package/dist/table/index.js +34 -21
- package/dist/theme/ThemeControl.svelte +16 -8
- package/dist/theme/index.d.ts +1 -5
- package/dist/theme/index.js +4 -10
- package/dist/theme/themes.mjs +14 -7
- package/dist/tooltip/KCoords.svelte +4 -1
- package/dist/tooltip/TooltipContent.svelte +2 -5
- package/dist/trajectory/Trajectory.svelte +515 -308
- package/dist/trajectory/Trajectory.svelte.d.ts +1 -1
- package/dist/trajectory/TrajectoryError.svelte +11 -8
- package/dist/trajectory/TrajectoryExportPane.svelte +14 -31
- package/dist/trajectory/TrajectoryInfoPane.svelte +85 -97
- package/dist/trajectory/extract.js +56 -34
- package/dist/trajectory/format-detect.js +11 -9
- package/dist/trajectory/frame-reader.d.ts +2 -0
- package/dist/trajectory/frame-reader.js +33 -29
- package/dist/trajectory/helpers.d.ts +2 -0
- package/dist/trajectory/helpers.js +18 -7
- package/dist/trajectory/index.d.ts +1 -0
- package/dist/trajectory/index.js +3 -0
- package/dist/trajectory/parse/h5-utils.d.ts +13 -0
- package/dist/trajectory/parse/h5-utils.js +109 -0
- package/dist/trajectory/parse/hdf5.d.ts +1 -1
- package/dist/trajectory/parse/hdf5.js +116 -106
- package/dist/trajectory/parse/index.d.ts +2 -3
- package/dist/trajectory/parse/index.js +17 -20
- package/dist/trajectory/parse/lammps.js +8 -12
- package/dist/trajectory/parse/vasp.js +10 -7
- package/dist/trajectory/parse/vaspout-electronic.d.ts +13 -0
- package/dist/trajectory/parse/vaspout-electronic.js +207 -0
- package/dist/trajectory/parse/vaspout-h5.d.ts +5 -0
- package/dist/trajectory/parse/vaspout-h5.js +284 -0
- package/dist/trajectory/parse/xyz.js +11 -7
- package/dist/trajectory/plotting.d.ts +8 -9
- package/dist/trajectory/plotting.js +99 -27
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +7 -0
- package/dist/xrd/XrdPlot.svelte +47 -61
- package/dist/xrd/broadening.js +2 -1
- package/dist/xrd/calc-xrd.js +2 -4
- package/dist/xrd/parse.d.ts +0 -1
- package/dist/xrd/parse.js +56 -73
- package/package.json +61 -33
- package/dist/api/mp.d.ts +0 -6
- package/dist/api/mp.js +0 -22
- package/dist/plot/sunburst/SunburstControls.svelte +0 -200
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
surface_color = $bindable(`#4488ff`),
|
|
26
26
|
surface_opacity = $bindable(0.3),
|
|
27
27
|
edge_color = $bindable(`#000000`),
|
|
28
|
-
edge_width = $bindable(0.
|
|
28
|
+
edge_width = $bindable(0.002),
|
|
29
29
|
show_vectors = $bindable(true),
|
|
30
30
|
vector_scale = $bindable(1.0),
|
|
31
31
|
// Irreducible BZ options
|
|
@@ -90,22 +90,24 @@
|
|
|
90
90
|
camera_position || default_camera_position(bz_size),
|
|
91
91
|
)
|
|
92
92
|
|
|
93
|
-
const orbit_controls_props = $derived(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
93
|
+
const orbit_controls_props = $derived(
|
|
94
|
+
build_orbit_props({
|
|
95
|
+
camera_projection,
|
|
96
|
+
target: rotation_target,
|
|
97
|
+
rotate_speed,
|
|
98
|
+
zoom_speed,
|
|
99
|
+
zoom_to_cursor,
|
|
100
|
+
pan_speed,
|
|
101
|
+
max_zoom,
|
|
102
|
+
min_zoom,
|
|
103
|
+
auto_rotate,
|
|
104
|
+
rotation_damping,
|
|
105
|
+
}),
|
|
106
|
+
)
|
|
105
107
|
|
|
106
108
|
// K-path styling. The invisible hover proxy is twice the visible thickness so the cursor
|
|
107
109
|
// snaps to the path even when it isn't directly over the thin visible segment.
|
|
108
|
-
const KPATH_THICKNESS = 0.
|
|
110
|
+
const KPATH_THICKNESS = 0.012
|
|
109
111
|
const KPATH_HOVER_THICKNESS = KPATH_THICKNESS * 2
|
|
110
112
|
|
|
111
113
|
// Threshold for skipping k-path segments that bridge a path discontinuity (e.g. `U|K`).
|
|
@@ -124,9 +126,7 @@
|
|
|
124
126
|
bz_data ? polyhedron_geometry(bz_data.vertices, bz_data.faces) : null,
|
|
125
127
|
)
|
|
126
128
|
const ibz_geometry = $derived(
|
|
127
|
-
show_ibz && ibz_data
|
|
128
|
-
? polyhedron_geometry(ibz_data.vertices, ibz_data.faces)
|
|
129
|
-
: null,
|
|
129
|
+
show_ibz && ibz_data ? polyhedron_geometry(ibz_data.vertices, ibz_data.faces) : null,
|
|
130
130
|
)
|
|
131
131
|
|
|
132
132
|
// Separate effects to avoid disposing one geometry when only the other changes
|
|
@@ -166,10 +166,7 @@
|
|
|
166
166
|
})
|
|
167
167
|
|
|
168
168
|
// Create hover data from pointer event
|
|
169
|
-
function create_hover_data(
|
|
170
|
-
event: ThreltePointerEvent,
|
|
171
|
-
is_ibz: boolean,
|
|
172
|
-
): BZHoverData | null {
|
|
169
|
+
function create_hover_data(event: ThreltePointerEvent, is_ibz: boolean): BZHoverData | null {
|
|
173
170
|
if (!bz_data) return null
|
|
174
171
|
|
|
175
172
|
const position_cartesian: Vec3 = [event.point.x, event.point.y, event.point.z]
|
|
@@ -178,9 +175,8 @@
|
|
|
178
175
|
const { clientX, clientY } = event.nativeEvent
|
|
179
176
|
const ibz_vol = ibz_data?.volume ?? null
|
|
180
177
|
// Round to nearest integer since symmetry multiplicity is the point group order
|
|
181
|
-
const symmetry_multiplicity =
|
|
182
|
-
? Math.round(bz_data.volume / ibz_vol)
|
|
183
|
-
: null
|
|
178
|
+
const symmetry_multiplicity =
|
|
179
|
+
ibz_vol != null && ibz_vol > 0 ? Math.round(bz_data.volume / ibz_vol) : null
|
|
184
180
|
|
|
185
181
|
return {
|
|
186
182
|
position_cartesian,
|
|
@@ -295,17 +291,12 @@
|
|
|
295
291
|
|
|
296
292
|
<!-- K-path visualization -->
|
|
297
293
|
{#if k_path_points && k_path_points.length > 1}
|
|
298
|
-
{#each k_path_points.slice(0, -1) as
|
|
299
|
-
from_point,
|
|
300
|
-
idx
|
|
301
|
-
(`${from_point}-${k_path_points[idx + 1]}#${idx}`)
|
|
302
|
-
}
|
|
294
|
+
{#each k_path_points.slice(0, -1) as from_point, idx (`${from_point}-${k_path_points[idx + 1]}#${idx}`)}
|
|
303
295
|
{@const to_point = k_path_points[idx + 1]}
|
|
304
|
-
{@const seg_len = Math.hypot(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
(idx === hovered_qpoint_index || idx === hovered_qpoint_index - 1)}
|
|
296
|
+
{@const seg_len = Math.hypot(...math.subtract(to_point as Vec3, from_point as Vec3))}
|
|
297
|
+
{@const is_hovered =
|
|
298
|
+
hovered_qpoint_index !== null &&
|
|
299
|
+
(idx === hovered_qpoint_index || idx === hovered_qpoint_index - 1)}
|
|
309
300
|
{#if seg_len <= k_path_seg_cutoff}
|
|
310
301
|
<Cylinder
|
|
311
302
|
from={from_point as Vec3}
|
|
@@ -357,11 +348,7 @@
|
|
|
357
348
|
{#if hovered_k_point}
|
|
358
349
|
<T.Mesh position={hovered_k_point}>
|
|
359
350
|
<T.SphereGeometry args={[0.03, 16, 16]} />
|
|
360
|
-
<T.MeshStandardMaterial
|
|
361
|
-
color="#ff0000"
|
|
362
|
-
emissive="#ff0000"
|
|
363
|
-
emissiveIntensity={1.2}
|
|
364
|
-
/>
|
|
351
|
+
<T.MeshStandardMaterial color="#ff0000" emissive="#ff0000" emissiveIntensity={1.2} />
|
|
365
352
|
</T.Mesh>
|
|
366
353
|
{/if}
|
|
367
354
|
{/if}
|
|
@@ -24,6 +24,6 @@ type $$ComponentProps = SceneControlProps & {
|
|
|
24
24
|
hover_data?: BZHoverData | null;
|
|
25
25
|
on_kpath_hover?: (qpoint_index: number | null) => void;
|
|
26
26
|
};
|
|
27
|
-
declare const BrillouinZoneScene: import("svelte").Component<$$ComponentProps, {}, "
|
|
27
|
+
declare const BrillouinZoneScene: import("svelte").Component<$$ComponentProps, {}, "camera" | "camera_projection" | "camera_position" | "vector_scale" | "scene" | "surface_color" | "surface_opacity" | "edge_color" | "edge_width" | "show_vectors" | "bz_data" | "hover_data">;
|
|
28
28
|
type BrillouinZoneScene = ReturnType<typeof BrillouinZoneScene>;
|
|
29
29
|
export default BrillouinZoneScene;
|
|
@@ -9,11 +9,7 @@
|
|
|
9
9
|
import ChemPotDiagram2D from './ChemPotDiagram2D.svelte'
|
|
10
10
|
import ChemPotDiagram3D from './ChemPotDiagram3D.svelte'
|
|
11
11
|
import { get_ternary_combinations } from './compute'
|
|
12
|
-
import type {
|
|
13
|
-
ChemPotDiagramConfig,
|
|
14
|
-
ChemPotHoverInfo,
|
|
15
|
-
ChemPotHoverInfo3D,
|
|
16
|
-
} from './types'
|
|
12
|
+
import type { ChemPotDiagramConfig, ChemPotHoverInfo, ChemPotHoverInfo3D } from './types'
|
|
17
13
|
import { CHEMPOT_DEFAULTS } from './types'
|
|
18
14
|
import { to_error } from '../utils'
|
|
19
15
|
|
|
@@ -37,27 +33,25 @@
|
|
|
37
33
|
// Extract unique elements from all entries (composition keys are element symbols)
|
|
38
34
|
const all_elements = $derived(
|
|
39
35
|
[
|
|
40
|
-
...new Set(
|
|
41
|
-
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
...new Set(
|
|
37
|
+
entries.flatMap((entry) =>
|
|
38
|
+
Object.entries(entry.composition)
|
|
39
|
+
.filter(([, amount]) => amount > 0)
|
|
40
|
+
.map(([element]) => element),
|
|
41
|
+
),
|
|
42
|
+
),
|
|
45
43
|
].toSorted(),
|
|
46
44
|
)
|
|
47
45
|
|
|
48
46
|
// How many display axes (2 = binary/2D, 3+ = ternary/3D)
|
|
49
47
|
const display_elements = $derived(config.elements ?? all_elements)
|
|
50
48
|
const n_display = $derived(display_elements.length)
|
|
51
|
-
const show_tooltip = $derived(
|
|
52
|
-
config.show_tooltip ?? CHEMPOT_DEFAULTS.show_tooltip,
|
|
53
|
-
)
|
|
49
|
+
const show_tooltip = $derived(config.show_tooltip ?? CHEMPOT_DEFAULTS.show_tooltip)
|
|
54
50
|
const tooltip_detail_level = $derived(
|
|
55
51
|
config.tooltip_detail_level ?? CHEMPOT_DEFAULTS.tooltip_detail_level,
|
|
56
52
|
)
|
|
57
53
|
|
|
58
|
-
const projection_mode = $derived(
|
|
59
|
-
config.projection_mode ?? CHEMPOT_DEFAULTS.projection_mode,
|
|
60
|
-
)
|
|
54
|
+
const projection_mode = $derived(config.projection_mode ?? CHEMPOT_DEFAULTS.projection_mode)
|
|
61
55
|
// For quaternary+ in grid mode, generate all C(n,3) ternary projections
|
|
62
56
|
// Uses display_elements (not all_elements) so config.elements scopes the grid
|
|
63
57
|
const ternary_combos = $derived(
|
|
@@ -81,25 +75,32 @@
|
|
|
81
75
|
if (!show_grid) return
|
|
82
76
|
let cancelled = false
|
|
83
77
|
compute_chempot_async(entries, { ...config, elements: ternary_combos[0] })
|
|
84
|
-
.then(() => {
|
|
78
|
+
.then(() => {
|
|
79
|
+
if (!cancelled) grid_cache_ready = true
|
|
80
|
+
})
|
|
85
81
|
.catch((err) => {
|
|
86
82
|
if (cancelled) return
|
|
87
83
|
console.error(`Grid precompute failed:`, err)
|
|
88
84
|
grid_error = to_error(err).message
|
|
89
85
|
})
|
|
90
|
-
return () => {
|
|
86
|
+
return () => {
|
|
87
|
+
cancelled = true
|
|
88
|
+
}
|
|
91
89
|
})
|
|
92
|
-
const is_hover_info_3d = (value: ChemPotHoverInfo | null): value is ChemPotHoverInfo3D =>
|
|
90
|
+
const is_hover_info_3d = (value: ChemPotHoverInfo | null): value is ChemPotHoverInfo3D =>
|
|
91
|
+
value?.view === `3d`
|
|
93
92
|
|
|
94
93
|
let tooltip_el = $state<HTMLElement>()
|
|
95
94
|
const tooltip_pos = $derived.by(() => {
|
|
96
95
|
const pointer = hover_info?.pointer
|
|
97
96
|
if (!pointer) return { x: 4, y: 4 }
|
|
98
97
|
return constrain_tooltip_position(
|
|
99
|
-
pointer.x,
|
|
98
|
+
pointer.x,
|
|
99
|
+
pointer.y,
|
|
100
100
|
tooltip_el?.offsetWidth ?? 200,
|
|
101
101
|
tooltip_el?.offsetHeight ?? 100,
|
|
102
|
-
width,
|
|
102
|
+
width,
|
|
103
|
+
height,
|
|
103
104
|
{ offset: 0 },
|
|
104
105
|
)
|
|
105
106
|
})
|
|
@@ -184,7 +185,9 @@ const is_hover_info_3d = (value: ChemPotHoverInfo | null): value is ChemPotHover
|
|
|
184
185
|
style:left="{tooltip_pos.x}px"
|
|
185
186
|
style:top="{tooltip_pos.y}px"
|
|
186
187
|
>
|
|
187
|
-
<h4>
|
|
188
|
+
<h4>
|
|
189
|
+
{@html sanitize_html(get_electro_neg_formula(hover_info.formula, false, ``, `.3~s`))}
|
|
190
|
+
</h4>
|
|
188
191
|
{#if hover_info.view === `2d`}
|
|
189
192
|
<p>2D domain · Points: {hover_info.n_points}</p>
|
|
190
193
|
{#if tooltip_detail_level === `detailed`}
|
|
@@ -209,8 +212,7 @@ const is_hover_info_3d = (value: ChemPotHoverInfo | null): value is ChemPotHover
|
|
|
209
212
|
</p>
|
|
210
213
|
<p>
|
|
211
214
|
Entries: {hover_info.matching_entry_count}
|
|
212
|
-
{#if hover_info.min_energy_per_atom !== null &&
|
|
213
|
-
hover_info.max_energy_per_atom !== null}
|
|
215
|
+
{#if hover_info.min_energy_per_atom !== null && hover_info.max_energy_per_atom !== null}
|
|
214
216
|
· E/atom: {format_num(hover_info.min_energy_per_atom, `.4~g`)}
|
|
215
217
|
to {format_num(hover_info.max_energy_per_atom, `.4~g`)} eV
|
|
216
218
|
{/if}
|
|
@@ -224,20 +226,16 @@ const is_hover_info_3d = (value: ChemPotHoverInfo | null): value is ChemPotHover
|
|
|
224
226
|
</p>
|
|
225
227
|
{/each}
|
|
226
228
|
<p>
|
|
227
|
-
Centroid: ({
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
)
|
|
231
|
-
})
|
|
229
|
+
Centroid: ({hover_info.ann_loc
|
|
230
|
+
.map((value) => format_num(value, `.3~g`))
|
|
231
|
+
.join(`, `)})
|
|
232
232
|
</p>
|
|
233
233
|
{#if hover_info.neighbors.length > 0}
|
|
234
234
|
<h5 id="neighbors">Neighbors ({hover_info.neighbors.length})</h5>
|
|
235
235
|
<p>
|
|
236
|
-
{
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
).join(`, `)
|
|
240
|
-
}
|
|
236
|
+
{hover_info.neighbors
|
|
237
|
+
.map((formula) => get_electro_neg_formula(formula, true, ``, `.3~s`))
|
|
238
|
+
.join(`, `)}
|
|
241
239
|
</p>
|
|
242
240
|
{/if}
|
|
243
241
|
{#if hover_info.touches_limits.length > 0}
|
|
@@ -295,10 +293,7 @@ const is_hover_info_3d = (value: ChemPotHoverInfo | null): value is ChemPotHover
|
|
|
295
293
|
.chempot-tooltip {
|
|
296
294
|
position: absolute;
|
|
297
295
|
max-width: min(32rem, 92vw);
|
|
298
|
-
background: var(
|
|
299
|
-
--tooltip-bg,
|
|
300
|
-
light-dark(rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0.9))
|
|
301
|
-
);
|
|
296
|
+
background: var(--tooltip-bg, light-dark(rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0.9)));
|
|
302
297
|
color: var(--tooltip-text, var(--text-color, #222));
|
|
303
298
|
border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
|
|
304
299
|
border-radius: 6px;
|
|
@@ -78,15 +78,18 @@
|
|
|
78
78
|
const render_height = $derived(Math.round(render_width * base_aspect_ratio))
|
|
79
79
|
|
|
80
80
|
// === Control overrides (override ?? config ?? default, cleared by Reset) ===
|
|
81
|
-
const overrides = create_chempot_overrides(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
const overrides = create_chempot_overrides(
|
|
82
|
+
() => config,
|
|
83
|
+
[
|
|
84
|
+
`formal_chempots`,
|
|
85
|
+
`label_stable`,
|
|
86
|
+
`element_padding`,
|
|
87
|
+
`default_min_limit`,
|
|
88
|
+
`color_mode`,
|
|
89
|
+
`color_scale`,
|
|
90
|
+
`reverse_color_scale`,
|
|
91
|
+
],
|
|
92
|
+
)
|
|
90
93
|
const formal_chempots = $derived(overrides.resolve(`formal_chempots`))
|
|
91
94
|
const label_stable = $derived(overrides.resolve(`label_stable`))
|
|
92
95
|
const element_padding = $derived(overrides.resolve(`element_padding`))
|
|
@@ -120,10 +123,7 @@
|
|
|
120
123
|
if (next_temperature !== temperature) temperature = next_temperature
|
|
121
124
|
})
|
|
122
125
|
|
|
123
|
-
const show_temperature_slider = $derived(
|
|
124
|
-
has_temp_data && available_temperatures.length > 0,
|
|
125
|
-
)
|
|
126
|
-
|
|
126
|
+
const show_temperature_slider = $derived(has_temp_data && available_temperatures.length > 0)
|
|
127
127
|
|
|
128
128
|
// === Diagram computation (off main thread via Web Worker) ===
|
|
129
129
|
let diagram_data = $state<ChemPotDiagramData | null>(null)
|
|
@@ -148,12 +148,12 @@
|
|
|
148
148
|
diagram_data = null
|
|
149
149
|
diagram_computing = false
|
|
150
150
|
})
|
|
151
|
-
return () => {
|
|
151
|
+
return () => {
|
|
152
|
+
cancelled = true
|
|
153
|
+
}
|
|
152
154
|
})
|
|
153
155
|
|
|
154
|
-
const plot_elements = $derived(
|
|
155
|
-
(diagram_data?.elements ?? config.elements ?? []).slice(0, 2),
|
|
156
|
-
)
|
|
156
|
+
const plot_elements = $derived((diagram_data?.elements ?? config.elements ?? []).slice(0, 2))
|
|
157
157
|
|
|
158
158
|
const draw_domains = $derived.by(() => {
|
|
159
159
|
if (!diagram_data || plot_elements.length < 2) return {}
|
|
@@ -191,9 +191,7 @@
|
|
|
191
191
|
}
|
|
192
192
|
type NumericColorMode = Exclude<ChemPotColorMode, `none` | `arity`>
|
|
193
193
|
|
|
194
|
-
const raw_el_refs = $derived(
|
|
195
|
-
get_min_entries_and_el_refs(temp_filtered_entries).el_refs,
|
|
196
|
-
)
|
|
194
|
+
const raw_el_refs = $derived(get_min_entries_and_el_refs(temp_filtered_entries).el_refs)
|
|
197
195
|
const entry_energy_stats_by_formula = $derived.by(
|
|
198
196
|
(): SvelteMap<string, FormulaEnergyStats> => {
|
|
199
197
|
const stats = new SvelteMap<string, FormulaEnergyStats>()
|
|
@@ -229,11 +227,7 @@
|
|
|
229
227
|
return entry_energy_stats_by_formula.get(formula)?.min_energy_per_atom ?? null
|
|
230
228
|
}
|
|
231
229
|
if (active_color_mode === `formation_energy`) {
|
|
232
|
-
return best_form_energy_for_formula(
|
|
233
|
-
temp_filtered_entries,
|
|
234
|
-
formula,
|
|
235
|
-
raw_el_refs,
|
|
236
|
-
) ?? null
|
|
230
|
+
return best_form_energy_for_formula(temp_filtered_entries, formula, raw_el_refs) ?? null
|
|
237
231
|
}
|
|
238
232
|
return entry_energy_stats_by_formula.get(formula)?.matching_entry_count ?? 0
|
|
239
233
|
}
|
|
@@ -275,24 +269,22 @@
|
|
|
275
269
|
}
|
|
276
270
|
return colors
|
|
277
271
|
})
|
|
278
|
-
const color_range = $derived.by(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
},
|
|
295
|
-
)
|
|
272
|
+
const color_range = $derived.by((): { min: number; max: number; label: string } | null => {
|
|
273
|
+
const values = domain_color_values?.values ?? []
|
|
274
|
+
if (values.length === 0) return null
|
|
275
|
+
let min_val = values[0],
|
|
276
|
+
max_val = values[0]
|
|
277
|
+
for (let idx = 1; idx < values.length; idx++) {
|
|
278
|
+
if (values[idx] < min_val) min_val = values[idx]
|
|
279
|
+
if (values[idx] > max_val) max_val = values[idx]
|
|
280
|
+
}
|
|
281
|
+
return {
|
|
282
|
+
min: min_val,
|
|
283
|
+
max: Math.max(max_val, min_val + 1e-6),
|
|
284
|
+
label:
|
|
285
|
+
color_mode === `none` || color_mode === `arity` ? `` : color_mode_labels[color_mode],
|
|
286
|
+
}
|
|
287
|
+
})
|
|
296
288
|
|
|
297
289
|
// === Convert domains to ScatterPlot DataSeries ===
|
|
298
290
|
const series = $derived<DataSeries[]>(
|
|
@@ -350,11 +342,7 @@
|
|
|
350
342
|
// === Hover info for external consumers ===
|
|
351
343
|
let locked_hover_formula = $state<string | null>(null)
|
|
352
344
|
|
|
353
|
-
function set_hover_info(
|
|
354
|
-
formula: string,
|
|
355
|
-
pts: number[][],
|
|
356
|
-
event: MouseEvent,
|
|
357
|
-
): void {
|
|
345
|
+
function set_hover_info(formula: string, pts: number[][], event: MouseEvent): void {
|
|
358
346
|
const bounds = wrapper?.getBoundingClientRect()
|
|
359
347
|
hover_info = with_hover_pointer<ChemPotHoverInfo>(
|
|
360
348
|
{
|
|
@@ -387,9 +375,7 @@
|
|
|
387
375
|
set_hover_info(formula, pts, data.event)
|
|
388
376
|
}
|
|
389
377
|
|
|
390
|
-
function handle_click(
|
|
391
|
-
data: { point: { series_idx: number }; event: MouseEvent },
|
|
392
|
-
): void {
|
|
378
|
+
function handle_click(data: { point: { series_idx: number }; event: MouseEvent }): void {
|
|
393
379
|
const entry = domain_entries[data.point.series_idx]
|
|
394
380
|
if (!entry) return
|
|
395
381
|
const [formula, pts] = entry
|
|
@@ -406,10 +392,12 @@
|
|
|
406
392
|
const pointer = hover_info?.pointer
|
|
407
393
|
if (!pointer) return { x: 4, y: 4 }
|
|
408
394
|
return constrain_tooltip_position(
|
|
409
|
-
pointer.x,
|
|
395
|
+
pointer.x,
|
|
396
|
+
pointer.y,
|
|
410
397
|
tooltip_el?.offsetWidth ?? 150,
|
|
411
398
|
tooltip_el?.offsetHeight ?? 40,
|
|
412
|
-
render_width,
|
|
399
|
+
render_width,
|
|
400
|
+
render_height,
|
|
413
401
|
{ offset: 0 },
|
|
414
402
|
)
|
|
415
403
|
})
|
|
@@ -447,11 +435,13 @@
|
|
|
447
435
|
},
|
|
448
436
|
{
|
|
449
437
|
title: `Export Data`,
|
|
450
|
-
items: [
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
438
|
+
items: [
|
|
439
|
+
{
|
|
440
|
+
label: `JSON`,
|
|
441
|
+
on_download: () => export_json_file(json_payload, export_basename),
|
|
442
|
+
copy_text: () => get_json_string(json_payload),
|
|
443
|
+
},
|
|
444
|
+
],
|
|
455
445
|
},
|
|
456
446
|
])
|
|
457
447
|
</script>
|
|
@@ -477,8 +467,7 @@
|
|
|
477
467
|
toggle_props={{
|
|
478
468
|
class: `chempot-export-toggle`,
|
|
479
469
|
title: `Export chemical potential diagram`,
|
|
480
|
-
style:
|
|
481
|
-
`position: absolute; top: var(--ctrl-btn-top, 5pt); right: 36px; z-index: 10`,
|
|
470
|
+
style: `position: absolute; top: var(--ctrl-btn-top, 5pt); right: 36px; z-index: 10`,
|
|
482
471
|
}}
|
|
483
472
|
/>
|
|
484
473
|
{/snippet}
|
|
@@ -509,7 +498,7 @@
|
|
|
509
498
|
step="0.1"
|
|
510
499
|
value={element_padding}
|
|
511
500
|
oninput={(event) =>
|
|
512
|
-
|
|
501
|
+
overrides.set(`element_padding`, Number(event.currentTarget.value) || 0)}
|
|
513
502
|
/>
|
|
514
503
|
</label>
|
|
515
504
|
<label>
|
|
@@ -534,7 +523,7 @@
|
|
|
534
523
|
<select
|
|
535
524
|
value={color_mode}
|
|
536
525
|
onchange={(event) =>
|
|
537
|
-
|
|
526
|
+
overrides.set(`color_mode`, event.currentTarget.value as typeof color_mode)}
|
|
538
527
|
>
|
|
539
528
|
{#each CHEMPOT_COLOR_MODE_OPTIONS as [value, label] (value)}
|
|
540
529
|
<option {value}>{label}</option>
|
|
@@ -547,7 +536,7 @@
|
|
|
547
536
|
<select
|
|
548
537
|
value={color_scale}
|
|
549
538
|
onchange={(event) =>
|
|
550
|
-
|
|
539
|
+
overrides.set(`color_scale`, event.currentTarget.value as D3InterpolateName)}
|
|
551
540
|
>
|
|
552
541
|
{#each CHEMPOT_COLOR_SCALE_OPTIONS as [value, label] (value)}
|
|
553
542
|
<option {value}>{label}</option>
|
|
@@ -589,9 +578,9 @@
|
|
|
589
578
|
onpointerdown={(event) => {
|
|
590
579
|
const target = event.target
|
|
591
580
|
if (!locked_hover_formula) return
|
|
592
|
-
const is_background_click =
|
|
593
|
-
|
|
594
|
-
|
|
581
|
+
const is_background_click =
|
|
582
|
+
target === wrapper ||
|
|
583
|
+
(target instanceof SVGElement && target.closest(`g[data-series-id]`) === null)
|
|
595
584
|
if (is_background_click) {
|
|
596
585
|
clear_hover_lock()
|
|
597
586
|
}
|
|
@@ -614,9 +603,9 @@
|
|
|
614
603
|
/>
|
|
615
604
|
{#if color_mode !== `none` && color_mode !== `arity` && color_range}
|
|
616
605
|
{@const color_bar_config = get_chempot_color_bar_config(
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
606
|
+
color_scale,
|
|
607
|
+
reverse_color_scale,
|
|
608
|
+
)}
|
|
620
609
|
<ColorBar
|
|
621
610
|
title={color_range.label}
|
|
622
611
|
range={[color_range.min, color_range.max]}
|
|
@@ -669,7 +658,9 @@
|
|
|
669
658
|
}
|
|
670
659
|
.chempot-diagram-2d > :global(.pane-toggle) {
|
|
671
660
|
opacity: 0;
|
|
672
|
-
transition:
|
|
661
|
+
transition:
|
|
662
|
+
opacity 0.2s,
|
|
663
|
+
background-color 0.2s;
|
|
673
664
|
}
|
|
674
665
|
.chempot-diagram-2d:hover > :global(.pane-toggle),
|
|
675
666
|
.chempot-diagram-2d > :global(.pane-toggle:focus-visible),
|
|
@@ -716,10 +707,7 @@
|
|
|
716
707
|
}
|
|
717
708
|
.tooltip {
|
|
718
709
|
position: absolute;
|
|
719
|
-
background: var(
|
|
720
|
-
--tooltip-bg,
|
|
721
|
-
light-dark(rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0.9))
|
|
722
|
-
);
|
|
710
|
+
background: var(--tooltip-bg, light-dark(rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0.9)));
|
|
723
711
|
color: var(--tooltip-text, var(--text-color, #fff));
|
|
724
712
|
padding: 4px 8px;
|
|
725
713
|
border-radius: 4px;
|
|
@@ -14,6 +14,6 @@ type $$ComponentProps = {
|
|
|
14
14
|
fullscreen?: boolean;
|
|
15
15
|
export_pane_open?: boolean;
|
|
16
16
|
};
|
|
17
|
-
declare const ChemPotDiagram2D: import("svelte").Component<$$ComponentProps, {}, "height" | "width" | "
|
|
17
|
+
declare const ChemPotDiagram2D: import("svelte").Component<$$ComponentProps, {}, "height" | "width" | "fullscreen" | "wrapper" | "export_pane_open" | "temperature" | "hover_info">;
|
|
18
18
|
type ChemPotDiagram2D = ReturnType<typeof ChemPotDiagram2D>;
|
|
19
19
|
export default ChemPotDiagram2D;
|