matterviz 0.3.0 → 0.3.2
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/FilePicker.svelte +37 -20
- package/dist/Icon.svelte +2 -2
- package/dist/MillerIndexInput.svelte +60 -0
- package/dist/MillerIndexInput.svelte.d.ts +7 -0
- package/dist/app.css +38 -2
- package/dist/brillouin/BrillouinZone.svelte +20 -62
- package/dist/brillouin/BrillouinZone.svelte.d.ts +1 -1
- package/dist/brillouin/BrillouinZoneExportPane.svelte +12 -20
- package/dist/brillouin/BrillouinZoneScene.svelte +2 -2
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +1 -1
- package/dist/chempot-diagram/ChemPotDiagram.svelte +192 -0
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +13 -0
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +677 -0
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +16 -0
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +2688 -0
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +16 -0
- package/dist/chempot-diagram/ChemPotScene3D.svelte +8 -0
- package/dist/chempot-diagram/ChemPotScene3D.svelte.d.ts +7 -0
- package/dist/chempot-diagram/color.d.ts +10 -0
- package/dist/chempot-diagram/color.js +33 -0
- package/dist/chempot-diagram/compute.d.ts +38 -0
- package/dist/chempot-diagram/compute.js +650 -0
- package/dist/chempot-diagram/index.d.ts +5 -0
- package/dist/chempot-diagram/index.js +5 -0
- package/dist/chempot-diagram/pointer.d.ts +16 -0
- package/dist/chempot-diagram/pointer.js +40 -0
- package/dist/chempot-diagram/temperature.d.ts +15 -0
- package/dist/chempot-diagram/temperature.js +37 -0
- package/dist/chempot-diagram/types.d.ts +83 -0
- package/dist/chempot-diagram/types.js +27 -0
- package/dist/colors/index.d.ts +3 -1
- package/dist/colors/index.js +4 -0
- package/dist/composition/BarChart.svelte +13 -22
- package/dist/composition/BubbleChart.svelte +5 -3
- package/dist/composition/FormulaFilter.svelte +770 -90
- package/dist/composition/FormulaFilter.svelte.d.ts +37 -1
- package/dist/composition/PieChart.svelte +43 -18
- package/dist/composition/PieChart.svelte.d.ts +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -0
- package/dist/convex-hull/ConvexHull.svelte +14 -1
- package/dist/convex-hull/ConvexHull.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull2D.svelte +14 -45
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull3D.svelte +396 -134
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHull4D.svelte +93 -42
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +1 -1
- package/dist/convex-hull/ConvexHullControls.svelte +94 -31
- package/dist/convex-hull/ConvexHullControls.svelte.d.ts +4 -2
- package/dist/convex-hull/ConvexHullStats.svelte +697 -128
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +6 -1
- package/dist/convex-hull/ConvexHullTooltip.svelte +1 -0
- package/dist/convex-hull/GasPressureControls.svelte +72 -38
- package/dist/convex-hull/GasPressureControls.svelte.d.ts +2 -1
- package/dist/convex-hull/TemperatureSlider.svelte +46 -19
- package/dist/convex-hull/TemperatureSlider.svelte.d.ts +2 -1
- package/dist/convex-hull/demo-temperature.d.ts +6 -0
- package/dist/convex-hull/demo-temperature.js +36 -0
- package/dist/convex-hull/gas-thermodynamics.js +16 -5
- package/dist/convex-hull/helpers.d.ts +7 -1
- package/dist/convex-hull/helpers.js +45 -15
- package/dist/convex-hull/index.d.ts +15 -1
- package/dist/convex-hull/index.js +1 -0
- package/dist/convex-hull/thermodynamics.d.ts +8 -21
- package/dist/convex-hull/thermodynamics.js +106 -17
- package/dist/convex-hull/types.d.ts +7 -0
- package/dist/convex-hull/types.js +11 -0
- package/dist/coordination/CoordinationBarPlot.svelte +29 -46
- package/dist/element/BohrAtom.svelte +1 -1
- package/dist/element/data.js +2 -14
- package/dist/element/data.json.gz +0 -0
- package/dist/element/index.d.ts +1 -1
- package/dist/element/index.js +1 -0
- package/dist/element/types.d.ts +1 -0
- package/dist/fermi-surface/FermiSurface.svelte +21 -65
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte +1 -1
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +1 -1
- package/dist/fermi-surface/compute.js +1 -21
- package/dist/fermi-surface/marching-cubes.d.ts +2 -13
- package/dist/fermi-surface/marching-cubes.js +2 -519
- package/dist/fermi-surface/parse.js +17 -23
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +1273 -0
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +110 -0
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +171 -0
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +31 -0
- package/dist/heatmap-matrix/index.d.ts +53 -0
- package/dist/heatmap-matrix/index.js +100 -0
- package/dist/heatmap-matrix/shared.d.ts +2 -0
- package/dist/heatmap-matrix/shared.js +4 -0
- package/dist/icons.d.ts +119 -0
- package/dist/icons.js +119 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -1
- package/dist/io/export.js +15 -3
- package/dist/io/file-drop.d.ts +7 -0
- package/dist/io/file-drop.js +43 -0
- package/dist/io/index.d.ts +2 -2
- package/dist/io/index.js +2 -112
- package/dist/io/types.d.ts +1 -0
- package/dist/io/url-drop.d.ts +2 -0
- package/dist/io/url-drop.js +118 -0
- package/dist/isosurface/Isosurface.svelte +231 -0
- package/dist/isosurface/Isosurface.svelte.d.ts +8 -0
- package/dist/isosurface/IsosurfaceControls.svelte +273 -0
- package/dist/isosurface/IsosurfaceControls.svelte.d.ts +9 -0
- package/dist/isosurface/index.d.ts +5 -0
- package/dist/isosurface/index.js +6 -0
- package/dist/isosurface/parse.d.ts +6 -0
- package/dist/isosurface/parse.js +548 -0
- package/dist/isosurface/slice.d.ts +11 -0
- package/dist/isosurface/slice.js +145 -0
- package/dist/isosurface/types.d.ts +55 -0
- package/dist/isosurface/types.js +178 -0
- package/dist/labels.d.ts +2 -1
- package/dist/labels.js +1 -0
- package/dist/layout/InfoTag.svelte +62 -62
- package/dist/layout/SubpageGrid.svelte +74 -0
- package/dist/layout/SubpageGrid.svelte.d.ts +14 -0
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.js +1 -0
- package/dist/layout/json-tree/JsonNode.svelte +226 -53
- package/dist/layout/json-tree/JsonTree.svelte +425 -51
- package/dist/layout/json-tree/JsonTree.svelte.d.ts +1 -1
- package/dist/layout/json-tree/JsonValue.svelte +218 -97
- package/dist/layout/json-tree/types.d.ts +27 -2
- package/dist/layout/json-tree/utils.d.ts +14 -1
- package/dist/layout/json-tree/utils.js +254 -0
- package/dist/marching-cubes.d.ts +14 -0
- package/dist/marching-cubes.js +519 -0
- package/dist/math.d.ts +8 -0
- package/dist/math.js +374 -7
- package/dist/overlays/ContextMenu.svelte +3 -2
- package/dist/overlays/DraggablePane.svelte +163 -58
- package/dist/overlays/DraggablePane.svelte.d.ts +2 -0
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +232 -77
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +6 -2
- package/dist/phase-diagram/PhaseDiagramControls.svelte +32 -11
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +3 -2
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +103 -0
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +15 -0
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +102 -95
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +7 -0
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +100 -26
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte.d.ts +6 -3
- package/dist/phase-diagram/index.d.ts +2 -0
- package/dist/phase-diagram/index.js +2 -0
- package/dist/phase-diagram/svg-to-diagram.d.ts +2 -0
- package/dist/phase-diagram/svg-to-diagram.js +865 -0
- package/dist/phase-diagram/types.d.ts +10 -0
- package/dist/phase-diagram/utils.d.ts +7 -4
- package/dist/phase-diagram/utils.js +149 -59
- package/dist/plot/AxisLabel.svelte +26 -0
- package/dist/plot/AxisLabel.svelte.d.ts +16 -0
- package/dist/plot/BarPlot.svelte +473 -228
- package/dist/plot/BarPlot.svelte.d.ts +3 -3
- package/dist/plot/BarPlotControls.svelte +3 -2
- package/dist/plot/BarPlotControls.svelte.d.ts +1 -1
- package/dist/plot/ColorBar.svelte +54 -54
- package/dist/plot/ColorBar.svelte.d.ts +1 -1
- package/dist/plot/ElementScatter.svelte +4 -3
- package/dist/plot/FillArea.svelte +4 -1
- package/dist/plot/Histogram.svelte +320 -230
- package/dist/plot/Histogram.svelte.d.ts +2 -2
- package/dist/plot/HistogramControls.svelte +29 -10
- package/dist/plot/HistogramControls.svelte.d.ts +6 -2
- package/dist/plot/InteractiveAxisLabel.svelte.d.ts +2 -2
- package/dist/plot/PlotControls.svelte +109 -27
- package/dist/plot/PlotControls.svelte.d.ts +1 -1
- package/dist/plot/PlotLegend.svelte +1 -1
- package/dist/plot/PortalSelect.svelte +2 -1
- package/dist/plot/ReferenceLine.svelte +2 -1
- package/dist/plot/ReferenceLine.svelte.d.ts +1 -0
- package/dist/plot/ReferencePlane.svelte +1 -3
- package/dist/plot/ScatterPlot.svelte +343 -209
- package/dist/plot/ScatterPlot.svelte.d.ts +3 -3
- package/dist/plot/ScatterPlot3D.svelte.d.ts +2 -2
- package/dist/plot/ScatterPlot3DControls.svelte +203 -250
- package/dist/plot/ScatterPlot3DScene.svelte +4 -7
- package/dist/plot/ScatterPlot3DScene.svelte.d.ts +2 -2
- package/dist/plot/ScatterPlotControls.svelte +95 -55
- package/dist/plot/ScatterPlotControls.svelte.d.ts +1 -1
- package/dist/plot/ZeroLines.svelte +44 -0
- package/dist/plot/ZeroLines.svelte.d.ts +32 -0
- package/dist/plot/ZoomRect.svelte +21 -0
- package/dist/plot/ZoomRect.svelte.d.ts +8 -0
- package/dist/plot/axis-utils.d.ts +1 -1
- package/dist/plot/data-cleaning.js +1 -5
- package/dist/plot/index.d.ts +6 -2
- package/dist/plot/index.js +6 -2
- package/dist/plot/interactions.d.ts +8 -10
- package/dist/plot/interactions.js +10 -19
- package/dist/plot/layout.d.ts +7 -1
- package/dist/plot/layout.js +12 -4
- package/dist/plot/reference-line.d.ts +4 -21
- package/dist/plot/reference-line.js +7 -81
- package/dist/plot/types.d.ts +42 -17
- package/dist/plot/types.js +10 -0
- package/dist/plot/utils/label-placement.js +14 -11
- package/dist/plot/utils.d.ts +1 -0
- package/dist/plot/utils.js +14 -0
- package/dist/rdf/RdfPlot.svelte +55 -66
- package/dist/rdf/RdfPlot.svelte.d.ts +1 -1
- package/dist/rdf/index.d.ts +1 -1
- package/dist/rdf/index.js +1 -1
- package/dist/settings.d.ts +5 -0
- package/dist/settings.js +37 -3
- package/dist/spectral/Bands.svelte +515 -143
- package/dist/spectral/Bands.svelte.d.ts +22 -2
- package/dist/spectral/helpers.d.ts +23 -1
- package/dist/spectral/helpers.js +65 -9
- package/dist/spectral/types.d.ts +2 -0
- package/dist/structure/AtomLegend.svelte +31 -10
- package/dist/structure/AtomLegend.svelte.d.ts +1 -1
- package/dist/structure/CellSelect.svelte +92 -22
- package/dist/structure/Lattice.svelte +2 -0
- package/dist/structure/Structure.svelte +716 -173
- package/dist/structure/Structure.svelte.d.ts +7 -2
- package/dist/structure/StructureControls.svelte +26 -14
- package/dist/structure/StructureControls.svelte.d.ts +5 -1
- package/dist/structure/StructureInfoPane.svelte +7 -1
- package/dist/structure/StructureScene.svelte +386 -95
- package/dist/structure/StructureScene.svelte.d.ts +15 -4
- package/dist/structure/atom-properties.d.ts +6 -2
- package/dist/structure/atom-properties.js +38 -25
- package/dist/structure/export.js +10 -7
- package/dist/structure/ferrox-wasm-types.d.ts +3 -2
- package/dist/structure/ferrox-wasm-types.js +0 -3
- package/dist/structure/ferrox-wasm.d.ts +3 -2
- package/dist/structure/ferrox-wasm.js +1 -2
- package/dist/structure/index.d.ts +7 -0
- package/dist/structure/index.js +22 -0
- package/dist/structure/parse.js +19 -16
- package/dist/structure/partial-occupancy.d.ts +25 -0
- package/dist/structure/partial-occupancy.js +102 -0
- package/dist/structure/validation.js +6 -3
- package/dist/symmetry/SymmetryStats.svelte +18 -4
- package/dist/symmetry/WyckoffTable.svelte +18 -10
- package/dist/symmetry/index.d.ts +7 -4
- package/dist/symmetry/index.js +83 -18
- package/dist/table/HeatmapTable.svelte +468 -69
- package/dist/table/HeatmapTable.svelte.d.ts +13 -1
- package/dist/table/ToggleMenu.svelte +291 -44
- package/dist/table/ToggleMenu.svelte.d.ts +4 -1
- package/dist/table/index.d.ts +3 -0
- package/dist/tooltip/index.d.ts +1 -1
- package/dist/tooltip/index.js +1 -0
- package/dist/trajectory/Trajectory.svelte +147 -145
- package/dist/trajectory/TrajectoryExportPane.svelte +13 -9
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +1 -1
- package/dist/trajectory/constants.d.ts +6 -0
- package/dist/trajectory/constants.js +7 -0
- package/dist/trajectory/extract.js +3 -5
- package/dist/trajectory/format-detect.d.ts +9 -0
- package/dist/trajectory/format-detect.js +76 -0
- package/dist/trajectory/frame-reader.d.ts +17 -0
- package/dist/trajectory/frame-reader.js +339 -0
- package/dist/trajectory/helpers.d.ts +15 -0
- package/dist/trajectory/helpers.js +187 -0
- package/dist/trajectory/index.d.ts +1 -0
- package/dist/trajectory/index.js +11 -4
- package/dist/trajectory/parse/ase.d.ts +2 -0
- package/dist/trajectory/parse/ase.js +76 -0
- package/dist/trajectory/parse/hdf5.d.ts +2 -0
- package/dist/trajectory/parse/hdf5.js +121 -0
- package/dist/trajectory/parse/index.d.ts +12 -0
- package/dist/trajectory/parse/index.js +304 -0
- package/dist/trajectory/parse/lammps.d.ts +5 -0
- package/dist/trajectory/parse/lammps.js +169 -0
- package/dist/trajectory/parse/vasp.d.ts +2 -0
- package/dist/trajectory/parse/vasp.js +65 -0
- package/dist/trajectory/parse/xyz.d.ts +2 -0
- package/dist/trajectory/parse/xyz.js +109 -0
- package/dist/trajectory/types.d.ts +11 -0
- package/dist/trajectory/types.js +1 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +4 -0
- package/dist/xrd/XrdPlot.svelte +6 -4
- package/dist/xrd/calc-xrd.js +0 -1
- package/package.json +33 -23
- package/readme.md +4 -4
- package/dist/trajectory/parse.d.ts +0 -42
- package/dist/trajectory/parse.js +0 -1267
- /package/dist/element/{data.json.d.ts → data.json.gz.d.ts} +0 -0
|
@@ -54,12 +54,12 @@ declare function $$render<Metadata extends Record<string, unknown> = Record<stri
|
|
|
54
54
|
on_ref_line_click?: (event: RefLineEvent) => void;
|
|
55
55
|
on_ref_line_hover?: (event: RefLineEvent | null) => void;
|
|
56
56
|
data_loader?: DataLoaderFn<Metadata, BarSeries<Metadata>>;
|
|
57
|
-
on_axis_change?: (axis: `x` | `y` | `y2`, key: string, new_series: BarSeries<Metadata>[]) => void;
|
|
57
|
+
on_axis_change?: (axis: `x` | `x2` | `y` | `y2`, key: string, new_series: BarSeries<Metadata>[]) => void;
|
|
58
58
|
on_error?: (error: AxisLoadError) => void;
|
|
59
59
|
pan?: PanConfig;
|
|
60
60
|
};
|
|
61
61
|
exports: {};
|
|
62
|
-
bindings: "display" | "mode" | "orientation" | "
|
|
62
|
+
bindings: "display" | "mode" | "orientation" | "series" | "show_controls" | "controls_open" | "x_axis" | "x2_axis" | "y_axis" | "y2_axis" | "fullscreen" | "hovered" | "ref_lines";
|
|
63
63
|
slots: {};
|
|
64
64
|
events: {};
|
|
65
65
|
};
|
|
@@ -67,7 +67,7 @@ declare class __sveltets_Render<Metadata extends Record<string, unknown> = Recor
|
|
|
67
67
|
props(): ReturnType<typeof $$render<Metadata>>['props'];
|
|
68
68
|
events(): ReturnType<typeof $$render<Metadata>>['events'];
|
|
69
69
|
slots(): ReturnType<typeof $$render<Metadata>>['slots'];
|
|
70
|
-
bindings(): "display" | "mode" | "orientation" | "
|
|
70
|
+
bindings(): "display" | "mode" | "orientation" | "series" | "show_controls" | "controls_open" | "x_axis" | "x2_axis" | "y_axis" | "y2_axis" | "fullscreen" | "hovered" | "ref_lines";
|
|
71
71
|
exports(): {};
|
|
72
72
|
}
|
|
73
73
|
interface $$IsomorphicComponent {
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
import { PlotControls } from './';
|
|
3
3
|
// Unique ID prefix to avoid conflicts when multiple instances on same page
|
|
4
4
|
const uid = crypto.randomUUID().slice(0, 8);
|
|
5
|
-
let { orientation = $bindable(`vertical`), mode = $bindable(`overlay`), x_axis = $bindable({}), y_axis = $bindable({}), y2_axis = $bindable({}), display = $bindable({}), show_controls = $bindable(false), controls_open = $bindable(false), children, ...rest } = $props();
|
|
5
|
+
let { orientation = $bindable(`vertical`), mode = $bindable(`overlay`), x_axis = $bindable({}), x2_axis = $bindable({}), y_axis = $bindable({}), y2_axis = $bindable({}), display = $bindable({}), show_controls = $bindable(false), controls_open = $bindable(false), children, ...rest } = $props();
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<PlotControls
|
|
9
9
|
bind:show_controls
|
|
10
10
|
bind:controls_open
|
|
11
11
|
bind:x_axis
|
|
12
|
+
bind:x2_axis
|
|
12
13
|
bind:y_axis
|
|
13
14
|
bind:y2_axis
|
|
14
15
|
bind:display
|
|
15
16
|
{...rest}
|
|
16
17
|
>
|
|
17
|
-
{@render children?.({ orientation, mode, x_axis, y_axis, y2_axis, display })}
|
|
18
|
+
{@render children?.({ orientation, mode, x_axis, x2_axis, y_axis, y2_axis, display })}
|
|
18
19
|
<SettingsSection
|
|
19
20
|
title="Layout"
|
|
20
21
|
current_values={{ orientation, mode }}
|
|
@@ -13,6 +13,6 @@ type $$ComponentProps = Omit<PlotControlsProps, `children` | `post_children`> &
|
|
|
13
13
|
} & Required<PlotConfig>
|
|
14
14
|
]>;
|
|
15
15
|
};
|
|
16
|
-
declare const BarPlotControls: import("svelte").Component<$$ComponentProps, {}, "display" | "mode" | "orientation" | "show_controls" | "controls_open" | "x_axis" | "y_axis" | "y2_axis">;
|
|
16
|
+
declare const BarPlotControls: import("svelte").Component<$$ComponentProps, {}, "display" | "mode" | "orientation" | "show_controls" | "controls_open" | "x_axis" | "x2_axis" | "y_axis" | "y2_axis">;
|
|
17
17
|
type BarPlotControls = ReturnType<typeof BarPlotControls>;
|
|
18
18
|
export default BarPlotControls;
|
|
@@ -503,40 +503,40 @@ let div_style = $derived(`
|
|
|
503
503
|
background: var(--cbar-tick-label-bg);
|
|
504
504
|
padding: var(--cbar-tick-label-padding, 0 2px);
|
|
505
505
|
white-space: nowrap;
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
506
|
+
/* --- Horizontal Ticks --- */
|
|
507
|
+
&.horizontal {
|
|
508
|
+
transform: translateX(-50%); /* Center horizontally by default */
|
|
509
|
+
&.tick-primary {
|
|
510
|
+
top: 100%; /* Position below bar */
|
|
511
|
+
margin-top: var(--cbar-tick-offset, 0);
|
|
512
|
+
}
|
|
513
|
+
&.tick-secondary {
|
|
514
|
+
bottom: 100%; /* Position above bar */
|
|
515
|
+
margin-bottom: var(--cbar-tick-offset, 0);
|
|
516
|
+
}
|
|
517
|
+
&.tick-inside {
|
|
518
|
+
top: 50%; /* Center vertically */
|
|
519
|
+
transform: translate(-50%, -50%); /* Center horizontally and vertically */
|
|
520
|
+
margin: 0; /* No extra margin for inside */
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
/* --- Vertical Ticks --- */
|
|
524
|
+
&.vertical {
|
|
525
|
+
transform: translateY(-50%); /* Center vertically by default */
|
|
526
|
+
&.tick-primary {
|
|
527
|
+
left: 100%; /* Position right of bar */
|
|
528
|
+
margin-left: var(--cbar-tick-offset, 1pt);
|
|
529
|
+
}
|
|
530
|
+
&.tick-secondary {
|
|
531
|
+
right: 100%; /* Position left of bar */
|
|
532
|
+
margin-right: var(--cbar-tick-offset, 1pt);
|
|
533
|
+
}
|
|
534
|
+
&.tick-inside {
|
|
535
|
+
left: 50%; /* Center horizontally */
|
|
536
|
+
transform: translate(-50%, -50%); /* Center horizontally and vertically */
|
|
537
|
+
padding: 0; /* No extra padding for inside */
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
540
|
}
|
|
541
541
|
/* Title row with optional selects */
|
|
542
542
|
.title-row {
|
|
@@ -545,25 +545,25 @@ let div_style = $derived(`
|
|
|
545
545
|
gap: var(--cbar-select-gap, 0.3em);
|
|
546
546
|
white-space: nowrap;
|
|
547
547
|
width: auto;
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
548
|
+
&:is(.left, .right) {
|
|
549
|
+
flex-direction: column;
|
|
550
|
+
}
|
|
551
|
+
/* Rotate only the label element, not the entire row (keeps selects usable) */
|
|
552
|
+
/* Only rotate when orientation is vertical AND title is on left/right side */
|
|
553
|
+
&.vertical:is(.left, .right) .label {
|
|
554
|
+
writing-mode: vertical-lr;
|
|
555
|
+
white-space: nowrap;
|
|
556
|
+
}
|
|
557
|
+
&.vertical.left .label {
|
|
558
|
+
transform: rotate(180deg);
|
|
559
|
+
}
|
|
560
|
+
/* Style PortalSelect triggers in colorbar context */
|
|
561
|
+
:global(:is(.property-select, .color-scale-select)) {
|
|
562
|
+
padding: 0 4px;
|
|
563
|
+
}
|
|
564
|
+
&.loading :global(.property-select) {
|
|
565
|
+
opacity: 0.6;
|
|
566
|
+
pointer-events: none;
|
|
567
|
+
}
|
|
568
568
|
}
|
|
569
569
|
</style>
|
|
@@ -26,6 +26,6 @@ type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
26
26
|
selected_color_scale_key?: string;
|
|
27
27
|
on_color_scale_change?: (key: string) => void;
|
|
28
28
|
};
|
|
29
|
-
declare const ColorBar: import("svelte").Component<$$ComponentProps, {}, "title" | "
|
|
29
|
+
declare const ColorBar: import("svelte").Component<$$ComponentProps, {}, "title" | "range" | "color_scale" | "tick_labels" | "nice_range" | "selected_property_key" | "selected_color_scale_key">;
|
|
30
30
|
type ColorBar = ReturnType<typeof ColorBar>;
|
|
31
31
|
export default ColorBar;
|
|
@@ -22,7 +22,7 @@ $effect.pre(() => {
|
|
|
22
22
|
x: [...Array(y.length + 1).keys()].slice(1),
|
|
23
23
|
y,
|
|
24
24
|
color_values: y,
|
|
25
|
-
point_style: { radius:
|
|
25
|
+
point_style: { radius: 2 },
|
|
26
26
|
},
|
|
27
27
|
]}
|
|
28
28
|
bind:tooltip_point
|
|
@@ -35,7 +35,8 @@ $effect.pre(() => {
|
|
|
35
35
|
{...rest}
|
|
36
36
|
>
|
|
37
37
|
{#snippet tooltip({ x, y })}
|
|
38
|
-
|
|
39
|
-
{
|
|
38
|
+
{@const elem = element_data[x - 1]}
|
|
39
|
+
<strong>{elem ? `${x} ${elem.symbol} - ${elem.name}` : `Element ${x}`}</strong><br />
|
|
40
|
+
{@html y_axis.label || `Value`}: {format_num(y, y_axis.format ?? `~s`)}{y_unit ?? ``}
|
|
40
41
|
{/snippet}
|
|
41
42
|
</ScatterPlot>
|
|
@@ -52,6 +52,8 @@ function handle_keydown(event) {
|
|
|
52
52
|
return;
|
|
53
53
|
// For keyboard activation, use center of element or default coordinates
|
|
54
54
|
const target = event.currentTarget;
|
|
55
|
+
if (!(target instanceof SVGElement))
|
|
56
|
+
return;
|
|
55
57
|
const rect = target.ownerSVGElement?.getBoundingClientRect();
|
|
56
58
|
const element_rect = target.getBoundingClientRect();
|
|
57
59
|
// Use center of the fill region element
|
|
@@ -79,7 +81,8 @@ function handle_keydown(event) {
|
|
|
79
81
|
}
|
|
80
82
|
// Construct FillHandlerEvent from MouseEvent
|
|
81
83
|
function construct_event(event) {
|
|
82
|
-
const
|
|
84
|
+
const current = event.currentTarget;
|
|
85
|
+
const rect = (current instanceof SVGElement ? current.ownerSVGElement : null)
|
|
83
86
|
?.getBoundingClientRect();
|
|
84
87
|
const px = event.clientX - (rect?.left ?? 0);
|
|
85
88
|
const py = event.clientY - (rect?.top ?? 0);
|