matterviz 0.3.5 → 0.3.6
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/.vscode/launch.json +13 -0
- package/.vscodeignore +7 -0
- package/dist/assets/STLExporter-BpTH3YHE.js +8 -0
- package/dist/assets/browser-DdDecX_W.js +1 -0
- package/dist/assets/export-qgn-H9y6.js +2 -0
- package/dist/assets/main-DiKYzti2.css +1 -0
- package/dist/assets/moyo_wasm_bg-0ocwg7xY.wasm +0 -0
- package/dist/extension.js +31293 -0
- package/dist/src/lib/FilePicker.svelte +360 -0
- package/dist/src/lib/MillerIndexInput.svelte +66 -0
- package/dist/src/lib/api/mp.ts +26 -0
- package/dist/src/lib/api/optimade.ts +204 -0
- package/dist/src/lib/brillouin/BrillouinZone.svelte +549 -0
- package/dist/src/lib/brillouin/BrillouinZoneControls.svelte +144 -0
- package/dist/src/lib/brillouin/BrillouinZoneExportPane.svelte +146 -0
- package/dist/src/lib/brillouin/BrillouinZoneInfoPane.svelte +146 -0
- package/dist/src/lib/brillouin/BrillouinZoneScene.svelte +476 -0
- package/dist/src/lib/brillouin/BrillouinZoneTooltip.svelte +92 -0
- package/dist/src/lib/brillouin/compute.ts +529 -0
- package/dist/src/lib/brillouin/index.ts +8 -0
- package/dist/src/lib/brillouin/types.ts +51 -0
- package/dist/src/lib/chempot-diagram/ChemPotDiagram.svelte +327 -0
- package/dist/src/lib/chempot-diagram/ChemPotDiagram2D.svelte +846 -0
- package/dist/src/lib/chempot-diagram/ChemPotDiagram3D.svelte +3193 -0
- package/dist/src/lib/chempot-diagram/async-compute.svelte.ts +94 -0
- package/dist/src/lib/chempot-diagram/chempot-worker.ts +11 -0
- package/dist/src/lib/chempot-diagram/color.ts +42 -0
- package/dist/src/lib/chempot-diagram/compute.ts +1014 -0
- package/dist/src/lib/chempot-diagram/index.ts +6 -0
- package/dist/src/lib/chempot-diagram/pointer.ts +56 -0
- package/dist/src/lib/chempot-diagram/temperature.ts +77 -0
- package/dist/src/lib/chempot-diagram/types.ts +130 -0
- package/dist/src/lib/colors/index.ts +249 -0
- package/dist/src/lib/composition/BarChart.svelte +297 -0
- package/dist/src/lib/composition/BubbleChart.svelte +218 -0
- package/dist/src/lib/composition/Composition.svelte +165 -0
- package/dist/src/lib/composition/Formula.svelte +268 -0
- package/dist/src/lib/composition/FormulaFilter.svelte +1257 -0
- package/dist/src/lib/composition/PieChart.svelte +323 -0
- package/dist/src/lib/composition/format.ts +155 -0
- package/dist/src/lib/composition/index.ts +37 -0
- package/dist/src/lib/composition/parse.ts +605 -0
- package/dist/src/lib/constants.ts +134 -0
- package/dist/src/lib/controls.ts +42 -0
- package/dist/src/lib/convex-hull/ConvexHull.svelte +157 -0
- package/dist/src/lib/convex-hull/ConvexHull2D.svelte +825 -0
- package/dist/src/lib/convex-hull/ConvexHull3D.svelte +1801 -0
- package/dist/src/lib/convex-hull/ConvexHull4D.svelte +1398 -0
- package/dist/src/lib/convex-hull/ConvexHullControls.svelte +535 -0
- package/dist/src/lib/convex-hull/ConvexHullInfoPane.svelte +125 -0
- package/dist/src/lib/convex-hull/ConvexHullStats.svelte +929 -0
- package/dist/src/lib/convex-hull/ConvexHullTooltip.svelte +131 -0
- package/dist/src/lib/convex-hull/GasPressureControls.svelte +247 -0
- package/dist/src/lib/convex-hull/StructurePopup.svelte +151 -0
- package/dist/src/lib/convex-hull/TemperatureSlider.svelte +140 -0
- package/dist/src/lib/convex-hull/barycentric-coords.ts +246 -0
- package/dist/src/lib/convex-hull/demo-temperature.ts +63 -0
- package/dist/src/lib/convex-hull/gas-thermodynamics.ts +405 -0
- package/dist/src/lib/convex-hull/helpers.ts +932 -0
- package/dist/src/lib/convex-hull/index.ts +202 -0
- package/dist/src/lib/convex-hull/thermodynamics.ts +2192 -0
- package/dist/src/lib/convex-hull/types.ts +267 -0
- package/dist/src/lib/coordination/CoordinationBarPlot.svelte +311 -0
- package/dist/src/lib/coordination/calc-coordination.ts +93 -0
- package/dist/src/lib/coordination/index.ts +9 -0
- package/dist/src/lib/effects.svelte.ts +48 -0
- package/dist/src/lib/element/BohrAtom.svelte +147 -0
- package/dist/src/lib/element/ElementHeading.svelte +26 -0
- package/dist/src/lib/element/ElementPhoto.svelte +57 -0
- package/dist/src/lib/element/ElementStats.svelte +80 -0
- package/dist/src/lib/element/ElementTile.svelte +484 -0
- package/dist/src/lib/element/data.json.gz.d.ts +4 -0
- package/dist/src/lib/element/data.ts +14 -0
- package/dist/src/lib/element/index.ts +8 -0
- package/dist/src/lib/element/types.ts +62 -0
- package/dist/src/lib/feedback/ClickFeedback.svelte +58 -0
- package/dist/src/lib/feedback/DragOverlay.svelte +42 -0
- package/dist/src/lib/feedback/index.ts +4 -0
- package/dist/src/lib/fermi-surface/FermiSlice.svelte +189 -0
- package/dist/src/lib/fermi-surface/FermiSurface.svelte +600 -0
- package/dist/src/lib/fermi-surface/FermiSurfaceControls.svelte +448 -0
- package/dist/src/lib/fermi-surface/FermiSurfaceScene.svelte +794 -0
- package/dist/src/lib/fermi-surface/FermiSurfaceTooltip.svelte +111 -0
- package/dist/src/lib/fermi-surface/compute.ts +728 -0
- package/dist/src/lib/fermi-surface/constants.ts +32 -0
- package/dist/src/lib/fermi-surface/export.ts +64 -0
- package/dist/src/lib/fermi-surface/index.ts +14 -0
- package/dist/src/lib/fermi-surface/marching-cubes.ts +3 -0
- package/dist/src/lib/fermi-surface/parse.ts +574 -0
- package/dist/src/lib/fermi-surface/symmetry.ts +56 -0
- package/dist/src/lib/fermi-surface/types.ts +159 -0
- package/dist/src/lib/heatmap-matrix/HeatmapMatrix.svelte +1545 -0
- package/dist/src/lib/heatmap-matrix/HeatmapMatrixControls.svelte +225 -0
- package/dist/src/lib/heatmap-matrix/index.ts +167 -0
- package/dist/src/lib/heatmap-matrix/shared.ts +7 -0
- package/dist/src/lib/icons.ts +650 -0
- package/dist/src/lib/index.ts +61 -0
- package/dist/src/lib/io/decompress.ts +92 -0
- package/dist/src/lib/io/export.ts +385 -0
- package/dist/src/lib/io/fetch.ts +46 -0
- package/dist/src/lib/io/file-drop.ts +51 -0
- package/dist/src/lib/io/index.ts +7 -0
- package/dist/src/lib/io/is-binary.ts +24 -0
- package/dist/src/lib/io/types.ts +8 -0
- package/dist/src/lib/io/url-drop.ts +141 -0
- package/dist/src/lib/isosurface/Isosurface.svelte +285 -0
- package/dist/src/lib/isosurface/IsosurfaceControls.svelte +277 -0
- package/dist/src/lib/isosurface/index.ts +7 -0
- package/dist/src/lib/isosurface/parse.ts +656 -0
- package/dist/src/lib/isosurface/slice.ts +175 -0
- package/dist/src/lib/isosurface/types.ts +309 -0
- package/dist/src/lib/labels.ts +320 -0
- package/dist/src/lib/layout/FullscreenToggle.svelte +50 -0
- package/dist/src/lib/layout/InfoCard.svelte +120 -0
- package/dist/src/lib/layout/InfoTag.svelte +185 -0
- package/dist/src/lib/layout/PropertyFilter.svelte +246 -0
- package/dist/src/lib/layout/SettingsSection.svelte +148 -0
- package/dist/src/lib/layout/SubpageGrid.svelte +82 -0
- package/dist/src/lib/layout/fullscreen.ts +65 -0
- package/dist/src/lib/layout/index.ts +11 -0
- package/dist/src/lib/layout/json-tree/JsonNode.svelte +548 -0
- package/dist/src/lib/layout/json-tree/JsonTree.svelte +1230 -0
- package/dist/src/lib/layout/json-tree/JsonValue.svelte +334 -0
- package/dist/src/lib/layout/json-tree/index.ts +3 -0
- package/dist/src/lib/layout/json-tree/types.ts +126 -0
- package/dist/src/lib/layout/json-tree/utils.ts +682 -0
- package/dist/src/lib/marching-cubes.ts +614 -0
- package/dist/src/lib/math.ts +1081 -0
- package/dist/src/lib/overlays/ContextMenu.svelte +162 -0
- package/dist/src/lib/overlays/CopyButton.svelte +45 -0
- package/dist/src/lib/overlays/DragControlTab.svelte +98 -0
- package/dist/src/lib/overlays/DraggablePane.svelte +487 -0
- package/dist/src/lib/overlays/InfoPaneCards.svelte +149 -0
- package/dist/src/lib/overlays/index.ts +3 -0
- package/dist/src/lib/periodic-table/PeriodicTable.svelte +469 -0
- package/dist/src/lib/periodic-table/PeriodicTableControls.svelte +557 -0
- package/dist/src/lib/periodic-table/PropertySelect.svelte +37 -0
- package/dist/src/lib/periodic-table/index.ts +12 -0
- package/dist/src/lib/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +1086 -0
- package/dist/src/lib/phase-diagram/PhaseDiagramControls.svelte +444 -0
- package/dist/src/lib/phase-diagram/PhaseDiagramEditorPane.svelte +126 -0
- package/dist/src/lib/phase-diagram/PhaseDiagramExportPane.svelte +184 -0
- package/dist/src/lib/phase-diagram/PhaseDiagramTooltip.svelte +391 -0
- package/dist/src/lib/phase-diagram/TdbInfoPanel.svelte +203 -0
- package/dist/src/lib/phase-diagram/build-diagram.ts +186 -0
- package/dist/src/lib/phase-diagram/colors.ts +58 -0
- package/dist/src/lib/phase-diagram/diagram-input.ts +40 -0
- package/dist/src/lib/phase-diagram/index.ts +13 -0
- package/dist/src/lib/phase-diagram/parse.ts +348 -0
- package/dist/src/lib/phase-diagram/svg-to-diagram.ts +1023 -0
- package/dist/src/lib/phase-diagram/types.ts +144 -0
- package/dist/src/lib/phase-diagram/utils.ts +775 -0
- package/dist/src/lib/plot/AxisLabel.svelte +51 -0
- package/dist/src/lib/plot/BarPlot.svelte +2113 -0
- package/dist/src/lib/plot/BarPlotControls.svelte +66 -0
- package/dist/src/lib/plot/BinnedScatterPlot.svelte +1114 -0
- package/dist/src/lib/plot/ColorBar.svelte +721 -0
- package/dist/src/lib/plot/ColorScaleSelect.svelte +54 -0
- package/dist/src/lib/plot/ElementScatter.svelte +63 -0
- package/dist/src/lib/plot/FillArea.svelte +223 -0
- package/dist/src/lib/plot/Histogram.svelte +1558 -0
- package/dist/src/lib/plot/HistogramControls.svelte +212 -0
- package/dist/src/lib/plot/InteractiveAxisLabel.svelte +96 -0
- package/dist/src/lib/plot/Line.svelte +84 -0
- package/dist/src/lib/plot/PlotAxis.svelte +169 -0
- package/dist/src/lib/plot/PlotControls.svelte +537 -0
- package/dist/src/lib/plot/PlotLegend.svelte +569 -0
- package/dist/src/lib/plot/PlotTooltip.svelte +67 -0
- package/dist/src/lib/plot/PortalSelect.svelte +253 -0
- package/dist/src/lib/plot/ReferenceLine3D.svelte +156 -0
- package/dist/src/lib/plot/ReferencePlane.svelte +175 -0
- package/dist/src/lib/plot/ScatterPlot.svelte +2778 -0
- package/dist/src/lib/plot/ScatterPlot3D.svelte +529 -0
- package/dist/src/lib/plot/ScatterPlot3DControls.svelte +437 -0
- package/dist/src/lib/plot/ScatterPlot3DScene.svelte +912 -0
- package/dist/src/lib/plot/ScatterPlotControls.svelte +306 -0
- package/dist/src/lib/plot/ScatterPoint.svelte +182 -0
- package/dist/src/lib/plot/SpacegroupBarPlot.svelte +293 -0
- package/dist/src/lib/plot/Surface3D.svelte +197 -0
- package/dist/src/lib/plot/ZeroLines.svelte +97 -0
- package/dist/src/lib/plot/ZoomRect.svelte +23 -0
- package/dist/src/lib/plot/adaptive-density.ts +316 -0
- package/dist/src/lib/plot/auto-place.ts +184 -0
- package/dist/src/lib/plot/axis-utils.ts +122 -0
- package/dist/src/lib/plot/binned-scatter-types.ts +83 -0
- package/dist/src/lib/plot/data-cleaning.ts +1069 -0
- package/dist/src/lib/plot/data-transform.ts +69 -0
- package/dist/src/lib/plot/defaults.ts +9 -0
- package/dist/src/lib/plot/fill-utils.ts +494 -0
- package/dist/src/lib/plot/hover-lock.svelte.ts +60 -0
- package/dist/src/lib/plot/index.ts +53 -0
- package/dist/src/lib/plot/interactions.ts +119 -0
- package/dist/src/lib/plot/layout.ts +425 -0
- package/dist/src/lib/plot/reference-line.ts +426 -0
- package/dist/src/lib/plot/scales.ts +654 -0
- package/dist/src/lib/plot/svg.ts +23 -0
- package/dist/src/lib/plot/types.ts +1144 -0
- package/dist/src/lib/plot/utils/label-placement.ts +541 -0
- package/dist/src/lib/plot/utils/series-visibility.ts +140 -0
- package/dist/src/lib/plot/utils.ts +11 -0
- package/dist/src/lib/rdf/RdfPlot.svelte +247 -0
- package/dist/src/lib/rdf/calc-rdf.ts +167 -0
- package/dist/src/lib/rdf/index.ts +27 -0
- package/dist/src/lib/sanitize.ts +126 -0
- package/dist/src/lib/settings.ts +1479 -0
- package/dist/src/lib/spectral/Bands.svelte +1040 -0
- package/dist/src/lib/spectral/BandsAndDos.svelte +134 -0
- package/dist/src/lib/spectral/BrillouinBandsDos.svelte +252 -0
- package/dist/src/lib/spectral/Dos.svelte +697 -0
- package/dist/src/lib/spectral/helpers.ts +1381 -0
- package/dist/src/lib/spectral/index.ts +8 -0
- package/dist/src/lib/spectral/types.ts +112 -0
- package/dist/src/lib/state.svelte.ts +64 -0
- package/dist/src/lib/structure/Arrow.svelte +72 -0
- package/dist/src/lib/structure/AtomLegend.svelte +815 -0
- package/dist/src/lib/structure/Bond.svelte +140 -0
- package/dist/src/lib/structure/CanvasTooltip.svelte +33 -0
- package/dist/src/lib/structure/CellSelect.svelte +349 -0
- package/dist/src/lib/structure/Cylinder.svelte +45 -0
- package/dist/src/lib/structure/Lattice.svelte +196 -0
- package/dist/src/lib/structure/Structure.svelte +2248 -0
- package/dist/src/lib/structure/StructureControls.svelte +1273 -0
- package/dist/src/lib/structure/StructureExportPane.svelte +252 -0
- package/dist/src/lib/structure/StructureInfoPane.svelte +737 -0
- package/dist/src/lib/structure/StructureScene.svelte +2255 -0
- package/dist/src/lib/structure/atom-properties.ts +316 -0
- package/dist/src/lib/structure/bond-order-perception.ts +447 -0
- package/dist/src/lib/structure/bonding.ts +944 -0
- package/dist/src/lib/structure/export.ts +861 -0
- package/dist/src/lib/structure/index.ts +291 -0
- package/dist/src/lib/structure/label-placement.ts +130 -0
- package/dist/src/lib/structure/measure.ts +45 -0
- package/dist/src/lib/structure/parse.ts +1705 -0
- package/dist/src/lib/structure/partial-occupancy.ts +183 -0
- package/dist/src/lib/structure/pbc.ts +164 -0
- package/dist/src/lib/structure/supercell.ts +226 -0
- package/dist/src/lib/structure/validation.ts +11 -0
- package/dist/src/lib/symmetry/SymmetryStats.svelte +226 -0
- package/dist/src/lib/symmetry/WyckoffTable.svelte +120 -0
- package/dist/src/lib/symmetry/cell-transform.ts +118 -0
- package/dist/src/lib/symmetry/index.ts +348 -0
- package/dist/src/lib/symmetry/spacegroups.ts +404 -0
- package/dist/src/lib/table/HeatmapTable.svelte +1833 -0
- package/dist/src/lib/table/ToggleMenu.svelte +385 -0
- package/dist/src/lib/table/index.ts +139 -0
- package/dist/src/lib/theme/ThemeControl.svelte +53 -0
- package/dist/src/lib/theme/index.ts +107 -0
- package/dist/src/lib/theme/themes.mjs +297 -0
- package/dist/src/lib/time.ts +71 -0
- package/dist/src/lib/tooltip/TooltipContent.svelte +58 -0
- package/dist/src/lib/tooltip/index.ts +2 -0
- package/dist/src/lib/tooltip/types.ts +13 -0
- package/dist/src/lib/trajectory/Trajectory.svelte +1545 -0
- package/dist/src/lib/trajectory/TrajectoryError.svelte +128 -0
- package/dist/src/lib/trajectory/TrajectoryExportPane.svelte +357 -0
- package/dist/src/lib/trajectory/TrajectoryInfoPane.svelte +313 -0
- package/dist/src/lib/trajectory/constants.ts +7 -0
- package/dist/src/lib/trajectory/extract.ts +196 -0
- package/dist/src/lib/trajectory/format-detect.ts +96 -0
- package/dist/src/lib/trajectory/frame-reader.ts +456 -0
- package/dist/src/lib/trajectory/helpers.ts +217 -0
- package/dist/src/lib/trajectory/index.ts +218 -0
- package/dist/src/lib/trajectory/parse/ase.ts +109 -0
- package/dist/src/lib/trajectory/parse/hdf5.ts +173 -0
- package/dist/src/lib/trajectory/parse/index.ts +411 -0
- package/dist/src/lib/trajectory/parse/lammps.ts +215 -0
- package/dist/src/lib/trajectory/parse/vasp.ts +102 -0
- package/dist/src/lib/trajectory/parse/xyz.ts +143 -0
- package/dist/src/lib/trajectory/plotting.ts +599 -0
- package/dist/src/lib/trajectory/types.ts +13 -0
- package/dist/src/lib/utils.ts +56 -0
- package/dist/src/lib/xrd/XrdPlot.svelte +615 -0
- package/dist/src/lib/xrd/broadening.ts +130 -0
- package/dist/src/lib/xrd/calc-xrd.ts +397 -0
- package/dist/src/lib/xrd/index.ts +38 -0
- package/dist/src/lib/xrd/parse.ts +858 -0
- package/dist/webview.js +29421 -0
- package/icon.png +0 -0
- package/license +1 -1
- package/matterviz-0.3.2.vsix +0 -0
- package/matterviz-0.3.4.vsix +0 -0
- package/matterviz-0.3.5.vsix +0 -0
- package/package.json +1460 -215
- package/readme.md +171 -98
- package/scripts/sync-config.ts +101 -0
- package/src/declarations.d.ts +2 -0
- package/src/extension.ts +972 -0
- package/src/node-io.ts +65 -0
- package/src/types.ts +17 -0
- package/src/webview/JsonBrowser.svelte +1079 -0
- package/src/webview/PlotPanel.svelte +346 -0
- package/src/webview/detect.ts +444 -0
- package/src/webview/main.ts +764 -0
- package/src/webview/plot-utils.ts +250 -0
- package/test-fixtures/all-viz-types.json.gz +0 -0
- package/test-fixtures/plot-demo-data.json.gz +0 -0
- package/tests/detect.test.ts +604 -0
- package/tests/extension.test.ts +2041 -0
- package/tests/node-io.test.ts +39 -0
- package/tests/plot-utils.test.ts +302 -0
- package/tests/vite-plugin-json-gz.test.ts +114 -0
- package/tests/vscode-mock.ts +18 -0
- package/tests/webview.test.ts +231 -0
- package/tsconfig.json +20 -0
- package/vite-plugin-json-gz.ts +29 -0
- package/vite.config.ts +34 -0
- package/vite.extension.config.ts +34 -0
- package/dist/EmptyState.svelte.d.ts +0 -9
- package/dist/FilePicker.svelte +0 -360
- package/dist/FilePicker.svelte.d.ts +0 -17
- package/dist/Icon.svelte.d.ts +0 -13
- package/dist/MillerIndexInput.svelte +0 -66
- package/dist/MillerIndexInput.svelte.d.ts +0 -7
- package/dist/api/mp.d.ts +0 -6
- package/dist/api/mp.js +0 -22
- package/dist/api/optimade.d.ts +0 -45
- package/dist/api/optimade.js +0 -135
- package/dist/brillouin/BrillouinZone.svelte +0 -546
- package/dist/brillouin/BrillouinZone.svelte.d.ts +0 -83
- package/dist/brillouin/BrillouinZoneControls.svelte +0 -144
- package/dist/brillouin/BrillouinZoneControls.svelte.d.ts +0 -17
- package/dist/brillouin/BrillouinZoneExportPane.svelte +0 -148
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +0 -15
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +0 -146
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +0 -13
- package/dist/brillouin/BrillouinZoneScene.svelte +0 -476
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +0 -48
- package/dist/brillouin/BrillouinZoneTooltip.svelte +0 -92
- package/dist/brillouin/BrillouinZoneTooltip.svelte.d.ts +0 -8
- package/dist/brillouin/compute.d.ts +0 -17
- package/dist/brillouin/compute.js +0 -426
- package/dist/brillouin/index.d.ts +0 -8
- package/dist/brillouin/index.js +0 -8
- package/dist/brillouin/types.d.ts +0 -48
- package/dist/brillouin/types.js +0 -1
- package/dist/chempot-diagram/ChemPotDiagram.svelte +0 -327
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +0 -13
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +0 -847
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +0 -16
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +0 -3194
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +0 -16
- package/dist/chempot-diagram/ChemPotScene3D.svelte.d.ts +0 -7
- package/dist/chempot-diagram/async-compute.svelte.d.ts +0 -3
- package/dist/chempot-diagram/async-compute.svelte.js +0 -78
- package/dist/chempot-diagram/chempot-worker.d.ts +0 -1
- package/dist/chempot-diagram/chempot-worker.js +0 -11
- package/dist/chempot-diagram/color.d.ts +0 -10
- package/dist/chempot-diagram/color.js +0 -32
- package/dist/chempot-diagram/compute.d.ts +0 -48
- package/dist/chempot-diagram/compute.js +0 -812
- package/dist/chempot-diagram/index.d.ts +0 -6
- package/dist/chempot-diagram/index.js +0 -6
- package/dist/chempot-diagram/pointer.d.ts +0 -16
- package/dist/chempot-diagram/pointer.js +0 -40
- package/dist/chempot-diagram/temperature.d.ts +0 -15
- package/dist/chempot-diagram/temperature.js +0 -36
- package/dist/chempot-diagram/types.d.ts +0 -86
- package/dist/chempot-diagram/types.js +0 -28
- package/dist/colors/index.d.ts +0 -47
- package/dist/colors/index.js +0 -203
- package/dist/composition/BarChart.svelte +0 -297
- package/dist/composition/BarChart.svelte.d.ts +0 -39
- package/dist/composition/BubbleChart.svelte +0 -218
- package/dist/composition/BubbleChart.svelte.d.ts +0 -28
- package/dist/composition/Composition.svelte +0 -164
- package/dist/composition/Composition.svelte.d.ts +0 -15
- package/dist/composition/Formula.svelte +0 -265
- package/dist/composition/Formula.svelte.d.ts +0 -19
- package/dist/composition/FormulaFilter.svelte +0 -1259
- package/dist/composition/FormulaFilter.svelte.d.ts +0 -51
- package/dist/composition/PieChart.svelte +0 -323
- package/dist/composition/PieChart.svelte.d.ts +0 -37
- package/dist/composition/format.d.ts +0 -15
- package/dist/composition/format.js +0 -109
- package/dist/composition/index.d.ts +0 -20
- package/dist/composition/index.js +0 -14
- package/dist/composition/parse.d.ts +0 -55
- package/dist/composition/parse.js +0 -459
- package/dist/constants.d.ts +0 -29
- package/dist/constants.js +0 -99
- package/dist/controls.d.ts +0 -14
- package/dist/controls.js +0 -30
- package/dist/convex-hull/ConvexHull.svelte +0 -157
- package/dist/convex-hull/ConvexHull.svelte.d.ts +0 -13
- package/dist/convex-hull/ConvexHull2D.svelte +0 -814
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +0 -11
- package/dist/convex-hull/ConvexHull3D.svelte +0 -1790
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +0 -8
- package/dist/convex-hull/ConvexHull4D.svelte +0 -1386
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +0 -8
- package/dist/convex-hull/ConvexHullControls.svelte +0 -546
- package/dist/convex-hull/ConvexHullControls.svelte.d.ts +0 -48
- package/dist/convex-hull/ConvexHullInfoPane.svelte +0 -122
- package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +0 -18
- package/dist/convex-hull/ConvexHullStats.svelte +0 -922
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +0 -15
- package/dist/convex-hull/ConvexHullTooltip.svelte +0 -131
- package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +0 -33
- package/dist/convex-hull/GasPressureControls.svelte +0 -247
- package/dist/convex-hull/GasPressureControls.svelte.d.ts +0 -11
- package/dist/convex-hull/StructurePopup.svelte +0 -116
- package/dist/convex-hull/StructurePopup.svelte.d.ts +0 -18
- package/dist/convex-hull/TemperatureSlider.svelte +0 -137
- package/dist/convex-hull/TemperatureSlider.svelte.d.ts +0 -8
- package/dist/convex-hull/barycentric-coords.d.ts +0 -18
- package/dist/convex-hull/barycentric-coords.js +0 -182
- package/dist/convex-hull/demo-temperature.d.ts +0 -6
- package/dist/convex-hull/demo-temperature.js +0 -40
- package/dist/convex-hull/gas-thermodynamics.d.ts +0 -16
- package/dist/convex-hull/gas-thermodynamics.js +0 -316
- package/dist/convex-hull/helpers.d.ts +0 -103
- package/dist/convex-hull/helpers.js +0 -689
- package/dist/convex-hull/index.d.ts +0 -118
- package/dist/convex-hull/index.js +0 -57
- package/dist/convex-hull/thermodynamics.d.ts +0 -66
- package/dist/convex-hull/thermodynamics.js +0 -1752
- package/dist/convex-hull/types.d.ts +0 -162
- package/dist/convex-hull/types.js +0 -36
- package/dist/coordination/CoordinationBarPlot.svelte +0 -311
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +0 -30
- package/dist/coordination/calc-coordination.d.ts +0 -15
- package/dist/coordination/calc-coordination.js +0 -63
- package/dist/coordination/index.d.ts +0 -8
- package/dist/coordination/index.js +0 -7
- package/dist/element/BohrAtom.svelte +0 -147
- package/dist/element/BohrAtom.svelte.d.ts +0 -20
- package/dist/element/ElementHeading.svelte +0 -26
- package/dist/element/ElementHeading.svelte.d.ts +0 -8
- package/dist/element/ElementPhoto.svelte +0 -57
- package/dist/element/ElementPhoto.svelte.d.ts +0 -9
- package/dist/element/ElementStats.svelte +0 -80
- package/dist/element/ElementStats.svelte.d.ts +0 -8
- package/dist/element/ElementTile.svelte +0 -484
- package/dist/element/ElementTile.svelte.d.ts +0 -29
- package/dist/element/Nucleus.svelte.d.ts +0 -17
- package/dist/element/data.d.ts +0 -2
- package/dist/element/data.js +0 -2
- package/dist/element/data.json.gz.d.ts +0 -2
- package/dist/element/index.d.ts +0 -8
- package/dist/element/index.js +0 -8
- package/dist/element/types.d.ts +0 -57
- package/dist/element/types.js +0 -1
- package/dist/feedback/ClickFeedback.svelte +0 -58
- package/dist/feedback/ClickFeedback.svelte.d.ts +0 -12
- package/dist/feedback/DragOverlay.svelte +0 -42
- package/dist/feedback/DragOverlay.svelte.d.ts +0 -7
- package/dist/feedback/Spinner.svelte.d.ts +0 -7
- package/dist/feedback/StatusMessage.svelte.d.ts +0 -9
- package/dist/feedback/index.d.ts +0 -4
- package/dist/feedback/index.js +0 -4
- package/dist/fermi-surface/FermiSlice.svelte +0 -189
- package/dist/fermi-surface/FermiSlice.svelte.d.ts +0 -24
- package/dist/fermi-surface/FermiSurface.svelte +0 -600
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +0 -83
- package/dist/fermi-surface/FermiSurfaceControls.svelte +0 -452
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +0 -35
- package/dist/fermi-surface/FermiSurfaceScene.svelte +0 -792
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +0 -50
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +0 -111
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte.d.ts +0 -8
- package/dist/fermi-surface/compute.d.ts +0 -5
- package/dist/fermi-surface/compute.js +0 -538
- package/dist/fermi-surface/constants.d.ts +0 -9
- package/dist/fermi-surface/constants.js +0 -27
- package/dist/fermi-surface/export.d.ts +0 -5
- package/dist/fermi-surface/export.js +0 -63
- package/dist/fermi-surface/index.d.ts +0 -12
- package/dist/fermi-surface/index.js +0 -13
- package/dist/fermi-surface/marching-cubes.d.ts +0 -2
- package/dist/fermi-surface/marching-cubes.js +0 -2
- package/dist/fermi-surface/parse.d.ts +0 -2
- package/dist/fermi-surface/parse.js +0 -495
- package/dist/fermi-surface/symmetry.d.ts +0 -3
- package/dist/fermi-surface/symmetry.js +0 -46
- package/dist/fermi-surface/types.d.ts +0 -113
- package/dist/fermi-surface/types.js +0 -4
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +0 -1527
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +0 -110
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +0 -225
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +0 -30
- package/dist/heatmap-matrix/index.d.ts +0 -53
- package/dist/heatmap-matrix/index.js +0 -100
- package/dist/heatmap-matrix/shared.d.ts +0 -2
- package/dist/heatmap-matrix/shared.js +0 -4
- package/dist/icons.d.ts +0 -569
- package/dist/icons.js +0 -648
- package/dist/index.d.ts +0 -39
- package/dist/index.js +0 -39
- package/dist/io/decompress.d.ts +0 -10
- package/dist/io/decompress.js +0 -74
- package/dist/io/export.d.ts +0 -16
- package/dist/io/export.js +0 -316
- package/dist/io/fetch.d.ts +0 -5
- package/dist/io/fetch.js +0 -39
- package/dist/io/file-drop.d.ts +0 -7
- package/dist/io/file-drop.js +0 -43
- package/dist/io/index.d.ts +0 -7
- package/dist/io/index.js +0 -7
- package/dist/io/is-binary.d.ts +0 -1
- package/dist/io/is-binary.js +0 -20
- package/dist/io/types.d.ts +0 -8
- package/dist/io/types.js +0 -1
- package/dist/io/url-drop.d.ts +0 -2
- package/dist/io/url-drop.js +0 -117
- package/dist/isosurface/Isosurface.svelte +0 -285
- package/dist/isosurface/Isosurface.svelte.d.ts +0 -8
- package/dist/isosurface/IsosurfaceControls.svelte +0 -291
- package/dist/isosurface/IsosurfaceControls.svelte.d.ts +0 -9
- package/dist/isosurface/index.d.ts +0 -5
- package/dist/isosurface/index.js +0 -6
- package/dist/isosurface/parse.d.ts +0 -6
- package/dist/isosurface/parse.js +0 -553
- package/dist/isosurface/slice.d.ts +0 -11
- package/dist/isosurface/slice.js +0 -140
- package/dist/isosurface/types.d.ts +0 -56
- package/dist/isosurface/types.js +0 -227
- package/dist/labels.d.ts +0 -53
- package/dist/labels.js +0 -274
- package/dist/layout/FullscreenToggle.svelte +0 -50
- package/dist/layout/FullscreenToggle.svelte.d.ts +0 -7
- package/dist/layout/InfoCard.svelte +0 -120
- package/dist/layout/InfoCard.svelte.d.ts +0 -21
- package/dist/layout/InfoTag.svelte +0 -183
- package/dist/layout/InfoTag.svelte.d.ts +0 -19
- package/dist/layout/PropertyFilter.svelte +0 -244
- package/dist/layout/PropertyFilter.svelte.d.ts +0 -24
- package/dist/layout/SettingsSection.svelte +0 -148
- package/dist/layout/SettingsSection.svelte.d.ts +0 -17
- package/dist/layout/SubpageGrid.svelte +0 -82
- package/dist/layout/SubpageGrid.svelte.d.ts +0 -14
- package/dist/layout/fullscreen.d.ts +0 -9
- package/dist/layout/fullscreen.js +0 -53
- package/dist/layout/index.d.ts +0 -10
- package/dist/layout/index.js +0 -8
- package/dist/layout/json-tree/JsonNode.svelte +0 -548
- package/dist/layout/json-tree/JsonNode.svelte.d.ts +0 -11
- package/dist/layout/json-tree/JsonTree.svelte +0 -1222
- package/dist/layout/json-tree/JsonTree.svelte.d.ts +0 -6
- package/dist/layout/json-tree/JsonValue.svelte +0 -334
- package/dist/layout/json-tree/JsonValue.svelte.d.ts +0 -9
- package/dist/layout/json-tree/index.d.ts +0 -3
- package/dist/layout/json-tree/index.js +0 -3
- package/dist/layout/json-tree/types.d.ts +0 -73
- package/dist/layout/json-tree/types.js +0 -3
- package/dist/layout/json-tree/utils.d.ts +0 -29
- package/dist/layout/json-tree/utils.js +0 -649
- package/dist/marching-cubes.d.ts +0 -14
- package/dist/marching-cubes.js +0 -542
- package/dist/math.d.ts +0 -91
- package/dist/math.js +0 -896
- package/dist/overlays/ContextMenu.svelte +0 -162
- package/dist/overlays/ContextMenu.svelte.d.ts +0 -25
- package/dist/overlays/CopyButton.svelte +0 -45
- package/dist/overlays/CopyButton.svelte.d.ts +0 -8
- package/dist/overlays/DraggablePane.svelte +0 -564
- package/dist/overlays/DraggablePane.svelte.d.ts +0 -36
- package/dist/overlays/InfoPaneCards.svelte +0 -149
- package/dist/overlays/InfoPaneCards.svelte.d.ts +0 -22
- package/dist/overlays/index.d.ts +0 -2
- package/dist/overlays/index.js +0 -2
- package/dist/periodic-table/PeriodicTable.svelte +0 -469
- package/dist/periodic-table/PeriodicTable.svelte.d.ts +0 -55
- package/dist/periodic-table/PeriodicTableControls.svelte +0 -557
- package/dist/periodic-table/PeriodicTableControls.svelte.d.ts +0 -24
- package/dist/periodic-table/PropertySelect.svelte +0 -37
- package/dist/periodic-table/PropertySelect.svelte.d.ts +0 -13
- package/dist/periodic-table/TableInset.svelte.d.ts +0 -9
- package/dist/periodic-table/index.d.ts +0 -10
- package/dist/periodic-table/index.js +0 -4
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +0 -1084
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +0 -44
- package/dist/phase-diagram/PhaseDiagramControls.svelte +0 -449
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +0 -30
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +0 -126
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +0 -15
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +0 -192
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +0 -19
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +0 -392
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte.d.ts +0 -16
- package/dist/phase-diagram/TdbInfoPanel.svelte +0 -203
- package/dist/phase-diagram/TdbInfoPanel.svelte.d.ts +0 -12
- package/dist/phase-diagram/build-diagram.d.ts +0 -11
- package/dist/phase-diagram/build-diagram.js +0 -167
- package/dist/phase-diagram/colors.d.ts +0 -35
- package/dist/phase-diagram/colors.js +0 -51
- package/dist/phase-diagram/diagram-input.d.ts +0 -33
- package/dist/phase-diagram/diagram-input.js +0 -3
- package/dist/phase-diagram/index.d.ts +0 -13
- package/dist/phase-diagram/index.js +0 -13
- package/dist/phase-diagram/parse.d.ts +0 -55
- package/dist/phase-diagram/parse.js +0 -276
- package/dist/phase-diagram/svg-to-diagram.d.ts +0 -2
- package/dist/phase-diagram/svg-to-diagram.js +0 -867
- package/dist/phase-diagram/types.d.ts +0 -99
- package/dist/phase-diagram/types.js +0 -1
- package/dist/phase-diagram/utils.d.ts +0 -118
- package/dist/phase-diagram/utils.js +0 -606
- package/dist/plot/AxisLabel.svelte +0 -51
- package/dist/plot/AxisLabel.svelte.d.ts +0 -16
- package/dist/plot/BarPlot.svelte +0 -2265
- package/dist/plot/BarPlot.svelte.d.ts +0 -83
- package/dist/plot/BarPlotControls.svelte +0 -66
- package/dist/plot/BarPlotControls.svelte.d.ts +0 -18
- package/dist/plot/ColorBar.svelte +0 -719
- package/dist/plot/ColorBar.svelte.d.ts +0 -31
- package/dist/plot/ColorScaleSelect.svelte +0 -54
- package/dist/plot/ColorScaleSelect.svelte.d.ts +0 -15
- package/dist/plot/ElementScatter.svelte +0 -63
- package/dist/plot/ElementScatter.svelte.d.ts +0 -14
- package/dist/plot/FillArea.svelte +0 -225
- package/dist/plot/FillArea.svelte.d.ts +0 -21
- package/dist/plot/Histogram.svelte +0 -1672
- package/dist/plot/Histogram.svelte.d.ts +0 -50
- package/dist/plot/HistogramControls.svelte +0 -212
- package/dist/plot/HistogramControls.svelte.d.ts +0 -22
- package/dist/plot/InteractiveAxisLabel.svelte +0 -94
- package/dist/plot/InteractiveAxisLabel.svelte.d.ts +0 -14
- package/dist/plot/Line.svelte +0 -84
- package/dist/plot/Line.svelte.d.ts +0 -15
- package/dist/plot/PlotControls.svelte +0 -537
- package/dist/plot/PlotControls.svelte.d.ts +0 -4
- package/dist/plot/PlotLegend.svelte +0 -569
- package/dist/plot/PlotLegend.svelte.d.ts +0 -29
- package/dist/plot/PlotTooltip.svelte +0 -67
- package/dist/plot/PlotTooltip.svelte.d.ts +0 -17
- package/dist/plot/PortalSelect.svelte +0 -253
- package/dist/plot/PortalSelect.svelte.d.ts +0 -16
- package/dist/plot/ReferenceLine.svelte.d.ts +0 -20
- package/dist/plot/ReferenceLine3D.svelte +0 -154
- package/dist/plot/ReferenceLine3D.svelte.d.ts +0 -14
- package/dist/plot/ReferencePlane.svelte +0 -178
- package/dist/plot/ReferencePlane.svelte.d.ts +0 -14
- package/dist/plot/ScatterPlot.svelte +0 -2845
- package/dist/plot/ScatterPlot.svelte.d.ts +0 -93
- package/dist/plot/ScatterPlot3D.svelte +0 -502
- package/dist/plot/ScatterPlot3D.svelte.d.ts +0 -94
- package/dist/plot/ScatterPlot3DControls.svelte +0 -437
- package/dist/plot/ScatterPlot3DControls.svelte.d.ts +0 -20
- package/dist/plot/ScatterPlot3DScene.svelte +0 -912
- package/dist/plot/ScatterPlot3DScene.svelte.d.ts +0 -74
- package/dist/plot/ScatterPlotControls.svelte +0 -307
- package/dist/plot/ScatterPlotControls.svelte.d.ts +0 -17
- package/dist/plot/ScatterPoint.svelte +0 -191
- package/dist/plot/ScatterPoint.svelte.d.ts +0 -21
- package/dist/plot/SpacegroupBarPlot.svelte +0 -293
- package/dist/plot/SpacegroupBarPlot.svelte.d.ts +0 -9
- package/dist/plot/Surface3D.svelte +0 -200
- package/dist/plot/Surface3D.svelte.d.ts +0 -13
- package/dist/plot/ZeroLines.svelte +0 -96
- package/dist/plot/ZeroLines.svelte.d.ts +0 -32
- package/dist/plot/ZoomRect.svelte +0 -23
- package/dist/plot/ZoomRect.svelte.d.ts +0 -8
- package/dist/plot/axis-utils.d.ts +0 -19
- package/dist/plot/axis-utils.js +0 -80
- package/dist/plot/data-cleaning.d.ts +0 -37
- package/dist/plot/data-cleaning.js +0 -855
- package/dist/plot/data-transform.d.ts +0 -16
- package/dist/plot/data-transform.js +0 -45
- package/dist/plot/defaults.d.ts +0 -19
- package/dist/plot/defaults.js +0 -9
- package/dist/plot/fill-utils.d.ts +0 -51
- package/dist/plot/fill-utils.js +0 -337
- package/dist/plot/hover-lock.svelte.d.ts +0 -14
- package/dist/plot/hover-lock.svelte.js +0 -46
- package/dist/plot/index.d.ts +0 -37
- package/dist/plot/index.js +0 -37
- package/dist/plot/interactions.d.ts +0 -12
- package/dist/plot/interactions.js +0 -100
- package/dist/plot/layout.d.ts +0 -60
- package/dist/plot/layout.js +0 -230
- package/dist/plot/reference-line.d.ts +0 -60
- package/dist/plot/reference-line.js +0 -316
- package/dist/plot/scales.d.ts +0 -48
- package/dist/plot/scales.js +0 -484
- package/dist/plot/svg.d.ts +0 -1
- package/dist/plot/svg.js +0 -11
- package/dist/plot/types.d.ts +0 -859
- package/dist/plot/types.js +0 -103
- package/dist/plot/utils/label-placement.d.ts +0 -47
- package/dist/plot/utils/label-placement.js +0 -256
- package/dist/plot/utils/series-visibility.d.ts +0 -9
- package/dist/plot/utils/series-visibility.js +0 -67
- package/dist/plot/utils.d.ts +0 -1
- package/dist/plot/utils.js +0 -14
- package/dist/rdf/RdfPlot.svelte +0 -247
- package/dist/rdf/RdfPlot.svelte.d.ts +0 -27
- package/dist/rdf/calc-rdf.d.ts +0 -4
- package/dist/rdf/calc-rdf.js +0 -111
- package/dist/rdf/index.d.ts +0 -23
- package/dist/rdf/index.js +0 -2
- package/dist/sanitize.d.ts +0 -4
- package/dist/sanitize.js +0 -114
- package/dist/settings.d.ts +0 -255
- package/dist/settings.js +0 -1132
- package/dist/spectral/Bands.svelte +0 -1040
- package/dist/spectral/Bands.svelte.d.ts +0 -40
- package/dist/spectral/BandsAndDos.svelte +0 -128
- package/dist/spectral/BandsAndDos.svelte.d.ts +0 -18
- package/dist/spectral/BrillouinBandsDos.svelte +0 -248
- package/dist/spectral/BrillouinBandsDos.svelte.d.ts +0 -20
- package/dist/spectral/Dos.svelte +0 -697
- package/dist/spectral/Dos.svelte.d.ts +0 -29
- package/dist/spectral/helpers.d.ts +0 -117
- package/dist/spectral/helpers.js +0 -1023
- package/dist/spectral/index.d.ts +0 -6
- package/dist/spectral/index.js +0 -7
- package/dist/spectral/types.d.ts +0 -84
- package/dist/spectral/types.js +0 -2
- package/dist/state.svelte.d.ts +0 -25
- package/dist/state.svelte.js +0 -45
- package/dist/structure/Arrow.svelte +0 -72
- package/dist/structure/Arrow.svelte.d.ts +0 -15
- package/dist/structure/AtomLegend.svelte +0 -798
- package/dist/structure/AtomLegend.svelte.d.ts +0 -34
- package/dist/structure/Bond.svelte +0 -140
- package/dist/structure/Bond.svelte.d.ts +0 -9
- package/dist/structure/CanvasTooltip.svelte +0 -33
- package/dist/structure/CanvasTooltip.svelte.d.ts +0 -12
- package/dist/structure/CellSelect.svelte +0 -351
- package/dist/structure/CellSelect.svelte.d.ts +0 -13
- package/dist/structure/Cylinder.svelte +0 -45
- package/dist/structure/Cylinder.svelte.d.ts +0 -10
- package/dist/structure/Lattice.svelte +0 -196
- package/dist/structure/Lattice.svelte.d.ts +0 -17
- package/dist/structure/Structure.svelte +0 -1999
- package/dist/structure/Structure.svelte.d.ts +0 -87
- package/dist/structure/StructureControls.svelte +0 -1298
- package/dist/structure/StructureControls.svelte.d.ts +0 -31
- package/dist/structure/StructureExportPane.svelte +0 -251
- package/dist/structure/StructureExportPane.svelte.d.ts +0 -17
- package/dist/structure/StructureInfoPane.svelte +0 -735
- package/dist/structure/StructureInfoPane.svelte.d.ts +0 -19
- package/dist/structure/StructureScene.svelte +0 -1905
- package/dist/structure/StructureScene.svelte.d.ts +0 -108
- package/dist/structure/atom-properties.d.ts +0 -37
- package/dist/structure/atom-properties.js +0 -200
- package/dist/structure/bond-order-perception.d.ts +0 -13
- package/dist/structure/bond-order-perception.js +0 -367
- package/dist/structure/bonding.d.ts +0 -42
- package/dist/structure/bonding.js +0 -525
- package/dist/structure/export.d.ts +0 -20
- package/dist/structure/export.js +0 -727
- package/dist/structure/index.d.ts +0 -125
- package/dist/structure/index.js +0 -171
- package/dist/structure/label-placement.d.ts +0 -14
- package/dist/structure/label-placement.js +0 -72
- package/dist/structure/measure.d.ts +0 -6
- package/dist/structure/measure.js +0 -29
- package/dist/structure/parse.d.ts +0 -66
- package/dist/structure/parse.js +0 -1363
- package/dist/structure/partial-occupancy.d.ts +0 -25
- package/dist/structure/partial-occupancy.js +0 -99
- package/dist/structure/pbc.d.ts +0 -9
- package/dist/structure/pbc.js +0 -123
- package/dist/structure/supercell.d.ts +0 -8
- package/dist/structure/supercell.js +0 -170
- package/dist/structure/validation.d.ts +0 -2
- package/dist/structure/validation.js +0 -10
- package/dist/symmetry/SymmetryStats.svelte +0 -226
- package/dist/symmetry/SymmetryStats.svelte.d.ts +0 -21
- package/dist/symmetry/WyckoffTable.svelte +0 -113
- package/dist/symmetry/WyckoffTable.svelte.d.ts +0 -11
- package/dist/symmetry/cell-transform.d.ts +0 -12
- package/dist/symmetry/cell-transform.js +0 -91
- package/dist/symmetry/index.d.ts +0 -43
- package/dist/symmetry/index.js +0 -229
- package/dist/symmetry/spacegroups.d.ts +0 -9
- package/dist/symmetry/spacegroups.js +0 -394
- package/dist/table/HeatmapTable.svelte +0 -1854
- package/dist/table/HeatmapTable.svelte.d.ts +0 -49
- package/dist/table/ToggleMenu.svelte +0 -376
- package/dist/table/ToggleMenu.svelte.d.ts +0 -11
- package/dist/table/index.d.ts +0 -74
- package/dist/table/index.js +0 -38
- package/dist/theme/ThemeControl.svelte +0 -53
- package/dist/theme/ThemeControl.svelte.d.ts +0 -9
- package/dist/theme/index.d.ts +0 -29
- package/dist/theme/index.js +0 -79
- package/dist/theme/themes.mjs +0 -285
- package/dist/time.d.ts +0 -4
- package/dist/time.js +0 -70
- package/dist/tooltip/TooltipContent.svelte +0 -58
- package/dist/tooltip/TooltipContent.svelte.d.ts +0 -31
- package/dist/tooltip/index.d.ts +0 -2
- package/dist/tooltip/index.js +0 -2
- package/dist/tooltip/types.d.ts +0 -8
- package/dist/tooltip/types.js +0 -1
- package/dist/trajectory/Trajectory.svelte +0 -1517
- package/dist/trajectory/Trajectory.svelte.d.ts +0 -77
- package/dist/trajectory/TrajectoryError.svelte +0 -128
- package/dist/trajectory/TrajectoryError.svelte.d.ts +0 -13
- package/dist/trajectory/TrajectoryExportPane.svelte +0 -357
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +0 -17
- package/dist/trajectory/TrajectoryInfoPane.svelte +0 -313
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +0 -17
- package/dist/trajectory/constants.d.ts +0 -6
- package/dist/trajectory/constants.js +0 -7
- package/dist/trajectory/extract.d.ts +0 -5
- package/dist/trajectory/extract.js +0 -162
- package/dist/trajectory/format-detect.d.ts +0 -9
- package/dist/trajectory/format-detect.js +0 -76
- package/dist/trajectory/frame-reader.d.ts +0 -17
- package/dist/trajectory/frame-reader.js +0 -332
- package/dist/trajectory/helpers.d.ts +0 -14
- package/dist/trajectory/helpers.js +0 -172
- package/dist/trajectory/index.d.ts +0 -63
- package/dist/trajectory/index.js +0 -126
- package/dist/trajectory/parse/ase.d.ts +0 -2
- package/dist/trajectory/parse/ase.js +0 -73
- package/dist/trajectory/parse/hdf5.d.ts +0 -2
- package/dist/trajectory/parse/hdf5.js +0 -127
- package/dist/trajectory/parse/index.d.ts +0 -12
- package/dist/trajectory/parse/index.js +0 -299
- package/dist/trajectory/parse/lammps.d.ts +0 -5
- package/dist/trajectory/parse/lammps.js +0 -179
- package/dist/trajectory/parse/vasp.d.ts +0 -2
- package/dist/trajectory/parse/vasp.js +0 -68
- package/dist/trajectory/parse/xyz.d.ts +0 -2
- package/dist/trajectory/parse/xyz.js +0 -110
- package/dist/trajectory/plotting.d.ts +0 -28
- package/dist/trajectory/plotting.js +0 -423
- package/dist/trajectory/types.d.ts +0 -11
- package/dist/trajectory/types.js +0 -1
- package/dist/utils.d.ts +0 -5
- package/dist/utils.js +0 -36
- package/dist/xrd/XrdPlot.svelte +0 -615
- package/dist/xrd/XrdPlot.svelte.d.ts +0 -28
- package/dist/xrd/broadening.d.ts +0 -20
- package/dist/xrd/broadening.js +0 -97
- package/dist/xrd/calc-xrd.d.ts +0 -37
- package/dist/xrd/calc-xrd.js +0 -337
- package/dist/xrd/index.d.ts +0 -37
- package/dist/xrd/index.js +0 -4
- package/dist/xrd/parse.d.ts +0 -13
- package/dist/xrd/parse.js +0 -749
- /package/dist/{EmptyState.svelte → src/lib/EmptyState.svelte} +0 -0
- /package/dist/{Icon.svelte → src/lib/Icon.svelte} +0 -0
- /package/dist/{app.css → src/lib/app.css} +0 -0
- /package/dist/{chempot-diagram → src/lib/chempot-diagram}/ChemPotScene3D.svelte +0 -0
- /package/dist/{colors → src/lib/colors}/alloy-colors.json +0 -0
- /package/dist/{colors → src/lib/colors}/dark-mode-colors.json +0 -0
- /package/dist/{colors → src/lib/colors}/jmol-colors.json +0 -0
- /package/dist/{colors → src/lib/colors}/muted-colors.json +0 -0
- /package/dist/{colors → src/lib/colors}/pastel-colors.json +0 -0
- /package/dist/{colors → src/lib/colors}/vesta-colors.json +0 -0
- /package/dist/{element → src/lib/element}/Nucleus.svelte +0 -0
- /package/dist/{element → src/lib/element}/data.json +0 -0
- /package/dist/{element → src/lib/element}/data.json.gz +0 -0
- /package/dist/{element → src/lib/element}/data.schema.json +0 -0
- /package/dist/{element-image-urls.json → src/lib/element-image-urls.json} +0 -0
- /package/dist/{feedback → src/lib/feedback}/Spinner.svelte +0 -0
- /package/dist/{feedback → src/lib/feedback}/StatusMessage.svelte +0 -0
- /package/dist/{periodic-table → src/lib/periodic-table}/TableInset.svelte +0 -0
- /package/dist/{plot → src/lib/plot}/ReferenceLine.svelte +0 -0
- /package/dist/{xrd → src/lib/xrd}/atomic_scattering_params.json +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Constants and thresholds for Fermi surface computation
|
|
2
|
+
|
|
3
|
+
// Maximum triangles for BZ symmetry tiling (48x for Oh symmetry)
|
|
4
|
+
// Above this, tiling is auto-disabled for performance
|
|
5
|
+
export const MAX_TRIANGLES_FOR_TILING = 50_000
|
|
6
|
+
|
|
7
|
+
// Throttle interval (ms) for pointer move events during hover
|
|
8
|
+
// Prevents expensive nearest-vertex O(n) lookups from causing UI jank
|
|
9
|
+
export const HOVER_THROTTLE_MS = 16 // ~60fps
|
|
10
|
+
|
|
11
|
+
// Numerical tolerances
|
|
12
|
+
export const CLOSED_CONTOUR_TOLERANCE = 1e-6 // Distance threshold for detecting closed contours
|
|
13
|
+
export const IRREDUCIBLE_BZ_TOLERANCE = 0.01 // Threshold for detecting irreducible BZ (vertices in positive octant)
|
|
14
|
+
export const IRREDUCIBLE_BZ_MIN_VERTICES = 10 // Minimum significant vertex count for irreducible BZ detection
|
|
15
|
+
|
|
16
|
+
export const SPANNING_THRESHOLD = 0.8 // Fraction of BZ extent a surface must cover to be considered "spanning" that direction
|
|
17
|
+
export const BOHR_TO_ANGSTROM = 0.529177 // 1 Bohr = 0.529177 Angstrom
|
|
18
|
+
export const HARTREE_TO_EV = 27.2114 // 1 Hartree = 27.2114 eV
|
|
19
|
+
|
|
20
|
+
// Band colors (ColorBrewer Set1 palette for categorical data)
|
|
21
|
+
export const BAND_COLORS = [
|
|
22
|
+
`#e41a1c`, // red
|
|
23
|
+
`#377eb8`, // blue
|
|
24
|
+
`#4daf4a`, // green
|
|
25
|
+
`#984ea3`, // purple
|
|
26
|
+
`#ff7f00`, // orange
|
|
27
|
+
`#ffff33`, // yellow
|
|
28
|
+
`#a65628`, // brown
|
|
29
|
+
`#f781bf`, // pink
|
|
30
|
+
`#999999`, // gray
|
|
31
|
+
`#66c2a5`, // teal
|
|
32
|
+
] as const
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Export Fermi surface to various 3D formats
|
|
2
|
+
import type { Scene } from 'three'
|
|
3
|
+
|
|
4
|
+
// Helper to trigger file download
|
|
5
|
+
function download_file(content: string | ArrayBuffer, filename: string, mime_type: string) {
|
|
6
|
+
const blob = new Blob([content], { type: mime_type })
|
|
7
|
+
const url = URL.createObjectURL(blob)
|
|
8
|
+
const link = document.createElement(`a`)
|
|
9
|
+
link.href = url
|
|
10
|
+
link.download = filename
|
|
11
|
+
document.body.appendChild(link)
|
|
12
|
+
link.click()
|
|
13
|
+
document.body.removeChild(link)
|
|
14
|
+
URL.revokeObjectURL(url)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Export scene to STL format (good for 3D printing)
|
|
18
|
+
export async function export_to_stl(scene: Scene, filename: string): Promise<void> {
|
|
19
|
+
const { STLExporter } = await import(`three/addons/exporters/STLExporter.js`)
|
|
20
|
+
const exporter = new STLExporter()
|
|
21
|
+
const result = exporter.parse(scene, { binary: true })
|
|
22
|
+
// Binary STL returns DataView, convert to ArrayBuffer for Blob
|
|
23
|
+
const buffer = result instanceof DataView ? result.buffer : result
|
|
24
|
+
download_file(buffer, `${filename}.stl`, `application/octet-stream`)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Export scene to OBJ format (widely compatible)
|
|
28
|
+
export async function export_to_obj(scene: Scene, filename: string): Promise<void> {
|
|
29
|
+
const { OBJExporter } = await import(`three/addons/exporters/OBJExporter.js`)
|
|
30
|
+
const exporter = new OBJExporter()
|
|
31
|
+
const result = exporter.parse(scene)
|
|
32
|
+
download_file(result, `${filename}.obj`, `text/plain`)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Export scene to GLTF format (modern web/AR standard)
|
|
36
|
+
export async function export_to_gltf(scene: Scene, filename: string): Promise<void> {
|
|
37
|
+
const { GLTFExporter } = await import(`three/addons/exporters/GLTFExporter.js`)
|
|
38
|
+
const exporter = new GLTFExporter()
|
|
39
|
+
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
exporter.parse(
|
|
42
|
+
scene,
|
|
43
|
+
(gltf) => {
|
|
44
|
+
const output = JSON.stringify(gltf, null, 2)
|
|
45
|
+
download_file(output, `${filename}.gltf`, `application/json`)
|
|
46
|
+
resolve()
|
|
47
|
+
},
|
|
48
|
+
(error) => reject(error),
|
|
49
|
+
{ binary: false },
|
|
50
|
+
)
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Main export function that dispatches to the appropriate format
|
|
55
|
+
export function export_scene(
|
|
56
|
+
scene: Scene,
|
|
57
|
+
format: `stl` | `obj` | `gltf`,
|
|
58
|
+
filename: string,
|
|
59
|
+
): Promise<void> {
|
|
60
|
+
if (format === `stl`) return export_to_stl(scene, filename)
|
|
61
|
+
if (format === `obj`) return export_to_obj(scene, filename)
|
|
62
|
+
if (format === `gltf`) return export_to_gltf(scene, filename)
|
|
63
|
+
return Promise.reject(new Error(`Unsupported export format: ${format}`))
|
|
64
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Fermi surface visualization module
|
|
2
|
+
export { default as FermiSlice } from './FermiSlice.svelte'
|
|
3
|
+
export { default as FermiSurface } from './FermiSurface.svelte'
|
|
4
|
+
export { default as FermiSurfaceControls } from './FermiSurfaceControls.svelte'
|
|
5
|
+
export { default as FermiSurfaceScene } from './FermiSurfaceScene.svelte'
|
|
6
|
+
export { default as FermiSurfaceTooltip } from './FermiSurfaceTooltip.svelte'
|
|
7
|
+
|
|
8
|
+
export * from './compute'
|
|
9
|
+
export * from './constants'
|
|
10
|
+
export * from './export'
|
|
11
|
+
export * from './marching-cubes'
|
|
12
|
+
export * from './parse'
|
|
13
|
+
export * from './symmetry'
|
|
14
|
+
export * from './types'
|
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
// Parsers for Fermi surface file formats (BXSF, FRMSF, JSON)
|
|
2
|
+
import type { Matrix3x3, Vec3 } from '$lib/math'
|
|
3
|
+
import * as constants from './constants'
|
|
4
|
+
import { compute_vertex_normals } from './marching-cubes'
|
|
5
|
+
import type {
|
|
6
|
+
BandGridData,
|
|
7
|
+
EnergyGrid5D,
|
|
8
|
+
FermiSurfaceData,
|
|
9
|
+
Isosurface,
|
|
10
|
+
SpinChannel,
|
|
11
|
+
SurfaceDimensionality,
|
|
12
|
+
} from './types'
|
|
13
|
+
|
|
14
|
+
const parse_number_tokens = (line: string): string[] => line.split(/\s+/).filter(Boolean)
|
|
15
|
+
|
|
16
|
+
// Parse whitespace-separated floats from a line (optimized with unary +)
|
|
17
|
+
const parse_floats = (line: string): number[] => parse_number_tokens(line).map((part) => +part)
|
|
18
|
+
|
|
19
|
+
// Parse whitespace-separated integers from a line
|
|
20
|
+
const parse_ints = (line: string): number[] =>
|
|
21
|
+
parse_number_tokens(line).map((part) => parseInt(part, 10))
|
|
22
|
+
|
|
23
|
+
// Parse BXSF (Band-XSF) format used by XCrySDen, Quantum ESPRESSO, etc.
|
|
24
|
+
// Format specification: http://www.xcrysden.org/doc/XSF.html
|
|
25
|
+
function parse_bxsf(content: string): BandGridData {
|
|
26
|
+
const lines = content.split(/\r?\n/).map((line) => line.trim())
|
|
27
|
+
let line_idx = 0
|
|
28
|
+
|
|
29
|
+
// Helper to get next non-empty, non-comment line
|
|
30
|
+
const next_line = (): string => {
|
|
31
|
+
while (line_idx < lines.length) {
|
|
32
|
+
const line = lines[line_idx++]
|
|
33
|
+
if (line && !line.startsWith(`#`)) return line
|
|
34
|
+
}
|
|
35
|
+
throw new Error(`Unexpected end of BXSF file`)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Find BEGIN_BLOCK_BANDGRID_3D
|
|
39
|
+
while (line_idx < lines.length) {
|
|
40
|
+
if (lines[line_idx].includes(`BEGIN_BLOCK_BANDGRID_3D`)) {
|
|
41
|
+
line_idx++
|
|
42
|
+
break
|
|
43
|
+
}
|
|
44
|
+
line_idx++
|
|
45
|
+
}
|
|
46
|
+
if (line_idx >= lines.length) {
|
|
47
|
+
throw new Error(`BXSF file missing BEGIN_BLOCK_BANDGRID_3D`)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Skip block identifier line (e.g. "band_energies")
|
|
51
|
+
next_line()
|
|
52
|
+
|
|
53
|
+
// Parse BEGIN_BANDGRID_3D or BANDGRID_3D_BANDS (both variants exist)
|
|
54
|
+
const bandgrid_line = next_line()
|
|
55
|
+
if (!bandgrid_line.includes(`BANDGRID_3D`)) {
|
|
56
|
+
throw new Error(`Expected BANDGRID_3D header, got: ${bandgrid_line}`)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Parse number of bands
|
|
60
|
+
const n_bands = parseInt(next_line(), 10)
|
|
61
|
+
if (isNaN(n_bands) || n_bands <= 0) {
|
|
62
|
+
throw new Error(`Invalid number of bands in BXSF file`)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Parse grid dimensions (nx ny nz)
|
|
66
|
+
const grid_dims = parse_ints(next_line())
|
|
67
|
+
if (grid_dims.length !== 3) {
|
|
68
|
+
throw new Error(`Expected 3 grid dimensions, got ${grid_dims.length}`)
|
|
69
|
+
}
|
|
70
|
+
const k_grid: Vec3 = [grid_dims[0], grid_dims[1], grid_dims[2]]
|
|
71
|
+
|
|
72
|
+
// Parse origin
|
|
73
|
+
const origin_vals = parse_floats(next_line())
|
|
74
|
+
if (origin_vals.length !== 3) {
|
|
75
|
+
throw new Error(`Expected 3 origin values, got ${origin_vals.length}`)
|
|
76
|
+
}
|
|
77
|
+
const origin: Vec3 = [origin_vals[0], origin_vals[1], origin_vals[2]]
|
|
78
|
+
|
|
79
|
+
// Parse 3 spanning vectors (reciprocal lattice)
|
|
80
|
+
const spanning_vectors: Matrix3x3 = [
|
|
81
|
+
parse_floats(next_line()).slice(0, 3) as Vec3,
|
|
82
|
+
parse_floats(next_line()).slice(0, 3) as Vec3,
|
|
83
|
+
parse_floats(next_line()).slice(0, 3) as Vec3,
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
// Validate spanning vectors
|
|
87
|
+
for (const vec of spanning_vectors) {
|
|
88
|
+
if (vec.length !== 3 || vec.some(isNaN)) {
|
|
89
|
+
throw new Error(`Invalid spanning vector in BXSF file`)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Parse band data
|
|
94
|
+
// Format: BAND: band_number followed by energy values on grid
|
|
95
|
+
const energies: EnergyGrid5D = [[]] // [spin=1][band][kx][ky][kz]
|
|
96
|
+
const [nx, ny, nz] = k_grid
|
|
97
|
+
const total_points = nx * ny * nz
|
|
98
|
+
|
|
99
|
+
for (let band_idx = 0; band_idx < n_bands; band_idx++) {
|
|
100
|
+
// Find BAND: line
|
|
101
|
+
let band_line = next_line()
|
|
102
|
+
while (!band_line.startsWith(`BAND:`)) {
|
|
103
|
+
band_line = next_line()
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Read energy values for this band
|
|
107
|
+
const energy_values: number[] = []
|
|
108
|
+
while (energy_values.length < total_points) {
|
|
109
|
+
const line = next_line()
|
|
110
|
+
if (line.startsWith(`END_BANDGRID`) || line.startsWith(`BAND:`)) {
|
|
111
|
+
// Unread this line: after next_line() returns, line_idx points past the
|
|
112
|
+
// returned line, so decrementing by 1 restores to the line just read
|
|
113
|
+
line_idx--
|
|
114
|
+
break
|
|
115
|
+
}
|
|
116
|
+
energy_values.push(...parse_floats(line))
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (energy_values.length < total_points) {
|
|
120
|
+
throw new Error(
|
|
121
|
+
`Band ${band_idx}: expected ${total_points} values, got ${energy_values.length}`,
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Reshape into 3D grid [kx][ky][kz] (preallocated for speed)
|
|
126
|
+
const band_grid: number[][][] = Array(nx)
|
|
127
|
+
let val_idx = 0
|
|
128
|
+
for (let ix = 0; ix < nx; ix++) {
|
|
129
|
+
const iy_arr: number[][] = Array(ny)
|
|
130
|
+
for (let iy = 0; iy < ny; iy++) {
|
|
131
|
+
const iz_arr = energy_values.slice(val_idx, val_idx + nz)
|
|
132
|
+
val_idx += nz
|
|
133
|
+
iy_arr[iy] = iz_arr
|
|
134
|
+
}
|
|
135
|
+
band_grid[ix] = iy_arr
|
|
136
|
+
}
|
|
137
|
+
energies[0].push(band_grid)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Try to find Fermi energy (often in a comment or as FERMI_ENERGY keyword)
|
|
141
|
+
let fermi_energy = 0
|
|
142
|
+
for (const line of lines) {
|
|
143
|
+
const lower = line.toLowerCase()
|
|
144
|
+
if (lower.includes(`fermi`) && lower.includes(`energy`)) {
|
|
145
|
+
// Match patterns like "Fermi Energy = 5.123" or "fermi_energy: -0.5"
|
|
146
|
+
const match = /(?:=|:)\s*([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)/i.exec(line)
|
|
147
|
+
if (match) {
|
|
148
|
+
fermi_energy = parseFloat(match[1])
|
|
149
|
+
break
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return {
|
|
155
|
+
energies,
|
|
156
|
+
k_grid,
|
|
157
|
+
k_lattice: spanning_vectors,
|
|
158
|
+
fermi_energy,
|
|
159
|
+
n_bands,
|
|
160
|
+
n_spins: 1,
|
|
161
|
+
origin,
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Parse FRMSF format used by FermiSurfer
|
|
166
|
+
// Format: https://mitsuaki1987.github.io/fermisurfer/en/_build/html/ops.html
|
|
167
|
+
function parse_frmsf(content: string): BandGridData {
|
|
168
|
+
const lines = content
|
|
169
|
+
.split(/\r?\n/)
|
|
170
|
+
.map((line) => line.trim())
|
|
171
|
+
.filter(Boolean)
|
|
172
|
+
let line_idx = 0
|
|
173
|
+
|
|
174
|
+
// Line 1: grid dimensions (ng[0] ng[1] ng[2])
|
|
175
|
+
const grid_dims = parse_ints(lines[line_idx++])
|
|
176
|
+
if (grid_dims.length !== 3) {
|
|
177
|
+
throw new Error(`FRMSF: Expected 3 grid dimensions`)
|
|
178
|
+
}
|
|
179
|
+
const k_grid: Vec3 = [grid_dims[0], grid_dims[1], grid_dims[2]]
|
|
180
|
+
|
|
181
|
+
// Line 2: lshift (grid shift type)
|
|
182
|
+
// 0 = Monkhorst-Pack grid (shifted)
|
|
183
|
+
// 1 = Gamma-centered grid
|
|
184
|
+
// 2 = Gamma + half grid shift
|
|
185
|
+
const lshift = parseInt(lines[line_idx++], 10)
|
|
186
|
+
if (isNaN(lshift) || lshift < 0 || lshift > 2) {
|
|
187
|
+
throw new Error(`FRMSF: Invalid lshift value (expected 0, 1, or 2)`)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Line 3: number of bands
|
|
191
|
+
const n_bands = parseInt(lines[line_idx++], 10)
|
|
192
|
+
if (isNaN(n_bands) || n_bands <= 0) {
|
|
193
|
+
throw new Error(`FRMSF: Invalid number of bands`)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// FRMSF format has single spin channel (no spin-polarized support in standard format)
|
|
197
|
+
const n_spins = 1
|
|
198
|
+
|
|
199
|
+
// Lines 4-6: reciprocal lattice vectors (in Bohr^-1, convert to Å^-1)
|
|
200
|
+
const inv_bohr = 1 / constants.BOHR_TO_ANGSTROM
|
|
201
|
+
const k_lattice: Matrix3x3 = [
|
|
202
|
+
parse_floats(lines[line_idx++])
|
|
203
|
+
.slice(0, 3)
|
|
204
|
+
.map((val) => val * inv_bohr) as Vec3,
|
|
205
|
+
parse_floats(lines[line_idx++])
|
|
206
|
+
.slice(0, 3)
|
|
207
|
+
.map((val) => val * inv_bohr) as Vec3,
|
|
208
|
+
parse_floats(lines[line_idx++])
|
|
209
|
+
.slice(0, 3)
|
|
210
|
+
.map((val) => val * inv_bohr) as Vec3,
|
|
211
|
+
]
|
|
212
|
+
|
|
213
|
+
const [nx, ny, nz] = k_grid
|
|
214
|
+
const total_points = nx * ny * nz
|
|
215
|
+
|
|
216
|
+
// Parse band energies for each spin and band
|
|
217
|
+
// FRMSF format: one energy value per line per grid point. Any additional columns
|
|
218
|
+
// (e.g. auxiliary color/velocity data) are ignored to prevent grid corruption.
|
|
219
|
+
const energies: EnergyGrid5D = []
|
|
220
|
+
for (let spin_idx = 0; spin_idx < n_spins; spin_idx++) {
|
|
221
|
+
energies[spin_idx] = []
|
|
222
|
+
for (let band_idx = 0; band_idx < n_bands; band_idx++) {
|
|
223
|
+
const energy_values: number[] = []
|
|
224
|
+
|
|
225
|
+
// Read energy values (first value per line only, ignore auxiliary columns)
|
|
226
|
+
while (energy_values.length < total_points && line_idx < lines.length) {
|
|
227
|
+
const line = lines[line_idx]
|
|
228
|
+
const first_token = line?.split(/\s+/)[0]
|
|
229
|
+
if (first_token && !isNaN(parseFloat(first_token))) {
|
|
230
|
+
energy_values.push(parseFloat(first_token))
|
|
231
|
+
line_idx++
|
|
232
|
+
} else {
|
|
233
|
+
break
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (energy_values.length < total_points) {
|
|
238
|
+
throw new Error(
|
|
239
|
+
`FRMSF spin ${spin_idx} band ${band_idx}: expected ${total_points} values, got ${energy_values.length}`,
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Reshape into 3D grid [kx][ky][kz]
|
|
244
|
+
const band_grid: number[][][] = []
|
|
245
|
+
let val_idx = 0
|
|
246
|
+
for (let ix = 0; ix < nx; ix++) {
|
|
247
|
+
band_grid[ix] = []
|
|
248
|
+
for (let iy = 0; iy < ny; iy++) {
|
|
249
|
+
band_grid[ix][iy] = []
|
|
250
|
+
for (let iz = 0; iz < nz; iz++) {
|
|
251
|
+
// FRMSF uses Hartree, convert to eV
|
|
252
|
+
band_grid[ix][iy][iz] = energy_values[val_idx++] * constants.HARTREE_TO_EV
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
energies[spin_idx].push(band_grid)
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return {
|
|
261
|
+
energies,
|
|
262
|
+
k_grid,
|
|
263
|
+
k_lattice,
|
|
264
|
+
fermi_energy: 0, // FRMSF typically expects Fermi level at 0
|
|
265
|
+
n_bands,
|
|
266
|
+
n_spins,
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Validate that an object has the required Isosurface shape
|
|
271
|
+
function is_valid_isosurface(obj: unknown): obj is Isosurface {
|
|
272
|
+
if (!obj || typeof obj !== `object`) return false
|
|
273
|
+
const isosurface_obj = obj as Record<string, unknown>
|
|
274
|
+
const vertices = isosurface_obj.vertices
|
|
275
|
+
const faces = isosurface_obj.faces
|
|
276
|
+
const normals = isosurface_obj.normals
|
|
277
|
+
const band_index = isosurface_obj.band_index
|
|
278
|
+
const spin = isosurface_obj.spin
|
|
279
|
+
|
|
280
|
+
if (!Array.isArray(vertices) || vertices.length === 0) return false
|
|
281
|
+
if (!Array.isArray(faces)) return false
|
|
282
|
+
if (!Array.isArray(normals)) return false
|
|
283
|
+
if (typeof band_index !== `number` || !Number.isFinite(band_index)) return false
|
|
284
|
+
if (spin !== null && spin !== `up` && spin !== `down`) return false
|
|
285
|
+
|
|
286
|
+
return true
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Validate FermiSurfaceData shape
|
|
290
|
+
function is_valid_fermi_surface_data(obj: unknown): obj is FermiSurfaceData {
|
|
291
|
+
if (!obj || typeof obj !== `object`) return false
|
|
292
|
+
const data = obj as Record<string, unknown>
|
|
293
|
+
|
|
294
|
+
// Check required fields
|
|
295
|
+
if (!Array.isArray(data.isosurfaces)) return false
|
|
296
|
+
if (!Array.isArray(data.k_lattice) || data.k_lattice.length !== 3) return false
|
|
297
|
+
if (typeof data.fermi_energy !== `number`) return false
|
|
298
|
+
if (data.reciprocal_cell !== `wigner_seitz` && data.reciprocal_cell !== `parallelepiped`) {
|
|
299
|
+
return false
|
|
300
|
+
}
|
|
301
|
+
if (!data.metadata || typeof data.metadata !== `object`) return false
|
|
302
|
+
|
|
303
|
+
// Validate each isosurface
|
|
304
|
+
for (const iso of data.isosurfaces) {
|
|
305
|
+
if (!is_valid_isosurface(iso)) return false
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
return true
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Parse Matterviz/IFermi JSON format for Fermi surface data
|
|
312
|
+
// Throws on invalid input; returns parsed data on success
|
|
313
|
+
function parse_fermi_json(content: string): FermiSurfaceData | BandGridData {
|
|
314
|
+
const data = JSON.parse(content)
|
|
315
|
+
|
|
316
|
+
// Check if it's already in our FermiSurfaceData format with full validation
|
|
317
|
+
if (data.isosurfaces && Array.isArray(data.isosurfaces)) {
|
|
318
|
+
if (is_valid_fermi_surface_data(data)) {
|
|
319
|
+
return data
|
|
320
|
+
}
|
|
321
|
+
throw new Error(
|
|
322
|
+
`Invalid FermiSurfaceData JSON: isosurfaces array present but missing required fields`,
|
|
323
|
+
)
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// Check if it's IFermi format (isosurfaces is an object keyed by band index)
|
|
327
|
+
if (
|
|
328
|
+
data[`@class`] === `FermiSurface` &&
|
|
329
|
+
data.isosurfaces &&
|
|
330
|
+
typeof data.isosurfaces === `object`
|
|
331
|
+
) {
|
|
332
|
+
return parse_ifermi_surface(data)
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// Check if it's BandGridData (raw grid data)
|
|
336
|
+
if (data.energies && data.k_grid && data.k_lattice) {
|
|
337
|
+
// Minimal validation of required fields
|
|
338
|
+
if (
|
|
339
|
+
!Array.isArray(data.energies) ||
|
|
340
|
+
!Array.isArray(data.k_grid) ||
|
|
341
|
+
data.k_grid.length !== 3 ||
|
|
342
|
+
!Array.isArray(data.k_lattice) ||
|
|
343
|
+
data.k_lattice.length !== 3
|
|
344
|
+
)
|
|
345
|
+
throw new Error(`Invalid BandGridData JSON: malformed required fields`)
|
|
346
|
+
return data as BandGridData
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Try to extract from nested structure (e.g. IFermi output)
|
|
350
|
+
if (data.fermi_surface) {
|
|
351
|
+
return data.fermi_surface as FermiSurfaceData
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
if (data.band_structure?.energies || data.bands?.energies) {
|
|
355
|
+
const bs = data.band_structure ?? data.bands
|
|
356
|
+
return {
|
|
357
|
+
energies: bs.energies,
|
|
358
|
+
k_grid: bs.k_grid ?? bs.kgrid,
|
|
359
|
+
k_lattice: bs.k_lattice ?? bs.reciprocal_lattice,
|
|
360
|
+
fermi_energy: bs.fermi_energy ?? bs.efermi ?? 0,
|
|
361
|
+
n_bands: bs.n_bands || bs.nbands || bs.energies[0]?.length || 0,
|
|
362
|
+
n_spins: bs.n_spins || bs.nspins || bs.energies.length || 1,
|
|
363
|
+
} as BandGridData
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// Check for pymatgen BandStructure format (k-path, not k-grid)
|
|
367
|
+
// These files cannot be used for Fermi surface visualization directly
|
|
368
|
+
if (data.bs?.[`@class`] === `BandStructure` || data[`@class`] === `BandStructure`) {
|
|
369
|
+
throw new Error(
|
|
370
|
+
`This is a pymatgen BandStructure file (band data along k-path). ` +
|
|
371
|
+
`Fermi surface visualization requires a uniform 3D k-grid of eigenvalues. ` +
|
|
372
|
+
`Use IFermi or a BXSF/FRMSF file instead.`,
|
|
373
|
+
)
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
throw new Error(`Unrecognized JSON format: missing required fields for Fermi surface data`)
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// Helper type for IFermi Isosurface format
|
|
380
|
+
interface IFermiIsosurface {
|
|
381
|
+
vertices: number[][]
|
|
382
|
+
faces: number[][]
|
|
383
|
+
band_idx: number
|
|
384
|
+
properties?: Record<string, number[]>
|
|
385
|
+
dimensionality?: string
|
|
386
|
+
orientation?: number[] | null
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// Parse IFermi's JSON output format
|
|
390
|
+
function parse_ifermi_surface(data: Record<string, unknown>): FermiSurfaceData {
|
|
391
|
+
const isosurfaces_obj = data.isosurfaces as Record<string, IFermiIsosurface[]>
|
|
392
|
+
const reciprocal_space = data.reciprocal_space as
|
|
393
|
+
| {
|
|
394
|
+
reciprocal_lattice?: number[][]
|
|
395
|
+
vertices?: number[][]
|
|
396
|
+
faces?: number[][]
|
|
397
|
+
}
|
|
398
|
+
| undefined
|
|
399
|
+
|
|
400
|
+
// Extract reciprocal lattice
|
|
401
|
+
const k_lattice: Matrix3x3 = reciprocal_space?.reciprocal_lattice
|
|
402
|
+
? (reciprocal_space.reciprocal_lattice as Matrix3x3)
|
|
403
|
+
: [
|
|
404
|
+
[1, 0, 0],
|
|
405
|
+
[0, 1, 0],
|
|
406
|
+
[0, 0, 1],
|
|
407
|
+
]
|
|
408
|
+
|
|
409
|
+
// Convert IFermi isosurfaces to our format
|
|
410
|
+
const isosurfaces: Isosurface[] = []
|
|
411
|
+
const band_indices = new Set<number>()
|
|
412
|
+
let has_spin = false
|
|
413
|
+
|
|
414
|
+
for (const [band_key, iso_list] of Object.entries(isosurfaces_obj)) {
|
|
415
|
+
const band_index = parseInt(band_key, 10)
|
|
416
|
+
// spin is determined by sign: positive = up, negative = down
|
|
417
|
+
const spin: SpinChannel = band_index < 0 ? `down` : `up`
|
|
418
|
+
const abs_band_idx = Math.abs(band_index)
|
|
419
|
+
band_indices.add(abs_band_idx)
|
|
420
|
+
if (band_index < 0) has_spin = true
|
|
421
|
+
|
|
422
|
+
for (const ifermi_iso of iso_list) {
|
|
423
|
+
const vertices = ifermi_iso.vertices as Vec3[]
|
|
424
|
+
const faces = ifermi_iso.faces
|
|
425
|
+
|
|
426
|
+
// Compute vertex normals from faces
|
|
427
|
+
const normals = compute_vertex_normals(vertices, faces)
|
|
428
|
+
|
|
429
|
+
// Extract properties if available
|
|
430
|
+
let properties: number[] | undefined
|
|
431
|
+
if (ifermi_iso.properties) {
|
|
432
|
+
// IFermi stores properties like fermi_velocity, spin, etc.
|
|
433
|
+
const prop_keys = Object.keys(ifermi_iso.properties)
|
|
434
|
+
if (prop_keys.length > 0) {
|
|
435
|
+
// Use first available property as vertex colors
|
|
436
|
+
properties = ifermi_iso.properties[prop_keys[0]]
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// Parse dimensionality
|
|
441
|
+
let dimensionality: SurfaceDimensionality | undefined
|
|
442
|
+
if (ifermi_iso.dimensionality) {
|
|
443
|
+
const dim = ifermi_iso.dimensionality.toLowerCase()
|
|
444
|
+
if (dim.includes(`1d`) || dim === `1d`) dimensionality = `1D`
|
|
445
|
+
else if (dim.includes(`quasi`) || dim === `quasi-2d`) dimensionality = `quasi-2D`
|
|
446
|
+
else if (dim.includes(`2d`) || dim === `2d`) dimensionality = `2D`
|
|
447
|
+
else if (dim.includes(`3d`) || dim === `3d`) dimensionality = `3D`
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// Compute area for this isosurface using fan triangulation for N-gons
|
|
451
|
+
let area = 0
|
|
452
|
+
for (const face of faces) {
|
|
453
|
+
if (face.length < 3) continue
|
|
454
|
+
// Validate face indices are within bounds to prevent NaN from undefined vertices
|
|
455
|
+
if (face.some((idx) => idx < 0 || idx >= vertices.length)) continue
|
|
456
|
+
// Fan triangulation: for N vertices, create N-2 triangles (0,1,2), (0,2,3), ...
|
|
457
|
+
const v0 = vertices[face[0]]
|
|
458
|
+
for (let fan_idx = 1; fan_idx < face.length - 1; fan_idx++) {
|
|
459
|
+
const v1 = vertices[face[fan_idx]]
|
|
460
|
+
const v2 = vertices[face[fan_idx + 1]]
|
|
461
|
+
const e1: Vec3 = [v1[0] - v0[0], v1[1] - v0[1], v1[2] - v0[2]]
|
|
462
|
+
const e2: Vec3 = [v2[0] - v0[0], v2[1] - v0[1], v2[2] - v0[2]]
|
|
463
|
+
const cross: Vec3 = [
|
|
464
|
+
e1[1] * e2[2] - e1[2] * e2[1],
|
|
465
|
+
e1[2] * e2[0] - e1[0] * e2[2],
|
|
466
|
+
e1[0] * e2[1] - e1[1] * e2[0],
|
|
467
|
+
]
|
|
468
|
+
area += 0.5 * Math.hypot(cross[0], cross[1], cross[2])
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
isosurfaces.push({
|
|
473
|
+
vertices,
|
|
474
|
+
faces,
|
|
475
|
+
normals,
|
|
476
|
+
properties,
|
|
477
|
+
band_index: abs_band_idx,
|
|
478
|
+
spin,
|
|
479
|
+
area,
|
|
480
|
+
dimensionality,
|
|
481
|
+
orientation: ifermi_iso.orientation as Vec3 | null,
|
|
482
|
+
})
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// Compute total surface area
|
|
487
|
+
const total_area = isosurfaces.reduce((sum, iso) => sum + (iso.area ?? 0), 0)
|
|
488
|
+
|
|
489
|
+
return {
|
|
490
|
+
isosurfaces,
|
|
491
|
+
k_lattice,
|
|
492
|
+
fermi_energy: 0, // IFermi surfaces are typically relative to Fermi level
|
|
493
|
+
reciprocal_cell: `wigner_seitz`, // IFermi typically uses Wigner-Seitz cells
|
|
494
|
+
metadata: {
|
|
495
|
+
n_bands: band_indices.size,
|
|
496
|
+
n_surfaces: isosurfaces.length,
|
|
497
|
+
total_area,
|
|
498
|
+
source_format: `ifermi-json`,
|
|
499
|
+
has_spin,
|
|
500
|
+
has_velocities: isosurfaces.some((iso) => iso.properties !== undefined),
|
|
501
|
+
},
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// Auto-detect file format and parse accordingly
|
|
506
|
+
export function parse_fermi_file(
|
|
507
|
+
content: string,
|
|
508
|
+
filename?: string,
|
|
509
|
+
): BandGridData | FermiSurfaceData | null {
|
|
510
|
+
const lower_name = filename?.toLowerCase() || ``
|
|
511
|
+
|
|
512
|
+
// Detect by filename extension
|
|
513
|
+
if (lower_name.endsWith(`.bxsf`) || lower_name.endsWith(`.bxsf.gz`)) {
|
|
514
|
+
try {
|
|
515
|
+
return parse_bxsf(content)
|
|
516
|
+
} catch (error) {
|
|
517
|
+
console.error(`BXSF parse error:`, error)
|
|
518
|
+
return null
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
if (lower_name.endsWith(`.frmsf`) || lower_name.endsWith(`.frmsf.gz`)) {
|
|
523
|
+
try {
|
|
524
|
+
return parse_frmsf(content)
|
|
525
|
+
} catch (error) {
|
|
526
|
+
console.error(`FRMSF parse error:`, error)
|
|
527
|
+
return null
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
if (lower_name.endsWith(`.json`) || lower_name.endsWith(`.json.gz`)) {
|
|
532
|
+
try {
|
|
533
|
+
return parse_fermi_json(content)
|
|
534
|
+
} catch (error) {
|
|
535
|
+
console.error(`JSON parse error:`, error)
|
|
536
|
+
return null
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
// Try auto-detection based on content
|
|
541
|
+
const trimmed = content.trim()
|
|
542
|
+
|
|
543
|
+
// BXSF format detection
|
|
544
|
+
if (trimmed.includes(`BEGIN_BLOCK_BANDGRID_3D`) || trimmed.includes(`BEGIN_BANDGRID_3D`)) {
|
|
545
|
+
try {
|
|
546
|
+
return parse_bxsf(content)
|
|
547
|
+
} catch (error) {
|
|
548
|
+
console.error(`BXSF auto-detect parse error:`, error)
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// JSON format detection
|
|
553
|
+
if (trimmed.startsWith(`{`) || trimmed.startsWith(`[`)) {
|
|
554
|
+
try {
|
|
555
|
+
return parse_fermi_json(content)
|
|
556
|
+
} catch (error) {
|
|
557
|
+
console.error(`JSON auto-detect parse error:`, error)
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// FRMSF format detection (starts with grid dimensions)
|
|
562
|
+
const first_line = trimmed.split(/\r?\n/)[0]
|
|
563
|
+
const first_tokens = first_line.split(/\s+/).filter(Boolean)
|
|
564
|
+
if (first_tokens.length === 3 && first_tokens.every((token) => /^\d+$/.test(token))) {
|
|
565
|
+
try {
|
|
566
|
+
return parse_frmsf(content)
|
|
567
|
+
} catch (error) {
|
|
568
|
+
console.error(`FRMSF auto-detect parse error:`, error)
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
console.warn(`Could not detect Fermi surface file format for: ${filename}`)
|
|
573
|
+
return null
|
|
574
|
+
}
|