matterviz 0.1.12 → 0.1.13
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/ContextMenu.svelte +1 -1
- package/dist/ContextMenu.svelte.d.ts +3 -3
- package/dist/DraggablePane.svelte +10 -5
- package/dist/DraggablePane.svelte.d.ts +3 -3
- package/dist/FilePicker.svelte.d.ts +3 -3
- package/dist/Icon.svelte.d.ts +3 -3
- package/dist/Nav.svelte +76 -31
- package/dist/SettingsSection.svelte.d.ts +3 -3
- package/dist/Spinner.svelte +18 -29
- package/dist/Spinner.svelte.d.ts +3 -3
- package/dist/app.css +4 -0
- package/dist/bands/Bands.svelte +216 -0
- package/dist/bands/Bands.svelte.d.ts +16 -0
- package/dist/bands/BandsAndDos.svelte +26 -0
- package/dist/bands/BandsAndDos.svelte.d.ts +16 -0
- package/dist/bands/Dos.svelte +124 -0
- package/dist/bands/Dos.svelte.d.ts +18 -0
- package/dist/bands/helpers.d.ts +11 -0
- package/dist/bands/helpers.js +195 -0
- package/dist/bands/index.d.ts +5 -0
- package/dist/bands/index.js +6 -0
- package/dist/bands/types.d.ts +54 -0
- package/dist/bands/types.js +2 -0
- package/dist/brillouin/BrillouinZone.svelte +373 -0
- package/dist/brillouin/BrillouinZone.svelte.d.ts +57 -0
- package/dist/brillouin/BrillouinZoneControls.svelte +88 -0
- package/dist/brillouin/BrillouinZoneControls.svelte.d.ts +14 -0
- package/dist/brillouin/BrillouinZoneExportPane.svelte +129 -0
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +15 -0
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +115 -0
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +13 -0
- package/dist/brillouin/BrillouinZoneScene.svelte +180 -0
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +34 -0
- package/dist/brillouin/compute.d.ts +7 -0
- package/dist/brillouin/compute.js +215 -0
- package/dist/brillouin/index.d.ts +7 -0
- package/dist/brillouin/index.js +7 -0
- package/dist/brillouin/types.d.ts +23 -0
- package/dist/brillouin/types.js +1 -0
- package/dist/composition/BarChart.svelte.d.ts +3 -3
- package/dist/composition/BubbleChart.svelte +7 -6
- package/dist/composition/BubbleChart.svelte.d.ts +3 -3
- package/dist/composition/Composition.svelte.d.ts +3 -3
- package/dist/composition/PieChart.svelte +1 -1
- package/dist/composition/PieChart.svelte.d.ts +3 -3
- package/dist/composition/parse.d.ts +3 -3
- package/dist/coordination/CoordinationBarPlot.svelte +241 -0
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +29 -0
- package/dist/coordination/calc-coordination.d.ts +15 -0
- package/dist/coordination/calc-coordination.js +66 -0
- package/dist/coordination/index.d.ts +8 -0
- package/dist/coordination/index.js +7 -0
- package/dist/element/BohrAtom.svelte.d.ts +3 -3
- package/dist/element/ElementHeading.svelte.d.ts +3 -3
- package/dist/element/ElementPhoto.svelte.d.ts +3 -3
- package/dist/element/ElementStats.svelte.d.ts +3 -3
- package/dist/element/ElementTile.svelte +1 -1
- package/dist/element/ElementTile.svelte.d.ts +4 -4
- package/dist/element/Nucleus.svelte.d.ts +3 -3
- package/dist/icons.d.ts +4 -0
- package/dist/icons.js +4 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -1
- package/dist/io/export.d.ts +1 -6
- package/dist/io/export.js +12 -12
- package/dist/labels.d.ts +19 -0
- package/dist/labels.js +59 -0
- package/dist/math.d.ts +7 -2
- package/dist/math.js +24 -12
- package/dist/periodic-table/PeriodicTable.svelte.d.ts +3 -3
- package/dist/periodic-table/PeriodicTableControls.svelte.d.ts +3 -3
- package/dist/periodic-table/PropertySelect.svelte +1 -1
- package/dist/periodic-table/PropertySelect.svelte.d.ts +5 -4
- package/dist/periodic-table/TableInset.svelte.d.ts +3 -3
- package/dist/phase-diagram/PhaseDiagram2D.svelte +44 -107
- package/dist/phase-diagram/PhaseDiagram2D.svelte.d.ts +7 -27
- package/dist/phase-diagram/PhaseDiagram3D.svelte +67 -170
- package/dist/phase-diagram/PhaseDiagram3D.svelte.d.ts +7 -31
- package/dist/phase-diagram/PhaseDiagram4D.svelte +87 -145
- package/dist/phase-diagram/PhaseDiagram4D.svelte.d.ts +5 -28
- package/dist/phase-diagram/PhaseDiagramControls.svelte +9 -9
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +6 -6
- package/dist/phase-diagram/PhaseDiagramInfoPane.svelte +4 -4
- package/dist/phase-diagram/PhaseDiagramInfoPane.svelte.d.ts +5 -5
- package/dist/phase-diagram/PhaseDiagramStats.svelte +9 -16
- package/dist/phase-diagram/PhaseDiagramStats.svelte.d.ts +3 -3
- package/dist/phase-diagram/StructurePopup.svelte.d.ts +3 -3
- package/dist/phase-diagram/barycentric-coords.js +13 -24
- package/dist/phase-diagram/helpers.d.ts +12 -14
- package/dist/phase-diagram/helpers.js +70 -23
- package/dist/phase-diagram/index.d.ts +58 -0
- package/dist/phase-diagram/index.js +44 -0
- package/dist/phase-diagram/thermodynamics.js +2 -3
- package/dist/phase-diagram/types.d.ts +3 -8
- package/dist/plot/BarPlot.svelte +474 -240
- package/dist/plot/BarPlot.svelte.d.ts +16 -37
- package/dist/plot/BarPlotControls.svelte +33 -201
- package/dist/plot/BarPlotControls.svelte.d.ts +11 -22
- package/dist/plot/ColorBar.svelte.d.ts +3 -3
- package/dist/plot/ColorScaleSelect.svelte +1 -1
- package/dist/plot/ColorScaleSelect.svelte.d.ts +3 -3
- package/dist/plot/ElementScatter.svelte +5 -5
- package/dist/plot/ElementScatter.svelte.d.ts +8 -8
- package/dist/plot/Histogram.svelte +318 -170
- package/dist/plot/Histogram.svelte.d.ts +21 -41
- package/dist/plot/HistogramControls.svelte +115 -347
- package/dist/plot/HistogramControls.svelte.d.ts +13 -28
- package/dist/plot/Line.svelte +1 -1
- package/dist/plot/Line.svelte.d.ts +4 -4
- package/dist/plot/PlotControls.svelte +280 -0
- package/dist/plot/PlotControls.svelte.d.ts +4 -0
- package/dist/plot/PlotLegend.svelte +9 -24
- package/dist/plot/PlotLegend.svelte.d.ts +3 -3
- package/dist/plot/ScatterPlot.svelte +536 -571
- package/dist/plot/ScatterPlot.svelte.d.ts +18 -90
- package/dist/plot/ScatterPlotControls.svelte +108 -316
- package/dist/plot/ScatterPlotControls.svelte.d.ts +11 -38
- package/dist/plot/ScatterPoint.svelte +1 -1
- package/dist/plot/ScatterPoint.svelte.d.ts +5 -5
- package/dist/plot/SpacegroupBarPlot.svelte +235 -0
- package/dist/plot/SpacegroupBarPlot.svelte.d.ts +9 -0
- package/dist/plot/data-transform.d.ts +2 -2
- package/dist/plot/data-transform.js +1 -5
- package/dist/plot/index.d.ts +12 -200
- package/dist/plot/index.js +14 -6
- package/dist/plot/layout.d.ts +10 -16
- package/dist/plot/layout.js +40 -25
- package/dist/plot/scales.d.ts +7 -8
- package/dist/plot/scales.js +22 -7
- package/dist/plot/types.d.ts +303 -0
- package/dist/plot/types.js +1 -0
- package/dist/rdf/RdfPlot.svelte +156 -0
- package/dist/rdf/RdfPlot.svelte.d.ts +20 -0
- package/dist/rdf/calc-rdf.d.ts +4 -0
- package/dist/rdf/calc-rdf.js +107 -0
- package/dist/rdf/index.d.ts +22 -0
- package/dist/rdf/index.js +2 -0
- package/dist/settings.d.ts +86 -75
- package/dist/settings.js +257 -155
- package/dist/structure/Bond.svelte +126 -110
- package/dist/structure/Bond.svelte.d.ts +7 -20
- package/dist/structure/CanvasTooltip.svelte.d.ts +4 -4
- package/dist/structure/Cylinder.svelte +29 -0
- package/dist/structure/Cylinder.svelte.d.ts +10 -0
- package/dist/structure/Lattice.svelte +1 -2
- package/dist/structure/Lattice.svelte.d.ts +3 -3
- package/dist/structure/Structure.svelte +23 -8
- package/dist/structure/Structure.svelte.d.ts +10 -7
- package/dist/structure/StructureControls.svelte +25 -134
- package/dist/structure/StructureControls.svelte.d.ts +4 -9
- package/dist/structure/StructureExportPane.svelte +188 -0
- package/dist/structure/StructureExportPane.svelte.d.ts +17 -0
- package/dist/structure/StructureInfoPane.svelte.d.ts +3 -3
- package/dist/structure/StructureLegend.svelte +91 -27
- package/dist/structure/StructureLegend.svelte.d.ts +5 -4
- package/dist/structure/StructureScene.svelte +93 -100
- package/dist/structure/StructureScene.svelte.d.ts +15 -12
- package/dist/structure/Vector.svelte +19 -25
- package/dist/structure/Vector.svelte.d.ts +3 -3
- package/dist/structure/bonding.d.ts +16 -14
- package/dist/structure/bonding.js +207 -216
- package/dist/structure/export.d.ts +3 -0
- package/dist/structure/export.js +120 -0
- package/dist/structure/index.d.ts +15 -1
- package/dist/structure/index.js +2 -0
- package/dist/symmetry/WyckoffTable.svelte.d.ts +3 -3
- package/dist/symmetry/index.d.ts +1 -0
- package/dist/symmetry/index.js +1 -0
- package/dist/symmetry/spacegroups.d.ts +9 -0
- package/dist/symmetry/spacegroups.js +397 -0
- package/dist/theme/ThemeControl.svelte.d.ts +3 -3
- package/dist/theme/themes.js +2 -16
- package/dist/trajectory/Trajectory.svelte +52 -78
- package/dist/trajectory/Trajectory.svelte.d.ts +5 -5
- package/dist/trajectory/TrajectoryError.svelte.d.ts +3 -3
- package/dist/trajectory/TrajectoryExportPane.svelte +1 -1
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +5 -5
- package/dist/trajectory/TrajectoryInfoPane.svelte +1 -1
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +3 -3
- package/dist/trajectory/extract.js +2 -1
- package/dist/trajectory/index.d.ts +1 -1
- package/dist/trajectory/index.js +1 -1
- package/dist/trajectory/parse.js +21 -14
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +17 -0
- package/dist/xrd/XrdPlot.svelte +14 -11
- package/dist/xrd/XrdPlot.svelte.d.ts +6 -5
- package/package.json +20 -12
- package/readme.md +1 -1
- package/dist/material/MaterialCard.svelte +0 -123
- package/dist/material/MaterialCard.svelte.d.ts +0 -9
- package/dist/material/index.d.ts +0 -1
- package/dist/material/index.js +0 -1
- package/dist/plot/formatting.d.ts +0 -7
- package/dist/plot/formatting.js +0 -53
|
@@ -8,7 +8,7 @@ type BubbleSegmentData = ChartSegmentData & {
|
|
|
8
8
|
x: number;
|
|
9
9
|
y: number;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type $$ComponentProps = SVGAttributes<SVGSVGElement> & {
|
|
12
12
|
composition: CompositionType;
|
|
13
13
|
size?: number;
|
|
14
14
|
padding?: number;
|
|
@@ -18,7 +18,7 @@ interface Props extends SVGAttributes<SVGSVGElement> {
|
|
|
18
18
|
bubble_content?: Snippet<[BubbleSegmentData]>;
|
|
19
19
|
interactive?: boolean;
|
|
20
20
|
svg_node?: SVGSVGElement | null;
|
|
21
|
-
}
|
|
22
|
-
declare const BubbleChart: import("svelte").Component
|
|
21
|
+
};
|
|
22
|
+
declare const BubbleChart: import("svelte").Component<$$ComponentProps, {}, "svg_node">;
|
|
23
23
|
type BubbleChart = ReturnType<typeof BubbleChart>;
|
|
24
24
|
export default BubbleChart;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ColorSchemeName, CompositionType } from '..';
|
|
2
2
|
import type { SVGAttributes } from 'svelte/elements';
|
|
3
3
|
type CompositionChartMode = `pie` | `bubble` | `bar`;
|
|
4
|
-
|
|
4
|
+
type $$ComponentProps = SVGAttributes<SVGSVGElement> & {
|
|
5
5
|
composition: string | CompositionType;
|
|
6
6
|
mode?: CompositionChartMode;
|
|
7
7
|
on_composition_change?: (composition: CompositionType) => void;
|
|
8
8
|
color_scheme?: ColorSchemeName;
|
|
9
|
-
}
|
|
10
|
-
declare const Composition: import("svelte").Component
|
|
9
|
+
};
|
|
10
|
+
declare const Composition: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
11
11
|
type Composition = ReturnType<typeof Composition>;
|
|
12
12
|
export default Composition;
|
|
@@ -11,7 +11,7 @@ type PieSegmentData = ChartSegmentData & {
|
|
|
11
11
|
label_y: number;
|
|
12
12
|
is_outside_slice: boolean;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
type $$ComponentProps = SVGAttributes<SVGSVGElement> & {
|
|
15
15
|
composition: CompositionType;
|
|
16
16
|
size?: number;
|
|
17
17
|
stroke_width?: number;
|
|
@@ -27,7 +27,7 @@ interface Props extends SVGAttributes<SVGSVGElement> {
|
|
|
27
27
|
segment_content?: Snippet<[PieSegmentData]>;
|
|
28
28
|
interactive?: boolean;
|
|
29
29
|
svg_node?: SVGSVGElement | null;
|
|
30
|
-
}
|
|
31
|
-
declare const PieChart: import("svelte").Component
|
|
30
|
+
};
|
|
31
|
+
declare const PieChart: import("svelte").Component<$$ComponentProps, {}, "svg_node">;
|
|
32
32
|
type PieChart = ReturnType<typeof PieChart>;
|
|
33
33
|
export default PieChart;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AnyStructure, CompositionType, ElementSymbol } from '..';
|
|
2
2
|
export declare const atomic_number_to_symbol: Record<number, ElementSymbol>;
|
|
3
3
|
export declare const symbol_to_atomic_number: Partial<Record<ElementSymbol, number>>;
|
|
4
|
-
export declare const atomic_weights: Map<"K" | "H" | "He" | "Li" | "Be" | "B" | "C" | "N" | "O" | "F" | "Ne" | "Na" | "Mg" | "Al" | "Si" | "P" | "
|
|
5
|
-
export declare const element_electronegativity_map: Map<"K" | "H" | "He" | "Li" | "Be" | "B" | "C" | "N" | "O" | "F" | "Ne" | "Na" | "Mg" | "Al" | "Si" | "P" | "
|
|
4
|
+
export declare const atomic_weights: Map<"S" | "K" | "H" | "He" | "Li" | "Be" | "B" | "C" | "N" | "O" | "F" | "Ne" | "Na" | "Mg" | "Al" | "Si" | "P" | "Cl" | "Ar" | "Ca" | "Sc" | "Ti" | "V" | "Cr" | "Mn" | "Fe" | "Co" | "Ni" | "Cu" | "Zn" | "Ga" | "Ge" | "As" | "Se" | "Br" | "Kr" | "Rb" | "Sr" | "Y" | "Zr" | "Nb" | "Mo" | "Tc" | "Ru" | "Rh" | "Pd" | "Ag" | "Cd" | "In" | "Sn" | "Sb" | "Te" | "I" | "Xe" | "Cs" | "Ba" | "La" | "Ce" | "Pr" | "Nd" | "Pm" | "Sm" | "Eu" | "Gd" | "Tb" | "Dy" | "Ho" | "Er" | "Tm" | "Yb" | "Lu" | "Hf" | "Ta" | "W" | "Re" | "Os" | "Ir" | "Pt" | "Au" | "Hg" | "Tl" | "Pb" | "Bi" | "Po" | "At" | "Rn" | "Fr" | "Ra" | "Ac" | "Th" | "Pa" | "U" | "Np" | "Pu" | "Am" | "Cm" | "Bk" | "Cf" | "Es" | "Fm" | "Md" | "No" | "Lr" | "Rf" | "Db" | "Sg" | "Bh" | "Hs" | "Mt" | "Ds" | "Rg" | "Cn" | "Nh" | "Fl" | "Mc" | "Lv" | "Ts" | "Og", number>;
|
|
5
|
+
export declare const element_electronegativity_map: Map<"S" | "K" | "H" | "He" | "Li" | "Be" | "B" | "C" | "N" | "O" | "F" | "Ne" | "Na" | "Mg" | "Al" | "Si" | "P" | "Cl" | "Ar" | "Ca" | "Sc" | "Ti" | "V" | "Cr" | "Mn" | "Fe" | "Co" | "Ni" | "Cu" | "Zn" | "Ga" | "Ge" | "As" | "Se" | "Br" | "Kr" | "Rb" | "Sr" | "Y" | "Zr" | "Nb" | "Mo" | "Tc" | "Ru" | "Rh" | "Pd" | "Ag" | "Cd" | "In" | "Sn" | "Sb" | "Te" | "I" | "Xe" | "Cs" | "Ba" | "La" | "Ce" | "Pr" | "Nd" | "Pm" | "Sm" | "Eu" | "Gd" | "Tb" | "Dy" | "Ho" | "Er" | "Tm" | "Yb" | "Lu" | "Hf" | "Ta" | "W" | "Re" | "Os" | "Ir" | "Pt" | "Au" | "Hg" | "Tl" | "Pb" | "Bi" | "Po" | "At" | "Rn" | "Fr" | "Ra" | "Ac" | "Th" | "Pa" | "U" | "Np" | "Pu" | "Am" | "Cm" | "Bk" | "Cf" | "Es" | "Fm" | "Md" | "No" | "Lr" | "Rf" | "Db" | "Sg" | "Bh" | "Hs" | "Mt" | "Ds" | "Rg" | "Cn" | "Nh" | "Fl" | "Mc" | "Lv" | "Ts" | "Og", number>;
|
|
6
6
|
export declare const elem_name_to_symbol: Record<string, ElementSymbol>;
|
|
7
7
|
export declare const elem_symbol_to_name: Record<ElementSymbol, string>;
|
|
8
8
|
export declare const atomic_num_to_symbols: (atomic_composition: Record<number, number>) => CompositionType;
|
|
@@ -14,5 +14,5 @@ export declare const get_total_atoms: (composition: CompositionType) => number;
|
|
|
14
14
|
export declare const parse_composition: (input: string | CompositionType | Record<number, number> | Record<string | number, number>) => CompositionType;
|
|
15
15
|
export declare const format_composition_formula: (composition: CompositionType, sort_fn: (symbols: ElementSymbol[]) => ElementSymbol[], plain_text?: boolean, delim?: string, amount_format?: string) => string;
|
|
16
16
|
export declare const get_alphabetical_formula: (input: string | CompositionType | AnyStructure, plain_text?: boolean, delim?: string, amount_format?: string) => string;
|
|
17
|
-
export declare const sort_by_electronegativity: (symbols: ElementSymbol[]) => ("K" | "H" | "He" | "Li" | "Be" | "B" | "C" | "N" | "O" | "F" | "Ne" | "Na" | "Mg" | "Al" | "Si" | "P" | "
|
|
17
|
+
export declare const sort_by_electronegativity: (symbols: ElementSymbol[]) => ("S" | "K" | "H" | "He" | "Li" | "Be" | "B" | "C" | "N" | "O" | "F" | "Ne" | "Na" | "Mg" | "Al" | "Si" | "P" | "Cl" | "Ar" | "Ca" | "Sc" | "Ti" | "V" | "Cr" | "Mn" | "Fe" | "Co" | "Ni" | "Cu" | "Zn" | "Ga" | "Ge" | "As" | "Se" | "Br" | "Kr" | "Rb" | "Sr" | "Y" | "Zr" | "Nb" | "Mo" | "Tc" | "Ru" | "Rh" | "Pd" | "Ag" | "Cd" | "In" | "Sn" | "Sb" | "Te" | "I" | "Xe" | "Cs" | "Ba" | "La" | "Ce" | "Pr" | "Nd" | "Pm" | "Sm" | "Eu" | "Gd" | "Tb" | "Dy" | "Ho" | "Er" | "Tm" | "Yb" | "Lu" | "Hf" | "Ta" | "W" | "Re" | "Os" | "Ir" | "Pt" | "Au" | "Hg" | "Tl" | "Pb" | "Bi" | "Po" | "At" | "Rn" | "Fr" | "Ra" | "Ac" | "Th" | "Pa" | "U" | "Np" | "Pu" | "Am" | "Cm" | "Bk" | "Cf" | "Es" | "Fm" | "Md" | "No" | "Lr" | "Rf" | "Db" | "Sg" | "Bh" | "Hs" | "Mt" | "Ds" | "Rg" | "Cn" | "Nh" | "Fl" | "Mc" | "Lv" | "Ts" | "Og")[];
|
|
18
18
|
export declare const get_electro_neg_formula: (input: string | CompositionType | AnyStructure, plain_text?: boolean, delim?: string, amount_format?: string) => string;
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
<script lang="ts">import { plot_colors } from '../colors';
|
|
2
|
+
import { decompress_file, handle_url_drop } from '../io';
|
|
3
|
+
import { format_value } from '../labels';
|
|
4
|
+
import { BarPlot } from '../plot';
|
|
5
|
+
import { parse_any_structure } from '../structure/parse';
|
|
6
|
+
import { SvelteMap, SvelteSet } from 'svelte/reactivity';
|
|
7
|
+
import { calc_coordination_numbers, } from './calc-coordination';
|
|
8
|
+
let { structures, strategy = `electroneg_ratio`, split_mode = `by_element`, mode = $bindable(`grouped`), orientation = `vertical`, x_axis = $bindable({ label: `Coordination Number`, format: `d` }), y_axis = $bindable({ label: `Count`, format: `d` }), allow_file_drop = true, on_file_drop, loading = $bindable(false), error_msg = $bindable(undefined), ...rest } = $props();
|
|
9
|
+
let dragover = $state(false);
|
|
10
|
+
let dropped_entries = $state([]);
|
|
11
|
+
// Normalize input to consistent array of { label, structure, color }
|
|
12
|
+
const structure_entries = $derived.by(() => {
|
|
13
|
+
if (!structures)
|
|
14
|
+
return [];
|
|
15
|
+
const base_entries = Array.isArray(structures)
|
|
16
|
+
? structures
|
|
17
|
+
: (`sites` in structures
|
|
18
|
+
? [{ label: `Structure`, structure: structures }]
|
|
19
|
+
: Object.entries(structures).map(([label, value]) => `structure` in value
|
|
20
|
+
? { label, ...value }
|
|
21
|
+
: { label, structure: value }));
|
|
22
|
+
// Merge user-provided structures with dropped structures
|
|
23
|
+
return [...base_entries, ...dropped_entries];
|
|
24
|
+
});
|
|
25
|
+
// Compute coordination data for each structure
|
|
26
|
+
const entries_with_data = $derived(structure_entries.map((entry) => ({
|
|
27
|
+
...entry,
|
|
28
|
+
data: calc_coordination_numbers(entry.structure, strategy),
|
|
29
|
+
})));
|
|
30
|
+
// Compute appropriate ranges
|
|
31
|
+
const ranges = $derived.by(() => {
|
|
32
|
+
// CN axis should always start at 0 and show at least [0,4]
|
|
33
|
+
let max_cn = 4; // minimum max value
|
|
34
|
+
for (const entry of entries_with_data) {
|
|
35
|
+
for (const [cn] of entry.data.cn_histogram)
|
|
36
|
+
max_cn = Math.max(max_cn, cn);
|
|
37
|
+
}
|
|
38
|
+
const cn_range = [-0.5, max_cn + 0.5];
|
|
39
|
+
return { count: [0, null], cn: cn_range }; // Count axis should always start at 0
|
|
40
|
+
});
|
|
41
|
+
// Derive integer CN ticks for axis labels
|
|
42
|
+
const cn_ticks = $derived.by(() => {
|
|
43
|
+
const all_cns = new SvelteSet();
|
|
44
|
+
// Always include minimum CN values 0-4
|
|
45
|
+
for (let idx = 0; idx <= 4; idx++)
|
|
46
|
+
all_cns.add(idx);
|
|
47
|
+
// Add actual CN values from data
|
|
48
|
+
for (const entry of entries_with_data) {
|
|
49
|
+
for (const [cn] of entry.data.cn_histogram)
|
|
50
|
+
all_cns.add(cn);
|
|
51
|
+
}
|
|
52
|
+
return Array.from(all_cns).sort((cn1, cn2) => cn1 - cn2);
|
|
53
|
+
});
|
|
54
|
+
// Build BarPlot series based on split_mode
|
|
55
|
+
const bar_series = $derived.by(() => {
|
|
56
|
+
if (split_mode === `by_element`) {
|
|
57
|
+
// One series per element across all structures
|
|
58
|
+
const element_series_map = new SvelteMap();
|
|
59
|
+
// Collect all unique CNs across all elements
|
|
60
|
+
const all_cns = new SvelteSet();
|
|
61
|
+
for (const entry of entries_with_data) {
|
|
62
|
+
for (const [element, cn_histogram] of entry.data.cn_histogram_by_element) {
|
|
63
|
+
if (!element_series_map.has(element)) {
|
|
64
|
+
element_series_map.set(element, new SvelteMap());
|
|
65
|
+
}
|
|
66
|
+
const element_map = element_series_map.get(element);
|
|
67
|
+
for (const [cn, count] of cn_histogram) {
|
|
68
|
+
all_cns.add(cn);
|
|
69
|
+
element_map.set(cn, (element_map.get(cn) ?? 0) + count);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Sort CNs for consistent x-axis
|
|
74
|
+
const sorted_cns = Array.from(all_cns).sort((a, b) => a - b);
|
|
75
|
+
// Convert map to array and ensure all series have same x-values
|
|
76
|
+
return Array.from(element_series_map.entries())
|
|
77
|
+
.sort((a, b) => a[0].localeCompare(b[0]))
|
|
78
|
+
.map(([element, cn_map], idx) => {
|
|
79
|
+
return {
|
|
80
|
+
x: sorted_cns,
|
|
81
|
+
y: sorted_cns.map((cn) => cn_map.get(cn) ?? 0),
|
|
82
|
+
label: element,
|
|
83
|
+
color: plot_colors[idx % plot_colors.length],
|
|
84
|
+
bar_width: 0.8,
|
|
85
|
+
visible: true,
|
|
86
|
+
metadata: { element },
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
else if (split_mode === `by_structure`) {
|
|
91
|
+
// One series per structure
|
|
92
|
+
// First collect all unique CNs
|
|
93
|
+
const all_cns = new SvelteSet();
|
|
94
|
+
for (const entry of entries_with_data) {
|
|
95
|
+
for (const [cn] of entry.data.cn_histogram) {
|
|
96
|
+
all_cns.add(cn);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const sorted_cns = Array.from(all_cns).sort((a, b) => a - b);
|
|
100
|
+
return entries_with_data.map((entry, idx) => {
|
|
101
|
+
return {
|
|
102
|
+
x: sorted_cns,
|
|
103
|
+
y: sorted_cns.map((cn) => entry.data.cn_histogram.get(cn) ?? 0),
|
|
104
|
+
label: entry.label,
|
|
105
|
+
color: entry.color ?? plot_colors[idx % plot_colors.length],
|
|
106
|
+
bar_width: 0.8,
|
|
107
|
+
visible: true,
|
|
108
|
+
metadata: { structure_label: entry.label },
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
// split_mode === 'none': combine all into single series
|
|
114
|
+
const combined_histogram = new SvelteMap();
|
|
115
|
+
for (const entry of entries_with_data) {
|
|
116
|
+
for (const [cn, count] of entry.data.cn_histogram) {
|
|
117
|
+
combined_histogram.set(cn, (combined_histogram.get(cn) ?? 0) + count);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const x_vals = Array.from(combined_histogram.keys()).sort((a, b) => a - b);
|
|
121
|
+
const y_vals = x_vals.map((cn) => combined_histogram.get(cn));
|
|
122
|
+
return [
|
|
123
|
+
{
|
|
124
|
+
x: x_vals,
|
|
125
|
+
y: y_vals,
|
|
126
|
+
label: `All Sites`,
|
|
127
|
+
color: plot_colors[0],
|
|
128
|
+
bar_width: 0.8,
|
|
129
|
+
visible: true,
|
|
130
|
+
metadata: {},
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
async function handle_file_drop(event) {
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
dragover = false;
|
|
138
|
+
if (!allow_file_drop)
|
|
139
|
+
return;
|
|
140
|
+
loading = true;
|
|
141
|
+
error_msg = undefined;
|
|
142
|
+
const compute_and_add = (content, filename) => {
|
|
143
|
+
try {
|
|
144
|
+
const text_content = content instanceof ArrayBuffer
|
|
145
|
+
? new TextDecoder().decode(content)
|
|
146
|
+
: content;
|
|
147
|
+
const parsed_structure = parse_any_structure(text_content, filename);
|
|
148
|
+
if (parsed_structure && `lattice` in parsed_structure) {
|
|
149
|
+
const label = filename || `Dropped structure`;
|
|
150
|
+
// Prepend latest dropped structure for visibility
|
|
151
|
+
dropped_entries = [
|
|
152
|
+
{ label, structure: parsed_structure },
|
|
153
|
+
...dropped_entries,
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
else if (parsed_structure && !(`lattice` in parsed_structure)) {
|
|
157
|
+
error_msg = `Structure has no lattice; cannot compute coordination`;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
error_msg = `Failed to parse structure from ${filename}`;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch (exc) {
|
|
164
|
+
error_msg = `Failed to process structure: ${exc instanceof Error ? exc.message : String(exc)}`;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
try {
|
|
168
|
+
// Handle URL-based drops
|
|
169
|
+
const handled = await handle_url_drop(event, on_file_drop || compute_and_add)
|
|
170
|
+
.catch(() => false);
|
|
171
|
+
if (handled)
|
|
172
|
+
return;
|
|
173
|
+
// Handle file system drops
|
|
174
|
+
const file = event.dataTransfer?.files?.[0];
|
|
175
|
+
if (file) {
|
|
176
|
+
try {
|
|
177
|
+
const { content, filename } = await decompress_file(file);
|
|
178
|
+
if (content)
|
|
179
|
+
(on_file_drop || compute_and_add)(content, filename);
|
|
180
|
+
}
|
|
181
|
+
catch (exc) {
|
|
182
|
+
error_msg = `Failed to load file ${file.name}: ${exc instanceof Error ? exc.message : String(exc)}`;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
finally {
|
|
187
|
+
loading = false;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
</script>
|
|
191
|
+
|
|
192
|
+
{#snippet tooltip(info: BarTooltipProps)}
|
|
193
|
+
{@const cn = info.x}
|
|
194
|
+
{@const count = info.y}
|
|
195
|
+
{@const element = info.metadata?.element as string | undefined}
|
|
196
|
+
{@const structure_label = info.metadata?.structure_label as string | undefined}
|
|
197
|
+
{#if element}
|
|
198
|
+
{element} —
|
|
199
|
+
{/if}
|
|
200
|
+
{#if structure_label}
|
|
201
|
+
{structure_label} —
|
|
202
|
+
{/if}
|
|
203
|
+
CN: {format_value(cn, `.0f`)}
|
|
204
|
+
<br />
|
|
205
|
+
Sites: {format_value(count, `.0f`)}
|
|
206
|
+
{/snippet}
|
|
207
|
+
|
|
208
|
+
<BarPlot
|
|
209
|
+
{...rest}
|
|
210
|
+
series={bar_series}
|
|
211
|
+
bind:orientation
|
|
212
|
+
bind:mode
|
|
213
|
+
x_axis={{
|
|
214
|
+
label_shift: { y: 20 },
|
|
215
|
+
range: orientation === `horizontal` ? ranges.count : ranges.cn,
|
|
216
|
+
ticks: orientation === `horizontal` ? undefined : cn_ticks,
|
|
217
|
+
...(orientation === `horizontal` ? y_axis : x_axis),
|
|
218
|
+
}}
|
|
219
|
+
y_axis={{
|
|
220
|
+
label_shift: { x: 2 },
|
|
221
|
+
range: orientation === `horizontal` ? ranges.cn : ranges.count,
|
|
222
|
+
ticks: orientation === `horizontal` ? cn_ticks : undefined,
|
|
223
|
+
...orientation === `horizontal` ? x_axis : y_axis,
|
|
224
|
+
}}
|
|
225
|
+
display={{
|
|
226
|
+
x_zero_line: orientation === `horizontal`,
|
|
227
|
+
y_zero_line: orientation === `vertical`,
|
|
228
|
+
}}
|
|
229
|
+
{tooltip}
|
|
230
|
+
ondrop={handle_file_drop}
|
|
231
|
+
ondragover={(event) => {
|
|
232
|
+
event.preventDefault()
|
|
233
|
+
if (!allow_file_drop) return
|
|
234
|
+
dragover = true
|
|
235
|
+
}}
|
|
236
|
+
ondragleave={(event) => {
|
|
237
|
+
event.preventDefault()
|
|
238
|
+
dragover = false
|
|
239
|
+
}}
|
|
240
|
+
class={(rest.class ?? ``) + (dragover ? ` dragover` : ``)}
|
|
241
|
+
/>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AnyStructure, AxisConfig } from '..';
|
|
2
|
+
import { BarPlot } from '../plot';
|
|
3
|
+
import type { BondingStrategy } from '../structure/bonding';
|
|
4
|
+
import type { ComponentProps } from 'svelte';
|
|
5
|
+
import { type CoordinationData } from './calc-coordination';
|
|
6
|
+
import type { SplitMode } from './index';
|
|
7
|
+
interface StructureEntry {
|
|
8
|
+
label: string;
|
|
9
|
+
structure: AnyStructure;
|
|
10
|
+
color?: string;
|
|
11
|
+
data?: CoordinationData;
|
|
12
|
+
}
|
|
13
|
+
type $$ComponentProps = ComponentProps<typeof BarPlot> & {
|
|
14
|
+
structures: AnyStructure | Record<string, AnyStructure | {
|
|
15
|
+
structure: AnyStructure;
|
|
16
|
+
color?: string;
|
|
17
|
+
}> | StructureEntry[];
|
|
18
|
+
strategy?: BondingStrategy;
|
|
19
|
+
split_mode?: SplitMode;
|
|
20
|
+
x_axis?: AxisConfig;
|
|
21
|
+
y_axis?: AxisConfig;
|
|
22
|
+
allow_file_drop?: boolean;
|
|
23
|
+
on_file_drop?: (content: string | ArrayBuffer, filename: string) => void;
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
error_msg?: string;
|
|
26
|
+
};
|
|
27
|
+
declare const CoordinationBarPlot: import("svelte").Component<$$ComponentProps, {}, "loading" | "mode" | "y_axis" | "x_axis" | "error_msg">;
|
|
28
|
+
type CoordinationBarPlot = ReturnType<typeof CoordinationBarPlot>;
|
|
29
|
+
export default CoordinationBarPlot;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AnyStructure } from '..';
|
|
2
|
+
import type { BondingStrategy } from '../structure/bonding';
|
|
3
|
+
export interface CoordinationSite {
|
|
4
|
+
site_idx: number;
|
|
5
|
+
element: string;
|
|
6
|
+
coordination_number: number;
|
|
7
|
+
neighbor_elements: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface CoordinationData {
|
|
10
|
+
sites: CoordinationSite[];
|
|
11
|
+
cn_by_element: Map<string, number[]>;
|
|
12
|
+
cn_histogram: Map<number, number>;
|
|
13
|
+
cn_histogram_by_element: Map<string, Map<number, number>>;
|
|
14
|
+
}
|
|
15
|
+
export declare function calc_coordination_numbers(structure: AnyStructure, strategy?: BondingStrategy): CoordinationData;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { BONDING_STRATEGIES } from '../structure/bonding';
|
|
2
|
+
// Calculate coordination numbers for all sites in a structure using the specified bonding strategy
|
|
3
|
+
export function calc_coordination_numbers(structure, strategy = `electroneg_ratio`) {
|
|
4
|
+
// Get bonds using the specified strategy
|
|
5
|
+
const bonds = BONDING_STRATEGIES[strategy](structure);
|
|
6
|
+
// Count neighbors for each site
|
|
7
|
+
const neighbor_counts = new Map();
|
|
8
|
+
const sites = structure.sites;
|
|
9
|
+
for (const bond of bonds) {
|
|
10
|
+
const { site_idx_1, site_idx_2 } = bond;
|
|
11
|
+
if (!neighbor_counts.has(site_idx_1)) {
|
|
12
|
+
neighbor_counts.set(site_idx_1, new Set());
|
|
13
|
+
}
|
|
14
|
+
if (!neighbor_counts.has(site_idx_2)) {
|
|
15
|
+
neighbor_counts.set(site_idx_2, new Set());
|
|
16
|
+
}
|
|
17
|
+
const neighbors_1 = neighbor_counts.get(site_idx_1);
|
|
18
|
+
const neighbors_2 = neighbor_counts.get(site_idx_2);
|
|
19
|
+
if (neighbors_1)
|
|
20
|
+
neighbors_1.add(site_idx_2);
|
|
21
|
+
if (neighbors_2)
|
|
22
|
+
neighbors_2.add(site_idx_1);
|
|
23
|
+
}
|
|
24
|
+
// Build coordination site data
|
|
25
|
+
const coordination_sites = [];
|
|
26
|
+
const cn_by_element = new Map();
|
|
27
|
+
const cn_histogram = new Map();
|
|
28
|
+
const cn_histogram_by_element = new Map();
|
|
29
|
+
for (let site_idx = 0; site_idx < sites.length; site_idx++) {
|
|
30
|
+
const site = sites[site_idx];
|
|
31
|
+
const element = site.species[0]?.element ?? `Unknown`;
|
|
32
|
+
const neighbors_set = neighbor_counts.get(site_idx) ?? new Set();
|
|
33
|
+
const coordination_number = neighbors_set.size;
|
|
34
|
+
// Get neighbor elements
|
|
35
|
+
const neighbor_elements = Array.from(neighbors_set).map((neighbor_idx) => sites[neighbor_idx].species[0]?.element ?? `Unknown`);
|
|
36
|
+
coordination_sites.push({
|
|
37
|
+
site_idx,
|
|
38
|
+
element,
|
|
39
|
+
coordination_number,
|
|
40
|
+
neighbor_elements,
|
|
41
|
+
});
|
|
42
|
+
// Update cn_by_element
|
|
43
|
+
if (!cn_by_element.has(element)) {
|
|
44
|
+
cn_by_element.set(element, []);
|
|
45
|
+
}
|
|
46
|
+
const element_array = cn_by_element.get(element);
|
|
47
|
+
if (element_array)
|
|
48
|
+
element_array.push(coordination_number);
|
|
49
|
+
// Update overall cn_histogram
|
|
50
|
+
cn_histogram.set(coordination_number, (cn_histogram.get(coordination_number) ?? 0) + 1);
|
|
51
|
+
// Update cn_histogram_by_element
|
|
52
|
+
if (!cn_histogram_by_element.has(element)) {
|
|
53
|
+
cn_histogram_by_element.set(element, new Map());
|
|
54
|
+
}
|
|
55
|
+
const element_histogram = cn_histogram_by_element.get(element);
|
|
56
|
+
if (element_histogram) {
|
|
57
|
+
element_histogram.set(coordination_number, (element_histogram.get(coordination_number) ?? 0) + 1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
sites: coordination_sites,
|
|
62
|
+
cn_by_element,
|
|
63
|
+
cn_histogram,
|
|
64
|
+
cn_histogram_by_element,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './calc-coordination';
|
|
2
|
+
export { default as CoordinationBarPlot } from './CoordinationBarPlot.svelte';
|
|
3
|
+
export declare const SPLIT_MODES: {
|
|
4
|
+
readonly by_element: "By Element";
|
|
5
|
+
readonly by_structure: "By Structure";
|
|
6
|
+
readonly none: "Combined";
|
|
7
|
+
};
|
|
8
|
+
export type SplitMode = keyof typeof SPLIT_MODES;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SVGAttributes } from 'svelte/elements';
|
|
2
|
-
|
|
2
|
+
type $$ComponentProps = SVGAttributes<SVGSVGElement> & {
|
|
3
3
|
symbol?: string;
|
|
4
4
|
name?: string;
|
|
5
5
|
shells: number[];
|
|
@@ -14,7 +14,7 @@ interface Props extends SVGAttributes<SVGSVGElement> {
|
|
|
14
14
|
highlight_shell?: number | null;
|
|
15
15
|
number_electrons?: boolean | `hierarchical` | `sequential` | ((idx: number) => string);
|
|
16
16
|
electron_label_props?: Record<string, string | number>;
|
|
17
|
-
}
|
|
18
|
-
declare const BohrAtom: import("svelte").Component
|
|
17
|
+
};
|
|
18
|
+
declare const BohrAtom: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
19
19
|
type BohrAtom = ReturnType<typeof BohrAtom>;
|
|
20
20
|
export default BohrAtom;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ChemicalElement } from '..';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
3
|
+
type $$ComponentProps = HTMLAttributes<HTMLHeadingElement> & {
|
|
4
4
|
element: ChemicalElement;
|
|
5
|
-
}
|
|
6
|
-
declare const ElementHeading: import("svelte").Component
|
|
5
|
+
};
|
|
6
|
+
declare const ElementHeading: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
7
|
type ElementHeading = ReturnType<typeof ElementHeading>;
|
|
8
8
|
export default ElementHeading;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ChemicalElement } from '..';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
3
|
+
type $$ComponentProps = HTMLAttributes<HTMLImageElement | HTMLDivElement> & {
|
|
4
4
|
element: ChemicalElement;
|
|
5
5
|
missing_msg?: string;
|
|
6
|
-
}
|
|
7
|
-
declare const ElementPhoto: import("svelte").Component
|
|
6
|
+
};
|
|
7
|
+
declare const ElementPhoto: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
8
|
type ElementPhoto = ReturnType<typeof ElementPhoto>;
|
|
9
9
|
export default ElementPhoto;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ChemicalElement } from '..';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
3
|
+
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
4
|
element: ChemicalElement | null;
|
|
5
|
-
}
|
|
6
|
-
declare const ElementStats: import("svelte").Component
|
|
5
|
+
};
|
|
6
|
+
declare const ElementStats: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
7
|
type ElementStats = ReturnType<typeof ElementStats>;
|
|
8
8
|
export default ElementStats;
|
|
@@ -99,7 +99,7 @@ const layout_config = $derived.by(() => {
|
|
|
99
99
|
style:color={text_color}
|
|
100
100
|
{@attach text_color ? null : contrast_color()}
|
|
101
101
|
{...(href ? { role: `link`, tabindex: 0 } : {})}
|
|
102
|
-
onclick={(event) => onclick?.({ element, event })}
|
|
102
|
+
onclick={(event: MouseEvent) => onclick?.({ element, event })}
|
|
103
103
|
{...rest}
|
|
104
104
|
>
|
|
105
105
|
{#if should_show_number}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ChemicalElement } from '..';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
type SplitLayout = `diagonal` | `horizontal` | `vertical` | `triangular` | `quadrant`;
|
|
4
|
-
|
|
4
|
+
type $$ComponentProps = Omit<HTMLAttributes<HTMLElement>, `onclick`> & {
|
|
5
5
|
element: ChemicalElement;
|
|
6
6
|
bg_color?: string;
|
|
7
7
|
show_symbol?: boolean;
|
|
8
8
|
show_number?: boolean;
|
|
9
9
|
show_name?: boolean;
|
|
10
|
-
value?: number | number[] | string | string[] | false
|
|
10
|
+
value?: number | number[] | string | string[] | false;
|
|
11
11
|
symbol_style?: string;
|
|
12
12
|
active?: boolean;
|
|
13
13
|
href?: string;
|
|
@@ -23,7 +23,7 @@ interface Props extends Omit<HTMLAttributes<HTMLElement>, `onclick`> {
|
|
|
23
23
|
element: ChemicalElement;
|
|
24
24
|
event: MouseEvent;
|
|
25
25
|
}) => void;
|
|
26
|
-
}
|
|
27
|
-
declare const ElementTile: import("svelte").Component
|
|
26
|
+
};
|
|
27
|
+
declare const ElementTile: import("svelte").Component<$$ComponentProps, {}, "node" | "text_color">;
|
|
28
28
|
type ElementTile = ReturnType<typeof ElementTile>;
|
|
29
29
|
export default ElementTile;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SVGAttributes } from 'svelte/elements';
|
|
2
|
-
|
|
2
|
+
type $$ComponentProps = SVGAttributes<SVGSVGElement> & {
|
|
3
3
|
protons: number;
|
|
4
4
|
neutrons: number;
|
|
5
5
|
radius?: number;
|
|
@@ -11,7 +11,7 @@ interface Props extends SVGAttributes<SVGSVGElement> {
|
|
|
11
11
|
neutron_label?: string;
|
|
12
12
|
text_color?: string;
|
|
13
13
|
symbol?: string;
|
|
14
|
-
}
|
|
15
|
-
declare const Nucleus: import("svelte").Component
|
|
14
|
+
};
|
|
15
|
+
declare const Nucleus: import("svelte").Component<$$ComponentProps, {}, "radius">;
|
|
16
16
|
type Nucleus = ReturnType<typeof Nucleus>;
|
|
17
17
|
export default Nucleus;
|
package/dist/icons.d.ts
CHANGED
|
@@ -117,6 +117,10 @@ export declare const icon_data: {
|
|
|
117
117
|
readonly viewBox: "0 0 24 24";
|
|
118
118
|
readonly path: "M19.75 2A2.25 2.25 0 0 1 22 4.25v5.462a3.25 3.25 0 0 1-.952 2.298l-.026.026a6.476 6.476 0 0 0-1.43-.692l.396-.395a1.75 1.75 0 0 0 .512-1.237V4.25a.75.75 0 0 0-.75-.75h-5.465c-.465 0-.91.185-1.239.513l-8.512 8.523a1.75 1.75 0 0 0 .015 2.462l4.461 4.454a1.755 1.755 0 0 0 2.33.13c.165.487.386.947.654 1.375a3.256 3.256 0 0 1-4.043-.443L3.489 16.06a3.25 3.25 0 0 1-.003-4.596l8.5-8.51A3.25 3.25 0 0 1 14.284 2h5.465zM17 5.502a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3zM23 17.5a5.5 5.5 0 1 0-11 0a5.5 5.5 0 0 0 11 0zm-6.125 3.005a.625.625 0 1 1 1.25 0a.625.625 0 0 1-1.25 0zm-1.228-4.548c-.011-1.137.805-1.954 1.853-1.954c1.031 0 1.853.846 1.853 1.95c0 .566-.185.913-.663 1.447l-.265.29l-.101.116c-.248.292-.324.462-.324.695a.5.5 0 1 1-1 0c0-.576.187-.926.671-1.468l.265-.29l.1-.113c.242-.286.317-.453.317-.677c0-.558-.38-.95-.853-.95c-.494 0-.859.366-.853.945a.5.5 0 1 1-1 .01z";
|
|
119
119
|
};
|
|
120
|
+
readonly Search: {
|
|
121
|
+
readonly viewBox: "0 0 24 24";
|
|
122
|
+
readonly path: "M10 4a6 6 0 1 0 0 12a6 6 0 0 0 0-12m-8 6a8 8 0 1 1 14.32 4.906l5.387 5.387a1 1 0 0 1-1.414 1.414l-5.387-5.387A8 8 0 0 1 2 10";
|
|
123
|
+
};
|
|
120
124
|
readonly Paper: {
|
|
121
125
|
readonly viewBox: "0 0 24 24";
|
|
122
126
|
readonly path: "M16.5 19q1.05 0 1.775-.725T19 16.5t-.725-1.775T16.5 14t-1.775.725T14 16.5t.725 1.775T16.5 19m5.8 3.3q-.275.275-.7.275t-.7-.275l-2-2q-.525.35-1.137.525T16.5 21q-1.875 0-3.187-1.312T12 16.5t1.313-3.187T16.5 12t3.188 1.313T21 16.5q0 .65-.175 1.263T20.3 18.9l2 2q.275.275.275.7t-.275.7M5 22q-.825 0-1.412-.587T3 20V4q0-.825.588-1.412T5 2h7.175q.4 0 .763.15t.637.425l4.85 4.85q.275.275.425.638t.15.762v.45q0 .45-.363.725t-.812.15q-.325-.075-.65-.113T16.5 10q-2.95 0-4.75 2t-1.8 4.525q0 1.1.388 2.175t1.212 2.025q.35.375.162.825t-.637.45zm7-18v4q0 .425.288.713T13 9h4zl5 5z";
|
package/dist/icons.js
CHANGED
|
@@ -118,6 +118,10 @@ export const icon_data = {
|
|
|
118
118
|
viewBox: `0 0 24 24`,
|
|
119
119
|
path: `M19.75 2A2.25 2.25 0 0 1 22 4.25v5.462a3.25 3.25 0 0 1-.952 2.298l-.026.026a6.476 6.476 0 0 0-1.43-.692l.396-.395a1.75 1.75 0 0 0 .512-1.237V4.25a.75.75 0 0 0-.75-.75h-5.465c-.465 0-.91.185-1.239.513l-8.512 8.523a1.75 1.75 0 0 0 .015 2.462l4.461 4.454a1.755 1.755 0 0 0 2.33.13c.165.487.386.947.654 1.375a3.256 3.256 0 0 1-4.043-.443L3.489 16.06a3.25 3.25 0 0 1-.003-4.596l8.5-8.51A3.25 3.25 0 0 1 14.284 2h5.465zM17 5.502a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3zM23 17.5a5.5 5.5 0 1 0-11 0a5.5 5.5 0 0 0 11 0zm-6.125 3.005a.625.625 0 1 1 1.25 0a.625.625 0 0 1-1.25 0zm-1.228-4.548c-.011-1.137.805-1.954 1.853-1.954c1.031 0 1.853.846 1.853 1.95c0 .566-.185.913-.663 1.447l-.265.29l-.101.116c-.248.292-.324.462-.324.695a.5.5 0 1 1-1 0c0-.576.187-.926.671-1.468l.265-.29l.1-.113c.242-.286.317-.453.317-.677c0-.558-.38-.95-.853-.95c-.494 0-.859.366-.853.945a.5.5 0 1 1-1 .01z`,
|
|
120
120
|
},
|
|
121
|
+
Search: {
|
|
122
|
+
viewBox: `0 0 24 24`,
|
|
123
|
+
path: `M10 4a6 6 0 1 0 0 12a6 6 0 0 0 0-12m-8 6a8 8 0 1 1 14.32 4.906l5.387 5.387a1 1 0 0 1-1.414 1.414l-5.387-5.387A8 8 0 0 1 2 10`,
|
|
124
|
+
},
|
|
121
125
|
Paper: {
|
|
122
126
|
viewBox: `0 0 24 24`,
|
|
123
127
|
path: `M16.5 19q1.05 0 1.775-.725T19 16.5t-.725-1.775T16.5 14t-1.775.725T14 16.5t.725 1.775T16.5 19m5.8 3.3q-.275.275-.7.275t-.7-.275l-2-2q-.525.35-1.137.525T16.5 21q-1.875 0-3.187-1.312T12 16.5t1.313-3.187T16.5 12t3.188 1.313T21 16.5q0 .65-.175 1.263T20.3 18.9l2 2q.275.275.275.7t-.275.7M5 22q-.825 0-1.412-.587T3 20V4q0-.825.588-1.412T5 2h7.175q.4 0 .763.15t.637.425l4.85 4.85q.275.275.425.638t.15.762v.45q0 .45-.363.725t-.812.15q-.325-.075-.65-.113T16.5 10q-2.95 0-4.75 2t-1.8 4.525q0 1.1.388 2.175t1.212 2.025q.35.375.162.825t-.637.45zm7-18v4q0 .425.288.713T13 9h4zl5 5z`,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { elem_symbols, element_categories } from './labels';
|
|
2
|
+
export * from './bands';
|
|
3
|
+
export * from './brillouin';
|
|
2
4
|
export * from './colors';
|
|
3
5
|
export * from './composition';
|
|
4
6
|
export { default as ContextMenu } from './ContextMenu.svelte';
|
|
7
|
+
export * from './coordination';
|
|
5
8
|
export { default as DraggablePane } from './DraggablePane.svelte';
|
|
6
9
|
export * from './element';
|
|
7
10
|
export { default as FilePicker } from './FilePicker.svelte';
|
|
@@ -10,18 +13,19 @@ export { icon_data, type IconName } from './icons';
|
|
|
10
13
|
export { default as InfoCard } from './InfoCard.svelte';
|
|
11
14
|
export * from './io';
|
|
12
15
|
export * from './labels';
|
|
13
|
-
export * from './material';
|
|
14
16
|
export * from './math';
|
|
15
17
|
export { default as Nav } from './Nav.svelte';
|
|
16
18
|
export * from './periodic-table';
|
|
17
19
|
export * from './phase-diagram';
|
|
18
20
|
export * from './plot';
|
|
21
|
+
export * from './rdf';
|
|
19
22
|
export * from './settings';
|
|
20
23
|
export { default as SettingsSection } from './SettingsSection.svelte';
|
|
21
24
|
export { default as Spinner } from './Spinner.svelte';
|
|
22
25
|
export * from './structure';
|
|
23
26
|
export * from './theme';
|
|
24
27
|
export { default as Trajectory } from './trajectory/Trajectory.svelte';
|
|
28
|
+
export * from './utils';
|
|
25
29
|
export * from './xrd';
|
|
26
30
|
export type ElementCategory = (typeof element_categories)[number];
|
|
27
31
|
export type ElementSymbol = (typeof elem_symbols)[number];
|