Skip to main content

euv_ui/component/chart/model/
struct.rs

1use super::*;
2
3/// Chart title and optional subtitle header configuration.
4#[derive(Clone, Data, Debug, Default, PartialEq)]
5pub struct EuvChartTitle {
6    /// Primary chart title text.
7    pub(crate) text: String,
8    /// Optional secondary subtitle text.
9    pub(crate) subtext: String,
10    /// Horizontal alignment of the title block.
11    #[get(type(copy))]
12    pub(crate) align: EuvChartAlign,
13}
14
15/// Interactive chart legend configuration controlling series visibility chips.
16#[derive(Clone, Data, Debug, PartialEq)]
17pub struct EuvChartLegend {
18    /// Whether the legend strip is displayed.
19    #[get(type(copy))]
20    pub(crate) show: bool,
21    /// Docked position around the plot region.
22    #[get(type(copy))]
23    pub(crate) position: EuvChartPosition,
24    /// Optional explicit ordered legend item labels (defaults to series names when empty).
25    pub(crate) items: Vec<String>,
26}
27
28/// Cartesian subplot grid margins and framing configuration.
29#[derive(Clone, Data, Debug, PartialEq)]
30pub struct EuvChartGrid {
31    /// Left margin in logical pixels.
32    #[get(type(copy))]
33    pub(crate) left: f32,
34    /// Right margin in logical pixels.
35    #[get(type(copy))]
36    pub(crate) right: f32,
37    /// Top margin in logical pixels.
38    #[get(type(copy))]
39    pub(crate) top: f32,
40    /// Bottom margin in logical pixels.
41    #[get(type(copy))]
42    pub(crate) bottom: f32,
43    /// When `true`, expands margins automatically so axis labels remain inside bounds.
44    #[get(type(copy))]
45    pub(crate) contain_label: bool,
46    /// When `true`, draws an outer border box around the plot grid.
47    #[get(type(copy))]
48    pub(crate) show_border: bool,
49}
50
51/// Axis scale, tick, split-line, and label configuration for Cartesian, Polar, and SingleAxis charts.
52#[derive(Clone, Data, Debug, PartialEq)]
53pub struct EuvChartAxis {
54    /// Scale domain kind (`Category`, `Value`, `Time`, `Log`).
55    #[get(type(copy))]
56    pub(crate) axis_type: EuvChartAxisType,
57    /// Optional axis caption displayed near the end of the axis.
58    pub(crate) name: String,
59    /// Optional unit suffix appended to numeric tick labels (e.g. `"%"` or `"ms"`).
60    pub(crate) unit_suffix: String,
61    /// Discrete category labels used when `axis_type` is `Category`.
62    pub(crate) categories: Vec<String>,
63    /// Target subplot grid index inside `EuvChartOption::grid`.
64    #[get(type(copy))]
65    pub(crate) grid_index: usize,
66    /// Optional explicit lower domain bound.
67    #[get(skip)]
68    pub(crate) min: Option<f32>,
69    /// Optional explicit upper domain bound.
70    #[get(skip)]
71    pub(crate) max: Option<f32>,
72    /// When `true`, reverses axis direction.
73    #[get(type(copy))]
74    pub(crate) inverse: bool,
75    /// Target interval split count for nice tick generation.
76    #[get(type(copy))]
77    pub(crate) split_number: usize,
78    /// Whether the main axis baseline stroke is drawn.
79    #[get(type(copy))]
80    pub(crate) show_axis_line: bool,
81    /// Whether short tick marks are drawn along the axis.
82    #[get(type(copy))]
83    pub(crate) show_axis_tick: bool,
84    /// Whether formatted tick labels are drawn.
85    #[get(type(copy))]
86    pub(crate) show_axis_label: bool,
87    /// Whether dashed grid split lines cross the plot area.
88    #[get(type(copy))]
89    pub(crate) show_split_line: bool,
90    /// Whether alternating subtle split bands tint the plot area.
91    #[get(type(copy))]
92    pub(crate) show_split_area: bool,
93    /// Optional explicit axis side override for dual-axis layouts.
94    #[get(skip)]
95    pub(crate) position: Option<EuvChartPosition>,
96}
97
98/// Polar coordinate system pairing an angular axis and radial axis.
99#[derive(Clone, Data, Debug, PartialEq)]
100pub struct EuvChartPolar {
101    /// Angular axis (typically `Category` or `Value` around 360 degrees).
102    pub(crate) angle_axis: EuvChartAxis,
103    /// Radial distance axis from center outward.
104    pub(crate) radius_axis: EuvChartAxis,
105    /// Outer radius ratio relative to half plot minimum side.
106    #[get(type(copy))]
107    pub(crate) radius_ratio: f32,
108    /// Horizontal center ratio in `[0.0, 1.0]`.
109    #[get(type(copy))]
110    pub(crate) center_x_ratio: f32,
111    /// Vertical center ratio in `[0.0, 1.0]`.
112    #[get(type(copy))]
113    pub(crate) center_y_ratio: f32,
114}
115
116/// Single multivariate indicator spoke inside a radar coordinate system.
117#[derive(Clone, Data, Debug, New, PartialEq)]
118pub struct EuvChartRadarIndicator {
119    /// Human-readable indicator dimension name.
120    pub(crate) name: String,
121    /// Lower domain bound at the radar center.
122    #[get(type(copy))]
123    pub(crate) min: f32,
124    /// Upper domain bound at the outer radar ring.
125    #[get(type(copy))]
126    pub(crate) max: f32,
127}
128
129/// Radar coordinate system defining multivariate indicator spokes and concentric rings.
130#[derive(Clone, Data, Debug, PartialEq)]
131pub struct EuvChartRadar {
132    /// Ordered indicator axes arranged clockwise from 12 o'clock.
133    pub(crate) indicators: Vec<EuvChartRadarIndicator>,
134    /// Ring shape (`Polygon` or `Circle`).
135    #[get(type(copy))]
136    pub(crate) shape: EuvChartRadarShape,
137    /// Number of concentric split rings.
138    #[get(type(copy))]
139    pub(crate) split_number: usize,
140    /// Outer radius ratio relative to half plot minimum side.
141    #[get(type(copy))]
142    pub(crate) radius_ratio: f32,
143}
144
145/// Single 1D axis coordinate system for compact bubble timelines or linear tracks.
146#[derive(Clone, Data, Debug, PartialEq)]
147pub struct EuvChartSingleAxis {
148    /// Underlying axis scale and tick configuration.
149    pub(crate) axis: EuvChartAxis,
150    /// Vertical center ratio inside the plot rect.
151    #[get(type(copy))]
152    pub(crate) center_y_ratio: f32,
153}
154
155/// Calendar matrix coordinate system for week-by-day contribution heatmaps.
156#[derive(Clone, Data, Debug, PartialEq)]
157pub struct EuvChartCalendar {
158    /// Display year caption (e.g. `2026`).
159    #[get(type(copy))]
160    pub(crate) year: u32,
161    /// Number of week columns rendered along the primary axis.
162    #[get(type(copy))]
163    pub(crate) weeks: usize,
164    /// Month header labels spaced across the week columns.
165    pub(crate) month_labels: Vec<String>,
166    /// Gap in logical pixels between day cells.
167    #[get(type(copy))]
168    pub(crate) cell_gap: f32,
169    /// Matrix orientation (`Horizontal` weeks left-to-right or `Vertical` top-to-bottom).
170    #[get(type(copy))]
171    pub(crate) orient: EuvChartOrient,
172}
173
174/// Custom or built-in geographic polygon region rendered on `GeoMap`.
175#[derive(Clone, Data, Debug, PartialEq)]
176pub struct EuvChartGeoRegion {
177    /// Display region name matching `EuvChartGeoDatum::region_name`.
178    pub(crate) name: String,
179    /// Short ISO or region code.
180    pub(crate) code: String,
181    /// Closed exterior polygon rings in `(longitude, latitude)` degrees (`lon in -180..=180`, `lat in -90..=90`).
182    pub(crate) polygons: Vec<Vec<(f32, f32)>>,
183    /// Optional explicit label anchor `(lon, lat)` overriding polygon centroid.
184    #[get(skip)]
185    pub(crate) label_center: Option<(f32, f32)>,
186}
187
188/// Geographic coordinate system backing `GeoMap`, `Scatter`, `EffectScatter`, and `Lines` overlays.
189#[derive(Clone, Data, Debug, PartialEq)]
190pub struct EuvChartGeo {
191    /// Built-in polygon preset or `Custom`.
192    #[get(type(copy))]
193    pub(crate) preset: EuvChartGeoMapPreset,
194    /// Additional or custom geographic regions.
195    pub(crate) regions: Vec<EuvChartGeoRegion>,
196    /// Whether region name labels are drawn atop polygons.
197    #[get(type(copy))]
198    pub(crate) show_labels: bool,
199    /// Whether pan/zoom roaming is enabled on the map canvas.
200    #[get(type(copy))]
201    pub(crate) roam: bool,
202}
203
204/// Interactive hover tooltip and axis-pointer configuration.
205#[derive(Clone, Data, Debug, PartialEq)]
206pub struct EuvChartTooltip {
207    /// Whether hover tooltip cards are shown.
208    #[get(type(copy))]
209    pub(crate) show: bool,
210    /// Snapping strategy (`Item`, `Axis`, or `None`).
211    #[get(type(copy))]
212    pub(crate) trigger: EuvChartTooltipTrigger,
213    /// Crosshair pointer visual style (`Line`, `Shadow`, `Cross`, or `None`).
214    #[get(type(copy))]
215    pub(crate) axis_pointer: EuvChartAxisPointerType,
216}
217
218/// Interactive data-zoom range controller (`Inside` or `Slider`).
219#[derive(Clone, Data, Debug, PartialEq)]
220pub struct EuvChartDataZoom {
221    /// Controller mode (`Inside` wheel/drag or `Slider` bottom scrubber).
222    #[get(type(copy))]
223    pub(crate) kind: EuvChartDataZoomKind,
224    /// Initial lower window percentage in `[0.0, 100.0]`.
225    #[get(type(copy))]
226    pub(crate) start_pct: f32,
227    /// Initial upper window percentage in `[0.0, 100.0]`.
228    #[get(type(copy))]
229    pub(crate) end_pct: f32,
230    /// Minimum allowed percentage span when zooming in.
231    #[get(type(copy))]
232    pub(crate) min_span_pct: f32,
233    /// Whether the slider track draws a mini sparkline preview of the primary series.
234    #[get(type(copy))]
235    pub(crate) show_preview: bool,
236}
237
238/// Single discrete interval bucket inside a piecewise `EuvChartVisualMap`.
239#[derive(Clone, Data, Debug, PartialEq)]
240pub struct EuvChartVisualPiece {
241    /// Optional inclusive lower threshold.
242    #[get(skip)]
243    pub(crate) min: Option<f32>,
244    /// Optional inclusive upper threshold.
245    #[get(skip)]
246    pub(crate) max: Option<f32>,
247    /// Display caption shown in the piecewise legend.
248    pub(crate) label: String,
249    /// Color assigned to values falling in this bucket.
250    #[get(type(copy))]
251    pub(crate) color: Color,
252}
253
254/// Continuous gradient or piecewise bucket color mapper for Heatmap, Scatter, GeoMap, Bar, and Parallel series.
255#[derive(Clone, Data, Debug, PartialEq)]
256pub struct EuvChartVisualMap {
257    /// Whether the visual-map bar/legend is drawn.
258    #[get(type(copy))]
259    pub(crate) show: bool,
260    /// Mapping mode (`Continuous` or `Piecewise`).
261    #[get(type(copy))]
262    pub(crate) kind: EuvChartVisualMapKind,
263    /// Lower numeric domain value.
264    #[get(type(copy))]
265    pub(crate) min: f32,
266    /// Upper numeric domain value.
267    #[get(type(copy))]
268    pub(crate) max: f32,
269    /// Ordered color stops used by `Continuous` interpolation.
270    pub(crate) in_range_colors: Vec<Color>,
271    /// Discrete threshold ranges used by `Piecewise` mapping.
272    pub(crate) pieces: Vec<EuvChartVisualPiece>,
273    /// Visual-map bar orientation.
274    #[get(type(copy))]
275    pub(crate) orient: EuvChartOrient,
276    /// Visual-map dock edge.
277    #[get(type(copy))]
278    pub(crate) position: EuvChartPosition,
279}
280
281/// Compact icon-only chart toolbox toolbar configuration.
282#[derive(Clone, Data, Debug, PartialEq)]
283pub struct EuvChartToolbox {
284    /// Whether the toolbox strip is shown.
285    #[get(type(copy))]
286    pub(crate) show: bool,
287    /// Enables the Restore (reset zoom, legend, magic-type) action icon.
288    #[get(type(copy))]
289    pub(crate) restore: bool,
290    /// Enables the MagicType (Line / Bar / Stack) mode toggle icon.
291    #[get(type(copy))]
292    pub(crate) magic_type: bool,
293    /// Enables the DataView tabular inspection toggle icon.
294    #[get(type(copy))]
295    pub(crate) data_view: bool,
296    /// Enables the Fullscreen modal expansion icon.
297    #[get(type(copy))]
298    pub(crate) fullscreen: bool,
299}
300
301/// Tabular dataset shared across multiple series via `EuvChartEncode`.
302#[derive(Clone, Data, Debug, Default, PartialEq)]
303pub struct EuvChartDataset {
304    /// Ordered column dimension names.
305    pub(crate) dimensions: Vec<String>,
306    /// Ordered data rows aligned to `dimensions`.
307    pub(crate) rows: Vec<Vec<EuvChartCell>>,
308}
309
310/// Column mapping binding `EuvChartDataset` dimensions to series channels.
311#[derive(Clone, Data, Debug, Default, PartialEq)]
312pub struct EuvChartEncode {
313    /// Dimension name mapped to the X channel.
314    #[get(skip)]
315    pub(crate) x: Option<String>,
316    /// Dimension name mapped to the Y channel.
317    #[get(skip)]
318    pub(crate) y: Option<String>,
319    /// Dimension name mapped to numeric value.
320    #[get(skip)]
321    pub(crate) value: Option<String>,
322    /// Dimension name mapped to bubble or symbol size.
323    #[get(skip)]
324    pub(crate) size: Option<String>,
325    /// Dimension name mapped to item label.
326    #[get(skip)]
327    pub(crate) item_name: Option<String>,
328}
329
330/// Point callout pin annotation attached to a Cartesian series.
331#[derive(Clone, Data, Debug, PartialEq)]
332pub struct EuvChartMarkPoint {
333    /// Target datum selection rule (`Min`, `Max`, `Average`, or explicit `Coord`).
334    #[get(type(copy))]
335    pub(crate) kind: EuvChartMarkPointKind,
336    /// Label displayed inside or beside the callout badge.
337    pub(crate) name: String,
338    /// Optional explicit pin tint overriding series color.
339    #[get(skip)]
340    pub(crate) color: Option<Color>,
341}
342
343/// Reference line annotation attached to a Cartesian series.
344#[derive(Clone, Data, Debug, PartialEq)]
345pub struct EuvChartMarkLine {
346    /// Reference placement rule (`Average`, `Min`, `Max`, `YAxis`, `XAxis`).
347    #[get(type(copy))]
348    pub(crate) kind: EuvChartMarkLineKind,
349    /// Pill label displayed along the reference line.
350    pub(crate) name: String,
351    /// Optional explicit stroke color overriding series color.
352    #[get(skip)]
353    pub(crate) color: Option<Color>,
354    /// When `true`, renders as a dashed reference line.
355    #[get(type(copy))]
356    pub(crate) dashed: bool,
357}
358
359/// Shaded background highlight band attached to a Cartesian series.
360#[derive(Clone, Data, Debug, PartialEq)]
361pub struct EuvChartMarkArea {
362    /// Optional lower X coordinate or category index bound.
363    #[get(skip)]
364    pub(crate) start_x: Option<f32>,
365    /// Optional upper X coordinate or category index bound.
366    #[get(skip)]
367    pub(crate) end_x: Option<f32>,
368    /// Optional lower Y coordinate bound.
369    #[get(skip)]
370    pub(crate) start_y: Option<f32>,
371    /// Optional upper Y coordinate bound.
372    #[get(skip)]
373    pub(crate) end_y: Option<f32>,
374    /// Caption drawn at the top of the shaded highlight band.
375    pub(crate) name: String,
376    /// Optional explicit tint color (rendered translucent).
377    #[get(skip)]
378    pub(crate) color: Option<Color>,
379}
380
381/// Collection of `MarkPoint`, `MarkLine`, and `MarkArea` overlays on a Cartesian series.
382#[derive(Clone, Data, Debug, Default, PartialEq)]
383pub struct EuvChartAnnotations {
384    /// Pin annotations on key extrema or coordinates.
385    pub(crate) mark_points: Vec<EuvChartMarkPoint>,
386    /// Horizontal or vertical reference threshold lines.
387    pub(crate) mark_lines: Vec<EuvChartMarkLine>,
388    /// Translucent shaded highlight bands.
389    pub(crate) mark_areas: Vec<EuvChartMarkArea>,
390}
391
392/// Line and area series configuration supporting straight, smooth Catmull-Rom, stepped, stacked, and dashed strokes.
393#[derive(Clone, Data, Debug, PartialEq)]
394pub struct EuvChartLineSeries {
395    /// Ordered category-aligned numeric values (`None` produces a data gap unless `connect_nulls`).
396    pub(crate) values: Vec<Option<f32>>,
397    /// Explicit `(x, y)` coordinate pairs used with `Value`, `Time`, `Log`, or `Polar` axes.
398    pub(crate) xy_points: Vec<(f32, f32)>,
399    /// When `true`, interpolates smooth Catmull-Rom cubic curves between adjacent points.
400    #[get(type(copy))]
401    pub(crate) smooth: bool,
402    /// Step-line mode (`None`, `Start`, `Middle`, `End`).
403    #[get(type(copy))]
404    pub(crate) step: EuvChartStepMode,
405    /// Area fill opacity under the line (`0.0` disables area fill).
406    #[get(type(copy))]
407    pub(crate) area_opacity: f32,
408    /// When `true`, fades area fill smoothly toward transparent at the baseline.
409    #[get(type(copy))]
410    pub(crate) area_gradient: bool,
411    /// Optional stack group identifier for stacked line/area charts.
412    #[get(skip)]
413    pub(crate) stack: Option<String>,
414    /// When `true`, renders the polyline with crisp dashes.
415    #[get(type(copy))]
416    pub(crate) dashed: bool,
417    /// Stroke width in logical pixels.
418    #[get(type(copy))]
419    pub(crate) line_width: f32,
420    /// Data vertex marker shape.
421    #[get(type(copy))]
422    pub(crate) symbol: EuvChartSymbol,
423    /// Data vertex marker radius in logical pixels.
424    #[get(type(copy))]
425    pub(crate) symbol_size: f32,
426    /// When `true`, bridges across `None` gaps instead of breaking the stroke.
427    #[get(type(copy))]
428    pub(crate) connect_nulls: bool,
429    /// When `true`, renders numeric value labels above plotted vertices.
430    #[get(type(copy))]
431    pub(crate) show_labels: bool,
432    /// Coordinate system hosting this series (`Cartesian2d`, `Polar`, or `SingleAxis`).
433    #[get(type(copy))]
434    pub(crate) coordinate_system: EuvChartCoordinateSystem,
435    /// X axis index inside `EuvChartOption::x_axes`.
436    #[get(type(copy))]
437    pub(crate) x_axis_index: usize,
438    /// Y axis index inside `EuvChartOption::y_axes`.
439    #[get(type(copy))]
440    pub(crate) y_axis_index: usize,
441    /// Series mark points, mark lines, and mark areas.
442    pub(crate) annotations: EuvChartAnnotations,
443    /// Optional dataset dimension encoding.
444    #[get(skip)]
445    pub(crate) encode: Option<EuvChartEncode>,
446}
447
448/// Vertical, horizontal, grouped, stacked, or polar bar series configuration.
449#[derive(Clone, Data, Debug, PartialEq)]
450pub struct EuvChartBarSeries {
451    /// Ordered category-aligned bar values (`None` skips the slot).
452    pub(crate) values: Vec<Option<f32>>,
453    /// Optional stack group identifier for stacked bars.
454    #[get(skip)]
455    pub(crate) stack: Option<String>,
456    /// Rounded cap corner radius in logical pixels.
457    #[get(type(copy))]
458    pub(crate) bar_radius: f32,
459    /// Fraction of slot width occupied by bars in `(0.1, 0.95]`.
460    #[get(type(copy))]
461    pub(crate) bar_width_ratio: f32,
462    /// When `true`, draws a subtle full-extent background track behind each bar.
463    #[get(type(copy))]
464    pub(crate) show_background: bool,
465    /// When `true`, draws formatted value labels near bar caps.
466    #[get(type(copy))]
467    pub(crate) show_labels: bool,
468    /// Coordinate system hosting this series (`Cartesian2d` or `Polar`).
469    #[get(type(copy))]
470    pub(crate) coordinate_system: EuvChartCoordinateSystem,
471    /// X axis index inside `EuvChartOption::x_axes`.
472    #[get(type(copy))]
473    pub(crate) x_axis_index: usize,
474    /// Y axis index inside `EuvChartOption::y_axes`.
475    #[get(type(copy))]
476    pub(crate) y_axis_index: usize,
477    /// Series mark points, mark lines, and mark areas.
478    pub(crate) annotations: EuvChartAnnotations,
479    /// Optional dataset dimension encoding.
480    #[get(skip)]
481    pub(crate) encode: Option<EuvChartEncode>,
482}
483
484/// Single labeled slice inside a pie, donut, or Nightingale Rose series.
485#[derive(Clone, Data, Debug, PartialEq)]
486pub struct EuvChartPieSlice {
487    /// Slice display name.
488    pub(crate) name: String,
489    /// Non-negative slice numeric weight.
490    #[get(type(copy))]
491    pub(crate) value: f32,
492    /// Optional explicit fill color overriding the active palette.
493    #[get(skip)]
494    pub(crate) color: Option<Color>,
495    /// When `true`, pops this slice radially outward.
496    #[get(type(copy))]
497    pub(crate) selected: bool,
498}
499
500/// Pie, donut, and Nightingale Rose series configuration.
501#[derive(Clone, Data, Debug, PartialEq)]
502pub struct EuvChartPieSeries {
503    /// Ordered proportional slices.
504    pub(crate) slices: Vec<EuvChartPieSlice>,
505    /// Inner cutout ratio in `[0.0, 0.9]` (`0.0` = full pie, `> 0.0` = donut).
506    #[get(type(copy))]
507    pub(crate) inner_radius_ratio: f32,
508    /// Outer radius ratio relative to half plot minimum side.
509    #[get(type(copy))]
510    pub(crate) outer_radius_ratio: f32,
511    /// Optional Nightingale Rose variation (`None`, `Radius`, `Area`).
512    #[get(type(copy))]
513    pub(crate) rose_type: EuvChartRoseType,
514    /// Angular gap between adjacent wedges in degrees.
515    #[get(type(copy))]
516    pub(crate) pad_angle_deg: f32,
517    /// Starting sweep angle in degrees (`90.0` = 12 o'clock).
518    #[get(type(copy))]
519    pub(crate) start_angle_deg: f32,
520    /// Whether slice name and percentage labels are rendered.
521    #[get(type(copy))]
522    pub(crate) show_labels: bool,
523    /// Whether external bent leader lines connect slices to outer labels.
524    #[get(type(copy))]
525    pub(crate) show_leader_lines: bool,
526    /// Radial pop-out distance in logical pixels for selected slices.
527    #[get(type(copy))]
528    pub(crate) selected_offset: f32,
529    /// Horizontal center ratio in `[0.0, 1.0]`.
530    #[get(type(copy))]
531    pub(crate) center_x_ratio: f32,
532    /// Vertical center ratio in `[0.0, 1.0]`.
533    #[get(type(copy))]
534    pub(crate) center_y_ratio: f32,
535}
536
537/// Single 2D point or variable bubble plotted by `Scatter` or `EffectScatter`.
538#[derive(Clone, Data, Debug, PartialEq)]
539pub struct EuvChartScatterPoint {
540    /// X coordinate (numeric domain value, category index, or longitude on `Geo`).
541    #[get(type(copy))]
542    pub(crate) x: f32,
543    /// Y coordinate (numeric domain value or latitude on `Geo`).
544    #[get(type(copy))]
545    pub(crate) y: f32,
546    /// Marker radius in logical pixels (`<= 0.0` falls back to series `default_size`).
547    #[get(type(copy))]
548    pub(crate) size: f32,
549    /// Optional scalar value mapped through `VisualMap`.
550    #[get(skip)]
551    pub(crate) value: Option<f32>,
552    /// Optional point caption shown on label or tooltip.
553    pub(crate) label: String,
554}
555
556/// Scatter, bubble, and ripple `EffectScatter` series configuration.
557#[derive(Clone, Data, Debug, PartialEq)]
558pub struct EuvChartScatterSeries {
559    /// Plotted `(x, y, size)` points.
560    pub(crate) points: Vec<EuvChartScatterPoint>,
561    /// Marker glyph shape.
562    #[get(type(copy))]
563    pub(crate) symbol: EuvChartSymbol,
564    /// Default marker radius in logical pixels.
565    #[get(type(copy))]
566    pub(crate) default_size: f32,
567    /// Concentric ripple ring count for `EffectScatter`.
568    #[get(type(copy))]
569    pub(crate) ripple_rings: usize,
570    /// Outer ripple expansion multiplier for `EffectScatter`.
571    #[get(type(copy))]
572    pub(crate) ripple_scale: f32,
573    /// Whether point captions are drawn beside markers.
574    #[get(type(copy))]
575    pub(crate) show_labels: bool,
576    /// Hosting coordinate system (`Cartesian2d`, `Polar`, `SingleAxis`, or `Geo`).
577    #[get(type(copy))]
578    pub(crate) coordinate_system: EuvChartCoordinateSystem,
579    /// X axis index inside `EuvChartOption::x_axes`.
580    #[get(type(copy))]
581    pub(crate) x_axis_index: usize,
582    /// Y axis index inside `EuvChartOption::y_axes`.
583    #[get(type(copy))]
584    pub(crate) y_axis_index: usize,
585    /// Series mark points, mark lines, and mark areas.
586    pub(crate) annotations: EuvChartAnnotations,
587    /// Optional dataset dimension encoding.
588    #[get(skip)]
589    pub(crate) encode: Option<EuvChartEncode>,
590}
591
592/// Single multivariate polygon dataset inside a radar series.
593#[derive(Clone, Data, Debug, PartialEq)]
594pub struct EuvChartRadarItem {
595    /// Item legend/tooltip name.
596    pub(crate) name: String,
597    /// Numeric values aligned to `EuvChartRadar::indicators`.
598    pub(crate) values: Vec<f32>,
599    /// Optional explicit color overriding the active palette.
600    #[get(skip)]
601    pub(crate) color: Option<Color>,
602}
603
604/// Multivariate radar web series configuration.
605#[derive(Clone, Data, Debug, PartialEq)]
606pub struct EuvChartRadarSeries {
607    /// Ordered radar polygon records.
608    pub(crate) items: Vec<EuvChartRadarItem>,
609    /// Semi-transparent interior fill opacity in `[0.0, 1.0]`.
610    #[get(type(copy))]
611    pub(crate) area_opacity: f32,
612    /// Polygon perimeter stroke width in logical pixels.
613    #[get(type(copy))]
614    pub(crate) line_width: f32,
615    /// Whether crisp circular dots are drawn at each indicator vertex.
616    #[get(type(copy))]
617    pub(crate) show_vertices: bool,
618}
619
620/// Single OHLC candle bar `(open, close, low, high)` for financial K-Line charts.
621#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
622pub struct EuvChartOhlcPoint {
623    /// Period opening price.
624    #[get(type(copy))]
625    pub(crate) open: f32,
626    /// Period closing price.
627    #[get(type(copy))]
628    pub(crate) close: f32,
629    /// Period lowest price.
630    #[get(type(copy))]
631    pub(crate) low: f32,
632    /// Period highest price.
633    #[get(type(copy))]
634    pub(crate) high: f32,
635}
636
637/// Financial candlestick (K-Line) series composable with overlaid moving-average line series.
638#[derive(Clone, Data, Debug, PartialEq)]
639pub struct EuvChartCandlestickSeries {
640    /// Ordered OHLC candles aligned with the X category axis.
641    pub(crate) candles: Vec<EuvChartOhlcPoint>,
642    /// Optional bullish candle color (`close >= open`).
643    #[get(skip)]
644    pub(crate) bull_color: Option<Color>,
645    /// Optional bearish candle color (`close < open`).
646    #[get(skip)]
647    pub(crate) bear_color: Option<Color>,
648    /// X axis index inside `EuvChartOption::x_axes`.
649    #[get(type(copy))]
650    pub(crate) x_axis_index: usize,
651    /// Y axis index inside `EuvChartOption::y_axes`.
652    #[get(type(copy))]
653    pub(crate) y_axis_index: usize,
654    /// Series mark points, mark lines, and mark areas.
655    pub(crate) annotations: EuvChartAnnotations,
656}
657
658/// Five-number statistical summary `[min, q1, median, q3, max]` with optional outliers.
659#[derive(Clone, Data, Debug, PartialEq)]
660pub struct EuvChartBoxplotItem {
661    /// Lower whisker minimum.
662    #[get(type(copy))]
663    pub(crate) min: f32,
664    /// First quartile (25th percentile).
665    #[get(type(copy))]
666    pub(crate) q1: f32,
667    /// Median (50th percentile).
668    #[get(type(copy))]
669    pub(crate) median: f32,
670    /// Third quartile (75th percentile).
671    #[get(type(copy))]
672    pub(crate) q3: f32,
673    /// Upper whisker maximum.
674    #[get(type(copy))]
675    pub(crate) max: f32,
676    /// Optional outlier scalar observations rendered as scatter dots.
677    pub(crate) outliers: Vec<f32>,
678}
679
680/// Statistical box-and-whisker distribution series.
681#[derive(Clone, Data, Debug, PartialEq)]
682pub struct EuvChartBoxplotSeries {
683    /// Ordered box summary records aligned with categories.
684    pub(crate) items: Vec<EuvChartBoxplotItem>,
685    /// X axis index inside `EuvChartOption::x_axes`.
686    #[get(type(copy))]
687    pub(crate) x_axis_index: usize,
688    /// Y axis index inside `EuvChartOption::y_axes`.
689    #[get(type(copy))]
690    pub(crate) y_axis_index: usize,
691    /// Series mark points, mark lines, and mark areas.
692    pub(crate) annotations: EuvChartAnnotations,
693}
694
695/// Single matrix cell plotted inside a Cartesian or Calendar heatmap.
696#[derive(Clone, Data, Debug, PartialEq)]
697pub struct EuvChartHeatmapCell {
698    /// Column index (X category index or calendar week index).
699    #[get(type(copy))]
700    pub(crate) x_index: usize,
701    /// Row index (Y category index or calendar day-of-week `0..7`).
702    #[get(type(copy))]
703    pub(crate) y_index: usize,
704    /// Numeric intensity value mapped through `VisualMap`.
705    #[get(type(copy))]
706    pub(crate) value: f32,
707    /// Optional custom label overriding formatted numeric cell value.
708    pub(crate) label: String,
709}
710
711/// 2D Cartesian matrix or Calendar heatmap series colored via `VisualMap`.
712#[derive(Clone, Data, Debug, PartialEq)]
713pub struct EuvChartHeatmapSeries {
714    /// Ordered heatmap cells.
715    pub(crate) cells: Vec<EuvChartHeatmapCell>,
716    /// When `true`, displays contrast-safe values inside cells.
717    #[get(type(copy))]
718    pub(crate) show_labels: bool,
719    /// Inset gap between adjacent cells in logical pixels.
720    #[get(type(copy))]
721    pub(crate) cell_gap: f32,
722    /// Coordinate system (`Cartesian2d` or `Calendar`).
723    #[get(type(copy))]
724    pub(crate) coordinate_system: EuvChartCoordinateSystem,
725    /// X axis index inside `EuvChartOption::x_axes`.
726    #[get(type(copy))]
727    pub(crate) x_axis_index: usize,
728    /// Y axis index inside `EuvChartOption::y_axes`.
729    #[get(type(copy))]
730    pub(crate) y_axis_index: usize,
731}
732
733/// Recursive hierarchical datum shared by `Treemap`, `Sunburst`, and `Tree` series.
734#[derive(Clone, Data, Debug, PartialEq)]
735pub struct EuvChartHierarchyNode {
736    /// Node display label.
737    pub(crate) name: String,
738    /// Leaf or aggregated numeric weight.
739    #[get(type(copy))]
740    pub(crate) value: f32,
741    /// Optional explicit color tint inherited by descendants.
742    #[get(skip)]
743    pub(crate) color: Option<Color>,
744    /// Nested child nodes.
745    pub(crate) children: Vec<EuvChartHierarchyNode>,
746}
747
748/// Squarified area-proportional hierarchical treemap series.
749#[derive(Clone, Data, Debug, PartialEq)]
750pub struct EuvChartTreemapSeries {
751    /// Top-level hierarchical groups or leaves.
752    pub(crate) nodes: Vec<EuvChartHierarchyNode>,
753    /// Whether parent group header bars are drawn above nested children.
754    #[get(type(copy))]
755    pub(crate) show_headers: bool,
756    /// Gap in logical pixels between sibling rectangles.
757    #[get(type(copy))]
758    pub(crate) cell_gap: f32,
759    /// Corner radius in logical pixels for treemap tiles.
760    #[get(type(copy))]
761    pub(crate) corner_radius: f32,
762}
763
764/// Concentric multi-ring hierarchical sunburst chart series.
765#[derive(Clone, Data, Debug, PartialEq)]
766pub struct EuvChartSunburstSeries {
767    /// Top-level hierarchical rings.
768    pub(crate) nodes: Vec<EuvChartHierarchyNode>,
769    /// Inner hollow radius ratio in `[0.0, 0.5]`.
770    #[get(type(copy))]
771    pub(crate) inner_radius_ratio: f32,
772    /// Outer radius ratio relative to half plot minimum side.
773    #[get(type(copy))]
774    pub(crate) outer_radius_ratio: f32,
775    /// Angular gap between sibling wedges in degrees.
776    #[get(type(copy))]
777    pub(crate) pad_angle_deg: f32,
778    /// Whether wedge labels are drawn inside sufficiently large sectors.
779    #[get(type(copy))]
780    pub(crate) show_labels: bool,
781}
782
783/// Named node column block inside a Sankey flow diagram.
784#[derive(Clone, Data, Debug, PartialEq)]
785pub struct EuvChartSankeyNode {
786    /// Unique node name referenced by `EuvChartSankeyLink`.
787    pub(crate) name: String,
788    /// Optional explicit fill color.
789    #[get(skip)]
790    pub(crate) color: Option<Color>,
791    /// Optional explicit topological column depth override.
792    #[get(skip)]
793    pub(crate) depth: Option<usize>,
794}
795
796/// Weighted directed flow ribbon between two Sankey nodes.
797#[derive(Clone, Data, Debug, New, PartialEq)]
798pub struct EuvChartSankeyLink {
799    /// Source node name.
800    pub(crate) source: String,
801    /// Destination node name.
802    pub(crate) target: String,
803    /// Positive flow magnitude controlling ribbon thickness.
804    #[get(type(copy))]
805    pub(crate) value: f32,
806}
807
808/// Layered topological Sankey flow diagram series.
809#[derive(Clone, Data, Debug, PartialEq)]
810pub struct EuvChartSankeySeries {
811    /// Ordered Sankey nodes.
812    pub(crate) nodes: Vec<EuvChartSankeyNode>,
813    /// Directed weighted flow links.
814    pub(crate) links: Vec<EuvChartSankeyLink>,
815    /// Vertical node rectangle width in logical pixels.
816    #[get(type(copy))]
817    pub(crate) node_width: f32,
818    /// Vertical spacing gap between nodes in the same column.
819    #[get(type(copy))]
820    pub(crate) node_gap: f32,
821    /// Translucent opacity applied to connecting cubic Bézier ribbons.
822    #[get(type(copy))]
823    pub(crate) ribbon_opacity: f32,
824}
825
826/// Single conversion stage trapezoid inside a funnel series.
827#[derive(Clone, Data, Debug, PartialEq)]
828pub struct EuvChartFunnelStage {
829    /// Stage display name.
830    pub(crate) name: String,
831    /// Stage numeric count or percentage weight.
832    #[get(type(copy))]
833    pub(crate) value: f32,
834    /// Optional explicit fill color.
835    #[get(skip)]
836    pub(crate) color: Option<Color>,
837}
838
839/// Ascending or descending conversion funnel trapezoid series.
840#[derive(Clone, Data, Debug, PartialEq)]
841pub struct EuvChartFunnelSeries {
842    /// Ordered conversion funnel stages.
843    pub(crate) stages: Vec<EuvChartFunnelStage>,
844    /// Vertical sorting order (`Descending`, `Ascending`, `None`).
845    #[get(type(copy))]
846    pub(crate) sort: EuvChartFunnelSort,
847    /// Vertical gap in logical pixels between consecutive trapezoids.
848    #[get(type(copy))]
849    pub(crate) gap: f32,
850    /// Whether stage labels are rendered.
851    #[get(type(copy))]
852    pub(crate) show_labels: bool,
853    /// Whether conversion percentage badges are included in labels.
854    #[get(type(copy))]
855    pub(crate) show_percent: bool,
856}
857
858/// Single color zone along a gauge dial arc ending at cumulative ratio `ratio` in `(0.0, 1.0]`.
859#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
860pub struct EuvChartGaugeSegment {
861    /// Cumulative upper ratio of this color band in `(0.0, 1.0]`.
862    #[get(type(copy))]
863    pub(crate) ratio: f32,
864    /// Band stroke color.
865    #[get(type(copy))]
866    pub(crate) color: Color,
867}
868
869/// Circular instrument gauge series with multi-segment ring, ticks, progress arc, needle, and readout.
870#[derive(Clone, Data, Debug, PartialEq)]
871pub struct EuvChartGaugeSeries {
872    /// Current numeric reading displayed by needle and progress arc.
873    #[get(type(copy))]
874    pub(crate) value: f32,
875    /// Minimum scale value.
876    #[get(type(copy))]
877    pub(crate) min: f32,
878    /// Maximum scale value.
879    #[get(type(copy))]
880    pub(crate) max: f32,
881    /// Unit suffix rendered next to the center numeric readout (e.g. `"%"` or `"km/h"`).
882    pub(crate) unit: String,
883    /// Caption label displayed below the dial center.
884    pub(crate) title: String,
885    /// Sweep start angle in degrees (`225.0` = bottom-left).
886    #[get(type(copy))]
887    pub(crate) start_angle_deg: f32,
888    /// Sweep end angle in degrees (`-45.0` = bottom-right).
889    #[get(type(copy))]
890    pub(crate) end_angle_deg: f32,
891    /// Number of major tick intervals around the dial.
892    #[get(type(copy))]
893    pub(crate) split_number: usize,
894    /// When `true`, highlights the swept progress arc from `min` to `value`.
895    #[get(type(copy))]
896    pub(crate) show_progress: bool,
897    /// When `true`, draws the tapered center pointer needle.
898    #[get(type(copy))]
899    pub(crate) show_pointer: bool,
900    /// Optional color zone segments along the outer dial ring.
901    pub(crate) segments: Vec<EuvChartGaugeSegment>,
902}
903
904/// Single vertex inside a relational `Graph` series.
905#[derive(Clone, Data, Debug, PartialEq)]
906pub struct EuvChartGraphNode {
907    /// Unique vertex identifier referenced by edges.
908    pub(crate) id: String,
909    /// Human-readable display label.
910    pub(crate) name: String,
911    /// Associated numeric weight.
912    #[get(type(copy))]
913    pub(crate) value: f32,
914    /// Visual circle radius in logical pixels.
915    #[get(type(copy))]
916    pub(crate) size: f32,
917    /// Category index controlling node tint color.
918    #[get(type(copy))]
919    pub(crate) category: usize,
920    /// Optional pre-assigned normalized X position in `[0.0, 1.0]`.
921    #[get(skip)]
922    pub(crate) x: Option<f32>,
923    /// Optional pre-assigned normalized Y position in `[0.0, 1.0]`.
924    #[get(skip)]
925    pub(crate) y: Option<f32>,
926    /// Optional explicit color overriding category palette.
927    #[get(skip)]
928    pub(crate) color: Option<Color>,
929}
930
931/// Directed or undirected connector edge inside a relational `Graph` series.
932#[derive(Clone, Data, Debug, PartialEq)]
933pub struct EuvChartGraphEdge {
934    /// Source node `id`.
935    pub(crate) source: String,
936    /// Target node `id`.
937    pub(crate) target: String,
938    /// Relative stroke weight.
939    #[get(type(copy))]
940    pub(crate) weight: f32,
941    /// Optional edge label.
942    pub(crate) label: String,
943    /// Quadratic curve bow ratio (`0.0` = straight segment).
944    #[get(type(copy))]
945    pub(crate) curveness: f32,
946}
947
948/// Relational network graph series supporting deterministic force-directed and circular layouts.
949#[derive(Clone, Data, Debug, PartialEq)]
950pub struct EuvChartGraphSeries {
951    /// Graph vertices.
952    pub(crate) nodes: Vec<EuvChartGraphNode>,
953    /// Graph edges.
954    pub(crate) edges: Vec<EuvChartGraphEdge>,
955    /// Category legend labels indexed by `EuvChartGraphNode::category`.
956    pub(crate) categories: Vec<String>,
957    /// Layout algorithm (`Force`, `Circular`, or `None`).
958    #[get(type(copy))]
959    pub(crate) layout: EuvChartGraphLayout,
960    /// When `true`, draws directional arrowheads at edge destinations.
961    #[get(type(copy))]
962    pub(crate) directed: bool,
963    /// When `true`, draws node captions next to vertices.
964    #[get(type(copy))]
965    pub(crate) show_labels: bool,
966    /// Force-directed relaxation iteration count.
967    #[get(type(copy))]
968    pub(crate) iterations: usize,
969}
970
971/// Hierarchical node-link tree series supporting orthogonal (`LeftRight` / `TopBottom`) and `Radial` layouts.
972#[derive(Clone, Data, Debug, PartialEq)]
973pub struct EuvChartTreeSeries {
974    /// Root hierarchical tree node.
975    pub(crate) root: EuvChartHierarchyNode,
976    /// Tree orientation (`OrthogonalLeftRight`, `OrthogonalTopBottom`, `Radial`).
977    #[get(type(copy))]
978    pub(crate) layout: EuvChartTreeLayout,
979    /// Node marker circle radius in logical pixels.
980    #[get(type(copy))]
981    pub(crate) symbol_size: f32,
982    /// Whether node labels are displayed.
983    #[get(type(copy))]
984    pub(crate) show_labels: bool,
985}
986
987/// Single vertical dimension axis inside a parallel coordinates series.
988#[derive(Clone, Data, Debug, PartialEq)]
989pub struct EuvChartParallelAxis {
990    /// Dimension axis heading.
991    pub(crate) name: String,
992    /// Optional explicit lower bound.
993    #[get(skip)]
994    pub(crate) min: Option<f32>,
995    /// Optional explicit upper bound.
996    #[get(skip)]
997    pub(crate) max: Option<f32>,
998    /// Optional categorical tick labels for discrete dimensions.
999    pub(crate) categories: Vec<String>,
1000}
1001
1002/// Single multivariate polyline observation inside a parallel coordinates series.
1003#[derive(Clone, Data, Debug, PartialEq)]
1004pub struct EuvChartParallelRow {
1005    /// Row identifier or label.
1006    pub(crate) name: String,
1007    /// Dimension values aligned to `EuvChartParallelSeries::axes`.
1008    pub(crate) values: Vec<f32>,
1009    /// Category index used for categorical coloring when `VisualMap` is absent.
1010    #[get(type(copy))]
1011    pub(crate) category: usize,
1012    /// Optional explicit stroke color.
1013    #[get(skip)]
1014    pub(crate) color: Option<Color>,
1015}
1016
1017/// Multidimensional parallel coordinates polyline series.
1018#[derive(Clone, Data, Debug, PartialEq)]
1019pub struct EuvChartParallelSeries {
1020    /// Ordered parallel dimension axes.
1021    pub(crate) axes: Vec<EuvChartParallelAxis>,
1022    /// Multivariate observation polylines.
1023    pub(crate) rows: Vec<EuvChartParallelRow>,
1024    /// Polyline stroke width in logical pixels.
1025    #[get(type(copy))]
1026    pub(crate) line_width: f32,
1027    /// Polyline opacity in `(0.0, 1.0]`.
1028    #[get(type(copy))]
1029    pub(crate) line_opacity: f32,
1030}
1031
1032/// Single directed curved flow arc between two Cartesian or Geo coordinates.
1033#[derive(Clone, Data, Debug, PartialEq)]
1034pub struct EuvChartFlowArc {
1035    /// Origin location or label.
1036    pub(crate) from_name: String,
1037    /// Destination location or label.
1038    pub(crate) to_name: String,
1039    /// Origin X coordinate (or longitude in degrees on `Geo`).
1040    #[get(type(copy))]
1041    pub(crate) from_x: f32,
1042    /// Origin Y coordinate (or latitude in degrees on `Geo`).
1043    #[get(type(copy))]
1044    pub(crate) from_y: f32,
1045    /// Destination X coordinate (or longitude in degrees on `Geo`).
1046    #[get(type(copy))]
1047    pub(crate) to_x: f32,
1048    /// Destination Y coordinate (or latitude in degrees on `Geo`).
1049    #[get(type(copy))]
1050    pub(crate) to_y: f32,
1051    /// Flow magnitude value.
1052    #[get(type(copy))]
1053    pub(crate) value: f32,
1054    /// Optional explicit arc color.
1055    #[get(skip)]
1056    pub(crate) color: Option<Color>,
1057}
1058
1059/// Quadratic curved directional flow arcs series on Cartesian or Geo coordinates.
1060#[derive(Clone, Data, Debug, PartialEq)]
1061pub struct EuvChartLinesSeries {
1062    /// Ordered directed flow arcs.
1063    pub(crate) arcs: Vec<EuvChartFlowArc>,
1064    /// Quadratic perpendicular curvature factor (`0.2` produces a gentle flight arc).
1065    #[get(type(copy))]
1066    pub(crate) curveness: f32,
1067    /// Arc stroke width in logical pixels.
1068    #[get(type(copy))]
1069    pub(crate) line_width: f32,
1070    /// When `true`, draws directional arrowheads at each destination point.
1071    #[get(type(copy))]
1072    pub(crate) show_arrows: bool,
1073    /// Hosting coordinate system (`Cartesian2d` or `Geo`).
1074    #[get(type(copy))]
1075    pub(crate) coordinate_system: EuvChartCoordinateSystem,
1076    /// X axis index inside `EuvChartOption::x_axes`.
1077    #[get(type(copy))]
1078    pub(crate) x_axis_index: usize,
1079    /// Y axis index inside `EuvChartOption::y_axes`.
1080    #[get(type(copy))]
1081    pub(crate) y_axis_index: usize,
1082}
1083
1084/// Single `(time, value, theme)` entry inside a centered ThemeRiver streamgraph.
1085#[derive(Clone, Data, Debug, New, PartialEq)]
1086pub struct EuvChartThemeRiverPoint {
1087    /// Numeric timestamp or time step.
1088    #[get(type(copy))]
1089    pub(crate) time: f32,
1090    /// Non-negative stream thickness at `time`.
1091    #[get(type(copy))]
1092    pub(crate) value: f32,
1093    /// Stream theme category name.
1094    pub(crate) theme: String,
1095}
1096
1097/// Centered stacked streamgraph ribbon series over time.
1098#[derive(Clone, Data, Debug, PartialEq)]
1099pub struct EuvChartThemeRiverSeries {
1100    /// Stream observations across time steps and themes.
1101    pub(crate) points: Vec<EuvChartThemeRiverPoint>,
1102    /// Whether stream theme labels are drawn on the leading edge.
1103    #[get(type(copy))]
1104    pub(crate) show_labels: bool,
1105    /// Whether stream boundaries use smooth curve interpolation.
1106    #[get(type(copy))]
1107    pub(crate) smooth: bool,
1108}
1109
1110/// Stacked glyph-symbol pictorial bar series.
1111#[derive(Clone, Data, Debug, PartialEq)]
1112pub struct EuvChartPictorialBarSeries {
1113    /// Ordered category-aligned numeric values.
1114    pub(crate) values: Vec<f32>,
1115    /// Repeated symbol glyph (`RoundRect`, `Diamond`, `Circle`, `Rect`, `Triangle`).
1116    #[get(type(copy))]
1117    pub(crate) symbol: EuvChartSymbol,
1118    /// When `true`, stacks discrete symbols up to the value height; when `false`, stretches one glyph.
1119    #[get(type(copy))]
1120    pub(crate) symbol_repeat: bool,
1121    /// Individual glyph size in logical pixels.
1122    #[get(type(copy))]
1123    pub(crate) symbol_size: f32,
1124    /// X axis index inside `EuvChartOption::x_axes`.
1125    #[get(type(copy))]
1126    pub(crate) x_axis_index: usize,
1127    /// Y axis index inside `EuvChartOption::y_axes`.
1128    #[get(type(copy))]
1129    pub(crate) y_axis_index: usize,
1130}
1131
1132/// Read-only coordinate and theme context passed into a custom series painter callback.
1133#[derive(Clone, Data, Debug, PartialEq)]
1134pub struct EuvChartCustomDrawContext {
1135    /// Active plot bounds in logical pixels.
1136    #[get(type(copy))]
1137    pub(crate) plot_rect: Rect,
1138    /// Resolved X-axis minimum value.
1139    #[get(type(copy))]
1140    pub(crate) x_min: f32,
1141    /// Resolved X-axis maximum value.
1142    #[get(type(copy))]
1143    pub(crate) x_max: f32,
1144    /// Resolved Y-axis minimum value.
1145    #[get(type(copy))]
1146    pub(crate) y_min: f32,
1147    /// Resolved Y-axis maximum value.
1148    #[get(type(copy))]
1149    pub(crate) y_max: f32,
1150    /// Active categorical color palette.
1151    pub(crate) palette: Vec<Color>,
1152    /// Active UI theme tokens.
1153    #[get(type(copy))]
1154    pub(crate) tokens: ThemeTokens,
1155    /// Current pointer coordinates in logical pixels when hovering the plot.
1156    #[get(skip)]
1157    pub(crate) hover_pos: Option<Point>,
1158}
1159
1160/// Custom user vector painter series invoking a caller-provided `DrawCommand` callback.
1161#[derive(Clone, CustomDebug, Data)]
1162pub struct EuvChartCustomSeries {
1163    /// Numeric sample values contributing to auto-axis domain sizing.
1164    pub(crate) values: Vec<f32>,
1165    /// Optional custom `DrawCommand` painter closure.
1166    #[debug(skip)]
1167    #[get(skip)]
1168    pub(crate) painter: Option<EuvChartCustomPainter>,
1169    /// X axis index inside `EuvChartOption::x_axes`.
1170    #[get(type(copy))]
1171    pub(crate) x_axis_index: usize,
1172    /// Y axis index inside `EuvChartOption::y_axes`.
1173    #[get(type(copy))]
1174    pub(crate) y_axis_index: usize,
1175}
1176
1177/// Single region choropleth value for `GeoMap`.
1178#[derive(Clone, Data, Debug, PartialEq)]
1179pub struct EuvChartGeoDatum {
1180    /// Region name matching a built-in or custom `EuvChartGeoRegion::name`.
1181    pub(crate) region_name: String,
1182    /// Numeric metric mapped through `VisualMap`.
1183    #[get(type(copy))]
1184    pub(crate) value: f32,
1185    /// Optional explicit fill color overriding `VisualMap`.
1186    #[get(skip)]
1187    pub(crate) color: Option<Color>,
1188}
1189
1190/// Geographic choropleth map series over built-in world/continent or custom polygons.
1191#[derive(Clone, Data, Debug, PartialEq)]
1192pub struct EuvChartGeoMapSeries {
1193    /// Region metric records.
1194    pub(crate) data: Vec<EuvChartGeoDatum>,
1195    /// Whether region name captions are drawn atop filled polygons.
1196    #[get(type(copy))]
1197    pub(crate) show_labels: bool,
1198    /// Polygon border stroke width in logical pixels.
1199    #[get(type(copy))]
1200    pub(crate) border_width: f32,
1201}
1202
1203/// Named series wrapper pairing a legend name, optional tint, visibility flag, and typed series payload.
1204#[derive(Clone, Data, Debug)]
1205pub struct EuvChartSeries {
1206    /// Legend and tooltip series name.
1207    pub(crate) name: String,
1208    /// Optional explicit series color overriding `color_palette`.
1209    #[get(skip)]
1210    pub(crate) color: Option<Color>,
1211    /// Initial visibility state (toggled interactively via the legend).
1212    #[get(type(copy))]
1213    pub(crate) visible: bool,
1214    /// Concrete series variant and dataset.
1215    pub(crate) data: EuvChartSeriesData,
1216}
1217
1218/// Complete declarative Apache ECharts option document rendered natively by `EuvEChart`.
1219#[derive(Clone, Data, Debug, Default)]
1220pub struct EuvChartOption {
1221    /// Optional chart title and subtitle block.
1222    #[get(skip)]
1223    pub(crate) title: Option<EuvChartTitle>,
1224    /// Optional interactive legend strip.
1225    #[get(skip)]
1226    pub(crate) legend: Option<EuvChartLegend>,
1227    /// One or more Cartesian subplot grids.
1228    pub(crate) grid: Vec<EuvChartGrid>,
1229    /// Horizontal axes (supporting dual/multi-axis via `x_axis_index`).
1230    pub(crate) x_axes: Vec<EuvChartAxis>,
1231    /// Vertical axes (supporting dual/multi-axis via `y_axis_index`).
1232    pub(crate) y_axes: Vec<EuvChartAxis>,
1233    /// Optional polar coordinate system.
1234    #[get(skip)]
1235    pub(crate) polar: Option<EuvChartPolar>,
1236    /// Optional multivariate radar coordinate system.
1237    #[get(skip)]
1238    pub(crate) radar: Option<EuvChartRadar>,
1239    /// Optional single 1D axis coordinate system.
1240    #[get(skip)]
1241    pub(crate) single_axis: Option<EuvChartSingleAxis>,
1242    /// Optional calendar week-by-day matrix coordinate system.
1243    #[get(skip)]
1244    pub(crate) calendar: Option<EuvChartCalendar>,
1245    /// Optional geographic coordinate system.
1246    #[get(skip)]
1247    pub(crate) geo: Option<EuvChartGeo>,
1248    /// Optional interactive hover tooltip and crosshair axis-pointer configuration.
1249    #[get(skip)]
1250    pub(crate) tooltip: Option<EuvChartTooltip>,
1251    /// Interactive `Inside` and `Slider` data-zoom controllers.
1252    pub(crate) data_zoom: Vec<EuvChartDataZoom>,
1253    /// Optional continuous gradient or piecewise discrete color visual-map controller.
1254    #[get(skip)]
1255    pub(crate) visual_map: Option<EuvChartVisualMap>,
1256    /// Optional compact icon-only toolbox toolbar.
1257    #[get(skip)]
1258    pub(crate) toolbox: Option<EuvChartToolbox>,
1259    /// Optional shared tabular dataset referenced by series `encode` mappings.
1260    #[get(skip)]
1261    pub(crate) dataset: Option<EuvChartDataset>,
1262    /// Optional explicit color palette overriding the theme-derived ECharts palette.
1263    #[get(skip)]
1264    pub(crate) color_palette: Option<Vec<Color>>,
1265    /// Ordered series list rendered back-to-front.
1266    pub(crate) series: Vec<EuvChartSeries>,
1267    /// Optional explicit canvas background color overriding `ThemePalette::card`.
1268    #[get(skip)]
1269    pub(crate) background: Option<Color>,
1270}