matterviz 0.3.4 → 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/app.css +247 -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 +1461 -231
- 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/app.css +0 -240
- package/dist/brillouin/BrillouinZone.svelte +0 -543
- 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 -422
- 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 -77
- 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 -105
- 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 -813
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +0 -11
- package/dist/convex-hull/ConvexHull3D.svelte +0 -1788
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +0 -8
- package/dist/convex-hull/ConvexHull4D.svelte +0 -1374
- 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 -115
- package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +0 -18
- package/dist/convex-hull/ConvexHullStats.svelte +0 -905
- 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 -671
- 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 -149
- 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 -3
- 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 -597
- 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 -69
- package/dist/io/export.d.ts +0 -16
- package/dist/io/export.js +0 -312
- 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 -5
- 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 -547
- 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 -648
- 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/DraggablePane.svelte +0 -564
- package/dist/overlays/DraggablePane.svelte.d.ts +0 -36
- 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 -1086
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +0 -44
- package/dist/phase-diagram/PhaseDiagramControls.svelte +0 -451
- 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 -869
- 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 -2256
- package/dist/plot/BarPlot.svelte.d.ts +0 -82
- 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 -226
- package/dist/plot/FillArea.svelte.d.ts +0 -20
- package/dist/plot/Histogram.svelte +0 -1654
- 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 -85
- 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 -498
- package/dist/plot/PlotLegend.svelte.d.ts +0 -25
- 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 -2831
- package/dist/plot/ScatterPlot.svelte.d.ts +0 -92
- package/dist/plot/ScatterPlot3D.svelte +0 -499
- 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 -185
- package/dist/plot/ScatterPoint.svelte.d.ts +0 -19
- package/dist/plot/SpacegroupBarPlot.svelte +0 -292
- 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 -43
- 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 -863
- 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 -107
- package/dist/settings.d.ts +0 -253
- package/dist/settings.js +0 -1123
- 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 -1857
- package/dist/structure/Structure.svelte.d.ts +0 -83
- package/dist/structure/StructureControls.svelte +0 -1184
- 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 -434
- package/dist/structure/StructureInfoPane.svelte.d.ts +0 -18
- package/dist/structure/StructureScene.svelte +0 -1574
- package/dist/structure/StructureScene.svelte.d.ts +0 -104
- package/dist/structure/atom-properties.d.ts +0 -37
- package/dist/structure/atom-properties.js +0 -198
- package/dist/structure/bonding.d.ts +0 -33
- package/dist/structure/bonding.js +0 -304
- package/dist/structure/export.d.ts +0 -20
- package/dist/structure/export.js +0 -725
- package/dist/structure/ferrox-wasm-types.d.ts +0 -46
- package/dist/structure/ferrox-wasm-types.js +0 -18
- package/dist/structure/ferrox-wasm.d.ts +0 -94
- package/dist/structure/ferrox-wasm.js +0 -249
- package/dist/structure/index.d.ts +0 -110
- package/dist/structure/index.js +0 -168
- package/dist/structure/measure.d.ts +0 -6
- package/dist/structure/measure.js +0 -29
- package/dist/structure/parse.d.ts +0 -65
- package/dist/structure/parse.js +0 -1374
- 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 -137
- 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 -77
- 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 -387
- 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 -77
- package/dist/trajectory/parse/hdf5.d.ts +0 -2
- package/dist/trajectory/parse/hdf5.js +0 -129
- 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/{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
|
@@ -1,459 +0,0 @@
|
|
|
1
|
-
import { element_data } from '../element';
|
|
2
|
-
import { ELEM_SYMBOLS } from '../labels';
|
|
3
|
-
// Create symbol/number/mass/electronegativity lookup maps for O(1) access
|
|
4
|
-
export const ATOMIC_NUMBER_TO_SYMBOL = {};
|
|
5
|
-
export const SYMBOL_TO_ATOMIC_NUMBER = {};
|
|
6
|
-
export const ATOMIC_WEIGHTS = new Map();
|
|
7
|
-
export const ELEMENT_ELECTRONEGATIVITY_MAP = new Map();
|
|
8
|
-
export const ELEM_NAME_TO_SYMBOL = {};
|
|
9
|
-
export const ELEM_SYMBOL_TO_NAME = {};
|
|
10
|
-
// Populate maps at module load time
|
|
11
|
-
for (const element of element_data) {
|
|
12
|
-
ATOMIC_NUMBER_TO_SYMBOL[element.number] = element.symbol;
|
|
13
|
-
SYMBOL_TO_ATOMIC_NUMBER[element.symbol] = element.number;
|
|
14
|
-
ATOMIC_WEIGHTS.set(element.symbol, element.atomic_mass);
|
|
15
|
-
ELEMENT_ELECTRONEGATIVITY_MAP.set(element.symbol, element.electronegativity ?? 0);
|
|
16
|
-
ELEM_NAME_TO_SYMBOL[element.name] = element.symbol;
|
|
17
|
-
ELEM_SYMBOL_TO_NAME[element.symbol] = element.name;
|
|
18
|
-
}
|
|
19
|
-
// Type guard: check if a string is a valid element symbol
|
|
20
|
-
export const is_valid_element = (sym) => ELEM_SYMBOLS.includes(sym);
|
|
21
|
-
// Check if object has atomic numbers as keys (1-118)
|
|
22
|
-
const is_atomic_number_composition = (obj) => {
|
|
23
|
-
const keys = Object.keys(obj);
|
|
24
|
-
return (keys.length > 0 &&
|
|
25
|
-
keys.map(Number).every((num) => Number.isInteger(num) && num >= 1 && num <= 118));
|
|
26
|
-
};
|
|
27
|
-
// Convert atomic numbers to element symbols
|
|
28
|
-
export const atomic_num_to_symbols = (atomic_composition) => {
|
|
29
|
-
const composition = {};
|
|
30
|
-
for (const [atomic_num_str, amount] of Object.entries(atomic_composition)) {
|
|
31
|
-
const symbol = ATOMIC_NUMBER_TO_SYMBOL[Number(atomic_num_str)];
|
|
32
|
-
if (!symbol)
|
|
33
|
-
throw new Error(`Invalid atomic number: ${atomic_num_str}`);
|
|
34
|
-
if (amount > 0)
|
|
35
|
-
composition[symbol] = (composition[symbol] || 0) + amount;
|
|
36
|
-
}
|
|
37
|
-
return composition;
|
|
38
|
-
};
|
|
39
|
-
// Convert element symbols to atomic numbers
|
|
40
|
-
export const atomic_symbol_to_num = (symbol_composition) => {
|
|
41
|
-
const atomic_composition = {};
|
|
42
|
-
for (const [symbol, amount] of Object.entries(symbol_composition)) {
|
|
43
|
-
const atomic_num = SYMBOL_TO_ATOMIC_NUMBER[symbol];
|
|
44
|
-
if (!atomic_num)
|
|
45
|
-
throw new Error(`Invalid element symbol: ${symbol}`);
|
|
46
|
-
if (amount > 0) {
|
|
47
|
-
atomic_composition[atomic_num] = (atomic_composition[atomic_num] || 0) + amount;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return atomic_composition;
|
|
51
|
-
};
|
|
52
|
-
// Expand parentheses in chemical formulas
|
|
53
|
-
const expand_parentheses = (formula) => {
|
|
54
|
-
while (formula.includes(`(`)) {
|
|
55
|
-
formula = formula.replace(/\(([^()]+)\)(\d*)/g, (_match, group, multiplier) => {
|
|
56
|
-
const mult = multiplier ? parseInt(multiplier, 10) : 1;
|
|
57
|
-
return group.replace(/([A-Z][a-z]?)(\d*)/g, (_m, element, count) => {
|
|
58
|
-
const num = (count ? parseInt(count, 10) : 1) * mult;
|
|
59
|
-
return element + (num > 1 ? num : ``);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return formula;
|
|
64
|
-
};
|
|
65
|
-
// Parse chemical formula string into composition object
|
|
66
|
-
export const parse_formula = (formula) => {
|
|
67
|
-
const composition = {};
|
|
68
|
-
const cleaned_formula = expand_parentheses(formula.replace(/\s/g, ``));
|
|
69
|
-
for (const match of cleaned_formula.matchAll(/([A-Z][a-z]?)(\d*)/g)) {
|
|
70
|
-
const element = match[1];
|
|
71
|
-
const count = match[2] ? parseInt(match[2], 10) : 1;
|
|
72
|
-
if (!is_valid_element(element))
|
|
73
|
-
throw new Error(`Invalid element symbol: ${element}`);
|
|
74
|
-
composition[element] = (composition[element] || 0) + count;
|
|
75
|
-
}
|
|
76
|
-
return composition;
|
|
77
|
-
};
|
|
78
|
-
// Normalize composition to positive numbers only
|
|
79
|
-
export const normalize_composition = (composition) => {
|
|
80
|
-
if (is_atomic_number_composition(composition)) {
|
|
81
|
-
return normalize_composition(atomic_num_to_symbols(composition));
|
|
82
|
-
}
|
|
83
|
-
const normalized = {};
|
|
84
|
-
for (const [element, amount] of Object.entries(composition)) {
|
|
85
|
-
if (typeof amount === `number` && amount > 0) {
|
|
86
|
-
normalized[element] = amount;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return normalized;
|
|
90
|
-
};
|
|
91
|
-
// Sanitize composition keys by extracting valid element symbols.
|
|
92
|
-
// Handles malformed keys like "B0.", "Fe2+", "Fe[2+]", "Ca^2+" by extracting
|
|
93
|
-
// the element symbol portion. Merges amounts for keys that map to the same element.
|
|
94
|
-
// Returns null if no valid elements can be extracted.
|
|
95
|
-
// NOTE: Only extracts the FIRST valid element from each key. Keys with multiple
|
|
96
|
-
// elements (e.g. "CO3", "Fe2O3") will lose stoichiometry - use parse_formula for those.
|
|
97
|
-
export const sanitize_composition_keys = (composition) => {
|
|
98
|
-
const sanitized = {};
|
|
99
|
-
for (const [key, amount] of Object.entries(composition)) {
|
|
100
|
-
if (typeof amount !== `number` || amount <= 0)
|
|
101
|
-
continue;
|
|
102
|
-
// Extract first valid element symbol from key (e.g. "B0." -> "B", "Fe2+" -> "Fe")
|
|
103
|
-
const elem = (key.match(/[A-Z][a-z]?/g) || []).find(is_valid_element);
|
|
104
|
-
if (elem)
|
|
105
|
-
sanitized[elem] = (sanitized[elem] || 0) + amount;
|
|
106
|
-
}
|
|
107
|
-
const result = normalize_composition(sanitized);
|
|
108
|
-
return Object.keys(result).length > 0 ? result : null;
|
|
109
|
-
};
|
|
110
|
-
// Get total number of atoms
|
|
111
|
-
export const count_atoms_in_composition = (composition) => Object.values(composition).reduce((sum, count) => sum + (count ?? 0), 0);
|
|
112
|
-
export const fractional_composition = (composition, by_weight = false) => {
|
|
113
|
-
// Filter out zero/negative amounts for both branches
|
|
114
|
-
const filtered = Object.fromEntries(Object.entries(composition).filter(([, amount]) => amount > 0));
|
|
115
|
-
if (by_weight) {
|
|
116
|
-
const element_weights = Object.fromEntries(Object.entries(filtered).map(([element, amount]) => {
|
|
117
|
-
const atomic_mass = ATOMIC_WEIGHTS.get(element);
|
|
118
|
-
if (!atomic_mass)
|
|
119
|
-
throw new Error(`Unknown element: ${element}`);
|
|
120
|
-
return [element, amount * atomic_mass];
|
|
121
|
-
}));
|
|
122
|
-
const total_weight = Object.values(element_weights).reduce((sum, wt) => sum + wt, 0);
|
|
123
|
-
if (total_weight === 0)
|
|
124
|
-
return {};
|
|
125
|
-
return Object.fromEntries(Object.entries(element_weights).map(([element, weight]) => [
|
|
126
|
-
element,
|
|
127
|
-
weight / total_weight,
|
|
128
|
-
]));
|
|
129
|
-
}
|
|
130
|
-
const total = count_atoms_in_composition(filtered);
|
|
131
|
-
if (total === 0)
|
|
132
|
-
return {};
|
|
133
|
-
return Object.fromEntries(Object.entries(filtered).map(([element, amount]) => [element, amount / total]));
|
|
134
|
-
};
|
|
135
|
-
// Parse composition from various input types
|
|
136
|
-
export const parse_composition = (input) => {
|
|
137
|
-
if (typeof input === `string`) {
|
|
138
|
-
if (input.trim().startsWith(`{`) && input.trim().endsWith(`}`)) {
|
|
139
|
-
try {
|
|
140
|
-
return normalize_composition(JSON.parse(input));
|
|
141
|
-
}
|
|
142
|
-
catch {
|
|
143
|
-
// Fall through to formula parsing
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return normalize_composition(parse_formula(input));
|
|
147
|
-
}
|
|
148
|
-
return normalize_composition(input);
|
|
149
|
-
};
|
|
150
|
-
// Calculate GCD of two numbers
|
|
151
|
-
const gcd = (num_a, num_b) => num_b === 0 ? num_a : gcd(num_b, num_a % num_b);
|
|
152
|
-
// Get reduced formula by dividing all amounts by their GCD
|
|
153
|
-
// Example: Fe2O4 -> FeO2, H4O2 -> H2O
|
|
154
|
-
export const get_reduced_formula = (composition) => {
|
|
155
|
-
const amounts = Object.values(composition).filter((amt) => amt > 0);
|
|
156
|
-
if (amounts.length === 0)
|
|
157
|
-
return {};
|
|
158
|
-
// Find GCD of all amounts (works with integers; for floats, find approximate GCD)
|
|
159
|
-
const all_integers = amounts.every((amt) => Number.isInteger(amt));
|
|
160
|
-
if (!all_integers)
|
|
161
|
-
return composition; // Can't reduce non-integer compositions
|
|
162
|
-
const divisor = amounts.reduce((acc, amt) => gcd(acc, amt));
|
|
163
|
-
if (divisor <= 1)
|
|
164
|
-
return composition;
|
|
165
|
-
return Object.fromEntries(Object.entries(composition).map(([elem, amt]) => [elem, amt / divisor]));
|
|
166
|
-
};
|
|
167
|
-
// Calculate molecular weight (sum of atomic masses * amounts)
|
|
168
|
-
export const get_molecular_weight = (composition) => Object.entries(composition).reduce((total, [elem, amount]) => {
|
|
169
|
-
const mass = ATOMIC_WEIGHTS.get(elem) ?? 0;
|
|
170
|
-
return total + mass * amount;
|
|
171
|
-
}, 0);
|
|
172
|
-
// Parse oxidation state string (e.g. "+2", "2+", "-", "[2-]") to number
|
|
173
|
-
const parse_oxidation_state = (oxidation_str) => {
|
|
174
|
-
// Handle bare signs: "+", "-" are treated as ±1
|
|
175
|
-
if (oxidation_str === `+` || oxidation_str === `-`) {
|
|
176
|
-
return oxidation_str === `+` ? 1 : -1;
|
|
177
|
-
}
|
|
178
|
-
// Handle formats like "2+", "+2", "2-", "-2"
|
|
179
|
-
const ox_match = /([+-]?)(\d+)([+-]?)/.exec(oxidation_str);
|
|
180
|
-
if (!ox_match)
|
|
181
|
-
return 0;
|
|
182
|
-
const [, sign_before, number, sign_after] = ox_match;
|
|
183
|
-
const sign = sign_before || sign_after || `+`;
|
|
184
|
-
return sign === `-` ? -parseInt(number, 10) : parseInt(number, 10);
|
|
185
|
-
};
|
|
186
|
-
// Parse chemical formula string with oxidation states into structured data.
|
|
187
|
-
// Supports both ^2+ and [2+] syntax for oxidation states.
|
|
188
|
-
// Examples: "Fe^2+O3", "Fe[2+]O3", "Ca^2+Cl^-2"
|
|
189
|
-
// Tracks original element order from the input string.
|
|
190
|
-
// When strict=true, throws on conflicting oxidation states for the same element.
|
|
191
|
-
export const parse_formula_with_oxidation = (formula, strict = false) => {
|
|
192
|
-
const elements = [];
|
|
193
|
-
const cleaned_formula = expand_parentheses(formula.replace(/\s/g, ``));
|
|
194
|
-
// Regex to match: Element, optional oxidation state and/or count in either order
|
|
195
|
-
// Pattern: ([A-Z][a-z]?) - element symbol
|
|
196
|
-
// Followed by one of:
|
|
197
|
-
// - oxidation then optional count: (?:\^([+-]?\d+[+-]?|[+-])|\[([+-]?\d+[+-]?|[+-])\])(\d*)
|
|
198
|
-
// - count then optional oxidation: (\d+)(?:\^([+-]?\d+[+-]?|[+-])|\[([+-]?\d+[+-]?|[+-])\])?
|
|
199
|
-
// - just oxidation: (?:\^([+-]?\d+[+-]?|[+-])|\[([+-]?\d+[+-]?|[+-])\])
|
|
200
|
-
// - just count: (\d+)
|
|
201
|
-
// - neither
|
|
202
|
-
const regex = /([A-Z][a-z]?)(?:(?:\^([+-]?\d+[+-]?|[+-])|\[([+-]?\d+[+-]?|[+-])\])(\d*)|(\d+)(?:\^([+-]?\d+[+-]?|[+-])|\[([+-]?\d+[+-]?|[+-])\])?)?/g;
|
|
203
|
-
let match;
|
|
204
|
-
let orig_idx = 0;
|
|
205
|
-
while ((match = regex.exec(cleaned_formula)) !== null) {
|
|
206
|
-
const element = match[1];
|
|
207
|
-
// Oxidation can be in groups 2/3 (oxidation first) or 6/7 (count first)
|
|
208
|
-
// Count can be in group 4 (after oxidation) or 5 (before oxidation)
|
|
209
|
-
const oxidation_str = match[2] || match[3] || match[6] || match[7];
|
|
210
|
-
const count_str = match[4] || match[5];
|
|
211
|
-
const count = count_str ? parseInt(count_str, 10) : 1;
|
|
212
|
-
if (!is_valid_element(element))
|
|
213
|
-
throw new Error(`Invalid element symbol: ${element}`);
|
|
214
|
-
const oxidation_state = oxidation_str ? parse_oxidation_state(oxidation_str) : undefined;
|
|
215
|
-
// Find or add element entry
|
|
216
|
-
const existing = elements.find((el) => el.element === element);
|
|
217
|
-
if (existing) {
|
|
218
|
-
existing.amount += count;
|
|
219
|
-
// Handle oxidation state conflicts
|
|
220
|
-
if (oxidation_state === undefined) {
|
|
221
|
-
// No oxidation state in current match, nothing to do
|
|
222
|
-
}
|
|
223
|
-
else if (existing.oxidation_state === undefined) {
|
|
224
|
-
// Set oxidation state on first occurrence
|
|
225
|
-
existing.oxidation_state = oxidation_state;
|
|
226
|
-
}
|
|
227
|
-
else if (strict && existing.oxidation_state !== oxidation_state) {
|
|
228
|
-
// In strict mode, throw on conflicting oxidation states
|
|
229
|
-
const format_state = (state) => (state > 0 ? `+` : ``) + state;
|
|
230
|
-
throw new Error(`Conflicting oxidation states for ${element}: ${format_state(existing.oxidation_state)} and ${format_state(oxidation_state)}`);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
elements.push({ element, amount: count, oxidation_state, orig_idx: orig_idx++ });
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return elements;
|
|
238
|
-
};
|
|
239
|
-
// Convert OxiComposition to ElementWithOxidation array
|
|
240
|
-
// Does not preserve original order since objects don't have a defined order
|
|
241
|
-
export const oxi_composition_to_elements = (composition) => Object.entries(composition).map(([element, data], idx) => ({
|
|
242
|
-
element: element,
|
|
243
|
-
amount: data.amount,
|
|
244
|
-
oxidation_state: data.oxidation_state,
|
|
245
|
-
orig_idx: idx,
|
|
246
|
-
}));
|
|
247
|
-
// Extract element symbols from a chemical formula.
|
|
248
|
-
// Default (unique=true, sorted=true): "NbZr2Nb" -> ["Nb", "Zr"]
|
|
249
|
-
// unique=false: Fast token extraction preserving order without parentheses expansion
|
|
250
|
-
// "NbZr2Nb" -> ["Nb", "Zr", "Nb"], "Fe2(SO4)3" -> ["Fe", "S", "O"]
|
|
251
|
-
// Validates tokens against ELEM_SYMBOLS, filtering out invalid ones.
|
|
252
|
-
// sorted=false: Preserves order of first appearance (only applies when unique=true)
|
|
253
|
-
// "ZrNb" -> ["Zr", "Nb"]
|
|
254
|
-
export function extract_formula_elements(formula, { unique = true, sorted = true } = {}) {
|
|
255
|
-
if (!unique) {
|
|
256
|
-
// Fast path: regex token extraction without parentheses expansion
|
|
257
|
-
const matches = formula.match(/[A-Z][a-z]?/g) || [];
|
|
258
|
-
return matches.filter(is_valid_element);
|
|
259
|
-
}
|
|
260
|
-
const symbols = Object.keys(parse_formula(formula));
|
|
261
|
-
return sorted ? symbols.sort() : symbols;
|
|
262
|
-
}
|
|
263
|
-
// Generate all non-empty subsets of a chemical system as hyphenated strings.
|
|
264
|
-
// Input: formula string, composition object, or element symbol array
|
|
265
|
-
// Output: All subsets sorted alphabetically: ["B", "Mo", "Sc", "B-Mo", "B-Sc", "Mo-Sc", "B-Mo-Sc"]
|
|
266
|
-
// Complexity: O(2^n) where n = number of unique elements (fine for typical ~1-5 elements)
|
|
267
|
-
export function generate_chem_sys_subspaces(input) {
|
|
268
|
-
let elements;
|
|
269
|
-
if (typeof input === `string`)
|
|
270
|
-
elements = extract_formula_elements(input);
|
|
271
|
-
else if (Array.isArray(input)) {
|
|
272
|
-
const uniq = [...new Set(input)];
|
|
273
|
-
for (const elem of uniq) {
|
|
274
|
-
if (!is_valid_element(elem))
|
|
275
|
-
throw new Error(`Invalid element symbol: ${elem}`);
|
|
276
|
-
}
|
|
277
|
-
elements = uniq;
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
const keys = Object.keys(input);
|
|
281
|
-
for (const elem of keys) {
|
|
282
|
-
if (!is_valid_element(elem))
|
|
283
|
-
throw new Error(`Invalid element symbol: ${elem}`);
|
|
284
|
-
}
|
|
285
|
-
elements = keys;
|
|
286
|
-
}
|
|
287
|
-
const sorted = [...elements].sort();
|
|
288
|
-
const subspaces = [];
|
|
289
|
-
const subset_count = 2 ** sorted.length;
|
|
290
|
-
for (let mask = 1; mask < subset_count; mask++) {
|
|
291
|
-
const subset = [];
|
|
292
|
-
for (let idx = 0; idx < sorted.length; idx++) {
|
|
293
|
-
if (mask & (1 << idx))
|
|
294
|
-
subset.push(sorted[idx]);
|
|
295
|
-
}
|
|
296
|
-
subspaces.push(subset.join(`-`));
|
|
297
|
-
}
|
|
298
|
-
return subspaces;
|
|
299
|
-
}
|
|
300
|
-
// Normalize CSV of element symbols to valid symbols in periodic order.
|
|
301
|
-
// Filters invalid symbols, removes duplicates, trims whitespace.
|
|
302
|
-
// Example: "Zr, Nb, InvalidElement, H" -> ["H", "Nb", "Zr"]
|
|
303
|
-
// Note: Matching is case-sensitive. Use all_symbols to filter against a subset.
|
|
304
|
-
export const normalize_element_symbols = (csv, all_symbols) => {
|
|
305
|
-
const input_set = new Set(csv
|
|
306
|
-
.split(`,`)
|
|
307
|
-
.map((sym) => sym.trim())
|
|
308
|
-
.filter(Boolean));
|
|
309
|
-
// Cast needed: ELEM_SYMBOLS is readonly const tuple, T is generic string subtype
|
|
310
|
-
return (all_symbols ?? ELEM_SYMBOLS).filter((sym) => input_set.has(sym));
|
|
311
|
-
};
|
|
312
|
-
// Check if input contains wildcard elements (*).
|
|
313
|
-
// Works for both chemsys format (Li-Fe-*-*) and exact formula format (LiFe*2*).
|
|
314
|
-
export const has_wildcards = (input) => input.includes(`*`);
|
|
315
|
-
// Parse chemsys format with wildcards: "Li-Fe-*-*" -> { elements: ["Li", "Fe"], wildcard_count: 2 }
|
|
316
|
-
// Accepts both hyphen and comma separators.
|
|
317
|
-
// Throws if any non-wildcard token is not a valid element symbol.
|
|
318
|
-
export function parse_chemsys_with_wildcards(input) {
|
|
319
|
-
const tokens = input
|
|
320
|
-
.replace(/-/g, `,`)
|
|
321
|
-
.split(`,`)
|
|
322
|
-
.map((tok) => tok.trim())
|
|
323
|
-
.filter(Boolean);
|
|
324
|
-
const elements = [];
|
|
325
|
-
let wildcard_count = 0;
|
|
326
|
-
for (const token of tokens) {
|
|
327
|
-
if (token === `*`) {
|
|
328
|
-
wildcard_count++;
|
|
329
|
-
}
|
|
330
|
-
else if (is_valid_element(token)) {
|
|
331
|
-
elements.push(token);
|
|
332
|
-
}
|
|
333
|
-
else {
|
|
334
|
-
throw new Error(`Invalid element symbol or wildcard: ${token}`);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
return { elements: elements.sort(), wildcard_count };
|
|
338
|
-
}
|
|
339
|
-
// Placeholder for wildcards during parentheses expansion (Zz is not a real element symbol).
|
|
340
|
-
// Use static regex literals to avoid escaping issues if placeholder ever changes.
|
|
341
|
-
export const ELEM_WILDCARD = {
|
|
342
|
-
placeholder: `Zz`,
|
|
343
|
-
to_placeholder: /\*/g,
|
|
344
|
-
from_placeholder: /Zz/g,
|
|
345
|
-
};
|
|
346
|
-
// Parse exact formula with wildcards: "LiFe*2*" -> [{ element: "Li", count: 1 }, { element: "Fe", count: 1 }, { element: null, count: 2 }, { element: null, count: 1 }]
|
|
347
|
-
// The * character represents any element, optionally followed by a count.
|
|
348
|
-
// Each * in the pattern represents a distinct element position (wildcards cannot share elements).
|
|
349
|
-
// Examples:
|
|
350
|
-
// "LiFe*2*" -> Li(1), Fe(1), *(2), *(1) - matches formulas with 4 distinct elements
|
|
351
|
-
// "*2O3" -> *(2), O(3) - matches any binary oxide with 2:3 ratio
|
|
352
|
-
// "**O4" -> *(1), *(1), O(4) - matches ternary oxides with 1:1:4 ratio
|
|
353
|
-
export function parse_formula_with_wildcards(formula) {
|
|
354
|
-
const tokens = [];
|
|
355
|
-
// Expand parentheses, treating * as a pseudo-element (temporarily replace to protect it)
|
|
356
|
-
let cleaned = formula.replace(/\s/g, ``);
|
|
357
|
-
// Protect wildcards from parentheses expansion by replacing * with placeholder
|
|
358
|
-
cleaned = cleaned.replace(ELEM_WILDCARD.to_placeholder, ELEM_WILDCARD.placeholder);
|
|
359
|
-
cleaned = expand_parentheses(cleaned);
|
|
360
|
-
// Restore wildcards
|
|
361
|
-
cleaned = cleaned.replace(ELEM_WILDCARD.from_placeholder, `*`);
|
|
362
|
-
// Regex to match either:
|
|
363
|
-
// 1. Standard element symbol with optional count: ([A-Z][a-z]?)(\d*)
|
|
364
|
-
// 2. Wildcard with optional count: \*(\d*)
|
|
365
|
-
const regex = /([A-Z][a-z]?)(\d*)|(\*)(\d*)/g;
|
|
366
|
-
let match;
|
|
367
|
-
while ((match = regex.exec(cleaned)) !== null) {
|
|
368
|
-
if (match[3] === `*`) {
|
|
369
|
-
// Wildcard match
|
|
370
|
-
const count = match[4] ? parseInt(match[4], 10) : 1;
|
|
371
|
-
tokens.push({ element: null, count });
|
|
372
|
-
}
|
|
373
|
-
else if (match[1]) {
|
|
374
|
-
// Element symbol match
|
|
375
|
-
const element = match[1];
|
|
376
|
-
const count = match[2] ? parseInt(match[2], 10) : 1;
|
|
377
|
-
if (!is_valid_element(element)) {
|
|
378
|
-
throw new Error(`Invalid element symbol: ${element}`);
|
|
379
|
-
}
|
|
380
|
-
tokens.push({ element, count });
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
return tokens;
|
|
384
|
-
}
|
|
385
|
-
// Check if a formula matches a chemsys pattern with wildcards.
|
|
386
|
-
// The formula must contain exactly the specified elements plus wildcard_count additional distinct elements.
|
|
387
|
-
// Example: matches_chemsys_wildcard("LiFeCoO", ["Li", "Fe"], 2) -> true (Co and O fill the wildcards)
|
|
388
|
-
export function matches_chemsys_wildcard(formula, explicit_elements, wildcard_count) {
|
|
389
|
-
try {
|
|
390
|
-
const formula_elements = extract_formula_elements(formula, { unique: true });
|
|
391
|
-
const required_count = explicit_elements.length + wildcard_count;
|
|
392
|
-
// Must have exactly the right number of elements
|
|
393
|
-
if (formula_elements.length !== required_count)
|
|
394
|
-
return false;
|
|
395
|
-
// Must contain all explicit elements
|
|
396
|
-
const formula_set = new Set(formula_elements);
|
|
397
|
-
for (const elem of explicit_elements) {
|
|
398
|
-
if (!formula_set.has(elem))
|
|
399
|
-
return false;
|
|
400
|
-
}
|
|
401
|
-
return true;
|
|
402
|
-
}
|
|
403
|
-
catch {
|
|
404
|
-
return false;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
// Check if a formula matches an exact formula pattern with wildcards.
|
|
408
|
-
// Each wildcard (*) must be satisfied by a distinct element not used by explicit elements or other wildcards.
|
|
409
|
-
// Example: matches_formula_wildcard("LiFeCoNiO4", [{element: "Li", count: 1}, {element: null, count: 1}, ...])
|
|
410
|
-
export function matches_formula_wildcard(formula, pattern) {
|
|
411
|
-
try {
|
|
412
|
-
const composition = parse_formula(formula);
|
|
413
|
-
// Separate explicit elements and wildcards from pattern
|
|
414
|
-
const explicit_requirements = [];
|
|
415
|
-
const wildcard_counts = [];
|
|
416
|
-
for (const token of pattern) {
|
|
417
|
-
if (token.element === null) {
|
|
418
|
-
wildcard_counts.push(token.count);
|
|
419
|
-
}
|
|
420
|
-
else {
|
|
421
|
-
// Merge counts for same element (e.g. "LiLi" -> Li with count 2)
|
|
422
|
-
const existing = explicit_requirements.find((req) => req.element === token.element);
|
|
423
|
-
if (existing) {
|
|
424
|
-
existing.count += token.count;
|
|
425
|
-
}
|
|
426
|
-
else {
|
|
427
|
-
explicit_requirements.push({ element: token.element, count: token.count });
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
// Check explicit element requirements
|
|
432
|
-
const used_elements = new Set();
|
|
433
|
-
for (const req of explicit_requirements) {
|
|
434
|
-
if (composition[req.element] !== req.count)
|
|
435
|
-
return false;
|
|
436
|
-
used_elements.add(req.element);
|
|
437
|
-
}
|
|
438
|
-
// Get remaining elements (candidates for wildcards)
|
|
439
|
-
const remaining_elements = Object.entries(composition)
|
|
440
|
-
.filter(([elem]) => !used_elements.has(elem))
|
|
441
|
-
.map(([elem, count]) => ({ elem, count }));
|
|
442
|
-
// Must have exactly as many remaining elements as wildcards
|
|
443
|
-
if (remaining_elements.length !== wildcard_counts.length)
|
|
444
|
-
return false;
|
|
445
|
-
// Try to match remaining elements to wildcards (each wildcard needs a distinct element)
|
|
446
|
-
// Sort both by count to enable greedy matching
|
|
447
|
-
const sorted_remaining = [...remaining_elements].sort((a, b) => a.count - b.count);
|
|
448
|
-
const sorted_wildcards = [...wildcard_counts].sort((a, b) => a - b);
|
|
449
|
-
// Check if counts match (simple comparison works because we need exact matches)
|
|
450
|
-
for (let idx = 0; idx < sorted_wildcards.length; idx++) {
|
|
451
|
-
if (sorted_remaining[idx].count !== sorted_wildcards[idx])
|
|
452
|
-
return false;
|
|
453
|
-
}
|
|
454
|
-
return true;
|
|
455
|
-
}
|
|
456
|
-
catch {
|
|
457
|
-
return false;
|
|
458
|
-
}
|
|
459
|
-
}
|
package/dist/constants.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare const COMPRESSION_FORMATS: {
|
|
2
|
-
readonly gzip: readonly [".gz", ".gzip"];
|
|
3
|
-
readonly deflate: readonly [".deflate"];
|
|
4
|
-
readonly 'deflate-raw': readonly [".z"];
|
|
5
|
-
readonly zip: readonly [".zip"];
|
|
6
|
-
readonly xz: readonly [".xz"];
|
|
7
|
-
readonly bz2: readonly [".bz2"];
|
|
8
|
-
};
|
|
9
|
-
export declare const COMPRESSION_EXTENSIONS: readonly string[];
|
|
10
|
-
export declare const TRAJ_KEYWORDS: readonly string[];
|
|
11
|
-
export declare const STRUCT_KEYWORDS: readonly string[];
|
|
12
|
-
export declare const STRUCT_KEYWORDS_STRICT: readonly string[];
|
|
13
|
-
export declare const TRAJ_KEYWORDS_REGEX: RegExp;
|
|
14
|
-
export declare const STRUCT_KEYWORDS_REGEX: RegExp;
|
|
15
|
-
export declare const STRUCT_KEYWORDS_STRICT_REGEX: RegExp;
|
|
16
|
-
export declare const TRAJ_KEYWORDS_SIMPLE_REGEX: RegExp;
|
|
17
|
-
export declare const TRAJ_EXTENSIONS: readonly string[];
|
|
18
|
-
export declare const TRAJ_EXTENSIONS_REGEX: RegExp;
|
|
19
|
-
export declare const STRUCTURE_EXTENSIONS: readonly string[];
|
|
20
|
-
export declare const STRUCTURE_EXTENSIONS_REGEX: RegExp;
|
|
21
|
-
export declare const TRAJ_FALLBACK_EXTENSIONS: readonly string[];
|
|
22
|
-
export declare const TRAJ_FALLBACK_EXTENSIONS_REGEX: RegExp;
|
|
23
|
-
export declare const VASP_FILES_REGEX: RegExp;
|
|
24
|
-
export declare const VASP_VOLUMETRIC_REGEX: RegExp;
|
|
25
|
-
export declare const XDATCAR_REGEX: RegExp;
|
|
26
|
-
export declare const CONFIG_DIRS_REGEX: RegExp;
|
|
27
|
-
export declare const MD_SIM_EXCLUDE_REGEX: RegExp;
|
|
28
|
-
export declare const XYZ_EXTXYZ_REGEX: RegExp;
|
|
29
|
-
export declare const COMPRESSION_EXTENSIONS_REGEX: RegExp;
|
package/dist/constants.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// Shared keyword constants for file type detection across the codebase
|
|
2
|
-
// compression formats and their file extensions
|
|
3
|
-
export const COMPRESSION_FORMATS = {
|
|
4
|
-
gzip: [`.gz`, `.gzip`],
|
|
5
|
-
deflate: [`.deflate`],
|
|
6
|
-
'deflate-raw': [`.z`],
|
|
7
|
-
zip: [`.zip`], // Browser DecompressionStream doesn't support ZIP
|
|
8
|
-
xz: [`.xz`], // Browser DecompressionStream doesn't support XZ
|
|
9
|
-
bz2: [`.bz2`], // Browser DecompressionStream doesn't support BZ2
|
|
10
|
-
};
|
|
11
|
-
// All detectable compression extensions
|
|
12
|
-
export const COMPRESSION_EXTENSIONS = Object.freeze([
|
|
13
|
-
...Object.values(COMPRESSION_FORMATS).flat(),
|
|
14
|
-
]);
|
|
15
|
-
// Keywords that indicate a file is likely a trajectory file
|
|
16
|
-
export const TRAJ_KEYWORDS = Object.freeze([
|
|
17
|
-
`trajectory`,
|
|
18
|
-
`traj`,
|
|
19
|
-
`relax`,
|
|
20
|
-
`npt`,
|
|
21
|
-
`nvt`,
|
|
22
|
-
`nve`,
|
|
23
|
-
`qha`,
|
|
24
|
-
`md`,
|
|
25
|
-
`dynamics`,
|
|
26
|
-
`simulation`,
|
|
27
|
-
]);
|
|
28
|
-
// Keywords that indicate a file is likely a structure file
|
|
29
|
-
export const STRUCT_KEYWORDS = Object.freeze([
|
|
30
|
-
`structure`,
|
|
31
|
-
`phono`,
|
|
32
|
-
`vasp`,
|
|
33
|
-
`crystal`,
|
|
34
|
-
`material`,
|
|
35
|
-
`lattice`,
|
|
36
|
-
`geometry`,
|
|
37
|
-
`unit_cell`,
|
|
38
|
-
`unitcell`,
|
|
39
|
-
`atoms`,
|
|
40
|
-
`sites`,
|
|
41
|
-
`data`,
|
|
42
|
-
`phono3py`,
|
|
43
|
-
`phonopy`,
|
|
44
|
-
]);
|
|
45
|
-
// More restrictive keywords for JSON/YAML files (excludes generic terms like "data")
|
|
46
|
-
export const STRUCT_KEYWORDS_STRICT = Object.freeze([
|
|
47
|
-
`structure`,
|
|
48
|
-
`phono`,
|
|
49
|
-
`vasp`,
|
|
50
|
-
`crystal`,
|
|
51
|
-
`material`,
|
|
52
|
-
`lattice`,
|
|
53
|
-
`geometry`,
|
|
54
|
-
`unit_cell`,
|
|
55
|
-
`unitcell`,
|
|
56
|
-
`atoms`,
|
|
57
|
-
`sites`,
|
|
58
|
-
`phono3py`,
|
|
59
|
-
`phonopy`,
|
|
60
|
-
]);
|
|
61
|
-
// Regex patterns for keyword matching
|
|
62
|
-
export const TRAJ_KEYWORDS_REGEX = new RegExp(`(^|[-_.])(${TRAJ_KEYWORDS.join(`|`)})([-_.]|$)`, `i`);
|
|
63
|
-
export const STRUCT_KEYWORDS_REGEX = new RegExp(`(${STRUCT_KEYWORDS.join(`|`)})`, `i`);
|
|
64
|
-
export const STRUCT_KEYWORDS_STRICT_REGEX = new RegExp(`(${STRUCT_KEYWORDS_STRICT.join(`|`)})`, `i`);
|
|
65
|
-
export const TRAJ_KEYWORDS_SIMPLE_REGEX = new RegExp(`(${TRAJ_KEYWORDS.join(`|`)})`, `i`);
|
|
66
|
-
// File extensions for different file types
|
|
67
|
-
export const TRAJ_EXTENSIONS = Object.freeze([
|
|
68
|
-
`.traj`,
|
|
69
|
-
`.xtc`,
|
|
70
|
-
`.lammpstrj`,
|
|
71
|
-
]);
|
|
72
|
-
export const TRAJ_EXTENSIONS_REGEX = new RegExp(`\\.(${TRAJ_EXTENSIONS.map((ext) => ext.slice(1)).join(`|`)})$`, `i`);
|
|
73
|
-
export const STRUCTURE_EXTENSIONS = Object.freeze([
|
|
74
|
-
`.cif`,
|
|
75
|
-
`.mcif`,
|
|
76
|
-
`.poscar`,
|
|
77
|
-
`.vasp`,
|
|
78
|
-
`.cube`,
|
|
79
|
-
`.lmp`,
|
|
80
|
-
`.data`,
|
|
81
|
-
`.dump`,
|
|
82
|
-
`.pdb`,
|
|
83
|
-
`.mol`,
|
|
84
|
-
`.mol2`,
|
|
85
|
-
`.sdf`,
|
|
86
|
-
`.mmcif`,
|
|
87
|
-
]);
|
|
88
|
-
export const STRUCTURE_EXTENSIONS_REGEX = new RegExp(`\\.(${STRUCTURE_EXTENSIONS.map((ext) => ext.slice(1)).join(`|`)})$`, `i`);
|
|
89
|
-
export const TRAJ_FALLBACK_EXTENSIONS = Object.freeze([
|
|
90
|
-
`.dat`,
|
|
91
|
-
`.data`,
|
|
92
|
-
`.log`,
|
|
93
|
-
`.out`,
|
|
94
|
-
`.json`,
|
|
95
|
-
]);
|
|
96
|
-
export const TRAJ_FALLBACK_EXTENSIONS_REGEX = new RegExp(`\\.(${TRAJ_FALLBACK_EXTENSIONS.map((ext) => ext.slice(1)).join(`|`)})$`, `i`);
|
|
97
|
-
// Special regex patterns
|
|
98
|
-
export const VASP_FILES_REGEX = /(?:^|[\\/_.-])(poscar|contcar|potcar|incar|kpoints|outcar)(?:[\\/_.-]|$)/i;
|
|
99
|
-
export const VASP_VOLUMETRIC_REGEX = /(?:^|[\\/_.-])(chgcar|aeccar[012]?|elfcar|locpot|parchg)(?:[\\/_.-]|$)/i;
|
|
100
|
-
export const XDATCAR_REGEX = /xdatcar/i;
|
|
101
|
-
export const CONFIG_DIRS_REGEX = /(?:^|[\\/])(\.vscode|\.idea|\.nyc_output|\.cache|\.tmp|\.temp|node_modules|dist|build|coverage)(?:[\\/]|$)/i;
|
|
102
|
-
export const MD_SIM_EXCLUDE_REGEX = /md_simulation\.(out|txt|yml|py|csv|html|css|md|js|ts)$/i;
|
|
103
|
-
export const XYZ_EXTXYZ_REGEX = /\.(xyz|extxyz)$/i;
|
|
104
|
-
// Compression extensions regex (shared across files)
|
|
105
|
-
export const COMPRESSION_EXTENSIONS_REGEX = new RegExp(`\\.(${COMPRESSION_EXTENSIONS.map((ext) => ext.slice(1)).join(`|`)})$`, `i`);
|
package/dist/controls.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type ControlsVisibility = `always` | `hover` | `never`;
|
|
2
|
-
export type ShowControlsConfig = {
|
|
3
|
-
mode?: ControlsVisibility;
|
|
4
|
-
hidden?: string[];
|
|
5
|
-
style?: string;
|
|
6
|
-
};
|
|
7
|
-
export type ShowControlsProp = ControlsVisibility | ShowControlsConfig | boolean;
|
|
8
|
-
export declare function normalize_show_controls(prop: ShowControlsProp | undefined): {
|
|
9
|
-
mode: ControlsVisibility;
|
|
10
|
-
hidden: Set<string>;
|
|
11
|
-
style: string | undefined;
|
|
12
|
-
visible: (name: string) => boolean;
|
|
13
|
-
class: string;
|
|
14
|
-
};
|
package/dist/controls.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Controls visibility configuration for visualization components
|
|
2
|
-
// Manages visibility of control buttons in Structure, Trajectory, BrillouinZone
|
|
3
|
-
// Normalize show_controls prop into consistent config with helper methods
|
|
4
|
-
export function normalize_show_controls(prop) {
|
|
5
|
-
// Extract mode, hidden, style from various prop forms
|
|
6
|
-
let mode = `hover`;
|
|
7
|
-
let hidden_arr;
|
|
8
|
-
let style;
|
|
9
|
-
if (typeof prop === `boolean`) {
|
|
10
|
-
mode = prop ? `always` : `never`;
|
|
11
|
-
}
|
|
12
|
-
else if (typeof prop === `string`) {
|
|
13
|
-
mode = prop;
|
|
14
|
-
}
|
|
15
|
-
else if (prop) {
|
|
16
|
-
mode = prop.mode ?? `hover`;
|
|
17
|
-
hidden_arr = prop.hidden;
|
|
18
|
-
style = prop.style;
|
|
19
|
-
}
|
|
20
|
-
const hidden = new Set(hidden_arr);
|
|
21
|
-
return {
|
|
22
|
-
mode,
|
|
23
|
-
hidden,
|
|
24
|
-
style,
|
|
25
|
-
// Helper: check if a control should be visible
|
|
26
|
-
visible: (name) => !hidden.has(name),
|
|
27
|
-
// CSS class for visibility mode
|
|
28
|
-
class: mode === `never` ? `` : `${mode}-visible`,
|
|
29
|
-
};
|
|
30
|
-
}
|