matterviz 0.3.2 → 0.3.4
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/EmptyState.svelte +10 -2
- package/dist/FilePicker.svelte +123 -82
- package/dist/Icon.svelte +18 -12
- package/dist/MillerIndexInput.svelte +27 -21
- package/dist/api/optimade.js +6 -6
- package/dist/app.css +216 -207
- package/dist/brillouin/BrillouinZone.svelte +292 -149
- package/dist/brillouin/BrillouinZone.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneControls.svelte +32 -5
- package/dist/brillouin/BrillouinZoneExportPane.svelte +69 -42
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +99 -68
- package/dist/brillouin/BrillouinZoneScene.svelte +275 -163
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneTooltip.svelte +17 -7
- package/dist/brillouin/compute.js +11 -6
- package/dist/chempot-diagram/ChemPotDiagram.svelte +162 -27
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +451 -281
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +2148 -1642
- package/dist/chempot-diagram/ChemPotScene3D.svelte +8 -5
- package/dist/chempot-diagram/async-compute.svelte.d.ts +3 -0
- package/dist/chempot-diagram/async-compute.svelte.js +77 -0
- package/dist/chempot-diagram/chempot-worker.d.ts +1 -0
- package/dist/chempot-diagram/chempot-worker.js +11 -0
- package/dist/chempot-diagram/color.js +1 -2
- package/dist/chempot-diagram/compute.d.ts +10 -0
- package/dist/chempot-diagram/compute.js +250 -88
- package/dist/chempot-diagram/index.d.ts +2 -1
- package/dist/chempot-diagram/index.js +2 -1
- package/dist/chempot-diagram/temperature.js +8 -9
- package/dist/chempot-diagram/types.d.ts +3 -0
- package/dist/chempot-diagram/types.js +1 -0
- package/dist/colors/index.d.ts +1 -1
- package/dist/colors/index.js +5 -3
- package/dist/composition/BarChart.svelte +128 -55
- package/dist/composition/BubbleChart.svelte +102 -49
- package/dist/composition/Composition.svelte +100 -79
- package/dist/composition/Formula.svelte +108 -62
- package/dist/composition/FormulaFilter.svelte +665 -537
- package/dist/composition/PieChart.svelte +183 -108
- package/dist/composition/format.d.ts +5 -0
- package/dist/composition/format.js +20 -3
- package/dist/composition/parse.js +14 -9
- package/dist/convex-hull/ConvexHull.svelte +93 -40
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull2D.svelte +549 -360
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +1296 -827
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +1004 -688
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullControls.svelte +115 -28
- package/dist/convex-hull/ConvexHullControls.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullInfoPane.svelte +29 -3
- package/dist/convex-hull/ConvexHullStats.svelte +425 -328
- package/dist/convex-hull/ConvexHullTooltip.svelte +40 -16
- package/dist/convex-hull/GasPressureControls.svelte +104 -61
- package/dist/convex-hull/StructurePopup.svelte +25 -4
- package/dist/convex-hull/TemperatureSlider.svelte +45 -25
- package/dist/convex-hull/barycentric-coords.js +13 -7
- package/dist/convex-hull/demo-temperature.js +8 -4
- package/dist/convex-hull/gas-thermodynamics.js +17 -12
- package/dist/convex-hull/helpers.d.ts +9 -0
- package/dist/convex-hull/helpers.js +77 -34
- package/dist/convex-hull/thermodynamics.js +61 -56
- package/dist/convex-hull/types.d.ts +9 -14
- package/dist/convex-hull/types.js +0 -17
- package/dist/coordination/CoordinationBarPlot.svelte +227 -154
- package/dist/element/BohrAtom.svelte +55 -12
- package/dist/element/ElementHeading.svelte +7 -2
- package/dist/element/ElementPhoto.svelte +15 -9
- package/dist/element/ElementStats.svelte +10 -4
- package/dist/element/ElementTile.svelte +137 -73
- package/dist/element/Nucleus.svelte +39 -11
- package/dist/element/data.js +1 -1
- package/dist/feedback/ClickFeedback.svelte +16 -5
- package/dist/feedback/DragOverlay.svelte +10 -2
- package/dist/feedback/Spinner.svelte +4 -2
- package/dist/feedback/StatusMessage.svelte +8 -2
- package/dist/fermi-surface/FermiSlice.svelte +118 -88
- package/dist/fermi-surface/FermiSurface.svelte +328 -187
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceControls.svelte +113 -46
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +535 -342
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +14 -5
- package/dist/fermi-surface/compute.js +16 -20
- package/dist/fermi-surface/parse.js +24 -14
- package/dist/fermi-surface/symmetry.js +2 -7
- package/dist/fermi-surface/types.d.ts +3 -5
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +1019 -765
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +1 -1
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +76 -22
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +2 -3
- package/dist/icons.js +47 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/io/decompress.js +1 -1
- package/dist/io/export.d.ts +3 -0
- package/dist/io/export.js +129 -143
- package/dist/io/is-binary.js +2 -3
- package/dist/io/url-drop.js +1 -2
- package/dist/isosurface/Isosurface.svelte +202 -148
- package/dist/isosurface/IsosurfaceControls.svelte +46 -28
- package/dist/isosurface/parse.js +34 -29
- package/dist/isosurface/slice.js +5 -10
- package/dist/isosurface/types.d.ts +2 -1
- package/dist/isosurface/types.js +61 -12
- package/dist/labels.js +11 -8
- package/dist/layout/FullscreenToggle.svelte +11 -2
- package/dist/layout/InfoCard.svelte +38 -6
- package/dist/layout/InfoTag.svelte +63 -32
- package/dist/layout/PropertyFilter.svelte +82 -37
- package/dist/layout/SettingsSection.svelte +85 -55
- package/dist/layout/SubpageGrid.svelte +10 -2
- package/dist/layout/json-tree/JsonNode.svelte +183 -138
- package/dist/layout/json-tree/JsonTree.svelte +499 -413
- package/dist/layout/json-tree/JsonValue.svelte +127 -99
- package/dist/layout/json-tree/utils.js +4 -2
- package/dist/marching-cubes.js +25 -2
- package/dist/math.d.ts +13 -17
- package/dist/math.js +133 -67
- package/dist/overlays/ContextMenu.svelte +65 -40
- package/dist/overlays/DraggablePane.svelte +211 -139
- package/dist/periodic-table/PeriodicTable.svelte +278 -145
- package/dist/periodic-table/PeriodicTableControls.svelte +178 -128
- package/dist/periodic-table/PropertySelect.svelte +25 -7
- package/dist/periodic-table/TableInset.svelte +8 -3
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +446 -309
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramControls.svelte +102 -43
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +63 -40
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +71 -28
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +1 -1
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +158 -101
- package/dist/phase-diagram/TdbInfoPanel.svelte +28 -4
- package/dist/phase-diagram/build-diagram.js +9 -9
- package/dist/phase-diagram/colors.js +1 -3
- package/dist/phase-diagram/parse.js +10 -9
- package/dist/phase-diagram/svg-to-diagram.js +53 -49
- package/dist/phase-diagram/utils.d.ts +1 -0
- package/dist/phase-diagram/utils.js +80 -25
- package/dist/plot/AxisLabel.svelte +28 -3
- package/dist/plot/BarPlot.svelte +1182 -734
- package/dist/plot/BarPlot.svelte.d.ts +2 -2
- package/dist/plot/BarPlotControls.svelte +31 -5
- package/dist/plot/BarPlotControls.svelte.d.ts +1 -1
- package/dist/plot/ColorBar.svelte +479 -329
- package/dist/plot/ColorScaleSelect.svelte +27 -6
- package/dist/plot/ElementScatter.svelte +36 -15
- package/dist/plot/FillArea.svelte +152 -95
- package/dist/plot/Histogram.svelte +934 -571
- package/dist/plot/Histogram.svelte.d.ts +1 -1
- package/dist/plot/HistogramControls.svelte +53 -9
- package/dist/plot/HistogramControls.svelte.d.ts +1 -1
- package/dist/plot/InteractiveAxisLabel.svelte +34 -11
- package/dist/plot/InteractiveAxisLabel.svelte.d.ts +1 -1
- package/dist/plot/Line.svelte +63 -28
- package/dist/plot/PlotControls.svelte +157 -114
- package/dist/plot/PlotControls.svelte.d.ts +1 -1
- package/dist/plot/PlotLegend.svelte +174 -91
- package/dist/plot/PlotTooltip.svelte +45 -6
- package/dist/plot/PortalSelect.svelte +175 -147
- package/dist/plot/ReferenceLine.svelte +76 -22
- package/dist/plot/ReferenceLine3D.svelte +132 -107
- package/dist/plot/ReferencePlane.svelte +146 -121
- package/dist/plot/ScatterPlot.svelte +1681 -1091
- package/dist/plot/ScatterPlot.svelte.d.ts +2 -2
- package/dist/plot/ScatterPlot3D.svelte +256 -131
- package/dist/plot/ScatterPlot3D.svelte.d.ts +2 -2
- package/dist/plot/ScatterPlot3DControls.svelte +113 -63
- package/dist/plot/ScatterPlot3DControls.svelte.d.ts +2 -1
- package/dist/plot/ScatterPlot3DScene.svelte +608 -403
- package/dist/plot/ScatterPlot3DScene.svelte.d.ts +2 -2
- package/dist/plot/ScatterPlotControls.svelte +65 -25
- package/dist/plot/ScatterPlotControls.svelte.d.ts +1 -1
- package/dist/plot/ScatterPoint.svelte +98 -26
- package/dist/plot/ScatterPoint.svelte.d.ts +1 -0
- package/dist/plot/SpacegroupBarPlot.svelte +142 -85
- package/dist/plot/Surface3D.svelte +159 -108
- package/dist/plot/ZeroLines.svelte +55 -3
- package/dist/plot/ZoomRect.svelte +4 -2
- package/dist/plot/axis-utils.js +1 -3
- package/dist/plot/data-cleaning.js +12 -28
- package/dist/plot/data-transform.js +2 -1
- package/dist/plot/fill-utils.js +2 -0
- package/dist/plot/layout.d.ts +4 -1
- package/dist/plot/layout.js +33 -14
- package/dist/plot/reference-line.d.ts +2 -2
- package/dist/plot/reference-line.js +7 -5
- package/dist/plot/scales.js +24 -36
- package/dist/plot/types.d.ts +11 -23
- package/dist/plot/types.js +6 -11
- package/dist/plot/utils/label-placement.d.ts +32 -15
- package/dist/plot/utils/label-placement.js +227 -66
- package/dist/plot/utils/series-visibility.js +2 -3
- package/dist/rdf/RdfPlot.svelte +143 -91
- package/dist/rdf/calc-rdf.js +4 -5
- package/dist/sanitize.d.ts +4 -0
- package/dist/sanitize.js +107 -0
- package/dist/settings.d.ts +18 -6
- package/dist/settings.js +46 -16
- package/dist/spectral/Bands.svelte +632 -453
- package/dist/spectral/BandsAndDos.svelte +90 -49
- package/dist/spectral/BrillouinBandsDos.svelte +151 -93
- package/dist/spectral/Dos.svelte +389 -258
- package/dist/spectral/helpers.js +55 -43
- package/dist/state.svelte.d.ts +1 -1
- package/dist/state.svelte.js +3 -2
- package/dist/structure/Arrow.svelte +59 -20
- package/dist/structure/AtomLegend.svelte +215 -134
- package/dist/structure/Bond.svelte +73 -47
- package/dist/structure/CanvasTooltip.svelte +10 -2
- package/dist/structure/CellSelect.svelte +72 -45
- package/dist/structure/Cylinder.svelte +33 -17
- package/dist/structure/Lattice.svelte +88 -33
- package/dist/structure/Structure.svelte +1063 -797
- package/dist/structure/Structure.svelte.d.ts +1 -1
- package/dist/structure/StructureControls.svelte +349 -118
- package/dist/structure/StructureExportPane.svelte +124 -89
- package/dist/structure/StructureExportPane.svelte.d.ts +1 -1
- package/dist/structure/StructureInfoPane.svelte +304 -237
- package/dist/structure/StructureScene.svelte +879 -443
- package/dist/structure/StructureScene.svelte.d.ts +15 -7
- package/dist/structure/atom-properties.js +8 -8
- package/dist/structure/bonding.js +6 -7
- package/dist/structure/export.js +14 -29
- package/dist/structure/ferrox-wasm.js +1 -1
- package/dist/structure/index.d.ts +13 -3
- package/dist/structure/index.js +83 -23
- package/dist/structure/measure.d.ts +2 -2
- package/dist/structure/measure.js +4 -44
- package/dist/structure/parse.js +113 -141
- package/dist/structure/partial-occupancy.js +7 -10
- package/dist/structure/pbc.d.ts +1 -0
- package/dist/structure/pbc.js +16 -6
- package/dist/structure/supercell.d.ts +2 -2
- package/dist/structure/supercell.js +12 -22
- package/dist/structure/validation.js +1 -2
- package/dist/symmetry/SymmetryStats.svelte +84 -41
- package/dist/symmetry/WyckoffTable.svelte +26 -6
- package/dist/symmetry/cell-transform.js +5 -3
- package/dist/symmetry/index.js +8 -7
- package/dist/symmetry/spacegroups.js +148 -148
- package/dist/table/HeatmapTable.svelte +790 -554
- package/dist/table/HeatmapTable.svelte.d.ts +1 -1
- package/dist/table/ToggleMenu.svelte +125 -92
- package/dist/table/index.js +2 -4
- package/dist/theme/ThemeControl.svelte +21 -12
- package/dist/time.js +4 -1
- package/dist/tooltip/TooltipContent.svelte +33 -8
- package/dist/trajectory/Trajectory.svelte +758 -558
- package/dist/trajectory/TrajectoryError.svelte +14 -3
- package/dist/trajectory/TrajectoryExportPane.svelte +137 -83
- package/dist/trajectory/TrajectoryInfoPane.svelte +272 -143
- package/dist/trajectory/extract.js +10 -26
- package/dist/trajectory/format-detect.js +5 -5
- package/dist/trajectory/frame-reader.d.ts +1 -1
- package/dist/trajectory/frame-reader.js +5 -12
- package/dist/trajectory/helpers.d.ts +0 -1
- package/dist/trajectory/helpers.js +2 -17
- package/dist/trajectory/index.js +14 -12
- package/dist/trajectory/parse/ase.js +5 -4
- package/dist/trajectory/parse/hdf5.js +26 -18
- package/dist/trajectory/parse/index.js +13 -18
- package/dist/trajectory/parse/lammps.js +17 -7
- package/dist/trajectory/parse/vasp.js +5 -2
- package/dist/trajectory/parse/xyz.js +8 -7
- package/dist/trajectory/plotting.js +13 -8
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +13 -0
- package/dist/xrd/XrdPlot.svelte +337 -247
- package/dist/xrd/broadening.js +14 -9
- package/dist/xrd/calc-xrd.js +12 -18
- package/dist/xrd/parse.d.ts +1 -1
- package/dist/xrd/parse.js +17 -17
- package/package.json +99 -103
- package/readme.md +1 -1
- /package/dist/theme/{themes.js → themes.mjs} +0 -0
|
@@ -3,6 +3,6 @@ import type { ConvexHullEntry, HighlightStyle } from './types';
|
|
|
3
3
|
type $$ComponentProps = BaseConvexHullProps<ConvexHullEntry> & Hull3DProps & {
|
|
4
4
|
highlight_style?: HighlightStyle;
|
|
5
5
|
};
|
|
6
|
-
declare const ConvexHull4D: import("svelte").Component<$$ComponentProps, {}, "temperature" | "
|
|
6
|
+
declare const ConvexHull4D: import("svelte").Component<$$ComponentProps, {}, "temperature" | "fullscreen" | "show_hull_faces" | "hull_face_opacity" | "hull_face_color_mode" | "color_mode" | "color_scale" | "show_stable" | "show_unstable" | "show_stable_labels" | "show_unstable_labels" | "max_hull_dist_show_phases" | "max_hull_dist_show_labels" | "info_pane_open" | "legend_pane_open" | "wrapper" | "energy_source_mode" | "stable_entries" | "unstable_entries" | "phase_stats" | "highlighted_entries" | "selected_entry" | "gas_pressures">;
|
|
7
7
|
type ConvexHull4D = ReturnType<typeof ConvexHull4D>;
|
|
8
8
|
export default ConvexHull4D;
|
|
@@ -1,28 +1,119 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { D3InterpolateName } from '../colors'
|
|
3
|
+
import { format_num } from '../labels'
|
|
4
|
+
import DraggablePane from '../overlays/DraggablePane.svelte'
|
|
5
|
+
import { sanitize_html } from '../sanitize'
|
|
6
|
+
import { ColorScaleSelect } from '../plot'
|
|
7
|
+
import type { ComponentProps } from 'svelte'
|
|
8
|
+
import { tooltip } from 'svelte-multiselect'
|
|
9
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
10
|
+
import type {
|
|
11
|
+
ConvexHullControlsType,
|
|
12
|
+
ConvexHullEntry,
|
|
13
|
+
HullFaceColorMode,
|
|
14
|
+
} from './types'
|
|
15
|
+
import { HULL_FACE_COLOR_MODES } from './types'
|
|
16
|
+
|
|
17
|
+
interface CameraState {
|
|
18
|
+
elevation?: number // Elevation angle in degrees (for ternary)
|
|
19
|
+
azimuth?: number // Azimuth angle in degrees (for ternary)
|
|
20
|
+
rotation_x?: number // X rotation in radians (for quaternary)
|
|
21
|
+
rotation_y?: number // Y rotation in radians (for quaternary)
|
|
22
|
+
zoom: number
|
|
23
|
+
center_x: number
|
|
24
|
+
center_y: number
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Face color mode display labels and tooltips
|
|
28
|
+
const FACE_COLOR_MODES: Record<HullFaceColorMode, { label: string; tip: string }> =
|
|
29
|
+
{
|
|
30
|
+
uniform: { label: `Uniform`, tip: `Single uniform color for all faces` },
|
|
31
|
+
formation_energy: {
|
|
10
32
|
label: `Energy`,
|
|
11
33
|
tip: `Color by average formation energy of face vertices`,
|
|
12
|
-
|
|
13
|
-
|
|
34
|
+
},
|
|
35
|
+
dominant_element: {
|
|
14
36
|
label: `Element`,
|
|
15
37
|
tip: `Color by element with highest concentration at face centroid`,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
38
|
+
},
|
|
39
|
+
facet_index: { label: `Index`, tip: `Distinct categorical color per facet` },
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
let {
|
|
43
|
+
color_mode = $bindable(`stability`),
|
|
44
|
+
color_scale = $bindable(`interpolateViridis`),
|
|
45
|
+
show_stable = $bindable(true),
|
|
46
|
+
show_unstable = $bindable(true),
|
|
47
|
+
show_stable_labels = $bindable(true),
|
|
48
|
+
show_unstable_labels = $bindable(false),
|
|
49
|
+
show_hull_faces = undefined,
|
|
50
|
+
on_hull_faces_change,
|
|
51
|
+
hull_face_color = `#0072B2`,
|
|
52
|
+
on_hull_face_color_change,
|
|
53
|
+
hull_face_opacity = $bindable(0.03),
|
|
54
|
+
on_hull_face_opacity_change,
|
|
55
|
+
hull_face_color_mode = `uniform` as HullFaceColorMode,
|
|
56
|
+
on_hull_face_color_mode_change,
|
|
57
|
+
max_hull_dist_show_phases = $bindable(0),
|
|
58
|
+
max_hull_dist_show_labels = $bindable(0.1),
|
|
59
|
+
max_hull_dist_in_data = 0.5,
|
|
60
|
+
energy_source_mode = $bindable(`precomputed`),
|
|
61
|
+
has_precomputed_hull = false,
|
|
62
|
+
can_compute_hull = false,
|
|
63
|
+
has_precomputed_e_form = false,
|
|
64
|
+
can_compute_e_form = false,
|
|
65
|
+
stable_entries,
|
|
66
|
+
unstable_entries,
|
|
67
|
+
camera,
|
|
68
|
+
merged_controls,
|
|
69
|
+
controls_open = $bindable(false),
|
|
70
|
+
toggle_props = {},
|
|
71
|
+
pane_props = {},
|
|
72
|
+
...rest
|
|
73
|
+
}: Omit<HTMLAttributes<HTMLDivElement>, `onclose`> & {
|
|
74
|
+
// Display controls
|
|
75
|
+
color_mode?: `stability` | `energy`
|
|
76
|
+
color_scale?: D3InterpolateName
|
|
77
|
+
show_stable?: boolean
|
|
78
|
+
show_unstable?: boolean
|
|
79
|
+
show_stable_labels?: boolean
|
|
80
|
+
show_unstable_labels?: boolean
|
|
81
|
+
// 3D specific controls
|
|
82
|
+
show_hull_faces?: boolean
|
|
83
|
+
on_hull_faces_change?: (value: boolean) => void
|
|
84
|
+
hull_face_color?: string
|
|
85
|
+
on_hull_face_color_change?: (value: string) => void
|
|
86
|
+
hull_face_opacity?: number
|
|
87
|
+
on_hull_face_opacity_change?: (value: number) => void
|
|
88
|
+
hull_face_color_mode?: HullFaceColorMode
|
|
89
|
+
on_hull_face_color_mode_change?: (value: HullFaceColorMode) => void
|
|
90
|
+
energy_source_mode?: `precomputed` | `on-the-fly` // whether to read formation and above hull distance from entries or compute them on the fly
|
|
91
|
+
has_precomputed_hull?: boolean
|
|
92
|
+
can_compute_hull?: boolean
|
|
93
|
+
has_precomputed_e_form?: boolean
|
|
94
|
+
can_compute_e_form?: boolean
|
|
95
|
+
// Thresholds
|
|
96
|
+
max_hull_dist_show_phases?: number
|
|
97
|
+
max_hull_dist_show_labels?: number
|
|
98
|
+
max_hull_dist_in_data?: number
|
|
99
|
+
// Data for visualization
|
|
100
|
+
stable_entries: ConvexHullEntry[]
|
|
101
|
+
unstable_entries: ConvexHullEntry[]
|
|
102
|
+
// Camera state (optional - only used for 3D/4D diagrams)
|
|
103
|
+
camera?: CameraState
|
|
104
|
+
// Legend configuration
|
|
105
|
+
merged_controls: ConvexHullControlsType
|
|
106
|
+
// Pane state
|
|
107
|
+
controls_open?: boolean
|
|
108
|
+
toggle_props?: ComponentProps<typeof DraggablePane>[`toggle_props`]
|
|
109
|
+
pane_props?: ComponentProps<typeof DraggablePane>[`pane_props`]
|
|
110
|
+
} = $props()
|
|
111
|
+
|
|
112
|
+
// Focus the multiselect input next to the "Color scale" label
|
|
113
|
+
function focus_multiselect(evt: Event): void {
|
|
114
|
+
;(evt.currentTarget as HTMLElement).nextElementSibling
|
|
115
|
+
?.querySelector<HTMLInputElement>(`input`)?.focus()
|
|
116
|
+
}
|
|
26
117
|
</script>
|
|
27
118
|
|
|
28
119
|
<DraggablePane
|
|
@@ -42,7 +133,7 @@ function focus_multiselect(evt) {
|
|
|
42
133
|
{...rest}
|
|
43
134
|
>
|
|
44
135
|
<h4>
|
|
45
|
-
{@html merged_controls.title || `Convex Hull Controls`}
|
|
136
|
+
{@html sanitize_html(merged_controls.title || `Convex Hull Controls`)}
|
|
46
137
|
</h4>
|
|
47
138
|
|
|
48
139
|
<!-- Energy source selection (only if both options are available) -->
|
|
@@ -247,7 +338,7 @@ function focus_multiselect(evt) {
|
|
|
247
338
|
value={hull_face_color}
|
|
248
339
|
oninput={(e) => on_hull_face_color_change?.((e.target as HTMLInputElement).value)}
|
|
249
340
|
{@attach tooltip({ content: `Set hull face color` })}
|
|
250
|
-
style="width: 40px; height:
|
|
341
|
+
style="width: 40px; height: 20px"
|
|
251
342
|
/>
|
|
252
343
|
{/if}
|
|
253
344
|
<input
|
|
@@ -390,9 +481,7 @@ function focus_multiselect(evt) {
|
|
|
390
481
|
border: 1px solid var(--border-color, rgba(0, 0, 0, 0.2));
|
|
391
482
|
}
|
|
392
483
|
.toggle-btn.active, .toggle-btn:hover.active {
|
|
393
|
-
background:
|
|
394
|
-
color: white;
|
|
395
|
-
border-color: var(--accent-color, #1976d2);
|
|
484
|
+
background: light-dark(rgba(25, 118, 210, 0.15), rgba(100, 180, 255, 0.2));
|
|
396
485
|
}
|
|
397
486
|
.legend-items-container {
|
|
398
487
|
display: flex;
|
|
@@ -441,7 +530,6 @@ function focus_multiselect(evt) {
|
|
|
441
530
|
flex-wrap: wrap;
|
|
442
531
|
}
|
|
443
532
|
.face-mode-btn {
|
|
444
|
-
padding: 2px 6px;
|
|
445
533
|
min-width: auto;
|
|
446
534
|
flex: 0 1 auto;
|
|
447
535
|
}
|
|
@@ -453,7 +541,6 @@ function focus_multiselect(evt) {
|
|
|
453
541
|
margin-top: 12px;
|
|
454
542
|
}
|
|
455
543
|
.color-scale-row :global(.multiselect) {
|
|
456
|
-
font-size: 0.85em;
|
|
457
544
|
--sms-min-height: 24px;
|
|
458
545
|
}
|
|
459
546
|
</style>
|
|
@@ -43,6 +43,6 @@ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, `onclose`> & {
|
|
|
43
43
|
toggle_props?: ComponentProps<typeof DraggablePane>[`toggle_props`];
|
|
44
44
|
pane_props?: ComponentProps<typeof DraggablePane>[`pane_props`];
|
|
45
45
|
};
|
|
46
|
-
declare const ConvexHullControls: import("svelte").Component<$$ComponentProps, {}, "
|
|
46
|
+
declare const ConvexHullControls: import("svelte").Component<$$ComponentProps, {}, "controls_open" | "hull_face_opacity" | "color_mode" | "color_scale" | "show_stable" | "show_unstable" | "show_stable_labels" | "show_unstable_labels" | "max_hull_dist_show_phases" | "max_hull_dist_show_labels" | "energy_source_mode">;
|
|
47
47
|
type ConvexHullControls = ReturnType<typeof ConvexHullControls>;
|
|
48
48
|
export default ConvexHullControls;
|
|
@@ -1,6 +1,32 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import DraggablePane from '../overlays/DraggablePane.svelte'
|
|
3
|
+
import type { ComponentProps } from 'svelte'
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
5
|
+
import ConvexHullStats from './ConvexHullStats.svelte'
|
|
6
|
+
import type { ConvexHullEntry, PhaseStats } from './types'
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
phase_stats,
|
|
10
|
+
stable_entries,
|
|
11
|
+
unstable_entries,
|
|
12
|
+
max_hull_dist_show_phases,
|
|
13
|
+
max_hull_dist_show_labels,
|
|
14
|
+
label_threshold,
|
|
15
|
+
pane_open = $bindable(false),
|
|
16
|
+
toggle_props = {},
|
|
17
|
+
pane_props = {},
|
|
18
|
+
...rest
|
|
19
|
+
}: Omit<HTMLAttributes<HTMLDivElement>, `onclose`> & {
|
|
20
|
+
phase_stats: PhaseStats | null
|
|
21
|
+
stable_entries: ConvexHullEntry[]
|
|
22
|
+
unstable_entries: ConvexHullEntry[]
|
|
23
|
+
max_hull_dist_show_phases: number
|
|
24
|
+
max_hull_dist_show_labels: number
|
|
25
|
+
label_threshold: number
|
|
26
|
+
pane_open?: boolean
|
|
27
|
+
toggle_props?: ComponentProps<typeof DraggablePane>[`toggle_props`]
|
|
28
|
+
pane_props?: ComponentProps<typeof DraggablePane>[`pane_props`]
|
|
29
|
+
} = $props()
|
|
4
30
|
</script>
|
|
5
31
|
|
|
6
32
|
<DraggablePane
|