matterviz 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EmptyState.svelte +10 -4
- package/dist/FilePicker.svelte +12 -14
- package/dist/Icon.svelte +7 -4
- package/dist/MillerIndexInput.svelte +2 -2
- package/dist/app.css +53 -0
- package/dist/brillouin/BrillouinZone.svelte +132 -219
- package/dist/brillouin/BrillouinZone.svelte.d.ts +9 -20
- package/dist/brillouin/BrillouinZoneControls.svelte +3 -6
- package/dist/brillouin/BrillouinZoneExportPane.svelte +47 -96
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +15 -42
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +2 -3
- package/dist/brillouin/BrillouinZoneScene.svelte +63 -230
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +3 -23
- package/dist/brillouin/ReciprocalVectors.svelte +39 -0
- package/dist/brillouin/ReciprocalVectors.svelte.d.ts +9 -0
- package/dist/brillouin/compute.d.ts +2 -0
- package/dist/brillouin/compute.js +80 -77
- package/dist/brillouin/geometry.d.ts +8 -0
- package/dist/brillouin/geometry.js +57 -0
- package/dist/brillouin/index.d.ts +2 -0
- package/dist/brillouin/index.js +2 -0
- package/dist/brillouin/types.d.ts +2 -2
- package/dist/chempot-diagram/ChemPotDiagram.svelte +33 -38
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +143 -246
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +4 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +652 -976
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +7 -1
- package/dist/chempot-diagram/async-compute.svelte.js +1 -1
- package/dist/chempot-diagram/color.d.ts +3 -6
- package/dist/chempot-diagram/color.js +5 -5
- package/dist/chempot-diagram/compute.d.ts +3 -3
- package/dist/chempot-diagram/compute.js +3 -1
- package/dist/chempot-diagram/controls-state.svelte.d.ts +10 -0
- package/dist/chempot-diagram/controls-state.svelte.js +42 -0
- package/dist/chempot-diagram/export.d.ts +47 -0
- package/dist/chempot-diagram/export.js +133 -0
- package/dist/chempot-diagram/index.d.ts +1 -0
- package/dist/chempot-diagram/index.js +1 -0
- package/dist/chempot-diagram/pointer.d.ts +0 -10
- package/dist/chempot-diagram/pointer.js +4 -4
- package/dist/chempot-diagram/types.d.ts +3 -3
- package/dist/colors/index.d.ts +0 -4
- package/dist/colors/index.js +21 -22
- package/dist/composition/BarChart.svelte +37 -31
- package/dist/composition/BubbleChart.svelte +17 -17
- package/dist/composition/Composition.svelte +7 -11
- package/dist/composition/Formula.svelte +18 -25
- package/dist/composition/FormulaFilter.svelte +96 -98
- package/dist/composition/PieChart.svelte +60 -46
- package/dist/composition/chem-sys.js +3 -2
- package/dist/composition/format.js +4 -3
- package/dist/composition/index.d.ts +2 -0
- package/dist/composition/index.js +14 -0
- package/dist/composition/parse.d.ts +2 -3
- package/dist/composition/parse.js +27 -28
- package/dist/constants.js +11 -9
- package/dist/controls.d.ts +1 -0
- package/dist/controls.js +0 -1
- package/dist/convex-hull/ConvexHull.svelte +20 -25
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -4
- package/dist/convex-hull/ConvexHull2D.svelte +176 -256
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +269 -804
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +236 -755
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +264 -0
- package/dist/convex-hull/ConvexHullChrome.svelte.d.ts +30 -0
- package/dist/convex-hull/ConvexHullControls.svelte +128 -49
- package/dist/convex-hull/ConvexHullControls.svelte.d.ts +7 -6
- package/dist/convex-hull/ConvexHullInfoPane.svelte +18 -5
- package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +6 -5
- package/dist/convex-hull/ConvexHullStats.svelte +210 -351
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +3 -1
- package/dist/convex-hull/ConvexHullTooltip.svelte +16 -14
- package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +2 -1
- package/dist/convex-hull/GasPressureControls.svelte +5 -12
- package/dist/convex-hull/StructurePopup.svelte +17 -21
- package/dist/convex-hull/StructurePopup.svelte.d.ts +2 -0
- package/dist/convex-hull/TemperatureSlider.svelte +4 -10
- package/dist/convex-hull/barycentric-coords.d.ts +2 -4
- package/dist/convex-hull/barycentric-coords.js +6 -33
- package/dist/convex-hull/canvas-interactions.svelte.d.ts +79 -0
- package/dist/convex-hull/canvas-interactions.svelte.js +279 -0
- package/dist/convex-hull/helpers.d.ts +47 -17
- package/dist/convex-hull/helpers.js +186 -101
- package/dist/convex-hull/hull-state.svelte.d.ts +44 -0
- package/dist/convex-hull/hull-state.svelte.js +124 -0
- package/dist/convex-hull/index.d.ts +9 -7
- package/dist/convex-hull/index.js +7 -2
- package/dist/convex-hull/thermodynamics.js +109 -937
- package/dist/convex-hull/types.d.ts +12 -4
- package/dist/convex-hull/types.js +12 -0
- package/dist/coordination/CoordinationBarPlot.svelte +41 -43
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +1 -1
- package/dist/coordination/calc-coordination.d.ts +1 -1
- package/dist/coordination/calc-coordination.js +28 -25
- package/dist/element/BohrAtom.svelte +6 -8
- package/dist/element/ElementHeading.svelte +4 -1
- package/dist/element/ElementPhoto.svelte +11 -9
- package/dist/element/ElementStats.svelte +12 -10
- package/dist/element/ElementTile.svelte +24 -29
- package/dist/element/ElementTile.svelte.d.ts +1 -1
- package/dist/element/Nucleus.svelte +4 -2
- package/dist/element/data.d.ts +1 -2
- package/dist/element/helpers.d.ts +4 -0
- package/dist/element/helpers.js +18 -0
- package/dist/element/index.d.ts +1 -0
- package/dist/element/index.js +3 -0
- package/dist/feedback/DragOverlay.svelte +5 -3
- package/dist/feedback/DragOverlay.svelte.d.ts +2 -1
- package/dist/feedback/StatusMessage.svelte +20 -7
- package/dist/fermi-surface/FermiSlice.svelte +21 -18
- package/dist/fermi-surface/FermiSurface.svelte +78 -165
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +9 -20
- package/dist/fermi-surface/FermiSurfaceControls.svelte +6 -20
- package/dist/fermi-surface/FermiSurfaceScene.svelte +93 -272
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +3 -23
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +9 -6
- package/dist/fermi-surface/compute.js +14 -13
- package/dist/fermi-surface/export.js +4 -15
- package/dist/fermi-surface/index.d.ts +0 -1
- package/dist/fermi-surface/index.js +0 -1
- package/dist/fermi-surface/parse.d.ts +1 -1
- package/dist/fermi-surface/parse.js +84 -97
- package/dist/fermi-surface/types.d.ts +2 -2
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +161 -185
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +6 -5
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +12 -9
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +5 -5
- package/dist/heatmap-matrix/index.d.ts +8 -2
- package/dist/icons.d.ts +4 -0
- package/dist/icons.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/io/ExportPane.svelte +170 -0
- package/dist/io/ExportPane.svelte.d.ts +17 -0
- package/dist/io/decompress.d.ts +2 -1
- package/dist/io/decompress.js +22 -36
- package/dist/io/export.d.ts +9 -1
- package/dist/io/export.js +37 -29
- package/dist/io/fetch.d.ts +2 -4
- package/dist/io/fetch.js +0 -11
- package/dist/io/file-drop.d.ts +7 -0
- package/dist/io/file-drop.js +13 -0
- package/dist/io/index.d.ts +1 -0
- package/dist/io/index.js +3 -0
- package/dist/io/is-binary.d.ts +9 -0
- package/dist/io/is-binary.js +45 -1
- package/dist/io/types.d.ts +13 -0
- package/dist/io/url-drop.js +13 -25
- package/dist/isosurface/Isosurface.svelte +17 -23
- package/dist/isosurface/IsosurfaceControls.svelte +37 -42
- package/dist/isosurface/parse-vaspwave.d.ts +3 -0
- package/dist/isosurface/parse-vaspwave.js +138 -0
- package/dist/isosurface/parse.js +50 -48
- package/dist/labels.d.ts +6 -2
- package/dist/labels.js +44 -14
- package/dist/layout/FullscreenButton.svelte +34 -0
- package/dist/layout/FullscreenButton.svelte.d.ts +10 -0
- package/dist/layout/FullscreenToggle.svelte +12 -12
- package/dist/layout/InfoCard.svelte +7 -18
- package/dist/layout/InfoTag.svelte +1 -3
- package/dist/layout/NumberRangeInput.svelte +46 -0
- package/dist/layout/NumberRangeInput.svelte.d.ts +12 -0
- package/dist/layout/PropertyFilter.svelte +2 -6
- package/dist/layout/SettingsSection.svelte +21 -17
- package/dist/layout/SubpageGrid.svelte +3 -1
- package/dist/layout/ViewerChrome.svelte +115 -0
- package/dist/layout/ViewerChrome.svelte.d.ts +18 -0
- package/dist/layout/fullscreen.d.ts +4 -0
- package/dist/layout/fullscreen.js +3 -5
- package/dist/layout/fullscreen.svelte.d.ts +8 -0
- package/dist/layout/fullscreen.svelte.js +36 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout/index.js +4 -0
- package/dist/layout/json-tree/JsonNode.svelte +8 -11
- package/dist/layout/json-tree/JsonTree.svelte +53 -77
- package/dist/layout/json-tree/JsonValue.svelte +7 -15
- package/dist/layout/json-tree/utils.js +14 -23
- package/dist/math.d.ts +9 -3
- package/dist/math.js +37 -21
- package/dist/overlays/ContextMenu.svelte +4 -2
- package/dist/overlays/CopyButton.svelte +11 -5
- package/dist/overlays/DragControlTab.svelte +6 -1
- package/dist/overlays/DraggablePane.svelte +81 -26
- package/dist/overlays/DraggablePane.svelte.d.ts +1 -0
- package/dist/overlays/GlassChip.svelte +30 -0
- package/dist/overlays/GlassChip.svelte.d.ts +8 -0
- package/dist/overlays/InfoPaneCards.svelte +11 -23
- package/dist/overlays/index.d.ts +11 -0
- package/dist/overlays/index.js +26 -0
- package/dist/overlays/portal.d.ts +2 -0
- package/dist/overlays/portal.js +14 -0
- package/dist/periodic-table/PeriodicTable.svelte +115 -146
- package/dist/periodic-table/PeriodicTable.svelte.d.ts +5 -3
- package/dist/periodic-table/PeriodicTableControls.svelte +11 -63
- package/dist/periodic-table/TableInset.svelte +9 -4
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +50 -71
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +6 -8
- package/dist/phase-diagram/PhaseDiagramControls.svelte +73 -96
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +4 -3
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +4 -2
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +2 -3
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +49 -134
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +3 -4
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +54 -58
- package/dist/phase-diagram/TdbInfoPanel.svelte +21 -15
- package/dist/phase-diagram/build-diagram.js +3 -3
- package/dist/phase-diagram/colors.js +1 -1
- package/dist/phase-diagram/diagram-input.d.ts +1 -2
- package/dist/phase-diagram/parse.d.ts +2 -1
- package/dist/phase-diagram/parse.js +15 -15
- package/dist/phase-diagram/svg-to-diagram.js +21 -15
- package/dist/phase-diagram/utils.js +2 -3
- package/dist/plot/bar/BarPlot.svelte +494 -692
- package/dist/plot/bar/BarPlot.svelte.d.ts +9 -15
- package/dist/plot/bar/BarPlotControls.svelte +1 -3
- package/dist/plot/bar/BarPlotControls.svelte.d.ts +5 -7
- package/dist/plot/bar/SpacegroupBarPlot.svelte +31 -37
- package/dist/plot/bar/data.d.ts +5 -4
- package/dist/plot/bar/data.js +2 -1
- package/dist/plot/box/BoxPlot.svelte +361 -439
- package/dist/plot/box/BoxPlot.svelte.d.ts +6 -3
- package/dist/plot/box/BoxPlotControls.svelte.d.ts +1 -1
- package/dist/plot/box/Violin.svelte.d.ts +2 -1
- package/dist/plot/box/box-plot.d.ts +3 -2
- package/dist/plot/box/box-plot.js +6 -3
- package/dist/plot/box/kde.d.ts +2 -1
- package/dist/plot/box/kde.js +4 -4
- package/dist/plot/core/auto-place.d.ts +1 -1
- package/dist/plot/core/auto-place.js +5 -2
- package/dist/plot/core/axis-utils.d.ts +12 -7
- package/dist/plot/core/axis-utils.js +48 -48
- package/dist/plot/core/components/AxisLabel.svelte +82 -20
- package/dist/plot/core/components/AxisLabel.svelte.d.ts +1 -0
- package/dist/plot/core/components/ColorBar.svelte +106 -111
- package/dist/plot/core/components/ColorBar.svelte.d.ts +5 -4
- package/dist/plot/core/components/ColorScaleSelect.svelte +1 -1
- package/dist/plot/core/components/FillArea.svelte +10 -17
- package/dist/plot/core/components/HierarchyControls.svelte +249 -0
- package/dist/plot/{sunburst/SunburstControls.svelte.d.ts → core/components/HierarchyControls.svelte.d.ts} +12 -8
- package/dist/plot/core/components/InteractiveAxisLabel.svelte +1 -1
- package/dist/plot/core/components/InteractiveAxisLabel.svelte.d.ts +1 -1
- package/dist/plot/core/components/Line.svelte +21 -11
- package/dist/plot/core/components/Line.svelte.d.ts +5 -2
- package/dist/plot/core/components/PlotAxis.svelte +42 -18
- package/dist/plot/core/components/PlotAxis.svelte.d.ts +2 -1
- package/dist/plot/core/components/PlotControls.svelte +65 -41
- package/dist/plot/core/components/PlotControls.svelte.d.ts +1 -1
- package/dist/plot/core/components/PlotLegend.svelte +31 -35
- package/dist/plot/core/components/PlotMarginals.svelte +616 -0
- package/dist/plot/core/components/PlotMarginals.svelte.d.ts +15 -0
- package/dist/plot/core/components/PlotTooltip.svelte +1 -1
- package/dist/plot/core/components/PortalSelect.svelte +4 -8
- package/dist/plot/core/components/ReferenceLine.svelte +27 -24
- package/dist/plot/core/components/ReferenceLine3D.svelte +56 -59
- package/dist/plot/core/components/ReferenceLine3D.svelte.d.ts +4 -4
- package/dist/plot/core/components/ReferencePlane.svelte +9 -10
- package/dist/plot/core/components/ReferencePlane.svelte.d.ts +4 -4
- package/dist/plot/core/components/ZeroLines.svelte +4 -8
- package/dist/plot/core/components/ZoomRect.svelte +1 -2
- package/dist/plot/core/components/index.d.ts +1 -0
- package/dist/plot/core/components/index.js +1 -0
- package/dist/plot/core/data-cleaning-signal.d.ts +46 -0
- package/dist/plot/core/data-cleaning-signal.js +467 -0
- package/dist/plot/core/data-cleaning.d.ts +2 -42
- package/dist/plot/core/data-cleaning.js +29 -476
- package/dist/plot/core/data-transform.js +9 -5
- package/dist/plot/core/fill-utils.d.ts +7 -4
- package/dist/plot/core/fill-utils.js +34 -9
- package/dist/plot/core/index.d.ts +1 -0
- package/dist/plot/core/index.js +1 -0
- package/dist/plot/core/interactions.d.ts +5 -1
- package/dist/plot/core/interactions.js +14 -2
- package/dist/plot/core/layout.d.ts +3 -1
- package/dist/plot/core/layout.js +22 -13
- package/dist/plot/core/marginals.d.ts +170 -0
- package/dist/plot/core/marginals.js +436 -0
- package/dist/plot/core/pan-zoom.svelte.d.ts +35 -0
- package/dist/plot/core/pan-zoom.svelte.js +221 -0
- package/dist/plot/core/placed-tween.svelte.d.ts +21 -0
- package/dist/plot/core/placed-tween.svelte.js +68 -0
- package/dist/plot/core/reference-line.d.ts +10 -10
- package/dist/plot/core/reference-line.js +7 -7
- package/dist/plot/core/scales.d.ts +40 -25
- package/dist/plot/core/scales.js +49 -21
- package/dist/plot/core/svg.d.ts +2 -1
- package/dist/plot/core/types/fills.d.ts +101 -0
- package/dist/plot/core/types/fills.js +15 -0
- package/dist/plot/core/types/plot-3d.d.ts +87 -0
- package/dist/plot/core/types/plot-3d.js +4 -0
- package/dist/plot/core/types/reference-lines.d.ts +140 -0
- package/dist/plot/core/types/reference-lines.js +9 -0
- package/dist/plot/core/types.d.ts +47 -331
- package/dist/plot/core/types.js +23 -20
- package/dist/plot/core/utils/hierarchy-chart.d.ts +51 -0
- package/dist/plot/core/utils/hierarchy-chart.js +179 -0
- package/dist/plot/core/utils/hierarchy-labels.d.ts +20 -0
- package/dist/plot/core/utils/hierarchy-labels.js +99 -0
- package/dist/plot/core/utils/label-placement.d.ts +1 -1
- package/dist/plot/core/utils/label-placement.js +5 -5
- package/dist/plot/core/utils.d.ts +2 -1
- package/dist/plot/histogram/Histogram.svelte +373 -631
- package/dist/plot/histogram/Histogram.svelte.d.ts +7 -7
- package/dist/plot/histogram/HistogramControls.svelte +30 -28
- package/dist/plot/histogram/HistogramControls.svelte.d.ts +1 -1
- package/dist/plot/histogram/histogram.d.ts +31 -0
- package/dist/plot/histogram/histogram.js +70 -0
- package/dist/plot/histogram/index.d.ts +1 -0
- package/dist/plot/histogram/index.js +1 -0
- package/dist/plot/index.d.ts +1 -0
- package/dist/plot/index.js +1 -0
- package/dist/plot/sankey/Sankey.svelte +79 -73
- package/dist/plot/sankey/Sankey.svelte.d.ts +3 -3
- package/dist/plot/sankey/SankeyControls.svelte +22 -16
- package/dist/plot/sankey/sankey.js +3 -1
- package/dist/plot/scatter/BinnedScatterPlot.svelte +264 -112
- package/dist/plot/scatter/BinnedScatterPlot.svelte.d.ts +11 -4
- package/dist/plot/scatter/ElementScatter.svelte +4 -1
- package/dist/plot/scatter/ScatterPlot.svelte +623 -821
- package/dist/plot/scatter/ScatterPlot.svelte.d.ts +9 -15
- package/dist/plot/scatter/ScatterPlotControls.svelte +18 -19
- package/dist/plot/scatter/ScatterPlotControls.svelte.d.ts +1 -1
- package/dist/plot/scatter/ScatterPoint.svelte +16 -9
- package/dist/plot/scatter/binned-scatter-types.d.ts +6 -12
- package/dist/plot/scatter/binned-scatter-types.js +6 -1
- package/dist/plot/scatter/index.d.ts +1 -1
- package/dist/plot/scatter/scatter-data.d.ts +1 -1
- package/dist/plot/scatter/scatter-data.js +8 -7
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte +40 -60
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte.d.ts +6 -14
- package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte +17 -15
- package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte.d.ts +5 -5
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte +232 -234
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte.d.ts +5 -14
- package/dist/plot/scatter-3d/Surface3D.svelte +9 -17
- package/dist/plot/scatter-3d/Surface3D.svelte.d.ts +4 -3
- package/dist/plot/sunburst/Sunburst.svelte +256 -338
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +4 -3
- package/dist/plot/sunburst/index.d.ts +1 -1
- package/dist/plot/sunburst/index.js +2 -1
- package/dist/plot/sunburst/render.d.ts +2 -2
- package/dist/plot/sunburst/render.js +47 -22
- package/dist/plot/sunburst/sunburst.d.ts +5 -1
- package/dist/plot/sunburst/sunburst.js +14 -4
- package/dist/plot/treemap/Treemap.svelte +907 -0
- package/dist/plot/treemap/Treemap.svelte.d.ts +84 -0
- package/dist/plot/treemap/index.d.ts +3 -0
- package/dist/plot/treemap/index.js +4 -0
- package/dist/plot/treemap/treemap.d.ts +26 -0
- package/dist/plot/treemap/treemap.js +99 -0
- package/dist/rdf/RdfPlot.svelte +22 -26
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/calc-rdf.js +4 -8
- package/dist/sanitize.js +14 -3
- package/dist/scene/SceneCamera.svelte +62 -0
- package/dist/scene/SceneCamera.svelte.d.ts +19 -0
- package/dist/scene/bind-renderer.svelte.d.ts +2 -0
- package/dist/scene/bind-renderer.svelte.js +22 -0
- package/dist/scene/index.d.ts +4 -0
- package/dist/scene/index.js +5 -0
- package/dist/scene/props.js +52 -0
- package/dist/scene/types.d.ts +26 -0
- package/dist/scene/types.js +1 -0
- package/dist/settings.d.ts +33 -11
- package/dist/settings.js +136 -51
- package/dist/spectral/Bands.svelte +231 -237
- package/dist/spectral/Bands.svelte.d.ts +3 -2
- package/dist/spectral/BandsAndDos.svelte +29 -29
- package/dist/spectral/BrillouinBandsDos.svelte +21 -29
- package/dist/spectral/Dos.svelte +75 -77
- package/dist/spectral/Dos.svelte.d.ts +2 -1
- package/dist/spectral/helpers.d.ts +9 -9
- package/dist/spectral/helpers.js +66 -70
- package/dist/state.svelte.d.ts +0 -7
- package/dist/state.svelte.js +5 -24
- package/dist/structure/Arrow.svelte +6 -21
- package/dist/structure/ArrowInstances.svelte +160 -0
- package/dist/structure/ArrowInstances.svelte.d.ts +16 -0
- package/dist/structure/AtomLegend.svelte +115 -75
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/Bond.svelte +31 -23
- package/dist/structure/CanvasTooltip.svelte +16 -3
- package/dist/structure/CellSelect.svelte +22 -29
- package/dist/structure/CellSelect.svelte.d.ts +2 -1
- package/dist/structure/Cylinder.svelte +24 -40
- package/dist/structure/InstancedAtoms.svelte +114 -0
- package/dist/structure/InstancedAtoms.svelte.d.ts +15 -0
- package/dist/structure/Lattice.svelte +85 -149
- package/dist/structure/SiteLabels.svelte +122 -0
- package/dist/structure/SiteLabels.svelte.d.ts +18 -0
- package/dist/structure/Structure.svelte +725 -735
- package/dist/structure/Structure.svelte.d.ts +8 -16
- package/dist/structure/StructureCarousel.svelte +630 -0
- package/dist/structure/StructureCarousel.svelte.d.ts +19 -0
- package/dist/structure/StructureControls.svelte +298 -325
- package/dist/structure/StructureControls.svelte.d.ts +5 -3
- package/dist/structure/StructureExportPane.svelte +62 -168
- package/dist/structure/StructureExportPane.svelte.d.ts +4 -5
- package/dist/structure/StructureInfoPane.svelte +77 -69
- package/dist/structure/StructureInfoPane.svelte.d.ts +6 -6
- package/dist/structure/StructureScene.svelte +758 -600
- package/dist/structure/StructureScene.svelte.d.ts +24 -20
- package/dist/structure/StructureViewport.svelte +386 -0
- package/dist/structure/StructureViewport.svelte.d.ts +63 -0
- package/dist/structure/atom-label-placement.d.ts +18 -0
- package/dist/structure/atom-label-placement.js +115 -0
- package/dist/structure/atom-properties.d.ts +3 -1
- package/dist/structure/atom-properties.js +115 -54
- package/dist/structure/bond-order-perception.js +2 -4
- package/dist/structure/bonding.d.ts +12 -2
- package/dist/structure/bonding.js +172 -73
- package/dist/structure/edit-history.d.ts +6 -0
- package/dist/structure/edit-history.js +27 -0
- package/dist/structure/export.d.ts +25 -4
- package/dist/structure/export.js +103 -153
- package/dist/structure/format-detect.d.ts +1 -0
- package/dist/structure/format-detect.js +22 -0
- package/dist/structure/geometry.d.ts +9 -0
- package/dist/structure/geometry.js +27 -0
- package/dist/structure/index.d.ts +18 -1
- package/dist/structure/index.js +15 -2
- package/dist/structure/measure.d.ts +1 -1
- package/dist/structure/measure.js +6 -12
- package/dist/structure/parse.d.ts +5 -3
- package/dist/structure/parse.js +551 -567
- package/dist/structure/partial-occupancy.d.ts +0 -1
- package/dist/structure/partial-occupancy.js +5 -3
- package/dist/structure/pbc.d.ts +1 -1
- package/dist/structure/pbc.js +204 -51
- package/dist/structure/polyhedra.d.ts +40 -0
- package/dist/structure/polyhedra.js +587 -0
- package/dist/structure/site.d.ts +4 -0
- package/dist/structure/site.js +1 -0
- package/dist/structure/supercell.d.ts +1 -2
- package/dist/structure/supercell.js +10 -15
- package/dist/structure/validation.js +5 -6
- package/dist/symmetry/SymmetryElementControls.svelte +69 -0
- package/dist/symmetry/SymmetryElementControls.svelte.d.ts +9 -0
- package/dist/symmetry/SymmetryElements.svelte +350 -0
- package/dist/symmetry/SymmetryElements.svelte.d.ts +24 -0
- package/dist/symmetry/SymmetryStats.svelte +142 -49
- package/dist/symmetry/WyckoffTable.svelte +58 -16
- package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -0
- package/dist/symmetry/cell-transform.js +8 -14
- package/dist/symmetry/index.d.ts +15 -4
- package/dist/symmetry/index.js +308 -81
- package/dist/symmetry/spacegroups.d.ts +5 -1
- package/dist/symmetry/spacegroups.js +18 -3
- package/dist/symmetry/symmetry-elements.d.ts +33 -0
- package/dist/symmetry/symmetry-elements.js +521 -0
- package/dist/symmetry/wyckoff-db.d.ts +9 -0
- package/dist/symmetry/wyckoff-db.js +87 -0
- package/dist/table/HeatmapTable.svelte +1104 -378
- package/dist/table/HeatmapTable.svelte.d.ts +12 -2
- package/dist/table/ToggleMenu.svelte +5 -12
- package/dist/table/index.d.ts +21 -6
- package/dist/table/index.js +34 -21
- package/dist/theme/ThemeControl.svelte +16 -8
- package/dist/theme/index.d.ts +1 -5
- package/dist/theme/index.js +4 -10
- package/dist/theme/themes.mjs +14 -7
- package/dist/tooltip/KCoords.svelte +4 -1
- package/dist/tooltip/TooltipContent.svelte +2 -5
- package/dist/trajectory/Trajectory.svelte +556 -352
- package/dist/trajectory/Trajectory.svelte.d.ts +10 -22
- package/dist/trajectory/TrajectoryError.svelte +11 -8
- package/dist/trajectory/TrajectoryExportPane.svelte +28 -54
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +4 -5
- package/dist/trajectory/TrajectoryInfoPane.svelte +88 -99
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -2
- package/dist/trajectory/constants.js +6 -2
- package/dist/trajectory/extract.js +73 -71
- package/dist/trajectory/format-detect.d.ts +0 -1
- package/dist/trajectory/format-detect.js +13 -17
- package/dist/trajectory/frame-reader.d.ts +2 -1
- package/dist/trajectory/frame-reader.js +74 -136
- package/dist/trajectory/helpers.d.ts +12 -2
- package/dist/trajectory/helpers.js +68 -37
- package/dist/trajectory/index.d.ts +1 -0
- package/dist/trajectory/index.js +3 -0
- package/dist/trajectory/parse/ase.d.ts +9 -1
- package/dist/trajectory/parse/ase.js +47 -32
- package/dist/trajectory/parse/diagnostics.d.ts +3 -0
- package/dist/trajectory/parse/diagnostics.js +14 -0
- package/dist/trajectory/parse/h5-utils.d.ts +13 -0
- package/dist/trajectory/parse/h5-utils.js +109 -0
- package/dist/trajectory/parse/hdf5.d.ts +1 -1
- package/dist/trajectory/parse/hdf5.js +116 -106
- package/dist/trajectory/parse/index.d.ts +3 -4
- package/dist/trajectory/parse/index.js +68 -119
- package/dist/trajectory/parse/lammps.d.ts +0 -2
- package/dist/trajectory/parse/lammps.js +14 -16
- package/dist/trajectory/parse/pymatgen.d.ts +2 -0
- package/dist/trajectory/parse/pymatgen.js +74 -0
- package/dist/trajectory/parse/vasp.js +13 -9
- package/dist/trajectory/parse/vaspout-electronic.d.ts +13 -0
- package/dist/trajectory/parse/vaspout-electronic.js +207 -0
- package/dist/trajectory/parse/vaspout-h5.d.ts +5 -0
- package/dist/trajectory/parse/vaspout-h5.js +284 -0
- package/dist/trajectory/parse/xyz.d.ts +9 -21
- package/dist/trajectory/parse/xyz.js +38 -39
- package/dist/trajectory/plotting.d.ts +8 -10
- package/dist/trajectory/plotting.js +102 -127
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +8 -1
- package/dist/xrd/XrdPlot.svelte +56 -85
- package/dist/xrd/broadening.d.ts +2 -1
- package/dist/xrd/broadening.js +2 -1
- package/dist/xrd/calc-xrd.js +8 -15
- package/dist/xrd/index.d.ts +2 -2
- package/dist/xrd/parse.d.ts +0 -1
- package/dist/xrd/parse.js +56 -73
- package/package.json +77 -36
- package/dist/api/mp.d.ts +0 -6
- package/dist/api/mp.js +0 -22
- package/dist/element/data.json +0 -11864
- package/dist/fermi-surface/marching-cubes.d.ts +0 -2
- package/dist/fermi-surface/marching-cubes.js +0 -2
- package/dist/plot/core/hover-lock.svelte.d.ts +0 -14
- package/dist/plot/core/hover-lock.svelte.js +0 -45
- package/dist/plot/sunburst/SunburstControls.svelte +0 -200
- package/dist/structure/label-placement.d.ts +0 -14
- package/dist/structure/label-placement.js +0 -72
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { PaneToggleProps } from '../overlays'
|
|
3
|
+
import type { ExportSection } from '../io'
|
|
4
|
+
import ExportPane from '../io/ExportPane.svelte'
|
|
2
5
|
import { export_svg_as_png, export_svg_as_svg } from '../io/export'
|
|
3
|
-
import
|
|
6
|
+
import { download } from '../io/fetch'
|
|
4
7
|
import type { ComponentProps } from 'svelte'
|
|
5
|
-
import { CopyButton } from 'svelte-multiselect'
|
|
6
|
-
import { tooltip } from 'svelte-multiselect/attachments'
|
|
7
8
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
8
9
|
import type { PhaseDiagramData } from './types'
|
|
9
10
|
|
|
@@ -29,12 +30,9 @@
|
|
|
29
30
|
filename?: string
|
|
30
31
|
png_dpi?: number
|
|
31
32
|
icon_style?: string
|
|
32
|
-
toggle_props?:
|
|
33
|
+
toggle_props?: PaneToggleProps
|
|
33
34
|
} = $props()
|
|
34
35
|
|
|
35
|
-
let json_copy_state = $state<ComponentProps<typeof CopyButton>[`state`]>(`ready`)
|
|
36
|
-
let svg_copy_state = $state<ComponentProps<typeof CopyButton>[`state`]>(`ready`)
|
|
37
|
-
|
|
38
36
|
// Generate filename with components if available (requires exactly 2 components)
|
|
39
37
|
const full_filename = $derived(
|
|
40
38
|
data?.components?.length === 2
|
|
@@ -43,142 +41,59 @@
|
|
|
43
41
|
)
|
|
44
42
|
|
|
45
43
|
const svg = $derived(
|
|
46
|
-
svg_element ??
|
|
47
|
-
(wrapper?.querySelector(svg_query_selector) as SVGSVGElement | null),
|
|
44
|
+
svg_element ?? (wrapper?.querySelector(svg_query_selector) as SVGSVGElement | null),
|
|
48
45
|
)
|
|
49
46
|
|
|
50
47
|
const json_export_data = $derived(json_payload ?? data)
|
|
48
|
+
const json_string = (): string | null =>
|
|
49
|
+
json_export_data ? JSON.stringify(json_export_data, null, 2) : null
|
|
51
50
|
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
51
|
+
const sections = $derived<ExportSection[]>([
|
|
52
|
+
{
|
|
53
|
+
title: `Image`,
|
|
54
|
+
tooltip: `Download or copy the phase diagram`,
|
|
55
|
+
items: [
|
|
56
|
+
{
|
|
57
|
+
label: `SVG`,
|
|
58
|
+
disabled: !svg,
|
|
59
|
+
on_download: () => svg && export_svg_as_svg(svg, `${full_filename}.svg`),
|
|
60
|
+
copy_text: () => (svg ? new XMLSerializer().serializeToString(svg) : null),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: `PNG`,
|
|
64
|
+
disabled: !svg,
|
|
65
|
+
show_dpi: true,
|
|
66
|
+
on_download: () => svg && export_svg_as_png(svg, `${full_filename}.png`, png_dpi),
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
title: `Data`,
|
|
72
|
+
tooltip: `Export phase diagram data as JSON`,
|
|
73
|
+
items: [
|
|
74
|
+
{
|
|
75
|
+
label: `JSON`,
|
|
76
|
+
disabled: !json_export_data,
|
|
77
|
+
on_download: () => {
|
|
78
|
+
const content = json_string()
|
|
79
|
+
if (content) download(content, `${full_filename}.json`, `application/json`)
|
|
80
|
+
},
|
|
81
|
+
copy_text: json_string,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
])
|
|
72
86
|
</script>
|
|
73
87
|
|
|
74
|
-
<
|
|
75
|
-
bind:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
pane_props={{ ...rest, class: `export-pane ${rest.class ?? ``}` }}
|
|
88
|
+
<ExportPane
|
|
89
|
+
bind:export_pane_open
|
|
90
|
+
bind:png_dpi
|
|
91
|
+
{sections}
|
|
79
92
|
{icon_style}
|
|
80
93
|
toggle_props={{
|
|
81
94
|
class: `pd-export-toggle`,
|
|
82
95
|
title: export_pane_open ? `` : `Export phase diagram`,
|
|
83
96
|
...caller_toggle_props,
|
|
84
97
|
}}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<h4 id="image" {@attach tooltip({ content: `Download or copy the phase diagram` })}>
|
|
88
|
-
Image
|
|
89
|
-
</h4>
|
|
90
|
-
<label>
|
|
91
|
-
SVG
|
|
92
|
-
<button
|
|
93
|
-
type="button"
|
|
94
|
-
onclick={() => svg && export_svg_as_svg(svg, `${full_filename}.svg`)}
|
|
95
|
-
disabled={!svg}
|
|
96
|
-
title="Download SVG"
|
|
97
|
-
>
|
|
98
|
-
⬇
|
|
99
|
-
</button>
|
|
100
|
-
<CopyButton
|
|
101
|
-
content={svg_string ?? ``}
|
|
102
|
-
title="Copy SVG to clipboard"
|
|
103
|
-
bind:state={svg_copy_state}
|
|
104
|
-
disabled={!svg_string}
|
|
105
|
-
/>
|
|
106
|
-
</label>
|
|
107
|
-
<label>
|
|
108
|
-
PNG
|
|
109
|
-
<button
|
|
110
|
-
type="button"
|
|
111
|
-
onclick={() => svg && export_svg_as_png(svg, `${full_filename}.png`, png_dpi)}
|
|
112
|
-
disabled={!svg}
|
|
113
|
-
title={`Download PNG (${png_dpi} DPI)`}
|
|
114
|
-
>
|
|
115
|
-
⬇
|
|
116
|
-
</button>
|
|
117
|
-
<span class="dpi-input"
|
|
118
|
-
>(DPI: <input
|
|
119
|
-
type="number"
|
|
120
|
-
min={50}
|
|
121
|
-
max={600}
|
|
122
|
-
bind:value={png_dpi}
|
|
123
|
-
title="Export resolution in dots per inch"
|
|
124
|
-
/>)</span>
|
|
125
|
-
</label>
|
|
126
|
-
|
|
127
|
-
<h4 id="data" {@attach tooltip({ content: `Export phase diagram data as JSON` })}>
|
|
128
|
-
Data
|
|
129
|
-
</h4>
|
|
130
|
-
<label>
|
|
131
|
-
JSON
|
|
132
|
-
<button
|
|
133
|
-
type="button"
|
|
134
|
-
onclick={download_json}
|
|
135
|
-
disabled={!json_export_data}
|
|
136
|
-
title="Download JSON"
|
|
137
|
-
>
|
|
138
|
-
⬇
|
|
139
|
-
</button>
|
|
140
|
-
<CopyButton
|
|
141
|
-
content={json_string ?? ``}
|
|
142
|
-
title="Copy JSON to clipboard"
|
|
143
|
-
bind:state={json_copy_state}
|
|
144
|
-
disabled={!json_string}
|
|
145
|
-
/>
|
|
146
|
-
</label>
|
|
147
|
-
</div>
|
|
148
|
-
</DraggablePane>
|
|
149
|
-
|
|
150
|
-
<style>
|
|
151
|
-
.export-grid {
|
|
152
|
-
display: flex;
|
|
153
|
-
flex-wrap: wrap;
|
|
154
|
-
align-items: center;
|
|
155
|
-
gap: 4pt 10pt;
|
|
156
|
-
}
|
|
157
|
-
.export-grid h4 {
|
|
158
|
-
display: inline-flex;
|
|
159
|
-
align-items: center;
|
|
160
|
-
margin: 0;
|
|
161
|
-
}
|
|
162
|
-
label {
|
|
163
|
-
display: flex;
|
|
164
|
-
align-items: center;
|
|
165
|
-
gap: 8pt;
|
|
166
|
-
font-size: 0.95em;
|
|
167
|
-
white-space: nowrap;
|
|
168
|
-
}
|
|
169
|
-
.dpi-input {
|
|
170
|
-
display: inline-flex;
|
|
171
|
-
align-items: center;
|
|
172
|
-
gap: 2pt;
|
|
173
|
-
white-space: nowrap;
|
|
174
|
-
}
|
|
175
|
-
button {
|
|
176
|
-
width: 1.9em;
|
|
177
|
-
height: 1.6em;
|
|
178
|
-
padding: 0 6pt;
|
|
179
|
-
box-sizing: border-box;
|
|
180
|
-
}
|
|
181
|
-
input {
|
|
182
|
-
width: 3.5em;
|
|
183
|
-
}
|
|
184
|
-
</style>
|
|
98
|
+
{...rest}
|
|
99
|
+
/>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { ComponentProps } from 'svelte';
|
|
1
|
+
import type { PaneToggleProps } from '../overlays';
|
|
3
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
3
|
import type { PhaseDiagramData } from './types';
|
|
5
4
|
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
@@ -12,8 +11,8 @@ type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
12
11
|
filename?: string;
|
|
13
12
|
png_dpi?: number;
|
|
14
13
|
icon_style?: string;
|
|
15
|
-
toggle_props?:
|
|
14
|
+
toggle_props?: PaneToggleProps;
|
|
16
15
|
};
|
|
17
|
-
declare const PhaseDiagramExportPane: import("svelte").Component<$$ComponentProps, {}, "
|
|
16
|
+
declare const PhaseDiagramExportPane: import("svelte").Component<$$ComponentProps, {}, "export_pane_open" | "png_dpi">;
|
|
18
17
|
type PhaseDiagramExportPane = ReturnType<typeof PhaseDiagramExportPane>;
|
|
19
18
|
export default PhaseDiagramExportPane;
|
|
@@ -51,8 +51,7 @@
|
|
|
51
51
|
const safe_formula = (comp: string) => sanitize_formula(comp, use_subscripts)
|
|
52
52
|
|
|
53
53
|
// Convert a temperature from data unit to display unit
|
|
54
|
-
const to_display = (temp: number): number =>
|
|
55
|
-
convert_temp(temp, data_unit, temperature_unit)
|
|
54
|
+
const to_display = (temp: number): number => convert_temp(temp, data_unit, temperature_unit)
|
|
56
55
|
|
|
57
56
|
// Convert atomic fraction to weight fraction: wt_B = (x_B * M_B) / (x_A * M_A + x_B * M_B)
|
|
58
57
|
const wt_fraction_b = $derived.by(() => {
|
|
@@ -136,14 +135,8 @@
|
|
|
136
135
|
phase_b: vlr.top_phase,
|
|
137
136
|
fraction_a: vlr.fraction_bottom,
|
|
138
137
|
fraction_b: vlr.fraction_top,
|
|
139
|
-
detail_a: format_temperature(
|
|
140
|
-
|
|
141
|
-
temperature_unit,
|
|
142
|
-
),
|
|
143
|
-
detail_b: format_temperature(
|
|
144
|
-
to_display(vlr.top_temperature),
|
|
145
|
-
temperature_unit,
|
|
146
|
-
),
|
|
138
|
+
detail_a: format_temperature(to_display(vlr.bottom_temperature), temperature_unit),
|
|
139
|
+
detail_b: format_temperature(to_display(vlr.top_temperature), temperature_unit),
|
|
147
140
|
}
|
|
148
141
|
}
|
|
149
142
|
if (lever_rule_mode === `horizontal` && hover_info.lever_rule) {
|
|
@@ -165,10 +158,14 @@
|
|
|
165
158
|
<TooltipContent data={hover_info} snippet_arg={hover_info} {tooltip}>
|
|
166
159
|
<div class="phase-diagram-tooltip">
|
|
167
160
|
<header>
|
|
168
|
-
<strong
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}</
|
|
161
|
+
<strong
|
|
162
|
+
>{@html sanitize_html(
|
|
163
|
+
format_label_html(hover_info.region.name, use_subscripts),
|
|
164
|
+
)}</strong
|
|
165
|
+
>
|
|
166
|
+
{#if special_point_info}<span class="special-point-badge"
|
|
167
|
+
>{special_point_info.badge}</span
|
|
168
|
+
>{/if}
|
|
172
169
|
</header>
|
|
173
170
|
|
|
174
171
|
{#if special_point_info?.description}
|
|
@@ -178,54 +175,51 @@
|
|
|
178
175
|
<dl>
|
|
179
176
|
<dt>Temperature</dt>
|
|
180
177
|
<dd>
|
|
181
|
-
{
|
|
182
|
-
format_temperature(
|
|
183
|
-
to_display(hover_info.temperature),
|
|
184
|
-
temperature_unit,
|
|
185
|
-
)
|
|
186
|
-
}
|
|
178
|
+
{format_temperature(to_display(hover_info.temperature), temperature_unit)}
|
|
187
179
|
{#if temperature_unit !== `°C`}
|
|
188
|
-
<small
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
180
|
+
<small
|
|
181
|
+
>({format_temperature(
|
|
182
|
+
convert_temp(hover_info.temperature, data_unit, `°C`),
|
|
183
|
+
`°C`,
|
|
184
|
+
)})</small
|
|
185
|
+
>
|
|
194
186
|
{/if}
|
|
195
187
|
</dd>
|
|
196
188
|
<dt>Composition</dt>
|
|
197
189
|
<dd>
|
|
198
190
|
{format_composition(hover_info.composition, composition_unit)}
|
|
199
191
|
{@html safe_formula(component_b)}
|
|
200
|
-
<small
|
|
201
|
-
{
|
|
192
|
+
<small
|
|
193
|
+
>({format_composition(1 - hover_info.composition, composition_unit)}
|
|
194
|
+
{@html safe_formula(component_a)})</small
|
|
195
|
+
>
|
|
202
196
|
</dd>
|
|
203
197
|
{#if wt_fraction_b !== null}
|
|
204
198
|
<dt>Weight</dt>
|
|
205
199
|
<dd>
|
|
206
200
|
{format_num(wt_fraction_b * 100, `.1f`)}%
|
|
207
201
|
{@html safe_formula(component_b)}
|
|
208
|
-
<small
|
|
209
|
-
{
|
|
202
|
+
<small
|
|
203
|
+
>({format_num((1 - wt_fraction_b) * 100, `.1f`)}%
|
|
204
|
+
{@html safe_formula(component_a)})</small
|
|
205
|
+
>
|
|
210
206
|
</dd>
|
|
211
207
|
{/if}
|
|
212
208
|
{#if stability}
|
|
213
|
-
<dt>Stable</dt
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
209
|
+
<dt>Stable</dt>
|
|
210
|
+
<dd>
|
|
211
|
+
{format_num(to_display(stability.t_min), `.0f`)} – {format_num(
|
|
212
|
+
to_display(stability.t_max),
|
|
213
|
+
`.0f`,
|
|
214
|
+
)}
|
|
215
|
+
{temperature_unit}
|
|
217
216
|
{#if temperature_unit !== `°C`}
|
|
218
|
-
<small
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
format_num(
|
|
225
|
-
convert_temp(stability.t_max, data_unit, `°C`),
|
|
226
|
-
`.0f`,
|
|
227
|
-
)
|
|
228
|
-
} °C)</small>
|
|
217
|
+
<small
|
|
218
|
+
>({format_num(convert_temp(stability.t_min, data_unit, `°C`), `.0f`)} – {format_num(
|
|
219
|
+
convert_temp(stability.t_max, data_unit, `°C`),
|
|
220
|
+
`.0f`,
|
|
221
|
+
)} °C)</small
|
|
222
|
+
>
|
|
229
223
|
{/if}
|
|
230
224
|
</dd>
|
|
231
225
|
{/if}
|
|
@@ -239,22 +233,22 @@
|
|
|
239
233
|
<div
|
|
240
234
|
style:width="{ld.fraction_a * 100}%"
|
|
241
235
|
title="{ld.phase_a}: {format_num(ld.fraction_a * 100, `.1f`)}%"
|
|
242
|
-
>
|
|
243
|
-
</div>
|
|
236
|
+
></div>
|
|
244
237
|
<div
|
|
245
238
|
style:width="{ld.fraction_b * 100}%"
|
|
246
239
|
title="{ld.phase_b}: {format_num(ld.fraction_b * 100, `.1f`)}%"
|
|
247
|
-
>
|
|
248
|
-
</div>
|
|
240
|
+
></div>
|
|
249
241
|
<i style:left="{ld.fraction_a * 100}%"></i>
|
|
250
242
|
</div>
|
|
251
243
|
<div class="phase-info">
|
|
252
|
-
<span
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
244
|
+
<span
|
|
245
|
+
>{@html safe_formula(ld.phase_a)}: {format_num(ld.fraction_a * 100, `.0f`)}%
|
|
246
|
+
<small>at {ld.detail_a}</small></span
|
|
247
|
+
>
|
|
248
|
+
<span
|
|
249
|
+
>{@html safe_formula(ld.phase_b)}: {format_num(ld.fraction_b * 100, `.0f`)}%
|
|
250
|
+
<small>at {ld.detail_b}</small></span
|
|
251
|
+
>
|
|
258
252
|
</div>
|
|
259
253
|
</div>
|
|
260
254
|
{/if}
|
|
@@ -263,11 +257,13 @@
|
|
|
263
257
|
{@const { type, delta_t } = boundary_distance}
|
|
264
258
|
{@const label = delta_t > 0 ? `above` : `below`}
|
|
265
259
|
{@const display_delta = Math.abs(
|
|
266
|
-
to_display(hover_info.temperature) -
|
|
267
|
-
to_display(hover_info.temperature - delta_t),
|
|
260
|
+
to_display(hover_info.temperature) - to_display(hover_info.temperature - delta_t),
|
|
268
261
|
)}
|
|
269
262
|
<div class="boundary-info">
|
|
270
|
-
{Math.round(display_delta)}
|
|
263
|
+
{Math.round(display_delta)}
|
|
264
|
+
{temperature_unit}
|
|
265
|
+
{label}
|
|
266
|
+
{type}
|
|
271
267
|
</div>
|
|
272
268
|
{/if}
|
|
273
269
|
</div>
|
|
@@ -20,12 +20,8 @@
|
|
|
20
20
|
style = ``,
|
|
21
21
|
}: Props = $props()
|
|
22
22
|
|
|
23
|
-
const reference = $derived(
|
|
24
|
-
|
|
25
|
-
)
|
|
26
|
-
const model_summary = $derived(
|
|
27
|
-
result.data ? summarize_models(result.data.phases) : null,
|
|
28
|
-
)
|
|
23
|
+
const reference = $derived(result.data ? extract_tdb_reference(result.data.comments) : null)
|
|
24
|
+
const model_summary = $derived(result.data ? summarize_models(result.data.phases) : null)
|
|
29
25
|
</script>
|
|
30
26
|
|
|
31
27
|
<div class="tdb-info-panel" {style}>
|
|
@@ -38,23 +34,30 @@
|
|
|
38
34
|
<dt>System</dt>
|
|
39
35
|
<dd>{sys}</dd>
|
|
40
36
|
<dt>Phases</dt>
|
|
41
|
-
<dd class="phases">
|
|
42
|
-
|
|
37
|
+
<dd class="phases">
|
|
38
|
+
{#each phases as { name } (name)}<span>{name}</span>{/each}
|
|
39
|
+
</dd>
|
|
40
|
+
{#if model_summary}<dt>Models</dt>
|
|
41
|
+
<dd>{model_summary}</dd>{/if}
|
|
43
42
|
<dt>Funcs / Params</dt>
|
|
44
43
|
<dd>{functions.length} / {parameters.length}</dd>
|
|
45
44
|
{#if result.temperature_range}
|
|
46
45
|
{@const [t_min, t_max] = result.temperature_range}
|
|
47
|
-
<dt>T Range</dt
|
|
46
|
+
<dt>T Range</dt>
|
|
47
|
+
<dd>{t_min} – {t_max} K</dd>
|
|
48
48
|
{/if}
|
|
49
|
-
{#if reference}<dt>Ref</dt
|
|
49
|
+
{#if reference}<dt>Ref</dt>
|
|
50
|
+
<dd class="ref" title={reference}>{reference}</dd>{/if}
|
|
50
51
|
</dl>
|
|
51
52
|
|
|
52
53
|
{#if has_precomputed}
|
|
53
54
|
<p class="notice success">
|
|
54
55
|
✓ {#if is_precomputed_loaded}
|
|
55
56
|
<strong>Phase diagram loaded</strong> ({sys}.json)
|
|
56
|
-
<small
|
|
57
|
-
|
|
57
|
+
<small
|
|
58
|
+
>TDB contains model parameters. Boundaries computed offline via
|
|
59
|
+
<a href="https://pycalphad.org" target="_blank">pycalphad</a>.</small
|
|
60
|
+
>
|
|
58
61
|
{:else}
|
|
59
62
|
Pre-computed diagram available!
|
|
60
63
|
{#if on_load_precomputed}
|
|
@@ -71,16 +74,19 @@
|
|
|
71
74
|
<div class="notice warning">
|
|
72
75
|
<p>
|
|
73
76
|
ℹ No pre-computed diagram. Use <a href="https://pycalphad.org" target="_blank"
|
|
74
|
-
|
|
77
|
+
>pycalphad</a
|
|
78
|
+
>:
|
|
75
79
|
</p>
|
|
76
80
|
<pre>
|
|
77
|
-
<code
|
|
81
|
+
<code
|
|
82
|
+
>from pycalphad import Database, binplot
|
|
78
83
|
import pycalphad.variables as v
|
|
79
84
|
|
|
80
85
|
db = Database('{tdb}.tdb')
|
|
81
86
|
binplot(db, ['{el_a}', '{el_b}', 'VA'], list(db.phases.keys()), {`{`}
|
|
82
87
|
v.X('{el_b}'): (0, 1, 0.01), v.T: (300, 2000, 10), v.P: 101325, v.N: 1
|
|
83
|
-
})</code
|
|
88
|
+
})</code
|
|
89
|
+
></pre>
|
|
84
90
|
</div>
|
|
85
91
|
{/if}
|
|
86
92
|
{:else}
|
|
@@ -19,11 +19,11 @@ export function parse_curve_ref(ref) {
|
|
|
19
19
|
name = name.slice(1);
|
|
20
20
|
}
|
|
21
21
|
// Check for slice suffix [start:end]
|
|
22
|
-
const slice_match = /^(
|
|
22
|
+
const slice_match = /^(?<base>.+)\[(?<start>-?\d*):(?<end>-?\d*)\]$/.exec(name);
|
|
23
23
|
if (slice_match) {
|
|
24
24
|
name = slice_match[1];
|
|
25
|
-
start = slice_match[2] ?
|
|
26
|
-
end = slice_match[3] ?
|
|
25
|
+
start = slice_match[2] ? Number(slice_match[2]) : null;
|
|
26
|
+
end = slice_match[3] ? Number(slice_match[3]) : null;
|
|
27
27
|
}
|
|
28
28
|
return { name, reverse, start, end };
|
|
29
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Phase diagram color palette
|
|
2
2
|
// Keys can be referenced in diagram JSON files
|
|
3
|
-
const rgba = (
|
|
3
|
+
const rgba = (red, green, blue, alpha = 0.6) => `rgba(${red}, ${green}, ${blue}, ${alpha})`;
|
|
4
4
|
// Color palette for diagram JSON files - keyed colors that can be referenced by name
|
|
5
5
|
export const DIAGRAM_COLORS = {
|
|
6
6
|
// Single-phase regions (alpha=0.6)
|
|
@@ -20,10 +20,9 @@ export interface RegionInput {
|
|
|
20
20
|
bounds: BoundElement[];
|
|
21
21
|
label_position?: DiagramPoint;
|
|
22
22
|
}
|
|
23
|
-
export type SpecialPointInput = SpecialPoint;
|
|
24
23
|
export interface DiagramInput {
|
|
25
24
|
meta: DiagramInputMeta;
|
|
26
25
|
curves: Record<string, DiagramPoint[]>;
|
|
27
26
|
regions: RegionInput[];
|
|
28
|
-
special_points?:
|
|
27
|
+
special_points?: SpecialPoint[];
|
|
29
28
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Vec2 } from '../math';
|
|
1
2
|
export declare const TDB_TEMP_DEFAULTS: {
|
|
2
3
|
readonly min: 298.15;
|
|
3
4
|
readonly max_fallback: 3000;
|
|
@@ -47,7 +48,7 @@ export interface TdbParseResult {
|
|
|
47
48
|
error?: string;
|
|
48
49
|
binary_system?: [string, string];
|
|
49
50
|
available_phases?: string[];
|
|
50
|
-
temperature_range?:
|
|
51
|
+
temperature_range?: Vec2;
|
|
51
52
|
}
|
|
52
53
|
export declare function parse_tdb(content: string): TdbParseResult;
|
|
53
54
|
export declare const get_system_name: (elements: string[]) => string;
|
|
@@ -86,31 +86,31 @@ const LINE_PARSERS = [
|
|
|
86
86
|
{
|
|
87
87
|
// ELEMENT AL FCC_A1 2.698154E-02 4.5773304E+03 2.871870E+01!
|
|
88
88
|
prefix: `ELEMENT `,
|
|
89
|
-
pattern: /ELEMENT\s+(
|
|
89
|
+
pattern: /ELEMENT\s+(?<symbol>\S+)\s+(?<reference_phase>\S+)\s+(?<mass>[\d.E+-]+)\s+(?<enthalpy>[\d.E+-]+)\s+(?<entropy>[\d.E+-]+)/i,
|
|
90
90
|
handler: (match, data) => {
|
|
91
91
|
data.elements.push({
|
|
92
92
|
symbol: match[1].toUpperCase(),
|
|
93
93
|
reference_phase: match[2],
|
|
94
|
-
mass:
|
|
95
|
-
enthalpy:
|
|
96
|
-
entropy:
|
|
94
|
+
mass: Number(match[3]),
|
|
95
|
+
enthalpy: Number(match[4]),
|
|
96
|
+
entropy: Number(match[5]),
|
|
97
97
|
});
|
|
98
98
|
},
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
// PHASE LIQUID % 1 1.0 !
|
|
102
102
|
prefix: `PHASE `,
|
|
103
|
-
pattern: /PHASE\s+(
|
|
103
|
+
pattern: /PHASE\s+(?<name>\S+)\s+(?<model_hints>%\S*)\s+(?<count>\d+)\s+(?<sites>.+?)!/i,
|
|
104
104
|
handler: (match, data) => {
|
|
105
105
|
const sublattice_sites = match[4]
|
|
106
106
|
.trim()
|
|
107
107
|
.split(/\s+/)
|
|
108
|
-
.map(
|
|
108
|
+
.map(Number)
|
|
109
109
|
.filter((val) => !isNaN(val));
|
|
110
110
|
data.phases.push({
|
|
111
111
|
name: match[1],
|
|
112
112
|
model_hints: match[2],
|
|
113
|
-
sublattice_count:
|
|
113
|
+
sublattice_count: Math.trunc(Number(match[3])),
|
|
114
114
|
sublattice_sites,
|
|
115
115
|
});
|
|
116
116
|
},
|
|
@@ -118,7 +118,7 @@ const LINE_PARSERS = [
|
|
|
118
118
|
{
|
|
119
119
|
// CONSTITUENT FCC_A1 :AL,ZN : VA : !
|
|
120
120
|
prefix: `CONSTITUENT `,
|
|
121
|
-
pattern: /CONSTITUENT\s+(
|
|
121
|
+
pattern: /CONSTITUENT\s+(?<phase_name>\S+)\s*:\s*(?<constituents>.+?)!/i,
|
|
122
122
|
handler: (match, data) => {
|
|
123
123
|
const phase_name = match[1];
|
|
124
124
|
const constituents = match[2].split(`:`).map((sub) => sub
|
|
@@ -133,7 +133,7 @@ const LINE_PARSERS = [
|
|
|
133
133
|
{
|
|
134
134
|
// FUNCTION GHSERAL 298.15 expr1; 700 Y expr2; 933.47 Y expr3; 2900 N !
|
|
135
135
|
prefix: `FUNCTION `,
|
|
136
|
-
pattern: /FUNCTION\s+(
|
|
136
|
+
pattern: /FUNCTION\s+(?<name>\S+)\s+(?<body>.+?)!/i,
|
|
137
137
|
handler: (match, data) => {
|
|
138
138
|
const ranges = parse_temperature_ranges(match[2]);
|
|
139
139
|
if (ranges.length > 0) {
|
|
@@ -148,15 +148,15 @@ const LINE_PARSERS = [
|
|
|
148
148
|
{
|
|
149
149
|
// PARAMETER G(LIQUID,AL;0) 298.15 +GHSERAL+11005.029-11.841867*T; 6000 N !
|
|
150
150
|
prefix: `PARAMETER `,
|
|
151
|
-
pattern: /PARAMETER\s+(
|
|
151
|
+
pattern: /PARAMETER\s+(?<type>\w+)\((?<spec>[^)]+)\)\s+(?<expression>.+?)!/i,
|
|
152
152
|
handler: (match, data) => {
|
|
153
|
-
const spec_match = /([^,]+),([^;]+);(
|
|
153
|
+
const spec_match = /(?<phase>[^,]+),(?<constituents>[^;]+);(?<order>\d+)/.exec(match[2]);
|
|
154
154
|
if (spec_match) {
|
|
155
155
|
data.parameters.push({
|
|
156
156
|
type: match[1],
|
|
157
157
|
phase: spec_match[1],
|
|
158
158
|
constituents: spec_match[2].split(`,`).map((name) => name.trim()),
|
|
159
|
-
order:
|
|
159
|
+
order: Math.trunc(Number(spec_match[3])),
|
|
160
160
|
expression: match[3],
|
|
161
161
|
});
|
|
162
162
|
}
|
|
@@ -170,9 +170,9 @@ function parse_temperature_ranges(body) {
|
|
|
170
170
|
const trimmed = segment.trim();
|
|
171
171
|
if (!trimmed)
|
|
172
172
|
continue;
|
|
173
|
-
const temp_match = /^([\d.E+-]+)\s+(
|
|
173
|
+
const temp_match = /^(?<temp>[\d.E+-]+)\s+(?<expr>.+)/i.exec(trimmed);
|
|
174
174
|
if (temp_match) {
|
|
175
|
-
const next_temp =
|
|
175
|
+
const next_temp = Number(temp_match[1]);
|
|
176
176
|
const expr = temp_match[2].replace(/\s+[YN]\s*$/, ``).trim();
|
|
177
177
|
if (ranges.length > 0)
|
|
178
178
|
ranges[ranges.length - 1].max = next_temp;
|
|
@@ -191,7 +191,7 @@ function parse_tdb_line(line, data) {
|
|
|
191
191
|
parser.handler(match, data);
|
|
192
192
|
else if (parser.prefix === `ELEMENT `) {
|
|
193
193
|
// Fallback for simpler ELEMENT format: ELEMENT AL FCC_A1!
|
|
194
|
-
const simple_match = /ELEMENT\s+(
|
|
194
|
+
const simple_match = /ELEMENT\s+(?<symbol>\S+)\s+(?<reference_phase>\S+)/i.exec(line);
|
|
195
195
|
if (simple_match) {
|
|
196
196
|
data.elements.push({
|
|
197
197
|
symbol: simple_match[1].toUpperCase(),
|