matterviz 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brillouin/BrillouinZone.svelte +68 -145
- package/dist/brillouin/BrillouinZone.svelte.d.ts +5 -14
- package/dist/brillouin/BrillouinZoneExportPane.svelte +43 -96
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +9 -32
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +2 -3
- package/dist/brillouin/BrillouinZoneScene.svelte +49 -203
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +3 -23
- package/dist/brillouin/ReciprocalVectors.svelte +39 -0
- package/dist/brillouin/ReciprocalVectors.svelte.d.ts +9 -0
- package/dist/brillouin/compute.d.ts +2 -0
- package/dist/brillouin/compute.js +80 -77
- package/dist/brillouin/geometry.d.ts +8 -0
- package/dist/brillouin/geometry.js +57 -0
- package/dist/brillouin/index.d.ts +2 -0
- package/dist/brillouin/index.js +2 -0
- package/dist/brillouin/types.d.ts +2 -2
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +100 -191
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +4 -1
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +176 -464
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +7 -1
- package/dist/chempot-diagram/color.d.ts +3 -6
- package/dist/chempot-diagram/color.js +5 -5
- package/dist/chempot-diagram/compute.d.ts +3 -3
- package/dist/chempot-diagram/compute.js +3 -1
- package/dist/chempot-diagram/controls-state.svelte.d.ts +10 -0
- package/dist/chempot-diagram/controls-state.svelte.js +42 -0
- package/dist/chempot-diagram/export.d.ts +47 -0
- package/dist/chempot-diagram/export.js +133 -0
- package/dist/chempot-diagram/index.d.ts +1 -0
- package/dist/chempot-diagram/index.js +1 -0
- package/dist/chempot-diagram/pointer.d.ts +0 -10
- package/dist/chempot-diagram/pointer.js +4 -4
- package/dist/chempot-diagram/types.d.ts +3 -3
- package/dist/colors/index.js +2 -2
- package/dist/composition/FormulaFilter.svelte +6 -5
- package/dist/composition/PieChart.svelte +5 -5
- package/dist/composition/chem-sys.js +3 -2
- package/dist/composition/format.js +3 -2
- package/dist/composition/parse.d.ts +0 -1
- package/dist/composition/parse.js +17 -19
- package/dist/controls.d.ts +1 -0
- package/dist/controls.js +0 -1
- package/dist/convex-hull/ConvexHull.svelte +8 -10
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -4
- package/dist/convex-hull/ConvexHull2D.svelte +94 -175
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +176 -680
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +180 -680
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullChrome.svelte +268 -0
- package/dist/convex-hull/ConvexHullChrome.svelte.d.ts +30 -0
- package/dist/convex-hull/ConvexHullControls.svelte +88 -7
- package/dist/convex-hull/ConvexHullControls.svelte.d.ts +7 -6
- package/dist/convex-hull/ConvexHullInfoPane.svelte +18 -5
- package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +6 -5
- package/dist/convex-hull/ConvexHullStats.svelte +29 -168
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +3 -1
- package/dist/convex-hull/ConvexHullTooltip.svelte +11 -2
- package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +2 -1
- package/dist/convex-hull/barycentric-coords.d.ts +2 -4
- package/dist/convex-hull/barycentric-coords.js +6 -33
- package/dist/convex-hull/canvas-interactions.svelte.d.ts +79 -0
- package/dist/convex-hull/canvas-interactions.svelte.js +278 -0
- package/dist/convex-hull/helpers.d.ts +39 -7
- package/dist/convex-hull/helpers.js +154 -69
- package/dist/convex-hull/hull-state.svelte.d.ts +44 -0
- package/dist/convex-hull/hull-state.svelte.js +124 -0
- package/dist/convex-hull/index.d.ts +9 -7
- package/dist/convex-hull/index.js +7 -2
- package/dist/convex-hull/thermodynamics.js +91 -920
- package/dist/convex-hull/types.d.ts +12 -4
- package/dist/convex-hull/types.js +12 -0
- package/dist/coordination/CoordinationBarPlot.svelte +4 -11
- package/dist/element/BohrAtom.svelte +2 -1
- package/dist/element/ElementTile.svelte.d.ts +1 -1
- package/dist/element/index.d.ts +4 -0
- package/dist/element/index.js +18 -0
- package/dist/feedback/DragOverlay.svelte +3 -1
- package/dist/feedback/DragOverlay.svelte.d.ts +1 -0
- package/dist/feedback/StatusMessage.svelte +13 -3
- package/dist/fermi-surface/FermiSurface.svelte +67 -146
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +5 -14
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +72 -224
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +3 -23
- package/dist/fermi-surface/compute.js +11 -10
- package/dist/fermi-surface/export.js +4 -15
- package/dist/fermi-surface/index.d.ts +0 -1
- package/dist/fermi-surface/index.js +0 -1
- package/dist/fermi-surface/parse.d.ts +1 -1
- package/dist/fermi-surface/parse.js +64 -75
- package/dist/fermi-surface/types.d.ts +2 -2
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +55 -40
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +4 -3
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +3 -2
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +5 -5
- package/dist/heatmap-matrix/index.d.ts +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/io/ExportPane.svelte +166 -0
- package/dist/io/ExportPane.svelte.d.ts +17 -0
- package/dist/io/decompress.js +1 -2
- package/dist/io/export.d.ts +5 -1
- package/dist/io/export.js +32 -28
- package/dist/io/fetch.d.ts +2 -1
- package/dist/io/file-drop.d.ts +7 -0
- package/dist/io/file-drop.js +13 -0
- package/dist/io/index.d.ts +2 -0
- package/dist/io/index.js +10 -0
- package/dist/io/types.d.ts +13 -0
- package/dist/isosurface/parse.js +46 -44
- package/dist/labels.js +1 -1
- package/dist/layout/FullscreenButton.svelte +33 -0
- package/dist/layout/FullscreenButton.svelte.d.ts +10 -0
- package/dist/layout/FullscreenToggle.svelte +8 -14
- package/dist/layout/ViewerChrome.svelte +116 -0
- package/dist/layout/ViewerChrome.svelte.d.ts +17 -0
- package/dist/layout/fullscreen.d.ts +4 -0
- package/dist/layout/fullscreen.svelte.d.ts +8 -0
- package/dist/layout/fullscreen.svelte.js +37 -0
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.js +3 -0
- package/dist/math.d.ts +7 -3
- package/dist/math.js +18 -21
- package/dist/overlays/index.d.ts +4 -0
- package/dist/periodic-table/PeriodicTable.svelte +9 -8
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramControls.svelte +3 -2
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +4 -3
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +2 -1
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +2 -3
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +47 -132
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +3 -4
- package/dist/phase-diagram/colors.js +1 -1
- package/dist/phase-diagram/parse.d.ts +2 -1
- package/dist/plot/bar/BarPlot.svelte +79 -316
- package/dist/plot/bar/BarPlot.svelte.d.ts +7 -15
- package/dist/plot/bar/BarPlotControls.svelte.d.ts +1 -1
- package/dist/plot/bar/SpacegroupBarPlot.svelte +2 -1
- package/dist/plot/box/BoxPlot.svelte +76 -246
- package/dist/plot/box/BoxPlot.svelte.d.ts +4 -3
- package/dist/plot/box/BoxPlotControls.svelte.d.ts +1 -1
- package/dist/plot/box/Violin.svelte.d.ts +1 -1
- package/dist/plot/box/box-plot.d.ts +3 -2
- package/dist/plot/box/box-plot.js +5 -2
- package/dist/plot/box/kde.d.ts +2 -1
- package/dist/plot/box/kde.js +4 -4
- package/dist/plot/core/auto-place.d.ts +1 -1
- package/dist/plot/core/auto-place.js +4 -1
- package/dist/plot/core/components/ColorBar.svelte +5 -5
- package/dist/plot/core/components/ColorBar.svelte.d.ts +5 -4
- package/dist/plot/core/components/Line.svelte +3 -2
- package/dist/plot/core/components/Line.svelte.d.ts +3 -2
- package/dist/plot/core/components/PlotAxis.svelte +2 -1
- package/dist/plot/core/components/PlotAxis.svelte.d.ts +2 -1
- package/dist/plot/core/components/PlotControls.svelte.d.ts +1 -1
- package/dist/plot/core/components/ReferenceLine3D.svelte +2 -2
- package/dist/plot/core/components/ReferenceLine3D.svelte.d.ts +4 -4
- package/dist/plot/core/components/ReferencePlane.svelte +2 -2
- package/dist/plot/core/components/ReferencePlane.svelte.d.ts +4 -4
- package/dist/plot/core/data-cleaning.js +18 -18
- package/dist/plot/core/fill-utils.d.ts +4 -3
- package/dist/plot/core/fill-utils.js +6 -3
- package/dist/plot/core/interactions.d.ts +5 -1
- package/dist/plot/core/interactions.js +14 -0
- package/dist/plot/core/pan-zoom.svelte.d.ts +35 -0
- package/dist/plot/core/pan-zoom.svelte.js +221 -0
- package/dist/plot/core/placed-tween.svelte.d.ts +21 -0
- package/dist/plot/core/placed-tween.svelte.js +68 -0
- package/dist/plot/core/reference-line.d.ts +10 -10
- package/dist/plot/core/reference-line.js +6 -6
- package/dist/plot/core/scales.d.ts +17 -25
- package/dist/plot/core/scales.js +10 -8
- package/dist/plot/core/svg.d.ts +2 -1
- package/dist/plot/core/types.d.ts +18 -7
- package/dist/plot/core/utils/label-placement.d.ts +1 -1
- package/dist/plot/core/utils/label-placement.js +3 -3
- package/dist/plot/core/utils.d.ts +2 -1
- package/dist/plot/histogram/Histogram.svelte +77 -314
- package/dist/plot/histogram/HistogramControls.svelte.d.ts +1 -1
- package/dist/plot/sankey/Sankey.svelte +2 -5
- package/dist/plot/sankey/Sankey.svelte.d.ts +1 -1
- package/dist/plot/sankey/sankey.js +3 -1
- package/dist/plot/scatter/BinnedScatterPlot.svelte +3 -5
- package/dist/plot/scatter/BinnedScatterPlot.svelte.d.ts +4 -4
- package/dist/plot/scatter/ScatterPlot.svelte +160 -450
- package/dist/plot/scatter/ScatterPlot.svelte.d.ts +7 -15
- package/dist/plot/scatter/ScatterPlotControls.svelte.d.ts +1 -1
- package/dist/plot/scatter/binned-scatter-types.d.ts +4 -11
- package/dist/plot/scatter/index.d.ts +1 -1
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte +15 -26
- package/dist/plot/scatter-3d/ScatterPlot3D.svelte.d.ts +6 -14
- package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte +9 -10
- package/dist/plot/scatter-3d/ScatterPlot3DControls.svelte.d.ts +5 -5
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte +122 -121
- package/dist/plot/scatter-3d/ScatterPlot3DScene.svelte.d.ts +5 -14
- package/dist/plot/scatter-3d/Surface3D.svelte +6 -5
- package/dist/plot/scatter-3d/Surface3D.svelte.d.ts +4 -3
- package/dist/plot/sunburst/Sunburst.svelte +16 -20
- package/dist/plot/sunburst/Sunburst.svelte.d.ts +4 -3
- package/dist/plot/sunburst/SunburstControls.svelte.d.ts +1 -1
- package/dist/plot/sunburst/sunburst.js +4 -1
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/sanitize.js +13 -2
- package/dist/scene/SceneCamera.svelte +62 -0
- package/dist/scene/SceneCamera.svelte.d.ts +19 -0
- package/dist/scene/bind-renderer.svelte.d.ts +2 -0
- package/dist/scene/bind-renderer.svelte.js +14 -0
- package/dist/scene/index.d.ts +4 -0
- package/dist/scene/index.js +5 -0
- package/dist/scene/props.js +52 -0
- package/dist/scene/types.d.ts +26 -0
- package/dist/scene/types.js +1 -0
- package/dist/settings.d.ts +14 -2
- package/dist/settings.js +59 -1
- package/dist/spectral/Bands.svelte +8 -7
- package/dist/spectral/Bands.svelte.d.ts +3 -2
- package/dist/spectral/BandsAndDos.svelte +22 -24
- package/dist/spectral/BrillouinBandsDos.svelte +3 -3
- package/dist/spectral/Dos.svelte +5 -4
- package/dist/spectral/Dos.svelte.d.ts +2 -1
- package/dist/spectral/helpers.d.ts +6 -6
- package/dist/spectral/helpers.js +43 -37
- package/dist/state.svelte.d.ts +0 -7
- package/dist/state.svelte.js +0 -6
- package/dist/structure/Arrow.svelte +2 -4
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/CanvasTooltip.svelte +1 -0
- package/dist/structure/CellSelect.svelte +11 -3
- package/dist/structure/CellSelect.svelte.d.ts +2 -1
- package/dist/structure/Lattice.svelte +2 -2
- package/dist/structure/Structure.svelte +291 -355
- package/dist/structure/Structure.svelte.d.ts +5 -15
- package/dist/structure/StructureControls.svelte +217 -2
- package/dist/structure/StructureControls.svelte.d.ts +5 -3
- package/dist/structure/StructureExportPane.svelte +54 -156
- package/dist/structure/StructureExportPane.svelte.d.ts +4 -5
- package/dist/structure/StructureInfoPane.svelte +5 -3
- package/dist/structure/StructureInfoPane.svelte.d.ts +5 -5
- package/dist/structure/StructureScene.svelte +365 -198
- package/dist/structure/StructureScene.svelte.d.ts +22 -20
- package/dist/structure/{label-placement.d.ts → atom-label-placement.d.ts} +3 -3
- package/dist/structure/{label-placement.js → atom-label-placement.js} +12 -2
- package/dist/structure/atom-properties.d.ts +1 -1
- package/dist/structure/atom-properties.js +11 -16
- package/dist/structure/bond-order-perception.js +2 -4
- package/dist/structure/bonding.d.ts +3 -0
- package/dist/structure/bonding.js +91 -48
- package/dist/structure/export.d.ts +24 -4
- package/dist/structure/export.js +64 -122
- package/dist/structure/index.d.ts +2 -0
- package/dist/structure/index.js +2 -0
- package/dist/structure/parse.d.ts +3 -2
- package/dist/structure/parse.js +333 -370
- package/dist/structure/partial-occupancy.d.ts +0 -1
- package/dist/structure/partial-occupancy.js +1 -1
- package/dist/structure/pbc.d.ts +1 -1
- package/dist/structure/pbc.js +186 -13
- package/dist/structure/polyhedra.d.ts +41 -0
- package/dist/structure/polyhedra.js +602 -0
- package/dist/structure/site.d.ts +4 -0
- package/dist/structure/site.js +1 -0
- package/dist/structure/supercell.js +3 -2
- package/dist/structure/validation.js +5 -6
- package/dist/symmetry/SymmetryElementControls.svelte +69 -0
- package/dist/symmetry/SymmetryElementControls.svelte.d.ts +9 -0
- package/dist/symmetry/SymmetryElements.svelte +354 -0
- package/dist/symmetry/SymmetryElements.svelte.d.ts +24 -0
- package/dist/symmetry/SymmetryStats.svelte +111 -6
- package/dist/symmetry/WyckoffTable.svelte +68 -7
- package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -0
- package/dist/symmetry/cell-transform.js +7 -14
- package/dist/symmetry/index.d.ts +14 -4
- package/dist/symmetry/index.js +301 -80
- package/dist/symmetry/spacegroups.d.ts +5 -1
- package/dist/symmetry/spacegroups.js +15 -1
- package/dist/symmetry/symmetry-elements.d.ts +33 -0
- package/dist/symmetry/symmetry-elements.js +521 -0
- package/dist/symmetry/wyckoff-db.d.ts +9 -0
- package/dist/symmetry/wyckoff-db.js +87 -0
- package/dist/table/HeatmapTable.svelte +4 -15
- package/dist/table/HeatmapTable.svelte.d.ts +1 -1
- package/dist/trajectory/Trajectory.svelte +58 -61
- package/dist/trajectory/Trajectory.svelte.d.ts +10 -22
- package/dist/trajectory/TrajectoryExportPane.svelte +15 -24
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +4 -5
- package/dist/trajectory/TrajectoryInfoPane.svelte +3 -2
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -2
- package/dist/trajectory/constants.js +6 -2
- package/dist/trajectory/extract.js +17 -37
- package/dist/trajectory/format-detect.d.ts +0 -1
- package/dist/trajectory/format-detect.js +3 -9
- package/dist/trajectory/frame-reader.d.ts +0 -1
- package/dist/trajectory/frame-reader.js +62 -128
- package/dist/trajectory/helpers.d.ts +10 -2
- package/dist/trajectory/helpers.js +56 -36
- package/dist/trajectory/parse/ase.d.ts +9 -1
- package/dist/trajectory/parse/ase.js +47 -32
- package/dist/trajectory/parse/diagnostics.d.ts +3 -0
- package/dist/trajectory/parse/diagnostics.js +14 -0
- package/dist/trajectory/parse/index.d.ts +1 -1
- package/dist/trajectory/parse/index.js +54 -102
- package/dist/trajectory/parse/lammps.d.ts +0 -2
- package/dist/trajectory/parse/lammps.js +8 -6
- package/dist/trajectory/parse/pymatgen.d.ts +2 -0
- package/dist/trajectory/parse/pymatgen.js +74 -0
- package/dist/trajectory/parse/vasp.js +4 -3
- package/dist/trajectory/parse/xyz.d.ts +9 -21
- package/dist/trajectory/parse/xyz.js +28 -33
- package/dist/trajectory/plotting.d.ts +0 -1
- package/dist/trajectory/plotting.js +3 -100
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -1
- package/dist/xrd/XrdPlot.svelte +14 -29
- package/dist/xrd/broadening.d.ts +2 -1
- package/dist/xrd/calc-xrd.js +6 -11
- package/dist/xrd/index.d.ts +2 -2
- package/package.json +29 -16
- package/dist/element/data.json +0 -11864
- package/dist/fermi-surface/marching-cubes.d.ts +0 -2
- package/dist/fermi-surface/marching-cubes.js +0 -2
- package/dist/plot/core/hover-lock.svelte.d.ts +0 -14
- package/dist/plot/core/hover-lock.svelte.js +0 -45
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import * as math from '../math';
|
|
2
|
+
import { is_plain_object } from '../utils';
|
|
1
3
|
import * as constants from './constants';
|
|
2
|
-
import { compute_vertex_normals } from '
|
|
4
|
+
import { compute_vertex_normals } from '../marching-cubes';
|
|
3
5
|
const parse_number_tokens = (line) => line.split(/\s+/).filter(Boolean);
|
|
4
6
|
// Parse whitespace-separated floats from a line (optimized with unary +)
|
|
5
7
|
const parse_floats = (line) => parse_number_tokens(line).map(Number);
|
|
@@ -224,14 +226,9 @@ function parse_frmsf(content) {
|
|
|
224
226
|
}
|
|
225
227
|
// Validate that an object has the required Isosurface shape
|
|
226
228
|
function is_valid_isosurface(obj) {
|
|
227
|
-
if (!obj
|
|
229
|
+
if (!is_plain_object(obj))
|
|
228
230
|
return false;
|
|
229
|
-
const
|
|
230
|
-
const vertices = isosurface_obj.vertices;
|
|
231
|
-
const faces = isosurface_obj.faces;
|
|
232
|
-
const normals = isosurface_obj.normals;
|
|
233
|
-
const band_index = isosurface_obj.band_index;
|
|
234
|
-
const spin = isosurface_obj.spin;
|
|
231
|
+
const { vertices, faces, normals, band_index, spin } = obj;
|
|
235
232
|
if (!Array.isArray(vertices) || vertices.length === 0)
|
|
236
233
|
return false;
|
|
237
234
|
if (!Array.isArray(faces))
|
|
@@ -246,27 +243,35 @@ function is_valid_isosurface(obj) {
|
|
|
246
243
|
}
|
|
247
244
|
// Validate FermiSurfaceData shape
|
|
248
245
|
function is_valid_fermi_surface_data(obj) {
|
|
249
|
-
if (!obj
|
|
246
|
+
if (!is_plain_object(obj))
|
|
250
247
|
return false;
|
|
251
|
-
const data = obj;
|
|
252
248
|
// Check required fields
|
|
253
|
-
if (!Array.isArray(
|
|
249
|
+
if (!Array.isArray(obj.isosurfaces))
|
|
254
250
|
return false;
|
|
255
|
-
if (!
|
|
251
|
+
if (!math.is_square_matrix(obj.k_lattice, 3))
|
|
256
252
|
return false;
|
|
257
|
-
if (typeof
|
|
253
|
+
if (typeof obj.fermi_energy !== `number`)
|
|
258
254
|
return false;
|
|
259
|
-
if (
|
|
255
|
+
if (obj.reciprocal_cell !== `wigner_seitz` && obj.reciprocal_cell !== `parallelepiped`) {
|
|
260
256
|
return false;
|
|
261
257
|
}
|
|
262
|
-
if (!
|
|
258
|
+
if (!obj.metadata || typeof obj.metadata !== `object`)
|
|
263
259
|
return false;
|
|
264
260
|
// Validate each isosurface
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
261
|
+
return obj.isosurfaces.every(is_valid_isosurface);
|
|
262
|
+
}
|
|
263
|
+
// Validate BandGridData shape: non-empty energies grid, 3 k-grid dims, 3x3 k-lattice
|
|
264
|
+
function is_valid_band_grid_data(obj) {
|
|
265
|
+
if (!is_plain_object(obj))
|
|
266
|
+
return false;
|
|
267
|
+
const { energies, k_grid, k_lattice } = obj;
|
|
268
|
+
if (!Array.isArray(energies) || energies.length === 0)
|
|
269
|
+
return false;
|
|
270
|
+
if (!Array.isArray(k_grid) ||
|
|
271
|
+
k_grid.length !== 3 ||
|
|
272
|
+
!k_grid.every((dim) => Number.isInteger(dim) && dim > 0))
|
|
273
|
+
return false;
|
|
274
|
+
return math.is_square_matrix(k_lattice, 3);
|
|
270
275
|
}
|
|
271
276
|
// Parse Matterviz/IFermi JSON format for Fermi surface data
|
|
272
277
|
// Throws on invalid input; returns parsed data on success
|
|
@@ -287,22 +292,21 @@ function parse_fermi_json(content) {
|
|
|
287
292
|
}
|
|
288
293
|
// Check if it's BandGridData (raw grid data)
|
|
289
294
|
if (data.energies && data.k_grid && data.k_lattice) {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
data.k_grid.length !== 3 ||
|
|
294
|
-
!Array.isArray(data.k_lattice) ||
|
|
295
|
-
data.k_lattice.length !== 3)
|
|
296
|
-
throw new Error(`Invalid BandGridData JSON: malformed required fields`);
|
|
295
|
+
if (!is_valid_band_grid_data(data)) {
|
|
296
|
+
throw new Error(`Invalid BandGridData JSON: expected non-empty 'energies' grid, 3 'k_grid' dims, and 3x3 'k_lattice'`);
|
|
297
|
+
}
|
|
297
298
|
return data;
|
|
298
299
|
}
|
|
299
300
|
// Try to extract from nested structure (e.g. IFermi output)
|
|
300
301
|
if (data.fermi_surface) {
|
|
302
|
+
if (!is_valid_fermi_surface_data(data.fermi_surface)) {
|
|
303
|
+
throw new Error(`Invalid nested 'fermi_surface' JSON: expected isosurfaces array, 3x3 k_lattice, numeric fermi_energy, reciprocal_cell, and metadata`);
|
|
304
|
+
}
|
|
301
305
|
return data.fermi_surface;
|
|
302
306
|
}
|
|
303
307
|
if (data.band_structure?.energies || data.bands?.energies) {
|
|
304
308
|
const bs = data.band_structure ?? data.bands;
|
|
305
|
-
|
|
309
|
+
const grid_data = {
|
|
306
310
|
energies: bs.energies,
|
|
307
311
|
k_grid: bs.k_grid ?? bs.kgrid,
|
|
308
312
|
k_lattice: bs.k_lattice ?? bs.reciprocal_lattice,
|
|
@@ -312,6 +316,10 @@ function parse_fermi_json(content) {
|
|
|
312
316
|
// oxlint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- numeric fallback chain (0 falls through)
|
|
313
317
|
n_spins: (bs.n_spins ?? bs.nspins) || bs.energies.length || 1,
|
|
314
318
|
};
|
|
319
|
+
if (!is_valid_band_grid_data(grid_data)) {
|
|
320
|
+
throw new Error(`Invalid band_structure JSON: expected non-empty 'energies' grid, 3 'k_grid' dims, and 3x3 'k_lattice'`);
|
|
321
|
+
}
|
|
322
|
+
return grid_data;
|
|
315
323
|
}
|
|
316
324
|
// Check for pymatgen BandStructure format (k-path, not k-grid)
|
|
317
325
|
// These files cannot be used for Fermi surface visualization directly
|
|
@@ -387,14 +395,8 @@ function parse_ifermi_surface(data) {
|
|
|
387
395
|
for (let fan_idx = 1; fan_idx < face.length - 1; fan_idx++) {
|
|
388
396
|
const v1 = vertices[face[fan_idx]];
|
|
389
397
|
const v2 = vertices[face[fan_idx + 1]];
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
const cross = [
|
|
393
|
-
e1[1] * e2[2] - e1[2] * e2[1],
|
|
394
|
-
e1[2] * e2[0] - e1[0] * e2[2],
|
|
395
|
-
e1[0] * e2[1] - e1[1] * e2[0],
|
|
396
|
-
];
|
|
397
|
-
area += 0.5 * Math.hypot(cross[0], cross[1], cross[2]);
|
|
398
|
+
const cross = math.cross_3d(math.subtract(v1, v0), math.subtract(v2, v0));
|
|
399
|
+
area += 0.5 * Math.hypot(...cross);
|
|
398
400
|
}
|
|
399
401
|
}
|
|
400
402
|
isosurfaces.push({
|
|
@@ -427,68 +429,55 @@ function parse_ifermi_surface(data) {
|
|
|
427
429
|
},
|
|
428
430
|
};
|
|
429
431
|
}
|
|
430
|
-
// Auto-detect file format and parse
|
|
432
|
+
// Auto-detect file format and parse; throws an Error aggregating per-format failure reasons when nothing parses
|
|
431
433
|
export function parse_fermi_file(content, filename) {
|
|
432
434
|
const lower_name = filename?.toLowerCase() ?? ``;
|
|
433
|
-
|
|
434
|
-
|
|
435
|
+
const errors = [];
|
|
436
|
+
const attempt = (format, parse) => {
|
|
435
437
|
try {
|
|
436
|
-
return
|
|
438
|
+
return parse();
|
|
437
439
|
}
|
|
438
440
|
catch (error) {
|
|
439
|
-
|
|
441
|
+
errors.push(`${format}: ${error instanceof Error ? error.message : String(error)}`);
|
|
442
|
+
console.error(`${format} parse error:`, error);
|
|
440
443
|
return null;
|
|
441
444
|
}
|
|
445
|
+
};
|
|
446
|
+
const fail = () => {
|
|
447
|
+
const detail = errors.length ? `: ${errors.join(`; `)}` : `: unrecognized format`;
|
|
448
|
+
throw new Error(`Failed to parse Fermi surface file${filename ? ` '${filename}'` : ``}${detail}`);
|
|
449
|
+
};
|
|
450
|
+
// Detect by filename extension (authoritative: parse failure throws immediately)
|
|
451
|
+
if (lower_name.endsWith(`.bxsf`) || lower_name.endsWith(`.bxsf.gz`)) {
|
|
452
|
+
return attempt(`BXSF`, () => parse_bxsf(content)) ?? fail();
|
|
442
453
|
}
|
|
443
454
|
if (lower_name.endsWith(`.frmsf`) || lower_name.endsWith(`.frmsf.gz`)) {
|
|
444
|
-
|
|
445
|
-
return parse_frmsf(content);
|
|
446
|
-
}
|
|
447
|
-
catch (error) {
|
|
448
|
-
console.error(`FRMSF parse error:`, error);
|
|
449
|
-
return null;
|
|
450
|
-
}
|
|
455
|
+
return attempt(`FRMSF`, () => parse_frmsf(content)) ?? fail();
|
|
451
456
|
}
|
|
452
457
|
if (lower_name.endsWith(`.json`) || lower_name.endsWith(`.json.gz`)) {
|
|
453
|
-
|
|
454
|
-
return parse_fermi_json(content);
|
|
455
|
-
}
|
|
456
|
-
catch (error) {
|
|
457
|
-
console.error(`JSON parse error:`, error);
|
|
458
|
-
return null;
|
|
459
|
-
}
|
|
458
|
+
return attempt(`JSON`, () => parse_fermi_json(content)) ?? fail();
|
|
460
459
|
}
|
|
461
460
|
// Try auto-detection based on content
|
|
462
461
|
const trimmed = content.trim();
|
|
463
462
|
// BXSF format detection
|
|
464
463
|
if (trimmed.includes(`BEGIN_BLOCK_BANDGRID_3D`) || trimmed.includes(`BEGIN_BANDGRID_3D`)) {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
catch (error) {
|
|
469
|
-
console.error(`BXSF auto-detect parse error:`, error);
|
|
470
|
-
}
|
|
464
|
+
const result = attempt(`BXSF`, () => parse_bxsf(content));
|
|
465
|
+
if (result)
|
|
466
|
+
return result;
|
|
471
467
|
}
|
|
472
468
|
// JSON format detection
|
|
473
469
|
if (trimmed.startsWith(`{`) || trimmed.startsWith(`[`)) {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
catch (error) {
|
|
478
|
-
console.error(`JSON auto-detect parse error:`, error);
|
|
479
|
-
}
|
|
470
|
+
const result = attempt(`JSON`, () => parse_fermi_json(content));
|
|
471
|
+
if (result)
|
|
472
|
+
return result;
|
|
480
473
|
}
|
|
481
474
|
// FRMSF format detection (starts with grid dimensions)
|
|
482
475
|
const first_line = trimmed.split(/\r?\n/)[0];
|
|
483
476
|
const first_tokens = first_line.split(/\s+/).filter(Boolean);
|
|
484
477
|
if (first_tokens.length === 3 && first_tokens.every((token) => /^\d+$/.test(token))) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
catch (error) {
|
|
489
|
-
console.error(`FRMSF auto-detect parse error:`, error);
|
|
490
|
-
}
|
|
478
|
+
const result = attempt(`FRMSF`, () => parse_frmsf(content));
|
|
479
|
+
if (result)
|
|
480
|
+
return result;
|
|
491
481
|
}
|
|
492
|
-
|
|
493
|
-
return null;
|
|
482
|
+
return fail();
|
|
494
483
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Matrix3x3, Point2D, Vec3 } from '../math';
|
|
1
|
+
import type { Matrix3x3, Point2D, Vec2, Vec3 } from '../math';
|
|
2
2
|
import type { TooltipConfig, TooltipProp } from '../tooltip';
|
|
3
3
|
export type SpinChannel = `up` | `down` | null;
|
|
4
4
|
export type RepresentationMode = `solid` | `wireframe` | `transparent`;
|
|
@@ -62,7 +62,7 @@ export interface FermiSliceData {
|
|
|
62
62
|
}
|
|
63
63
|
export interface Isoline {
|
|
64
64
|
points: Vec3[];
|
|
65
|
-
points_2d: [
|
|
65
|
+
points_2d: Vec2[];
|
|
66
66
|
properties?: number[];
|
|
67
67
|
band_index: number;
|
|
68
68
|
spin: SpinChannel;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { D3InterpolateName } from '../colors'
|
|
3
|
-
import { is_color, pick_contrast_color } from '../colors'
|
|
3
|
+
import { get_d3_interpolator, is_color, pick_contrast_color } from '../colors'
|
|
4
4
|
import { format_num } from '../labels'
|
|
5
|
+
import type { Vec2 } from '../math'
|
|
5
6
|
import type { AxisConfig } from '../plot'
|
|
6
7
|
import ColorBar from '../plot/core/components/ColorBar.svelte'
|
|
7
|
-
import {
|
|
8
|
-
import * as d3_sc from 'd3-scale-chromatic'
|
|
8
|
+
import { quickselect } from '../plot/box/quantile'
|
|
9
9
|
import { type ComponentProps, onDestroy, onMount, type Snippet } from 'svelte'
|
|
10
10
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
11
11
|
import { SvelteMap, SvelteSet } from 'svelte/reactivity'
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
) => number | null
|
|
128
128
|
normalize?: NormalizeMode
|
|
129
129
|
domain_mode?: DomainMode
|
|
130
|
-
quantile_clip?:
|
|
130
|
+
quantile_clip?: Vec2
|
|
131
131
|
show_legend?: boolean
|
|
132
132
|
legend_position?: LegendPosition
|
|
133
133
|
legend_label?: string
|
|
@@ -146,8 +146,8 @@
|
|
|
146
146
|
oncontextmenu?: (cell: CellContext, event: MouseEvent) => void
|
|
147
147
|
enable_brush?: boolean
|
|
148
148
|
onbrush?: (payload: {
|
|
149
|
-
x_range:
|
|
150
|
-
y_range:
|
|
149
|
+
x_range: Vec2
|
|
150
|
+
y_range: Vec2
|
|
151
151
|
cells: CellContext[]
|
|
152
152
|
}) => void
|
|
153
153
|
tile_size?: string
|
|
@@ -213,7 +213,6 @@
|
|
|
213
213
|
// === Value resolution ===
|
|
214
214
|
let x_keys = $derived(x_items.map((item) => item.key ?? item.label))
|
|
215
215
|
let y_keys = $derived(y_items.map((item) => item.key ?? item.label))
|
|
216
|
-
let interaction_axis_signature = $derived(JSON.stringify([x_keys, y_keys]))
|
|
217
216
|
let highlight_x_key_set = $derived(new SvelteSet(highlight_x_keys))
|
|
218
217
|
let highlight_y_key_set = $derived(new SvelteSet(highlight_y_keys))
|
|
219
218
|
let search_query_norm = $derived(search_query.trim().toLowerCase())
|
|
@@ -290,11 +289,23 @@
|
|
|
290
289
|
|
|
291
290
|
const col_has_data = Array(x_items.length).fill(false)
|
|
292
291
|
const row_has_data = Array(y_items.length).fill(false)
|
|
292
|
+
// Early-exit: skip cells whose row+col are already non-empty, stop once all resolved (dense matrices touch ~n+m cells, not n*m)
|
|
293
|
+
let unknown_cols = x_items.length
|
|
294
|
+
let unknown_rows = y_items.length
|
|
293
295
|
for (let y_idx = 0; y_idx < y_items.length; y_idx++) {
|
|
296
|
+
if (unknown_cols === 0 && unknown_rows === 0) break
|
|
294
297
|
for (let x_idx = 0; x_idx < x_items.length; x_idx++) {
|
|
295
|
-
if (
|
|
298
|
+
if (row_has_data[y_idx] && col_has_data[x_idx]) continue
|
|
299
|
+
// ignore cells hidden by symmetric rendering so emptiness reflects only visible cells
|
|
300
|
+
if (is_hidden_cell(x_idx, y_idx)) continue
|
|
301
|
+
if (get_value(x_idx, y_idx) === null) continue
|
|
302
|
+
if (!col_has_data[x_idx]) {
|
|
296
303
|
col_has_data[x_idx] = true
|
|
304
|
+
unknown_cols--
|
|
305
|
+
}
|
|
306
|
+
if (!row_has_data[y_idx]) {
|
|
297
307
|
row_has_data[y_idx] = true
|
|
308
|
+
unknown_rows--
|
|
298
309
|
}
|
|
299
310
|
}
|
|
300
311
|
}
|
|
@@ -313,11 +324,9 @@
|
|
|
313
324
|
})
|
|
314
325
|
|
|
315
326
|
// === Color computation ===
|
|
316
|
-
let color_scale_fn = $derived
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
return typeof named_scale === `function` ? named_scale : d3_sc.interpolateViridis
|
|
320
|
-
})
|
|
327
|
+
let color_scale_fn = $derived(
|
|
328
|
+
typeof color_scale === `function` ? color_scale : get_d3_interpolator(color_scale),
|
|
329
|
+
)
|
|
321
330
|
|
|
322
331
|
function get_transformed_value(x_idx: number, y_idx: number): number | null {
|
|
323
332
|
const raw_value = get_value(x_idx, y_idx)
|
|
@@ -333,53 +342,53 @@
|
|
|
333
342
|
return transformed_value
|
|
334
343
|
}
|
|
335
344
|
|
|
336
|
-
|
|
337
|
-
|
|
345
|
+
// Interpolated quantile via quickselect (O(n) avg vs full sort); reorders `scratch_values` in place so callers must pass a copy they own
|
|
346
|
+
function get_quantile(scratch_values: number[], quantile: number): number {
|
|
347
|
+
if (scratch_values.length === 0) return 0
|
|
338
348
|
const clipped_quantile = Math.max(0, Math.min(1, quantile))
|
|
339
|
-
const float_idx = (
|
|
349
|
+
const float_idx = (scratch_values.length - 1) * clipped_quantile
|
|
340
350
|
const low_idx = Math.floor(float_idx)
|
|
341
351
|
const high_idx = Math.ceil(float_idx)
|
|
342
|
-
|
|
352
|
+
const low_val = quickselect(scratch_values, low_idx)
|
|
353
|
+
if (low_idx === high_idx) return low_val
|
|
354
|
+
const high_val = quickselect(scratch_values, high_idx)
|
|
343
355
|
const low_weight = high_idx - float_idx
|
|
344
356
|
const high_weight = float_idx - low_idx
|
|
345
|
-
return
|
|
357
|
+
return low_val * low_weight + high_val * high_weight
|
|
346
358
|
}
|
|
347
359
|
|
|
348
|
-
|
|
360
|
+
// Single pass collecting transformed values + min/max (avoids spreading large arrays into
|
|
361
|
+
// Math.min/max). min_pos is the log-mode lower bound when domain min <= 0 (the old
|
|
362
|
+
// Number.MIN_VALUE floor gave log_min ~ -744, squashing all colors to the top)
|
|
363
|
+
let { valid_numeric_values, auto_min, auto_max, min_pos } = $derived.by(() => {
|
|
349
364
|
const numeric_values: number[] = []
|
|
365
|
+
let [min, max, pos] = [Infinity, -Infinity, Infinity]
|
|
350
366
|
for (let y_idx = 0; y_idx < y_items.length; y_idx++) {
|
|
351
367
|
for (let x_idx = 0; x_idx < x_items.length; x_idx++) {
|
|
352
368
|
if (is_hidden_cell(x_idx, y_idx)) continue
|
|
353
369
|
const value = get_transformed_value(x_idx, y_idx)
|
|
354
370
|
if (value === null) continue
|
|
355
371
|
numeric_values.push(value)
|
|
372
|
+
if (value < min) min = value
|
|
373
|
+
if (value > max) max = value
|
|
374
|
+
if (value > 0 && value < pos) pos = value
|
|
356
375
|
}
|
|
357
376
|
}
|
|
358
|
-
return
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
// floor gave log_min ~ -744, squashing all colors to the top)
|
|
364
|
-
let [auto_min, auto_max, min_pos] = $derived.by(() => {
|
|
365
|
-
let [min, max, pos] = [Infinity, -Infinity, Infinity]
|
|
366
|
-
for (const value of valid_numeric_values) {
|
|
367
|
-
if (value < min) min = value
|
|
368
|
-
if (value > max) max = value
|
|
369
|
-
if (value > 0 && value < pos) pos = value
|
|
377
|
+
return {
|
|
378
|
+
valid_numeric_values: numeric_values,
|
|
379
|
+
auto_min: min <= max ? min : 0,
|
|
380
|
+
auto_max: min <= max ? max : 1,
|
|
381
|
+
min_pos: Number.isFinite(pos) ? pos : null,
|
|
370
382
|
}
|
|
371
|
-
const min_pos_val = Number.isFinite(pos) ? pos : null
|
|
372
|
-
return min <= max ? [min, max, min_pos_val] as const : [0, 1, min_pos_val] as const
|
|
373
383
|
})
|
|
374
384
|
|
|
385
|
+
// Lazy derived: only evaluated while domain_mode === 'robust' reads it
|
|
375
386
|
let [robust_min, robust_max] = $derived.by(() => {
|
|
376
387
|
if (valid_numeric_values.length === 0) return [0, 1] as const
|
|
377
|
-
const
|
|
378
|
-
value_a - value_b
|
|
379
|
-
)
|
|
388
|
+
const scratch = [...valid_numeric_values]
|
|
380
389
|
const [q_low, q_high] = quantile_clip
|
|
381
|
-
const clipped_min = get_quantile(
|
|
382
|
-
const clipped_max = get_quantile(
|
|
390
|
+
const clipped_min = get_quantile(scratch, q_low)
|
|
391
|
+
const clipped_max = get_quantile(scratch, q_high)
|
|
383
392
|
return clipped_min <= clipped_max
|
|
384
393
|
? [clipped_min, clipped_max] as const
|
|
385
394
|
: [clipped_max, clipped_min] as const
|
|
@@ -1089,9 +1098,15 @@
|
|
|
1089
1098
|
|
|
1090
1099
|
// Tooltip state: only used for custom tooltip snippets (function tooltips)
|
|
1091
1100
|
let tooltip_cell: CellContext | null = $state(null)
|
|
1092
|
-
|
|
1101
|
+
// Reset interactions when axis keys change; element-wise compare beats JSON.stringify-ing every key on each x_items/y_items update
|
|
1102
|
+
const keys_equal = (keys_a: string[], keys_b: string[]): boolean =>
|
|
1103
|
+
keys_a.length === keys_b.length && keys_a.every((key, idx) => key === keys_b[idx])
|
|
1104
|
+
let prev_axis_keys: { x: string[]; y: string[] } | null = null
|
|
1093
1105
|
$effect(() => {
|
|
1094
|
-
|
|
1106
|
+
const changed = prev_axis_keys !== null &&
|
|
1107
|
+
!(keys_equal(x_keys, prev_axis_keys.x) && keys_equal(y_keys, prev_axis_keys.y))
|
|
1108
|
+
prev_axis_keys = { x: x_keys, y: y_keys }
|
|
1109
|
+
if (!changed) return
|
|
1095
1110
|
cancel_raf(active_cell_raf)
|
|
1096
1111
|
// Cancel delayed clicks before old cell coordinates can fire on new axes.
|
|
1097
1112
|
clear_pending_click()
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { D3InterpolateName } from '../colors';
|
|
2
|
+
import type { Vec2 } from '../math';
|
|
2
3
|
import type { AxisConfig } from '../plot';
|
|
3
4
|
import { type ComponentProps, type Snippet } from 'svelte';
|
|
4
5
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
@@ -29,7 +30,7 @@ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `onclick` | `ondblc
|
|
|
29
30
|
}) => number | null;
|
|
30
31
|
normalize?: NormalizeMode;
|
|
31
32
|
domain_mode?: DomainMode;
|
|
32
|
-
quantile_clip?:
|
|
33
|
+
quantile_clip?: Vec2;
|
|
33
34
|
show_legend?: boolean;
|
|
34
35
|
legend_position?: LegendPosition;
|
|
35
36
|
legend_label?: string;
|
|
@@ -51,8 +52,8 @@ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `onclick` | `ondblc
|
|
|
51
52
|
oncontextmenu?: (cell: CellContext, event: MouseEvent) => void;
|
|
52
53
|
enable_brush?: boolean;
|
|
53
54
|
onbrush?: (payload: {
|
|
54
|
-
x_range:
|
|
55
|
-
y_range:
|
|
55
|
+
x_range: Vec2;
|
|
56
|
+
y_range: Vec2;
|
|
56
57
|
cells: CellContext[];
|
|
57
58
|
}) => void;
|
|
58
59
|
tile_size?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { PaneProps, PaneToggleProps } from '../overlays'
|
|
2
3
|
import DraggablePane from '../overlays/DraggablePane.svelte'
|
|
3
4
|
import type { ComponentProps, Snippet } from 'svelte'
|
|
4
5
|
import {
|
|
@@ -46,8 +47,8 @@
|
|
|
46
47
|
export_formats?: HeatmapExportFormat[]
|
|
47
48
|
onexport?: (format: HeatmapExportFormat) => void
|
|
48
49
|
show_pane?: boolean
|
|
49
|
-
pane_props?:
|
|
50
|
-
toggle_props?:
|
|
50
|
+
pane_props?: PaneProps
|
|
51
|
+
toggle_props?: PaneToggleProps
|
|
51
52
|
children?: Snippet<[{ controls_open: boolean }]>
|
|
52
53
|
} = $props()
|
|
53
54
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
1
|
+
import type { PaneProps, PaneToggleProps } from '../overlays';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { ElementAxisOrderingKey, DomainMode, HeatmapExportFormat, LegendPosition, NormalizeMode, SymmetricMode } from './index';
|
|
4
4
|
type $$ComponentProps = {
|
|
5
5
|
ordering?: ElementAxisOrderingKey;
|
|
@@ -19,12 +19,12 @@ type $$ComponentProps = {
|
|
|
19
19
|
export_formats?: HeatmapExportFormat[];
|
|
20
20
|
onexport?: (format: HeatmapExportFormat) => void;
|
|
21
21
|
show_pane?: boolean;
|
|
22
|
-
pane_props?:
|
|
23
|
-
toggle_props?:
|
|
22
|
+
pane_props?: PaneProps;
|
|
23
|
+
toggle_props?: PaneToggleProps;
|
|
24
24
|
children?: Snippet<[{
|
|
25
25
|
controls_open: boolean;
|
|
26
26
|
}]>;
|
|
27
27
|
};
|
|
28
|
-
declare const HeatmapMatrixControls: import("svelte").Component<$$ComponentProps, {}, "normalize" | "
|
|
28
|
+
declare const HeatmapMatrixControls: import("svelte").Component<$$ComponentProps, {}, "normalize" | "show_values" | "show_legend" | "controls_open" | "ordering" | "theme" | "toggle_visible" | "domain_mode" | "legend_position" | "search_query" | "symmetric" | "show_row_summaries" | "show_col_summaries">;
|
|
29
29
|
type HeatmapMatrixControls = ReturnType<typeof HeatmapMatrixControls>;
|
|
30
30
|
export default HeatmapMatrixControls;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChemicalElement, ElementSymbol } from '../element';
|
|
2
|
+
import type { Vec2 } from '../math';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
export { COLOR_OVERRIDE_KEY_SEPARATOR, make_color_override_key } from './shared';
|
|
4
5
|
export type AxisItem<T = Record<string, unknown>> = {
|
|
@@ -41,8 +42,8 @@ export type HeatmapSelection = {
|
|
|
41
42
|
};
|
|
42
43
|
export type HeatmapExportFormat = `csv` | `json`;
|
|
43
44
|
export type HeatmapBrushPayload = {
|
|
44
|
-
x_range:
|
|
45
|
-
y_range:
|
|
45
|
+
x_range: Vec2;
|
|
46
|
+
y_range: Vec2;
|
|
46
47
|
cells: CellContext[];
|
|
47
48
|
};
|
|
48
49
|
export declare const ELEMENT_ORDERINGS: ElementAxisOrderingKey[];
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED