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,764 @@
|
|
|
1
|
+
// Import MatterViz parsing functions and components
|
|
2
|
+
import '$lib/app.css'
|
|
3
|
+
import { COMPRESSION_EXTENSIONS_REGEX } from '$lib/constants'
|
|
4
|
+
import ConvexHull from '$lib/convex-hull/ConvexHull.svelte'
|
|
5
|
+
import type { PhaseData } from '$lib/convex-hull/types'
|
|
6
|
+
import FermiSurface from '$lib/fermi-surface/FermiSurface.svelte'
|
|
7
|
+
import { parse_fermi_file } from '$lib/fermi-surface/parse'
|
|
8
|
+
import { is_fermi_surface_data } from '$lib/fermi-surface/types'
|
|
9
|
+
import { decompress_data, detect_compression_format } from '$lib/io/decompress'
|
|
10
|
+
import { parse_volumetric_file } from '$lib/isosurface/parse'
|
|
11
|
+
import type { VolumetricData } from '$lib/isosurface/types'
|
|
12
|
+
import IsobaricBinaryPhaseDiagram from '$lib/phase-diagram/IsobaricBinaryPhaseDiagram.svelte'
|
|
13
|
+
import type { PhaseDiagramData } from '$lib/phase-diagram/types'
|
|
14
|
+
import { type DefaultSettings, merge } from '$lib/settings'
|
|
15
|
+
import type { AnyStructure } from '$lib/structure'
|
|
16
|
+
import { parse_structure_file } from '$lib/structure/parse'
|
|
17
|
+
import Structure from '$lib/structure/Structure.svelte'
|
|
18
|
+
import { ensure_moyo_wasm_ready } from '$lib/symmetry'
|
|
19
|
+
import { apply_theme_to_dom, is_valid_theme_name, type ThemeName } from '$lib/theme/index'
|
|
20
|
+
import '$lib/theme/themes.mjs'
|
|
21
|
+
import type {
|
|
22
|
+
FrameIndex,
|
|
23
|
+
FrameLoader,
|
|
24
|
+
TrajectoryFrame,
|
|
25
|
+
TrajectoryMetadata,
|
|
26
|
+
TrajectoryType,
|
|
27
|
+
} from '$lib/trajectory'
|
|
28
|
+
import { is_trajectory_file, parse_trajectory_data } from '$lib/trajectory/parse'
|
|
29
|
+
import Trajectory from '$lib/trajectory/Trajectory.svelte'
|
|
30
|
+
import { mount, unmount } from 'svelte'
|
|
31
|
+
import type { ViewType } from '../types'
|
|
32
|
+
import { FERMI_FILE_RE, VOLUMETRIC_EXT_RE, VOLUMETRIC_VASP_RE } from '../types'
|
|
33
|
+
import type { RenderableType } from './detect'
|
|
34
|
+
import { detect_view_type } from './detect'
|
|
35
|
+
import JsonBrowser from './JsonBrowser.svelte'
|
|
36
|
+
|
|
37
|
+
// Maps detect.ts RenderableType to ViewType for direct rendering.
|
|
38
|
+
// Types not listed here fall through to json_browser (which can render all types
|
|
39
|
+
// via its internal mount_into, giving the user a tree view alongside the viz).
|
|
40
|
+
// structure and volumetric have special handling in parse_file_content below.
|
|
41
|
+
const DETECTION_TO_VIEW_TYPE: Partial<Record<RenderableType, ViewType>> = {
|
|
42
|
+
fermi_surface: `fermi_surface`,
|
|
43
|
+
band_grid: `fermi_surface`,
|
|
44
|
+
convex_hull: `convex_hull`,
|
|
45
|
+
phase_diagram: `phase_diagram`,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type { ViewType }
|
|
49
|
+
export interface FileData {
|
|
50
|
+
filename: string
|
|
51
|
+
content: string
|
|
52
|
+
is_base64: boolean
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface MatterVizData {
|
|
56
|
+
type: ViewType
|
|
57
|
+
data: FileData
|
|
58
|
+
theme: ThemeName
|
|
59
|
+
defaults?: DefaultSettings
|
|
60
|
+
moyo_wasm_url?: string
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ParseResult {
|
|
64
|
+
type: ViewType
|
|
65
|
+
data: unknown
|
|
66
|
+
filename: string
|
|
67
|
+
// For trajectories that support VS Code streaming
|
|
68
|
+
streaming_info?: { supports_streaming: boolean; file_path: string }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface MatterVizApp {
|
|
72
|
+
$on?(type: string, callback: (event: Event) => void): () => void
|
|
73
|
+
$set?(props: Partial<Record<string, unknown>>): void
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface FileChangeMessage {
|
|
77
|
+
command: `fileUpdated` | `fileDeleted`
|
|
78
|
+
file_path?: string
|
|
79
|
+
data?: FileData
|
|
80
|
+
type?: ViewType
|
|
81
|
+
theme?: ThemeName
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// VS Code Frame Loader - streams frames via extension communication
|
|
85
|
+
class VSCodeFrameLoader implements FrameLoader {
|
|
86
|
+
constructor(
|
|
87
|
+
private readonly file_path: string,
|
|
88
|
+
private readonly vscode_api: VSCodeAPI,
|
|
89
|
+
) {}
|
|
90
|
+
|
|
91
|
+
// Only implement the method we actually use
|
|
92
|
+
async load_frame(
|
|
93
|
+
_data: string | ArrayBuffer,
|
|
94
|
+
frame_index: number,
|
|
95
|
+
timeout: number = 10, // 10 seconds
|
|
96
|
+
): Promise<TrajectoryFrame | null> {
|
|
97
|
+
return new Promise((resolve, reject) => {
|
|
98
|
+
const request_id = crypto.randomUUID()
|
|
99
|
+
let timer: ReturnType<typeof setTimeout> | null = null
|
|
100
|
+
const handler = (event: MessageEvent) => {
|
|
101
|
+
const { command, request_id: id, error, frame } = event.data
|
|
102
|
+
if (command === `frame_response` && id === request_id) {
|
|
103
|
+
globalThis.removeEventListener(`message`, handler)
|
|
104
|
+
if (timer) clearTimeout(timer)
|
|
105
|
+
if (error) reject(new Error(error))
|
|
106
|
+
else resolve(frame)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
globalThis.addEventListener(`message`, handler)
|
|
111
|
+
this.vscode_api.postMessage({
|
|
112
|
+
command: `request_frame`,
|
|
113
|
+
request_id,
|
|
114
|
+
file_path: this.file_path,
|
|
115
|
+
frame_index,
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
timer = setTimeout(() => {
|
|
119
|
+
globalThis.removeEventListener(`message`, handler)
|
|
120
|
+
reject(new Error(`Frame ${frame_index} timeout after ${timeout}s`))
|
|
121
|
+
}, timeout * 1000)
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Unused methods - just throw errors
|
|
126
|
+
async get_total_frames(): Promise<number> {
|
|
127
|
+
throw new Error(`Not implemented`)
|
|
128
|
+
}
|
|
129
|
+
async build_frame_index(): Promise<FrameIndex[]> {
|
|
130
|
+
throw new Error(`Not implemented`)
|
|
131
|
+
}
|
|
132
|
+
async extract_plot_metadata(): Promise<TrajectoryMetadata[]> {
|
|
133
|
+
throw new Error(`Not implemented`)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface VSCodeAPI {
|
|
138
|
+
postMessage(message: unknown): void
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Extend globalThis interface for MatterViz data
|
|
142
|
+
declare global {
|
|
143
|
+
interface Window {
|
|
144
|
+
matterviz_data?: MatterVizData
|
|
145
|
+
initializeMatterViz?: () => Promise<MatterVizApp | null>
|
|
146
|
+
cleanupMatterViz?: () => Promise<void>
|
|
147
|
+
download?: (data: string | Blob, filename: string) => void
|
|
148
|
+
}
|
|
149
|
+
// Also declare as global var for direct access via globalThis.matterviz_data
|
|
150
|
+
// Both are needed: Window.matterviz_data is set by extension.ts, accessed via globalThis
|
|
151
|
+
var matterviz_data: MatterVizData | undefined
|
|
152
|
+
|
|
153
|
+
// VSCode webview API
|
|
154
|
+
function acquireVsCodeApi(): VSCodeAPI
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Store VSCode API instance to avoid multiple acquisitions
|
|
158
|
+
let vscode_api: VSCodeAPI | null = null
|
|
159
|
+
let current_app: MatterVizApp | null = null
|
|
160
|
+
|
|
161
|
+
// Initialize VSCode API at module level
|
|
162
|
+
try {
|
|
163
|
+
vscode_api = globalThis.acquireVsCodeApi?.() ?? null
|
|
164
|
+
} catch (error) {
|
|
165
|
+
console.warn(`VSCode API already acquired or not available:`, error)
|
|
166
|
+
vscode_api = null
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Set up VSCode-specific download override for file exports
|
|
170
|
+
export const setup_vscode_download = (): void => {
|
|
171
|
+
if (!vscode_api) return
|
|
172
|
+
;(globalThis as unknown as Window).download = (
|
|
173
|
+
data: string | Blob,
|
|
174
|
+
filename: string,
|
|
175
|
+
): void => {
|
|
176
|
+
if (!filename?.trim()) {
|
|
177
|
+
console.error(`Invalid filename provided to download`)
|
|
178
|
+
return
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const send_message = (content: string, is_binary: boolean) => {
|
|
182
|
+
vscode_api?.postMessage({
|
|
183
|
+
command: `saveAs`,
|
|
184
|
+
content,
|
|
185
|
+
filename,
|
|
186
|
+
is_binary,
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
try {
|
|
191
|
+
if (typeof data === `string`) {
|
|
192
|
+
send_message(data, false)
|
|
193
|
+
} else {
|
|
194
|
+
const reader = new FileReader()
|
|
195
|
+
reader.addEventListener(`load`, () => send_message(reader.result as string, true))
|
|
196
|
+
reader.addEventListener(`error`, () => {
|
|
197
|
+
console.error(`Failed to read binary data for download`)
|
|
198
|
+
vscode_api?.postMessage({
|
|
199
|
+
command: `error`,
|
|
200
|
+
text: `Failed to read binary data for download`,
|
|
201
|
+
})
|
|
202
|
+
})
|
|
203
|
+
reader.readAsDataURL(data)
|
|
204
|
+
}
|
|
205
|
+
} catch (error) {
|
|
206
|
+
console.error(`VSCode download failed:`, error)
|
|
207
|
+
vscode_api?.postMessage({
|
|
208
|
+
command: `error`,
|
|
209
|
+
text: `Download failed: ${error}`,
|
|
210
|
+
})
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Handle file change events from extension
|
|
216
|
+
const handle_file_change = async (message: FileChangeMessage): Promise<void> => {
|
|
217
|
+
if (message.command === `fileDeleted`) {
|
|
218
|
+
// File was deleted - show error message
|
|
219
|
+
const container = document.getElementById(`matterviz-app`)
|
|
220
|
+
if (container) {
|
|
221
|
+
container.innerHTML = `
|
|
222
|
+
<div style="padding: 2rem; text-align: center; color: var(--vscode-errorForeground);">
|
|
223
|
+
<h2>File Deleted</h2>
|
|
224
|
+
<p>The file "${escape_html(message.file_path ?? ``)}" has been deleted.</p>
|
|
225
|
+
</div>
|
|
226
|
+
`
|
|
227
|
+
}
|
|
228
|
+
return
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (message.command === `fileUpdated` && message.data) {
|
|
232
|
+
try {
|
|
233
|
+
if (message.theme && is_valid_theme_name(message.theme)) {
|
|
234
|
+
apply_theme_to_dom(message.theme)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const { content, filename, is_base64 } = message.data
|
|
238
|
+
const result = await parse_file_content(content, filename, is_base64)
|
|
239
|
+
|
|
240
|
+
// Update the display
|
|
241
|
+
const container = document.getElementById(`matterviz-app`)
|
|
242
|
+
if (container && current_app) {
|
|
243
|
+
await unmount(current_app) // unmount the existing component to prevent memory leaks
|
|
244
|
+
current_app = create_display(container, result, result.filename)
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
vscode_api?.postMessage({ command: `info`, text: `File reloaded successfully` })
|
|
248
|
+
} catch (error) {
|
|
249
|
+
console.error(`Failed to reload file:`, error)
|
|
250
|
+
vscode_api?.postMessage({
|
|
251
|
+
command: `error`,
|
|
252
|
+
text: `Failed to reload file: ${error}`,
|
|
253
|
+
})
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Convert base64 to ArrayBuffer for binary files
|
|
259
|
+
export function base64_to_array_buffer(base64: string): ArrayBuffer {
|
|
260
|
+
const binary = atob(base64)
|
|
261
|
+
const bytes = new Uint8Array(binary.length)
|
|
262
|
+
for (let idx = 0; idx < binary.length; idx++) {
|
|
263
|
+
bytes[idx] = binary.charCodeAt(idx)
|
|
264
|
+
}
|
|
265
|
+
return bytes.buffer
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Type for parsed trajectory response from large file requests
|
|
269
|
+
type ParsedTrajectoryResponse = {
|
|
270
|
+
trajectory: TrajectoryType
|
|
271
|
+
supports_streaming: boolean
|
|
272
|
+
file_path: string
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Request large file content from the extension using chunked streaming
|
|
276
|
+
function request_large_file_content(
|
|
277
|
+
file_path: string,
|
|
278
|
+
filename: string,
|
|
279
|
+
is_compressed: boolean,
|
|
280
|
+
timeout: number = 30_000, // 30 seconds
|
|
281
|
+
): Promise<string | ParsedTrajectoryResponse> {
|
|
282
|
+
if (!vscode_api) throw new Error(`VS Code API not available`)
|
|
283
|
+
|
|
284
|
+
return new Promise((resolve, reject) => {
|
|
285
|
+
const request_id = crypto.randomUUID()
|
|
286
|
+
|
|
287
|
+
let timer: ReturnType<typeof setTimeout> | null = null
|
|
288
|
+
const handler = (event: MessageEvent) => {
|
|
289
|
+
const { command, request_id: id, error, parsed_trajectory } = event.data
|
|
290
|
+
const { is_parsed, stage, progress } = event.data
|
|
291
|
+
if (command === `large_file_progress` && id === request_id) {
|
|
292
|
+
// TODO maybe forward file load progress to UI
|
|
293
|
+
console.info(`Progress: ${stage} - ${progress}%`)
|
|
294
|
+
return
|
|
295
|
+
}
|
|
296
|
+
if (command === `large_file_response` && id === request_id) {
|
|
297
|
+
globalThis.removeEventListener(`message`, handler)
|
|
298
|
+
if (timer) clearTimeout(timer)
|
|
299
|
+
if (error) return reject(new Error(error))
|
|
300
|
+
if (is_parsed && parsed_trajectory) {
|
|
301
|
+
return resolve({
|
|
302
|
+
trajectory: parsed_trajectory,
|
|
303
|
+
supports_streaming: true,
|
|
304
|
+
file_path,
|
|
305
|
+
})
|
|
306
|
+
}
|
|
307
|
+
resolve(event.data.content)
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
globalThis.addEventListener(`message`, handler)
|
|
312
|
+
const command = `request_large_file`
|
|
313
|
+
vscode_api.postMessage({ command, request_id, file_path, filename, is_compressed })
|
|
314
|
+
|
|
315
|
+
timer = setTimeout(() => {
|
|
316
|
+
globalThis.removeEventListener(`message`, handler)
|
|
317
|
+
reject(new Error(`Large file timeout`))
|
|
318
|
+
}, timeout)
|
|
319
|
+
})
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Parse file content and determine if it's a structure or trajectory
|
|
323
|
+
const parse_file_content = async (
|
|
324
|
+
content: string,
|
|
325
|
+
filename: string,
|
|
326
|
+
is_compressed: boolean = false,
|
|
327
|
+
recursion_depth: number = 0,
|
|
328
|
+
): Promise<ParseResult> => {
|
|
329
|
+
if (recursion_depth > 2) {
|
|
330
|
+
throw new Error(
|
|
331
|
+
`parse_file_content exceeded max recursion depth=2 while parsing file ${filename}`,
|
|
332
|
+
)
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// Check if this is a large file marker from the extension
|
|
336
|
+
if (content.startsWith(`LARGE_FILE:`)) {
|
|
337
|
+
const [, file_path, file_size_str] = content.split(`:`)
|
|
338
|
+
const file_size = parseInt(file_size_str, 10)
|
|
339
|
+
|
|
340
|
+
console.info(`Handling large file: ${filename} (${Math.round(file_size / 1024 / 1024)}MB)`)
|
|
341
|
+
|
|
342
|
+
const parsed_trajectory = await request_large_file_content(
|
|
343
|
+
file_path,
|
|
344
|
+
filename,
|
|
345
|
+
is_compressed,
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
// Check if we received a pre-parsed trajectory with VS Code streaming support
|
|
349
|
+
if (
|
|
350
|
+
parsed_trajectory &&
|
|
351
|
+
typeof parsed_trajectory === `object` &&
|
|
352
|
+
`trajectory` in parsed_trajectory &&
|
|
353
|
+
`supports_streaming` in parsed_trajectory
|
|
354
|
+
) {
|
|
355
|
+
const { trajectory, supports_streaming, file_path } = parsed_trajectory
|
|
356
|
+
const streaming_info = { supports_streaming, file_path }
|
|
357
|
+
return { type: `trajectory`, data: trajectory, filename, streaming_info }
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// Fallback: if not pre-parsed, treat as raw content
|
|
361
|
+
return parse_file_content(
|
|
362
|
+
parsed_trajectory as string,
|
|
363
|
+
filename,
|
|
364
|
+
is_compressed,
|
|
365
|
+
recursion_depth + 1,
|
|
366
|
+
)
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// Handle compressed/binary files by converting from base64 first
|
|
370
|
+
if (is_compressed) {
|
|
371
|
+
const buffer = base64_to_array_buffer(content)
|
|
372
|
+
|
|
373
|
+
// Binary trajectory formats: pass buffer directly to trajectory parser
|
|
374
|
+
if (/\.(h5|hdf5|traj)$/i.test(filename)) {
|
|
375
|
+
const data = await parse_trajectory_data(buffer, filename)
|
|
376
|
+
return { type: `trajectory`, filename, data }
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// Unified handling for all supported compression formats
|
|
380
|
+
const format = detect_compression_format(filename)
|
|
381
|
+
if (format && format !== `zip`) {
|
|
382
|
+
// Skip ZIP as it's not supported in browser
|
|
383
|
+
content = await decompress_data(buffer, format)
|
|
384
|
+
filename = filename.replace(COMPRESSION_EXTENSIONS_REGEX, ``)
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// Try trajectory parsing first if it looks like a trajectory
|
|
389
|
+
if (is_trajectory_file(filename, content)) {
|
|
390
|
+
const data = await parse_trajectory_data(content, filename)
|
|
391
|
+
return { type: `trajectory`, data, filename }
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Fermi surface files (.bxsf, .frmsf)
|
|
395
|
+
// Use basename for regex matching in case filename retains a directory prefix
|
|
396
|
+
const basename = filename.split(`/`).pop() ?? filename
|
|
397
|
+
if (FERMI_FILE_RE.test(basename)) {
|
|
398
|
+
const data = parse_fermi_file(content, filename)
|
|
399
|
+
if (data) return { type: `fermi_surface`, data, filename }
|
|
400
|
+
throw new Error(`Failed to parse Fermi surface file: ${filename}`)
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// Volumetric data files (.cube, CHGCAR, AECCAR*, ELFCAR, LOCPOT, PARCHG)
|
|
404
|
+
if (VOLUMETRIC_EXT_RE.test(basename) || VOLUMETRIC_VASP_RE.test(basename)) {
|
|
405
|
+
const data = parse_volumetric_file(content, filename)
|
|
406
|
+
if (data) return { type: `isosurface`, data, filename }
|
|
407
|
+
throw new Error(`Failed to parse volumetric file: ${filename}`)
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// JSON files: use smart detection + JSON browser
|
|
411
|
+
if (/\.json$/i.test(filename)) {
|
|
412
|
+
try {
|
|
413
|
+
const parsed = JSON.parse(content)
|
|
414
|
+
// Check if the top-level value matches a known visualization type
|
|
415
|
+
const detected = detect_view_type(parsed)
|
|
416
|
+
if (detected) {
|
|
417
|
+
// Structure JSON needs normalization (OPTIMADE, fractional coords, etc.)
|
|
418
|
+
if (detected === `structure`) {
|
|
419
|
+
const structure = parse_structure_file(content, filename)
|
|
420
|
+
if (structure?.sites) {
|
|
421
|
+
return {
|
|
422
|
+
type: `structure`,
|
|
423
|
+
data: { ...structure, id: filename.replace(/\.[^/.]+$/, ``) },
|
|
424
|
+
filename,
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
// Volumetric JSON needs wrapping in { structure, volumes } for the isosurface renderer
|
|
429
|
+
if (detected === `volumetric`) {
|
|
430
|
+
const vol = parsed as { lattice?: unknown }
|
|
431
|
+
return {
|
|
432
|
+
type: `isosurface`,
|
|
433
|
+
data: { structure: { sites: [], lattice: vol.lattice }, volumes: [parsed] },
|
|
434
|
+
filename,
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return {
|
|
438
|
+
type: DETECTION_TO_VIEW_TYPE[detected] ?? `json_browser`,
|
|
439
|
+
data: parsed,
|
|
440
|
+
filename,
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
// No top-level match -- show JSON browser for navigation
|
|
444
|
+
return { type: `json_browser`, data: parsed, filename }
|
|
445
|
+
} catch {
|
|
446
|
+
// JSON parse failed, fall through to structure parser
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// Parse as structure (CIF, POSCAR, XYZ, etc.)
|
|
451
|
+
const structure = parse_structure_file(content, filename)
|
|
452
|
+
if (!structure?.sites) {
|
|
453
|
+
throw new Error(`Failed to parse file or no atoms found`)
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const data = { ...structure, id: filename.replace(/\.[^/.]+$/, ``) }
|
|
457
|
+
return { type: `structure`, data, filename }
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// Escape HTML special chars to prevent XSS when inserting into innerHTML
|
|
461
|
+
const escape_html = (text: string): string =>
|
|
462
|
+
text
|
|
463
|
+
.replace(/&/g, `&`)
|
|
464
|
+
.replace(/</g, `<`)
|
|
465
|
+
.replace(/>/g, `>`)
|
|
466
|
+
.replace(/"/g, `"`)
|
|
467
|
+
.replace(/'/g, `'`)
|
|
468
|
+
|
|
469
|
+
// Create error display in container
|
|
470
|
+
const create_error_display = (
|
|
471
|
+
container: HTMLElement,
|
|
472
|
+
error: Error,
|
|
473
|
+
filename: string,
|
|
474
|
+
): void => {
|
|
475
|
+
container.innerHTML = `
|
|
476
|
+
<div style="padding: 20px; text-align: center; color: var(--vscode-errorForeground, #f85149);
|
|
477
|
+
background: var(--vscode-editor-background, #1e1e1e); height: 100%;
|
|
478
|
+
display: flex; flex-direction: column; justify-content: center; align-items: center;">
|
|
479
|
+
<div style="font-size: 48px; margin-bottom: 20px;">❌</div>
|
|
480
|
+
<h2 style="margin: 0 0 15px 0;">Failed to Parse File</h2>
|
|
481
|
+
<div style="background: rgba(255,255,255,0.1); padding: 20px; border-radius: 8px; max-width: 600px;">
|
|
482
|
+
<p style="margin: 0 0 10px 0;"><strong>File:</strong> ${escape_html(filename)}</p>
|
|
483
|
+
<p style="margin: 0 0 10px 0;"><strong>Error:</strong> ${escape_html(error.message)}</p>
|
|
484
|
+
<p style="margin: 0; font-size: 14px; opacity: 0.8;">
|
|
485
|
+
Supported formats: XYZ, CIF, JSON, POSCAR, trajectory files (.traj, .h5, .extxyz), etc.
|
|
486
|
+
</p>
|
|
487
|
+
</div>
|
|
488
|
+
</div>`
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// Mount Svelte component and create display
|
|
492
|
+
const create_display = (
|
|
493
|
+
container: HTMLElement,
|
|
494
|
+
result: ParseResult,
|
|
495
|
+
filename: string,
|
|
496
|
+
): MatterVizApp => {
|
|
497
|
+
Object.assign(container.style, {
|
|
498
|
+
width: `100%`,
|
|
499
|
+
height: `100%`,
|
|
500
|
+
position: `absolute`,
|
|
501
|
+
top: `0`,
|
|
502
|
+
left: `0`,
|
|
503
|
+
right: `0`,
|
|
504
|
+
bottom: `0`,
|
|
505
|
+
background: `var(--vscode-editor-background, #1e1e1e)`,
|
|
506
|
+
color: `var(--vscode-editor-foreground, #d4d4d4)`,
|
|
507
|
+
overflow: `hidden`,
|
|
508
|
+
})
|
|
509
|
+
container.innerHTML = ``
|
|
510
|
+
|
|
511
|
+
// Get defaults and create props
|
|
512
|
+
const defaults = merge(globalThis.matterviz_data?.defaults)
|
|
513
|
+
const common_props = {
|
|
514
|
+
allow_file_drop: false,
|
|
515
|
+
style: `height: 100%; border-radius: 0`,
|
|
516
|
+
enable_tips: false,
|
|
517
|
+
fullscreen_toggle: false,
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
let app: MatterVizApp
|
|
521
|
+
let log_message: string
|
|
522
|
+
|
|
523
|
+
if (result.type === `trajectory`) {
|
|
524
|
+
// Type for trajectory with optional frame loader for streaming
|
|
525
|
+
type StreamingTrajectory = TrajectoryType & { frame_loader?: FrameLoader }
|
|
526
|
+
|
|
527
|
+
// Prepare trajectory data for VS Code streaming if supported
|
|
528
|
+
let final_trajectory: TrajectoryType | StreamingTrajectory = result.data as TrajectoryType
|
|
529
|
+
|
|
530
|
+
if (result.streaming_info?.supports_streaming) {
|
|
531
|
+
const trajectory = result.data as TrajectoryType
|
|
532
|
+
if (vscode_api && result.streaming_info.file_path) {
|
|
533
|
+
final_trajectory = {
|
|
534
|
+
...trajectory,
|
|
535
|
+
is_indexed: true,
|
|
536
|
+
frames: trajectory.frames || [],
|
|
537
|
+
frame_loader: new VSCodeFrameLoader(result.streaming_info.file_path, vscode_api),
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
app = mount(Trajectory, {
|
|
543
|
+
target: container,
|
|
544
|
+
props: {
|
|
545
|
+
trajectory: final_trajectory,
|
|
546
|
+
...trajectory_props(defaults),
|
|
547
|
+
...common_props,
|
|
548
|
+
},
|
|
549
|
+
})
|
|
550
|
+
log_message = `Trajectory rendered: ${filename} (${
|
|
551
|
+
final_trajectory.frames?.length ?? 0
|
|
552
|
+
} initial frames, ${final_trajectory.total_frames ?? `unknown`} total)`
|
|
553
|
+
} else if (result.type === `fermi_surface`) {
|
|
554
|
+
const fermi_props: Record<string, unknown> = { ...common_props }
|
|
555
|
+
if (is_fermi_surface_data(result.data as Parameters<typeof is_fermi_surface_data>[0])) {
|
|
556
|
+
fermi_props.fermi_data = result.data
|
|
557
|
+
} else {
|
|
558
|
+
fermi_props.band_data = result.data
|
|
559
|
+
}
|
|
560
|
+
app = mount(FermiSurface, { target: container, props: fermi_props })
|
|
561
|
+
log_message = `Fermi surface rendered: ${filename}`
|
|
562
|
+
} else if (result.type === `isosurface`) {
|
|
563
|
+
// VolumetricFileData has structure + volumes; render via Structure with volumetric_data
|
|
564
|
+
const vol_file = result.data as { structure: AnyStructure; volumes: VolumetricData[] }
|
|
565
|
+
app = mount(Structure, {
|
|
566
|
+
target: container,
|
|
567
|
+
props: {
|
|
568
|
+
structure: vol_file.structure,
|
|
569
|
+
volumetric_data: vol_file.volumes,
|
|
570
|
+
...structure_props(defaults),
|
|
571
|
+
...common_props,
|
|
572
|
+
},
|
|
573
|
+
})
|
|
574
|
+
log_message = `Volumetric data rendered: ${filename}`
|
|
575
|
+
} else if (result.type === `convex_hull`) {
|
|
576
|
+
const entries = result.data as PhaseData[]
|
|
577
|
+
app = mount(ConvexHull, {
|
|
578
|
+
target: container,
|
|
579
|
+
props: { entries, ...common_props },
|
|
580
|
+
})
|
|
581
|
+
log_message = `Convex hull rendered: ${filename} (${entries.length} entries)`
|
|
582
|
+
} else if (result.type === `phase_diagram`) {
|
|
583
|
+
app = mount(IsobaricBinaryPhaseDiagram, {
|
|
584
|
+
target: container,
|
|
585
|
+
props: { data: result.data as PhaseDiagramData, ...common_props },
|
|
586
|
+
})
|
|
587
|
+
log_message = `Phase diagram rendered: ${filename}`
|
|
588
|
+
} else if (result.type === `json_browser`) {
|
|
589
|
+
app = mount(JsonBrowser, {
|
|
590
|
+
target: container,
|
|
591
|
+
props: { value: result.data, defaults, filename },
|
|
592
|
+
})
|
|
593
|
+
log_message = `JSON browser opened: ${filename}`
|
|
594
|
+
} else {
|
|
595
|
+
// Default: structure
|
|
596
|
+
const structure = result.data as AnyStructure
|
|
597
|
+
app = mount(Structure, {
|
|
598
|
+
target: container,
|
|
599
|
+
props: {
|
|
600
|
+
structure,
|
|
601
|
+
...structure_props(defaults),
|
|
602
|
+
...common_props,
|
|
603
|
+
},
|
|
604
|
+
})
|
|
605
|
+
log_message = `Structure rendered: ${filename} (${structure.sites?.length ?? 0} sites)`
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
vscode_api?.postMessage({ command: `info`, text: log_message })
|
|
609
|
+
return app
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// Map defaults in settings.ts to structure component props
|
|
613
|
+
// TIGHT COUPLING WARNING: settings-to-props mapping functions create a direct dependency between the centralized settings schema
|
|
614
|
+
// (src/lib/settings.ts) and component prop interfaces. Changes to either side
|
|
615
|
+
// require manual updates here.
|
|
616
|
+
const structure_props = (defaults: DefaultSettings) => {
|
|
617
|
+
const { structure } = defaults
|
|
618
|
+
return {
|
|
619
|
+
scene_props: { ...structure, gizmo: structure.show_gizmo },
|
|
620
|
+
lattice_props: {
|
|
621
|
+
show_cell_vectors: structure.show_cell_vectors,
|
|
622
|
+
cell_edge_opacity: structure.cell_edge_opacity,
|
|
623
|
+
cell_surface_opacity: structure.cell_surface_opacity,
|
|
624
|
+
cell_edge_color: structure.cell_edge_color,
|
|
625
|
+
cell_surface_color: structure.cell_surface_color,
|
|
626
|
+
},
|
|
627
|
+
color_scheme: defaults.color_scheme,
|
|
628
|
+
background_color: defaults.background_color,
|
|
629
|
+
background_opacity: defaults.background_opacity,
|
|
630
|
+
show_image_atoms: structure.show_image_atoms,
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
// Map defaults to trajectory component props
|
|
635
|
+
const trajectory_props = (defaults: DefaultSettings) => {
|
|
636
|
+
const { trajectory, plot, scatter, histogram } = defaults
|
|
637
|
+
return {
|
|
638
|
+
...trajectory,
|
|
639
|
+
structure_props: structure_props(defaults),
|
|
640
|
+
loading_options: {
|
|
641
|
+
bin_file_threshold: trajectory.bin_file_threshold,
|
|
642
|
+
text_file_threshold: trajectory.text_file_threshold,
|
|
643
|
+
use_indexing: trajectory.use_indexing,
|
|
644
|
+
chunk_size: trajectory.chunk_size,
|
|
645
|
+
max_frames_in_memory: trajectory.max_frames_in_memory,
|
|
646
|
+
enable_performance_monitoring: trajectory.enable_performance_monitoring,
|
|
647
|
+
prefetch_frames: trajectory.prefetch_frames,
|
|
648
|
+
cache_parsed_data: trajectory.cache_parsed_data,
|
|
649
|
+
},
|
|
650
|
+
scatter_props: {
|
|
651
|
+
markers: scatter.symbol_type,
|
|
652
|
+
line_width: scatter.line.width,
|
|
653
|
+
point_size: scatter.point.size,
|
|
654
|
+
show_legend: scatter.show_legend,
|
|
655
|
+
enable_zoom: plot.enable_zoom,
|
|
656
|
+
zoom_factor: plot.zoom_factor,
|
|
657
|
+
auto_fit_range: plot.auto_fit_range,
|
|
658
|
+
show_grid: plot.grid_lines,
|
|
659
|
+
show_axis_labels: plot.axis_labels,
|
|
660
|
+
animation_duration: plot.animation_duration,
|
|
661
|
+
legend: { show: scatter.show_legend },
|
|
662
|
+
},
|
|
663
|
+
histogram_props: {
|
|
664
|
+
mode: histogram.mode,
|
|
665
|
+
show_legend: histogram.show_legend,
|
|
666
|
+
bin_count: histogram.bin_count,
|
|
667
|
+
enable_zoom: plot.enable_zoom,
|
|
668
|
+
zoom_factor: plot.zoom_factor,
|
|
669
|
+
auto_fit_range: plot.auto_fit_range,
|
|
670
|
+
show_grid: plot.grid_lines,
|
|
671
|
+
show_axis_labels: plot.axis_labels,
|
|
672
|
+
animation_duration: plot.animation_duration,
|
|
673
|
+
legend: { show: histogram.show_legend },
|
|
674
|
+
},
|
|
675
|
+
spinner_props: { show_progress: trajectory.show_parsing_progress },
|
|
676
|
+
ELEM_PROPERTY_LABELS: {},
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
// Initialize the MatterViz application
|
|
681
|
+
async function initialize() {
|
|
682
|
+
// Get MatterViz data passed from extension
|
|
683
|
+
const { content, filename, is_base64 } = globalThis.matterviz_data?.data || {}
|
|
684
|
+
const theme = globalThis.matterviz_data?.theme
|
|
685
|
+
const moyo_wasm_url = globalThis.matterviz_data?.moyo_wasm_url
|
|
686
|
+
if (!content || !filename) {
|
|
687
|
+
throw new Error(`No data provided to MatterViz app`)
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// Initialize WASM early with URL from extension (for symmetry analysis)
|
|
691
|
+
if (moyo_wasm_url) await ensure_moyo_wasm_ready(moyo_wasm_url)
|
|
692
|
+
|
|
693
|
+
// Set up VSCode-specific download override
|
|
694
|
+
setup_vscode_download()
|
|
695
|
+
|
|
696
|
+
// Apply theme early
|
|
697
|
+
if (theme) apply_theme_to_dom(theme)
|
|
698
|
+
|
|
699
|
+
const container = document.getElementById(`matterviz-app`)
|
|
700
|
+
if (!container) throw new Error(`Target container not found in DOM`)
|
|
701
|
+
|
|
702
|
+
const result = await parse_file_content(content, filename, is_base64)
|
|
703
|
+
const app = create_display(container, result, result.filename)
|
|
704
|
+
|
|
705
|
+
// Store the app instance for file watching
|
|
706
|
+
current_app = app
|
|
707
|
+
|
|
708
|
+
// Set up file change monitoring
|
|
709
|
+
if (vscode_api) {
|
|
710
|
+
// Listen for file change messages from extension
|
|
711
|
+
globalThis.addEventListener(`message`, (event) => {
|
|
712
|
+
if ([`fileUpdated`, `fileDeleted`].includes(event.data.command)) {
|
|
713
|
+
handle_file_change(event.data)
|
|
714
|
+
}
|
|
715
|
+
})
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
return app
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// Cleanup function to properly dispose of components
|
|
722
|
+
async function cleanup_matterviz(): Promise<void> {
|
|
723
|
+
if (current_app) {
|
|
724
|
+
await unmount(current_app)
|
|
725
|
+
current_app = null
|
|
726
|
+
}
|
|
727
|
+
} // Export initialization and cleanup functions to global scope
|
|
728
|
+
|
|
729
|
+
;(
|
|
730
|
+
globalThis as unknown as {
|
|
731
|
+
initializeMatterViz?: () => Promise<MatterVizApp | null>
|
|
732
|
+
cleanupMatterViz?: () => Promise<void>
|
|
733
|
+
}
|
|
734
|
+
).initializeMatterViz = async (): Promise<MatterVizApp | null> => {
|
|
735
|
+
if (!globalThis.matterviz_data) {
|
|
736
|
+
console.warn(`No matterviz_data found on window`)
|
|
737
|
+
return null
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
try {
|
|
741
|
+
const app = await initialize()
|
|
742
|
+
current_app = app
|
|
743
|
+
return app
|
|
744
|
+
} catch (error) {
|
|
745
|
+
const err = error instanceof Error ? error : new Error(String(error))
|
|
746
|
+
const container = document.getElementById(`matterviz-app`)
|
|
747
|
+
if (container) {
|
|
748
|
+
create_error_display(
|
|
749
|
+
container,
|
|
750
|
+
err,
|
|
751
|
+
globalThis.matterviz_data?.data?.filename || `Unknown file`,
|
|
752
|
+
)
|
|
753
|
+
}
|
|
754
|
+
vscode_api?.postMessage({
|
|
755
|
+
command: `error`,
|
|
756
|
+
text: `Error rendering ${
|
|
757
|
+
globalThis.matterviz_data?.data?.filename || `Unknown file`
|
|
758
|
+
}: ${err.message}`,
|
|
759
|
+
})
|
|
760
|
+
return null
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
;(globalThis as unknown as { cleanupMatterViz?: () => Promise<void> }).cleanupMatterViz =
|
|
764
|
+
cleanup_matterviz
|