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
|
@@ -1,42 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { DataSeries,
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
show_controls?: boolean;
|
|
6
|
-
controls_open?: boolean;
|
|
7
|
-
plot_controls?: Snippet<[]>;
|
|
1
|
+
import type { AxisConfig, ControlsConfig } from './';
|
|
2
|
+
import type { DataSeries, DisplayConfig, PlotControlsProps, StyleOverrides } from './types';
|
|
3
|
+
type $$ComponentProps = Omit<PlotControlsProps, `children` | `post_children`> & {
|
|
8
4
|
series?: readonly DataSeries[];
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
x_range?: [number | null, number | null];
|
|
16
|
-
y_range?: [number | null, number | null];
|
|
17
|
-
y2_range?: [number | null, number | null];
|
|
18
|
-
auto_x_range?: [number, number];
|
|
19
|
-
auto_y_range?: [number, number];
|
|
20
|
-
auto_y2_range?: [number, number];
|
|
21
|
-
x_format?: string;
|
|
22
|
-
y_format?: string;
|
|
23
|
-
y2_format?: string;
|
|
24
|
-
point_size?: number;
|
|
25
|
-
point_color?: string;
|
|
26
|
-
point_opacity?: number;
|
|
27
|
-
point_stroke_width?: number;
|
|
28
|
-
point_stroke_color?: string;
|
|
29
|
-
point_stroke_opacity?: number;
|
|
30
|
-
line_width?: number;
|
|
31
|
-
line_color?: string;
|
|
32
|
-
line_opacity?: number;
|
|
33
|
-
line_dash?: string;
|
|
34
|
-
show_points?: boolean;
|
|
35
|
-
show_lines?: boolean;
|
|
5
|
+
x_axis?: AxisConfig;
|
|
6
|
+
y_axis?: AxisConfig;
|
|
7
|
+
y2_axis?: AxisConfig;
|
|
8
|
+
display?: DisplayConfig;
|
|
9
|
+
styles?: StyleOverrides;
|
|
10
|
+
controls?: ControlsConfig;
|
|
36
11
|
selected_series_idx?: number;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
declare const ScatterPlotControls: import("svelte").Component<Props, {}, "show_controls" | "show_zero_lines" | "x_grid" | "y_grid" | "y2_grid" | "x_format" | "y_format" | "y2_format" | "point_size" | "markers" | "point_color" | "point_opacity" | "point_stroke_width" | "point_stroke_color" | "point_stroke_opacity" | "line_width" | "line_color" | "line_opacity" | "line_dash" | "show_points" | "show_lines" | "controls_open" | "selected_series_idx" | "x_range" | "y_range" | "y2_range">;
|
|
12
|
+
};
|
|
13
|
+
declare const ScatterPlotControls: import("svelte").Component<$$ComponentProps, {}, "display" | "controls" | "y_axis" | "y2_axis" | "x_axis" | "styles" | "selected_series_idx">;
|
|
41
14
|
type ScatterPlotControls = ReturnType<typeof ScatterPlotControls>;
|
|
42
15
|
export default ScatterPlotControls;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { HoverStyle, LabelStyle, Point
|
|
1
|
+
import type { HoverStyle, LabelStyle, Point } from './';
|
|
2
|
+
import type { PointStyle, TweenedOptions, XyObj } from './types';
|
|
2
3
|
import type { SVGAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
interface Props extends Omit<SVGAttributes<SVGGElement>, `style` | `offset` | `origin` | `transform`> {
|
|
4
|
+
type $$ComponentProps = Omit<SVGAttributes<SVGGElement>, `style` | `offset` | `origin` | `transform`> & {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
7
7
|
style?: PointStyle;
|
|
@@ -11,7 +11,7 @@ interface Props extends Omit<SVGAttributes<SVGGElement>, `style` | `offset` | `o
|
|
|
11
11
|
point_tween?: TweenedOptions<XyObj>;
|
|
12
12
|
origin?: XyObj;
|
|
13
13
|
is_hovered?: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare const ScatterPoint: import("svelte").Component
|
|
14
|
+
};
|
|
15
|
+
declare const ScatterPoint: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
16
16
|
type ScatterPoint = ReturnType<typeof ScatterPoint>;
|
|
17
17
|
export default ScatterPoint;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
<script lang="ts">import { format_num } from '..';
|
|
2
|
+
import { format_value } from '../labels';
|
|
3
|
+
import { BarPlot } from './';
|
|
4
|
+
import { CRYSTAL_SYSTEM_COLORS, CRYSTAL_SYSTEM_RANGES, CRYSTAL_SYSTEMS, } from '../symmetry';
|
|
5
|
+
import { normalize_spacegroup, SPACEGROUP_NUM_TO_SYMBOL, spacegroup_to_crystal_system, } from '../symmetry/spacegroups';
|
|
6
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
7
|
+
const MAX_SPACEGROUP = 230;
|
|
8
|
+
let { data, show_counts = true, orientation = `vertical`, x_axis = {}, y_axis = {}, ...rest } = $props();
|
|
9
|
+
// Normalize input data to space group numbers
|
|
10
|
+
const normalized_data = $derived(data.map((sg) => normalize_spacegroup(sg)).filter((sg) => sg !== null));
|
|
11
|
+
// Compute histogram of space group numbers
|
|
12
|
+
const histogram = $derived.by(() => {
|
|
13
|
+
const hist = new SvelteMap();
|
|
14
|
+
// Count occurrences
|
|
15
|
+
for (const sg of normalized_data) {
|
|
16
|
+
hist.set(sg, (hist.get(sg) ?? 0) + 1);
|
|
17
|
+
}
|
|
18
|
+
return hist;
|
|
19
|
+
});
|
|
20
|
+
// Group counts by crystal system
|
|
21
|
+
const crystal_system_stats = $derived.by(() => {
|
|
22
|
+
const stats = new SvelteMap();
|
|
23
|
+
for (const system of CRYSTAL_SYSTEMS) {
|
|
24
|
+
stats.set(system, { count: 0, spacegroups: [] });
|
|
25
|
+
}
|
|
26
|
+
for (const [sg, count] of histogram) {
|
|
27
|
+
const system = spacegroup_to_crystal_system(sg);
|
|
28
|
+
if (system) {
|
|
29
|
+
const stat = stats.get(system);
|
|
30
|
+
stat.count += count;
|
|
31
|
+
stat.spacegroups.push(sg);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return stats;
|
|
35
|
+
});
|
|
36
|
+
// Create sorted list of space groups for x-axis
|
|
37
|
+
const sorted_spacegroups = $derived(Array.from(histogram.keys()).sort((a, b) => a - b));
|
|
38
|
+
// Smart tick selection: thin out ticks for dense data
|
|
39
|
+
const x_axis_ticks = $derived.by(() => {
|
|
40
|
+
const non_zero_count = sorted_spacegroups.filter((sg) => (histogram.get(sg) ?? 0) > 0).length;
|
|
41
|
+
// If data is dense (>40 space groups with data), show only multiples of 5
|
|
42
|
+
return non_zero_count > 40
|
|
43
|
+
? sorted_spacegroups.filter((sg) => sg % 5 === 0)
|
|
44
|
+
: sorted_spacegroups;
|
|
45
|
+
});
|
|
46
|
+
// Build BarSeries - one series per crystal system for proper coloring
|
|
47
|
+
const bar_series = $derived.by(() => {
|
|
48
|
+
const series_by_system = new SvelteMap();
|
|
49
|
+
// Group data by crystal system
|
|
50
|
+
for (const sg of sorted_spacegroups) {
|
|
51
|
+
const system = spacegroup_to_crystal_system(sg);
|
|
52
|
+
if (system) {
|
|
53
|
+
let series = series_by_system.get(system);
|
|
54
|
+
if (!series) {
|
|
55
|
+
series = { x: [], y: [] };
|
|
56
|
+
series_by_system.set(system, series);
|
|
57
|
+
}
|
|
58
|
+
series.x.push(sg);
|
|
59
|
+
series.y.push(histogram.get(sg) ?? 0);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Convert to BarSeries array, maintaining order of crystal systems
|
|
63
|
+
const result = [];
|
|
64
|
+
for (const system of CRYSTAL_SYSTEMS) {
|
|
65
|
+
const data = series_by_system.get(system);
|
|
66
|
+
if (data) {
|
|
67
|
+
const { x, y } = data;
|
|
68
|
+
const color = CRYSTAL_SYSTEM_COLORS[system];
|
|
69
|
+
result.push({ x, y, color, label: system, bar_width: 0.9, visible: true });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
});
|
|
74
|
+
// Always show full space group range (1-230)
|
|
75
|
+
const x_range = [0.5, MAX_SPACEGROUP + 0.5];
|
|
76
|
+
// Calculate crystal system region boundaries using full theoretical ranges
|
|
77
|
+
const crystal_system_regions = $derived.by(() => {
|
|
78
|
+
const [range_min, range_max] = x_range;
|
|
79
|
+
return CRYSTAL_SYSTEMS.map((system) => {
|
|
80
|
+
const [sg_min, sg_max] = CRYSTAL_SYSTEM_RANGES[system];
|
|
81
|
+
const stats = crystal_system_stats.get(system);
|
|
82
|
+
return {
|
|
83
|
+
system,
|
|
84
|
+
sg_start: sg_min,
|
|
85
|
+
sg_end: sg_max,
|
|
86
|
+
count: stats?.count ?? 0,
|
|
87
|
+
color: CRYSTAL_SYSTEM_COLORS[system],
|
|
88
|
+
};
|
|
89
|
+
}).filter((region) => region.sg_end >= range_min && region.sg_start <= range_max);
|
|
90
|
+
});
|
|
91
|
+
const total_count = $derived(normalized_data.length);
|
|
92
|
+
// Build axis configurations based on orientation
|
|
93
|
+
const x_axis_config = $derived(orientation === `horizontal` ? { ...x_axis, label: x_axis.label ?? `Counts` } : {
|
|
94
|
+
...x_axis,
|
|
95
|
+
label: x_axis.label ?? `International Spacegroup Number`,
|
|
96
|
+
range: x_range,
|
|
97
|
+
ticks: x_axis_ticks,
|
|
98
|
+
tick_rotation: x_axis.tick_rotation ?? 90, // Rotate ticks 90° to avoid overlap
|
|
99
|
+
label_shift: { x: 0, y: 20, ...x_axis.label_shift }, // Move label down for rotated ticks
|
|
100
|
+
});
|
|
101
|
+
const y_axis_config = $derived(orientation === `horizontal`
|
|
102
|
+
? {
|
|
103
|
+
...y_axis,
|
|
104
|
+
label: y_axis.label ?? `International Spacegroup Number`,
|
|
105
|
+
range: x_range,
|
|
106
|
+
ticks: x_axis_ticks,
|
|
107
|
+
tick_rotation: y_axis.tick_rotation ?? 0,
|
|
108
|
+
}
|
|
109
|
+
: { ...y_axis, label: y_axis.label ?? `Counts` });
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
{#snippet tooltip(info: BarTooltipProps)}
|
|
113
|
+
{@const { x: sg, y: count } = info}
|
|
114
|
+
{@const system = spacegroup_to_crystal_system(sg)}
|
|
115
|
+
Space Group: {format_value(sg, `.0f`)} ({SPACEGROUP_NUM_TO_SYMBOL[sg]})<br />
|
|
116
|
+
{#if system}
|
|
117
|
+
Crystal System: {system}<br />
|
|
118
|
+
{/if}
|
|
119
|
+
Count: {format_value(count, `.0f`)}
|
|
120
|
+
{/snippet}
|
|
121
|
+
|
|
122
|
+
{#snippet user_content({ width, height, x_scale_fn, y_scale_fn, pad }: {
|
|
123
|
+
width: number
|
|
124
|
+
height: number
|
|
125
|
+
x_scale_fn: (x: number) => number
|
|
126
|
+
y_scale_fn: (y: number) => number
|
|
127
|
+
pad: { t: number; b: number; l: number; r: number }
|
|
128
|
+
})}
|
|
129
|
+
<g class="crystal-system-overlays">
|
|
130
|
+
{#each crystal_system_regions as region (region.system)}
|
|
131
|
+
{#if orientation === `vertical`}
|
|
132
|
+
{@const x_start = x_scale_fn(region.sg_start - 0.5)}
|
|
133
|
+
{@const x_end = x_scale_fn(region.sg_end + 0.5)}
|
|
134
|
+
{@const x_center = (x_start + x_end) / 2}
|
|
135
|
+
{@const rect_width = x_end - x_start}
|
|
136
|
+
<!-- Background colored rectangle (vertical mode) -->
|
|
137
|
+
<rect
|
|
138
|
+
x={x_start}
|
|
139
|
+
y={pad.t}
|
|
140
|
+
width={rect_width}
|
|
141
|
+
height={height - pad.t - pad.b}
|
|
142
|
+
fill={region.color}
|
|
143
|
+
opacity="0.15"
|
|
144
|
+
stroke={region.color}
|
|
145
|
+
stroke-width="1"
|
|
146
|
+
stroke-opacity="0.3"
|
|
147
|
+
/>
|
|
148
|
+
<!-- Crystal system label (rotated 90 degrees) at top edge -->
|
|
149
|
+
<text
|
|
150
|
+
x={x_center}
|
|
151
|
+
y={pad.t + 15}
|
|
152
|
+
text-anchor="start"
|
|
153
|
+
font-size="14"
|
|
154
|
+
fill="var(--text-color, black)"
|
|
155
|
+
opacity="0.6"
|
|
156
|
+
transform="rotate(90, {x_center}, {pad.t + 15})"
|
|
157
|
+
>
|
|
158
|
+
{region.system}
|
|
159
|
+
</text>
|
|
160
|
+
<!-- Count annotation at top -->
|
|
161
|
+
{#if show_counts && total_count > 0}
|
|
162
|
+
{@const y_offset = region.system === `triclinic` ? -20 : -5}
|
|
163
|
+
<text
|
|
164
|
+
x={x_center}
|
|
165
|
+
y={pad.t + y_offset}
|
|
166
|
+
text-anchor="middle"
|
|
167
|
+
font-size="12"
|
|
168
|
+
fill="var(--text-color, black)"
|
|
169
|
+
>
|
|
170
|
+
{format_num(region.count, `,~`)} ({
|
|
171
|
+
format_num(region.count / total_count, `.1~%`)
|
|
172
|
+
})
|
|
173
|
+
</text>
|
|
174
|
+
{/if}
|
|
175
|
+
{:else}
|
|
176
|
+
{@const y_start = y_scale_fn(region.sg_end + 0.5)}
|
|
177
|
+
{@const y_end = y_scale_fn(region.sg_start - 0.5)}
|
|
178
|
+
{@const y_center = (y_start + y_end) / 2}
|
|
179
|
+
{@const rect_height = y_end - y_start}
|
|
180
|
+
<!-- Background colored rectangle (horizontal mode) -->
|
|
181
|
+
<rect
|
|
182
|
+
x={pad.l}
|
|
183
|
+
y={y_start}
|
|
184
|
+
width={width - pad.l - pad.r}
|
|
185
|
+
height={rect_height}
|
|
186
|
+
fill={region.color}
|
|
187
|
+
opacity="0.15"
|
|
188
|
+
stroke={region.color}
|
|
189
|
+
stroke-width="1"
|
|
190
|
+
stroke-opacity="0.3"
|
|
191
|
+
/>
|
|
192
|
+
<!-- Crystal system label (horizontal) at left edge -->
|
|
193
|
+
<text
|
|
194
|
+
x={width - pad.r - 8}
|
|
195
|
+
y={y_center}
|
|
196
|
+
text-anchor="end"
|
|
197
|
+
dominant-baseline="central"
|
|
198
|
+
font-size="14"
|
|
199
|
+
fill="var(--text-color, black)"
|
|
200
|
+
opacity="0.6"
|
|
201
|
+
>
|
|
202
|
+
{region.system}
|
|
203
|
+
</text>
|
|
204
|
+
<!-- Count annotation at right -->
|
|
205
|
+
{#if show_counts && total_count > 0}
|
|
206
|
+
<text
|
|
207
|
+
x={width - pad.r + 5}
|
|
208
|
+
y={y_center}
|
|
209
|
+
text-anchor="start"
|
|
210
|
+
dominant-baseline="central"
|
|
211
|
+
font-size="12"
|
|
212
|
+
fill="var(--text-color, black)"
|
|
213
|
+
>
|
|
214
|
+
{format_num(region.count, `,~`)} ({
|
|
215
|
+
format_num(region.count / total_count, `.1~%`)
|
|
216
|
+
})
|
|
217
|
+
</text>
|
|
218
|
+
{/if}
|
|
219
|
+
{/if}
|
|
220
|
+
{/each}
|
|
221
|
+
</g>
|
|
222
|
+
{/snippet}
|
|
223
|
+
|
|
224
|
+
<BarPlot
|
|
225
|
+
{...rest}
|
|
226
|
+
series={bar_series}
|
|
227
|
+
{orientation}
|
|
228
|
+
mode="overlay"
|
|
229
|
+
x_axis={x_axis_config}
|
|
230
|
+
y_axis={y_axis_config}
|
|
231
|
+
show_legend={false}
|
|
232
|
+
show_controls={false}
|
|
233
|
+
{tooltip}
|
|
234
|
+
{user_content}
|
|
235
|
+
/>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BarPlot } from './';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
type $$ComponentProps = ComponentProps<typeof BarPlot> & {
|
|
4
|
+
data: (number | string)[];
|
|
5
|
+
show_counts?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const SpacegroupBarPlot: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type SpacegroupBarPlot = ReturnType<typeof SpacegroupBarPlot>;
|
|
9
|
+
export default SpacegroupBarPlot;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { D3SymbolName
|
|
1
|
+
import type { D3SymbolName } from '../labels';
|
|
2
|
+
import type { DataSeries, Point } from './';
|
|
2
3
|
export declare function extract_series_color(series_data: DataSeries): string;
|
|
3
4
|
export declare const prepare_legend_data: (series: DataSeries[]) => {
|
|
4
5
|
series_idx: number;
|
|
@@ -9,5 +10,4 @@ export declare const prepare_legend_data: (series: DataSeries[]) => {
|
|
|
9
10
|
symbol_color: string;
|
|
10
11
|
};
|
|
11
12
|
}[];
|
|
12
|
-
export declare function filter_visible_series(series: DataSeries[]): DataSeries[];
|
|
13
13
|
export declare function create_data_points(series: DataSeries[], filter_fn?: (series: DataSeries) => boolean): Point[];
|
|
@@ -6,7 +6,7 @@ export function extract_series_color(series_data) {
|
|
|
6
6
|
(Array.isArray(series_data.point_style)
|
|
7
7
|
? series_data.point_style[0]?.fill
|
|
8
8
|
: series_data.point_style?.fill) ||
|
|
9
|
-
`#
|
|
9
|
+
`#4A9EFF`;
|
|
10
10
|
}
|
|
11
11
|
// Prepare legend data from series array
|
|
12
12
|
export const prepare_legend_data = (series) => series.map((series_data, series_idx) => ({
|
|
@@ -20,10 +20,6 @@ export const prepare_legend_data = (series) => series.map((series_data, series_i
|
|
|
20
20
|
symbol_color: extract_series_color(series_data),
|
|
21
21
|
},
|
|
22
22
|
}));
|
|
23
|
-
// Filter visible series from series array
|
|
24
|
-
export function filter_visible_series(series) {
|
|
25
|
-
return series.filter((s) => s.visible ?? true);
|
|
26
|
-
}
|
|
27
23
|
// Create data points from series for analysis
|
|
28
24
|
export function create_data_points(series, filter_fn) {
|
|
29
25
|
return series
|
package/dist/plot/index.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import type { SimulationNodeDatum } from 'd3-force';
|
|
2
|
-
import type { ComponentProps } from 'svelte';
|
|
3
|
-
import type ColorBar from './ColorBar.svelte';
|
|
4
|
-
import PlotLegend from './PlotLegend.svelte';
|
|
5
|
-
import type { D3SymbolName } from './formatting';
|
|
6
1
|
export interface TweenedOptions<T> {
|
|
7
2
|
delay?: number;
|
|
8
3
|
duration?: number | ((from: T, to: T) => number);
|
|
@@ -13,213 +8,30 @@ export { default as BarPlot } from './BarPlot.svelte';
|
|
|
13
8
|
export { default as BarPlotControls } from './BarPlotControls.svelte';
|
|
14
9
|
export { default as ColorBar } from './ColorBar.svelte';
|
|
15
10
|
export { default as ColorScaleSelect } from './ColorScaleSelect.svelte';
|
|
11
|
+
export * from './data-transform';
|
|
16
12
|
export { default as ElementScatter } from './ElementScatter.svelte';
|
|
17
13
|
export { default as Histogram } from './Histogram.svelte';
|
|
18
14
|
export { default as HistogramControls } from './HistogramControls.svelte';
|
|
15
|
+
export * from './interactions';
|
|
16
|
+
export * from './layout';
|
|
19
17
|
export { default as Line } from './Line.svelte';
|
|
18
|
+
export { default as PlotControls } from './PlotControls.svelte';
|
|
20
19
|
export { default as PlotLegend } from './PlotLegend.svelte';
|
|
20
|
+
export * from './scales';
|
|
21
21
|
export { default as ScatterPlot } from './ScatterPlot.svelte';
|
|
22
22
|
export { default as ScatterPlotControls } from './ScatterPlotControls.svelte';
|
|
23
23
|
export { default as ScatterPoint } from './ScatterPoint.svelte';
|
|
24
|
-
export
|
|
25
|
-
export * from './
|
|
26
|
-
export * from './interactions';
|
|
27
|
-
export * from './layout';
|
|
28
|
-
export * from './scales';
|
|
29
|
-
export type XyObj = {
|
|
30
|
-
x: number;
|
|
31
|
-
y: number;
|
|
32
|
-
};
|
|
33
|
-
export type Sides = {
|
|
34
|
-
t?: number;
|
|
35
|
-
b?: number;
|
|
36
|
-
l?: number;
|
|
37
|
-
r?: number;
|
|
38
|
-
};
|
|
24
|
+
export { default as SpacegroupBarPlot } from './SpacegroupBarPlot.svelte';
|
|
25
|
+
export * from './types';
|
|
39
26
|
export declare const line_types: readonly ["solid", "dashed", "dotted"];
|
|
40
27
|
export type LineType = (typeof line_types)[number];
|
|
41
|
-
export type Point = {
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
metadata?: {
|
|
45
|
-
[key: string]: unknown;
|
|
46
|
-
};
|
|
47
|
-
offset?: XyObj;
|
|
48
|
-
};
|
|
49
|
-
export interface PointStyle {
|
|
50
|
-
fill?: string;
|
|
51
|
-
radius?: number;
|
|
52
|
-
stroke?: string;
|
|
53
|
-
stroke_width?: number;
|
|
54
|
-
stroke_opacity?: number;
|
|
55
|
-
fill_opacity?: number;
|
|
56
|
-
symbol_type?: D3SymbolName;
|
|
57
|
-
symbol_size?: number | null;
|
|
58
|
-
shape?: string;
|
|
59
|
-
cursor?: string;
|
|
60
|
-
}
|
|
61
|
-
export interface HoverStyle {
|
|
62
|
-
enabled?: boolean;
|
|
63
|
-
scale?: number;
|
|
64
|
-
stroke?: string;
|
|
65
|
-
stroke_width?: number;
|
|
66
|
-
brightness?: number;
|
|
67
|
-
}
|
|
68
|
-
export interface LabelStyle {
|
|
69
|
-
text?: string;
|
|
70
|
-
offset?: XyObj;
|
|
71
|
-
font_size?: string;
|
|
72
|
-
font_family?: string;
|
|
73
|
-
auto_placement?: boolean;
|
|
74
|
-
}
|
|
75
|
-
export interface PlotPoint extends Point {
|
|
76
|
-
color_value?: number | null;
|
|
77
|
-
metadata?: Record<string, unknown>;
|
|
78
|
-
point_style?: PointStyle;
|
|
79
|
-
point_hover?: HoverStyle;
|
|
80
|
-
point_label?: LabelStyle;
|
|
81
|
-
point_offset?: XyObj;
|
|
82
|
-
point_tween?: TweenedOptions<XyObj>;
|
|
83
|
-
}
|
|
84
|
-
export type Markers = `line` | `points` | `line+points`;
|
|
85
|
-
export interface DataSeries {
|
|
86
|
-
x: readonly number[];
|
|
87
|
-
y: readonly number[];
|
|
88
|
-
markers?: Markers;
|
|
89
|
-
y_axis?: `y1` | `y2`;
|
|
90
|
-
color_values?: (number | null)[] | null;
|
|
91
|
-
size_values?: readonly (number | null)[] | null;
|
|
92
|
-
metadata?: Record<string, unknown>[] | Record<string, unknown>;
|
|
93
|
-
point_style?: PointStyle[] | PointStyle;
|
|
94
|
-
point_hover?: HoverStyle[] | HoverStyle;
|
|
95
|
-
point_label?: LabelStyle[] | LabelStyle;
|
|
96
|
-
point_offset?: XyObj[] | XyObj;
|
|
97
|
-
point_tween?: TweenedOptions<XyObj>;
|
|
98
|
-
visible?: boolean;
|
|
99
|
-
label?: string;
|
|
100
|
-
unit?: string;
|
|
101
|
-
line_style?: {
|
|
102
|
-
stroke?: string;
|
|
103
|
-
stroke_width?: number;
|
|
104
|
-
line_dash?: string;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
export interface InternalPoint extends PlotPoint {
|
|
108
|
-
series_idx: number;
|
|
109
|
-
point_idx: number;
|
|
110
|
-
size_value?: number | null;
|
|
111
|
-
}
|
|
112
|
-
export interface Tooltip {
|
|
113
|
-
show: boolean;
|
|
114
|
-
x: number;
|
|
115
|
-
y: number;
|
|
116
|
-
title?: string;
|
|
117
|
-
items?: {
|
|
118
|
-
label: string;
|
|
119
|
-
value: string;
|
|
120
|
-
color?: string;
|
|
121
|
-
}[];
|
|
122
|
-
}
|
|
123
|
-
export interface TooltipProps {
|
|
124
|
-
x: number;
|
|
125
|
-
y: number;
|
|
126
|
-
metadata?: Record<string, unknown> | null;
|
|
127
|
-
color?: string | null;
|
|
128
|
-
label?: string | null;
|
|
129
|
-
series_idx: number;
|
|
130
|
-
}
|
|
131
|
-
export interface ScatterTooltipProps extends TooltipProps {
|
|
132
|
-
cx: number;
|
|
133
|
-
cy: number;
|
|
134
|
-
x_formatted: string;
|
|
135
|
-
y_formatted: string;
|
|
136
|
-
}
|
|
137
|
-
export interface BarTooltipProps extends TooltipProps {
|
|
138
|
-
bar_idx: number;
|
|
139
|
-
orient_x: number;
|
|
140
|
-
orient_y: number;
|
|
141
|
-
}
|
|
142
|
-
export type TimeInterval = `day` | `month` | `year`;
|
|
143
|
-
export type ScaleType = `linear` | `log`;
|
|
144
|
-
export type QuadrantCounts = {
|
|
145
|
-
top_left: number;
|
|
146
|
-
top_right: number;
|
|
147
|
-
bottom_left: number;
|
|
148
|
-
bottom_right: number;
|
|
149
|
-
};
|
|
150
|
-
export interface LabelNode extends SimulationNodeDatum {
|
|
151
|
-
id: string;
|
|
152
|
-
anchor_x: number;
|
|
153
|
-
anchor_y: number;
|
|
154
|
-
point_node: InternalPoint;
|
|
155
|
-
label_width: number;
|
|
156
|
-
label_height: number;
|
|
157
|
-
}
|
|
158
|
-
export interface LabelPlacementConfig {
|
|
159
|
-
collision_strength: number;
|
|
160
|
-
link_strength: number;
|
|
161
|
-
link_distance: number;
|
|
162
|
-
placement_ticks: number;
|
|
163
|
-
link_distance_range?: [number | null, number | null];
|
|
164
|
-
}
|
|
165
|
-
export type HoverConfig = {
|
|
166
|
-
threshold_px: number;
|
|
167
|
-
};
|
|
168
|
-
export interface AnchorNode extends SimulationNodeDatum {
|
|
169
|
-
id: string;
|
|
170
|
-
fx: number;
|
|
171
|
-
fy: number;
|
|
172
|
-
point_radius: number;
|
|
173
|
-
show_color_bar?: boolean;
|
|
174
|
-
color_bar?: ComponentProps<typeof ColorBar> | null;
|
|
175
|
-
label_placement_config?: Partial<LabelPlacementConfig>;
|
|
176
|
-
}
|
|
177
|
-
export type LegendConfig = Omit<ComponentProps<typeof PlotLegend>, `series_data` | `on_drag_start` | `on_drag` | `on_drag_end`> & {
|
|
178
|
-
margin?: number | Sides;
|
|
179
|
-
tween?: TweenedOptions<XyObj>;
|
|
180
|
-
responsive?: boolean;
|
|
181
|
-
draggable?: boolean;
|
|
182
|
-
};
|
|
183
28
|
export declare const cells_3x3: readonly ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"];
|
|
184
29
|
export declare const corner_cells: readonly ["top-left", "top-right", "bottom-left", "bottom-right"];
|
|
185
30
|
export type Cell3x3 = (typeof cells_3x3)[number];
|
|
186
31
|
export type Corner = (typeof corner_cells)[number];
|
|
187
|
-
export
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
display_style: {
|
|
192
|
-
symbol_type?: D3SymbolName;
|
|
193
|
-
symbol_color?: string;
|
|
194
|
-
line_color?: string;
|
|
195
|
-
line_dash?: string;
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
export type UserContentProps = {
|
|
199
|
-
height: number;
|
|
200
|
-
width: number;
|
|
201
|
-
x_scale_fn: (x: number) => number;
|
|
202
|
-
y_scale_fn: (y: number) => number;
|
|
203
|
-
pad: Required<Sides>;
|
|
204
|
-
x_min: number;
|
|
205
|
-
y_min: number;
|
|
206
|
-
x_max: number;
|
|
207
|
-
y_max: number;
|
|
32
|
+
export declare const DEFAULT_GRID_STYLE: {
|
|
33
|
+
readonly stroke: "var(--border-color, gray)";
|
|
34
|
+
readonly 'stroke-dasharray': "4";
|
|
35
|
+
readonly 'stroke-width': "1";
|
|
208
36
|
};
|
|
209
|
-
export
|
|
210
|
-
export type BarMode = `overlay` | `stacked` | `grouped`;
|
|
211
|
-
export interface BarSeries {
|
|
212
|
-
x: readonly number[];
|
|
213
|
-
y: readonly number[];
|
|
214
|
-
label?: string;
|
|
215
|
-
color?: string;
|
|
216
|
-
bar_width?: number | readonly number[];
|
|
217
|
-
visible?: boolean;
|
|
218
|
-
metadata?: Record<string, unknown>[] | Record<string, unknown>;
|
|
219
|
-
labels?: readonly (string | null | undefined)[];
|
|
220
|
-
render_mode?: `bar` | `line`;
|
|
221
|
-
line_style?: {
|
|
222
|
-
stroke_width?: number;
|
|
223
|
-
line_dash?: string;
|
|
224
|
-
};
|
|
225
|
-
}
|
|
37
|
+
export declare const DEFAULT_MARKERS: "line+points";
|
package/dist/plot/index.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import PlotLegend from './PlotLegend.svelte';
|
|
2
1
|
export { default as BarPlot } from './BarPlot.svelte';
|
|
3
2
|
export { default as BarPlotControls } from './BarPlotControls.svelte';
|
|
4
3
|
export { default as ColorBar } from './ColorBar.svelte';
|
|
5
4
|
export { default as ColorScaleSelect } from './ColorScaleSelect.svelte';
|
|
5
|
+
export * from './data-transform';
|
|
6
6
|
export { default as ElementScatter } from './ElementScatter.svelte';
|
|
7
7
|
export { default as Histogram } from './Histogram.svelte';
|
|
8
8
|
export { default as HistogramControls } from './HistogramControls.svelte';
|
|
9
|
+
export * from './interactions';
|
|
10
|
+
export * from './layout';
|
|
9
11
|
export { default as Line } from './Line.svelte';
|
|
12
|
+
export { default as PlotControls } from './PlotControls.svelte';
|
|
10
13
|
export { default as PlotLegend } from './PlotLegend.svelte';
|
|
14
|
+
export * from './scales';
|
|
11
15
|
export { default as ScatterPlot } from './ScatterPlot.svelte';
|
|
12
16
|
export { default as ScatterPlotControls } from './ScatterPlotControls.svelte';
|
|
13
17
|
export { default as ScatterPoint } from './ScatterPoint.svelte';
|
|
14
|
-
export
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './interactions';
|
|
17
|
-
export * from './layout';
|
|
18
|
-
export * from './scales';
|
|
18
|
+
export { default as SpacegroupBarPlot } from './SpacegroupBarPlot.svelte';
|
|
19
|
+
export * from './types';
|
|
19
20
|
export const line_types = [`solid`, `dashed`, `dotted`];
|
|
20
21
|
// Define grid cell identifiers
|
|
21
22
|
export const cells_3x3 = [
|
|
@@ -35,3 +36,10 @@ export const corner_cells = [
|
|
|
35
36
|
`bottom-left`,
|
|
36
37
|
`bottom-right`,
|
|
37
38
|
];
|
|
39
|
+
// Default grid line style (SSOT for all plot components)
|
|
40
|
+
export const DEFAULT_GRID_STYLE = {
|
|
41
|
+
'stroke': `var(--border-color, gray)`,
|
|
42
|
+
'stroke-dasharray': `4`,
|
|
43
|
+
'stroke-width': `1`,
|
|
44
|
+
};
|
|
45
|
+
export const DEFAULT_MARKERS = `line+points`;
|
package/dist/plot/layout.d.ts
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
import type { Sides } from './';
|
|
1
|
+
import type { AxisConfig, Sides } from './';
|
|
2
2
|
export declare function measure_text_width(text: string, font?: string): number;
|
|
3
3
|
export interface AutoPaddingConfig {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
padding: Partial<Sides>;
|
|
5
|
+
default_padding: Required<Sides>;
|
|
6
|
+
y_axis?: AxisConfig & {
|
|
7
|
+
tick_values?: (string | number)[];
|
|
8
|
+
};
|
|
9
|
+
y2_axis?: AxisConfig & {
|
|
10
|
+
tick_values?: (string | number)[];
|
|
11
|
+
};
|
|
9
12
|
label_gap?: number;
|
|
10
13
|
}
|
|
11
|
-
export declare const calc_auto_padding: ({
|
|
14
|
+
export declare const calc_auto_padding: ({ padding, default_padding, y_axis, y2_axis, label_gap, }: AutoPaddingConfig) => Required<Sides>;
|
|
12
15
|
export declare function constrain_tooltip_position(base_x: number, base_y: number, tooltip_width: number, tooltip_height: number, chart_width: number, chart_height: number): {
|
|
13
16
|
x: number;
|
|
14
17
|
y: number;
|
|
15
18
|
};
|
|
16
|
-
export declare function get_chart_dimensions(width: number, height: number, padding: {
|
|
17
|
-
t: number;
|
|
18
|
-
b: number;
|
|
19
|
-
l: number;
|
|
20
|
-
r: number;
|
|
21
|
-
}): {
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
};
|
|
25
19
|
export type PlacementPosition = `top-left` | `top-right` | `bottom-left` | `bottom-right` | `top-center` | `right-center` | `bottom-center` | `left-center`;
|
|
26
20
|
export interface LegendPlacement {
|
|
27
21
|
x: number;
|