euv_chart/option/struct.rs
1use super::*;
2
3/// The horizontal and vertical placement of a label relative to its
4/// anchor.
5#[derive(Clone, Copy, Debug, Default, PartialEq)]
6pub struct LabelOffset {
7 /// The horizontal offset, in pixels.
8 pub x: f64,
9 /// The vertical offset, in pixels.
10 pub y: f64,
11}
12
13/// The fill, stroke, and shadow of a shape, as configured on a series or
14/// a data point.
15#[derive(Clone, Debug, Default, PartialEq)]
16pub struct ItemStyleOption {
17 /// The fill colour, as a CSS colour string.
18 pub color: Option<String>,
19 /// The fill colour of the border.
20 pub border_color: Option<String>,
21 /// The width of the border.
22 pub border_width: Option<f64>,
23 /// The radius of the border's rounded corners.
24 pub border_radius: Option<f64>,
25 /// The shadow cast by the shape.
26 pub shadow: Option<ShadowOption>,
27 /// The opacity of the shape.
28 pub opacity: Option<f64>,
29 /// A gradient fill, as `[from, to]` in chart coordinates.
30 pub gradient: Option<(String, String)>,
31}
32
33/// The shadow cast by a shape.
34#[derive(Clone, Debug, Default, PartialEq)]
35pub struct ShadowOption {
36 /// The horizontal offset of the shadow.
37 pub offset_x: f64,
38 /// The vertical offset of the shadow.
39 pub offset_y: f64,
40 /// The blur radius of the shadow.
41 pub blur: f64,
42 /// The colour of the shadow.
43 pub color: Option<String>,
44}
45
46/// The stroke of a shape or a line.
47#[derive(Clone, Debug, Default, PartialEq)]
48pub struct LineStyleOption {
49 /// The colour of the line.
50 pub color: Option<String>,
51 /// The width of the line.
52 pub width: Option<f64>,
53 /// The dash pattern type.
54 pub line_type: Option<LineType>,
55 /// The opacity of the line.
56 pub opacity: Option<f64>,
57 /// The cap drawn at the ends of the line.
58 pub cap: Option<LineCap>,
59 /// The join drawn between two segments.
60 pub join: Option<LineJoin>,
61 /// The shadow cast by the line.
62 pub shadow: Option<ShadowOption>,
63}
64
65/// The text drawn next to a data point, an axis, or a legend entry.
66#[derive(Clone, Debug, Default, lombok_macros::Data, PartialEq)]
67pub struct LabelOption {
68 /// Whether the label is drawn.
69 #[get(type(copy))]
70 pub show: bool,
71 /// The text of the label.
72 ///
73 /// `None` means "derive it from the data"; a template uses the
74 /// ECharts syntax, for example `"{b}: {c}"`.
75 #[get(type(clone))]
76 pub text: Option<String>,
77 /// The position of the label relative to its anchor.
78 #[get(type(copy))]
79 pub position: Option<Position>,
80 /// The offset of the label from its anchor.
81 #[get(type(copy))]
82 pub offset: Option<LabelOffset>,
83 /// The distance between the label and the anchor, in pixels.
84 #[get(type(copy))]
85 pub distance: Option<f64>,
86 /// The rotation of the label, in degrees.
87 #[get(type(copy))]
88 pub rotate: Option<f64>,
89 /// The alignment of the label.
90 #[get(type(copy))]
91 pub align: Option<TextAlign>,
92 /// The vertical alignment of the label.
93 #[get(type(copy))]
94 pub vertical_align: Option<TextVerticalAlign>,
95 /// The colour of the label.
96 #[get(type(clone))]
97 pub color: Option<String>,
98 /// The font family of the label.
99 #[get(type(clone))]
100 pub font_family: Option<String>,
101 /// The font size of the label, in pixels.
102 #[get(type(copy))]
103 pub font_size: Option<f64>,
104 /// The font weight of the label.
105 #[get(type(clone))]
106 pub font_weight: Option<String>,
107 /// The font style of the label.
108 #[get(type(clone))]
109 pub font_style: Option<String>,
110 /// The line height of the label, as a multiple of the font size.
111 #[get(type(copy))]
112 pub line_height: Option<f64>,
113 /// The background colour of the label.
114 #[get(type(clone))]
115 pub background_color: Option<String>,
116 /// The padding inside the label's background.
117 #[get(type(copy))]
118 pub padding: Option<(f64, f64, f64, f64)>,
119 /// The border colour of the label's background.
120 #[get(type(clone))]
121 pub border_color: Option<String>,
122 /// The border width of the label's background.
123 #[get(type(copy))]
124 pub border_width: Option<f64>,
125 /// The radius of the label's background corners.
126 #[get(type(copy))]
127 pub border_radius: Option<f64>,
128 /// Whether the label is stroked with an outline.
129 #[get(type(copy))]
130 pub stroke: Option<bool>,
131 /// The width of the label's outline.
132 #[get(type(copy))]
133 pub stroke_width: Option<f64>,
134 /// The colour of the label's outline.
135 #[get(type(clone))]
136 pub stroke_color: Option<String>,
137 /// Whether the label is hidden when it would overlap another one.
138 #[get(type(copy))]
139 pub hide_overlap: Option<bool>,
140 /// The formatter used when the text is not a template.
141 #[get(type(clone))]
142 pub formatter: Option<String>,
143}
144
145/// The rules that move labels out of each other's way.
146#[derive(Clone, Debug, Default, PartialEq)]
147pub struct LabelLayoutOption {
148 /// Whether the layout runs.
149 pub hide_overlap: bool,
150 /// The horizontal drift allowed when hiding overlaps, in pixels.
151 pub move_tolerance: Option<f64>,
152 /// The label fields that participate in the layout.
153 pub label_line_lengths: Option<Vec<f64>>,
154}
155
156/// The style applied to a data point when it is highlighted.
157#[derive(Clone, Debug, Default, PartialEq)]
158pub struct EmphasisOption {
159 /// Whether the emphasis style is applied.
160 pub enabled: bool,
161 /// The fill of the highlighted shape.
162 pub item_style: Option<ItemStyleOption>,
163 /// The stroke of the highlighted shape.
164 pub line_style: Option<LineStyleOption>,
165 /// The label of the highlighted shape.
166 pub label: Option<LabelOption>,
167 /// The scale the highlighted shape is drawn at.
168 pub scale: Option<bool>,
169 /// The focus mode of the highlight.
170 pub focus: Option<String>,
171 /// The blur applied to the other data points.
172 pub blur: Option<BlurOption>,
173}
174
175/// The blur applied to the data points that are not highlighted.
176#[derive(Clone, Debug, Default, PartialEq)]
177pub struct BlurOption {
178 /// The opacity of the blurred shapes.
179 pub item_style: Option<ItemStyleOption>,
180 /// The opacity of the blurred lines.
181 pub line_style: Option<LineStyleOption>,
182 /// The opacity of the blurred labels.
183 pub label: Option<LabelOption>,
184}
185
186/// A mark drawn at a data point.
187#[derive(Clone, Debug, Default, PartialEq)]
188pub struct MarkPointOption {
189 /// The symbol drawn at the point.
190 pub symbol: Option<String>,
191 /// The size of the symbol.
192 pub symbol_size: Option<f64>,
193 /// The fill of the symbol.
194 pub item_style: Option<ItemStyleOption>,
195 /// The label of the symbol.
196 pub label: Option<LabelOption>,
197 /// The points to mark.
198 pub data: Vec<DataValue>,
199}
200
201/// A line drawn across the series.
202#[derive(Clone, Debug, Default, PartialEq)]
203pub struct MarkLineOption {
204 /// Whether the mark line is drawn.
205 pub silent: bool,
206 /// The stroke of the mark line.
207 pub line_style: Option<LineStyleOption>,
208 /// The label of the mark line.
209 pub label: Option<LabelOption>,
210 /// The kind of the mark line.
211 pub mark_type: Option<MarkLineType>,
212 /// The data the mark line is computed from.
213 pub data: Vec<DataValue>,
214}
215
216/// An area highlighted across the series.
217#[derive(Clone, Debug, Default, PartialEq)]
218pub struct MarkAreaOption {
219 /// Whether the marked area is silent to pointer events.
220 pub silent: bool,
221 /// The fill of the marked area.
222 pub item_style: Option<ItemStyleOption>,
223 /// The label of the marked area.
224 pub label: Option<LabelOption>,
225 /// The data the marked area is computed from.
226 pub data: Vec<DataValue>,
227}
228
229/// The options specific to a bar series.
230#[derive(Clone, Debug, Default, PartialEq)]
231pub struct BarOptions {
232 /// The width of the bars, in pixels.
233 pub bar_width: Option<f64>,
234 /// The maximum width of the bars, in pixels.
235 pub bar_max_width: Option<f64>,
236 /// The minimum width of the bars, in pixels.
237 pub bar_min_width: Option<f64>,
238 /// The width of the gap between bars, as a fraction of the bar width.
239 pub bar_gap: Option<String>,
240 /// The width of the gap between bar groups, as a fraction of the bar
241 /// width.
242 pub bar_category_gap: Option<String>,
243 /// Whether the bars are drawn horizontally.
244 pub horizontal: bool,
245 /// The colour of the background behind the bars.
246 pub show_background: bool,
247 /// The fill of the background behind the bars.
248 pub background_style: Option<ItemStyleOption>,
249 /// The border radius of the bars.
250 pub bar_min_radius: Option<f64>,
251 /// Whether the bars are stacked.
252 pub stack: Option<String>,
253}
254
255/// The options specific to a line series.
256#[derive(Clone, Debug, Default, PartialEq)]
257pub struct LineOptions {
258 /// Whether the area under the line is filled.
259 pub area_style: Option<ItemStyleOption>,
260 /// How the points are connected.
261 pub smooth: Option<LineSmooth>,
262 /// How steep a smoothed curve may get, from `0.0` to `1.0`.
263 pub smooth_monotone: Option<String>,
264 /// Whether the line is drawn.
265 pub show_symbol: Option<bool>,
266 /// The shape of the data point symbols.
267 pub symbol: Option<SymbolType>,
268 /// The size of the data point symbols.
269 pub symbol_size: Option<SymbolSize>,
270 /// The rotation of the data point symbols, in degrees.
271 pub symbol_rotate: Option<f64>,
272 /// The number of pixels between two symbols; symbols are hidden when
273 /// the points are closer than this.
274 pub show_all_symbol: Option<bool>,
275 /// Whether the data points are clipped by the grid.
276 pub clip: Option<bool>,
277 /// The stack the line belongs to.
278 pub stack: Option<String>,
279}
280
281/// The options specific to a pie series.
282#[derive(Clone, Debug, Default, PartialEq)]
283pub struct PieOptions {
284 /// The radius of the pie, as a percentage of the smaller of the
285 /// container width and height.
286 pub radius: Option<String>,
287 /// The inner radius of the doughnut, as a percentage of the outer
288 /// radius.
289 pub inner_radius: Option<String>,
290 /// The centre of the pie, as a percentage of the container.
291 pub center: Option<Vec<String>>,
292 /// The angle the first slice starts at, in degrees.
293 pub start_angle: Option<f64>,
294 /// The angle between two slices, in degrees.
295 pub min_angle: Option<f64>,
296 /// The angle the slices are drawn through, in degrees.
297 pub max_angle: Option<f64>,
298 /// The angle of the selected slice, in degrees.
299 pub selected_offset: Option<f64>,
300 /// Whether the slices are sorted by value.
301 pub sort: Option<bool>,
302 /// Whether the pie is drawn as a rose chart.
303 pub rose_type: Option<String>,
304 /// The label of a slice.
305 pub label: Option<LabelOption>,
306 /// The line between a slice and its label.
307 pub label_line: Option<LineStyleOption>,
308 /// Whether the edges between slices are rounded.
309 pub round_cap: Option<bool>,
310 /// The number of pixels the pie is pulled in by, to avoid overlapping
311 /// the edge of the container.
312 pub avoid_label_overlap: Option<bool>,
313}
314
315/// The options specific to a scatter series.
316#[derive(Clone, Debug, Default, PartialEq)]
317pub struct ScatterOptions {
318 /// The shape of the symbols.
319 pub symbol: Option<SymbolType>,
320 /// The size of the symbols.
321 pub symbol_size: Option<SymbolSize>,
322 /// The rotation of the symbols, in degrees.
323 pub symbol_rotate: Option<f64>,
324 /// The largest size a symbol may take, when the size is computed from
325 /// the data.
326 pub symbol_max_size: Option<f64>,
327 /// Whether the symbols are drawn in a separate pass, which keeps them
328 /// readable when they overlap.
329 pub large: bool,
330 /// The threshold, in pixels, above which the large mode is used.
331 pub large_threshold: Option<f64>,
332 /// Whether the series is drawn in the large mode.
333 pub progressive: Option<usize>,
334}
335
336/// The options specific to a radar series.
337#[derive(Clone, Debug, Default, PartialEq)]
338pub struct RadarOptions {
339 /// The centre of the radar, as a percentage of the container.
340 pub center: Option<Vec<String>>,
341 /// The radius of the radar, as a percentage of the container.
342 pub radius: Option<String>,
343 /// The number of sides of the radar.
344 pub split_number: Option<usize>,
345 /// The shape of the radar.
346 pub shape: Option<String>,
347 /// The starting angle of the radar, in degrees.
348 pub start_angle: Option<f64>,
349 /// The area under the radar is filled.
350 pub area_style: Option<ItemStyleOption>,
351}
352
353/// The options specific to a gauge series.
354#[derive(Clone, Debug, Default, PartialEq)]
355pub struct GaugeOptions {
356 /// The centre of the gauge, as a percentage of the container.
357 pub center: Option<Vec<String>>,
358 /// The radius of the gauge, as a percentage of the container.
359 pub radius: Option<String>,
360 /// The start angle of the gauge, in degrees.
361 pub start_angle: Option<f64>,
362 /// The end angle of the gauge, in degrees.
363 pub end_angle: Option<f64>,
364 /// The minimum value of the gauge.
365 pub min: Option<f64>,
366 /// The maximum value of the gauge.
367 pub max: Option<f64>,
368 /// The number of segments the gauge is split into.
369 pub split_number: Option<usize>,
370 /// The progress arc of the gauge.
371 pub progress: Option<GaugeProgressOption>,
372 /// The pointer of the gauge.
373 pub axis_line: Option<AxisLineOption>,
374 /// The axis line of the gauge.
375 pub axis_tick: Option<AxisTickOption>,
376 /// The split line of the gauge.
377 pub split_line: Option<SplitLineOption>,
378 /// The pointer of the gauge.
379 pub pointer: Option<PointerOption>,
380 /// The anchor of the gauge's pointer.
381 pub anchor: Option<PointerOption>,
382 /// The title of the gauge.
383 pub title: Option<LabelOption>,
384 /// The detail of the gauge.
385 pub detail: Option<LabelOption>,
386}
387
388/// The progress arc of a gauge.
389#[derive(Clone, Debug, Default, PartialEq)]
390pub struct GaugeProgressOption {
391 /// Whether the arc is drawn.
392 pub show: bool,
393 /// The width of the arc.
394 pub width: Option<f64>,
395 /// The colour of the arc.
396 pub item_style: Option<ItemStyleOption>,
397 /// The kind of the arc.
398 pub round_cap: Option<bool>,
399}
400
401/// The axis line of a gauge.
402#[derive(Clone, Debug, Default, PartialEq)]
403pub struct AxisLineOption {
404 /// Whether the axis line is drawn.
405 pub show: bool,
406 /// The line style of the axis line.
407 pub line_style: Option<LineStyleOption>,
408}
409
410/// The tick marks of a gauge.
411#[derive(Clone, Debug, Default, PartialEq)]
412pub struct AxisTickOption {
413 /// Whether the ticks are drawn.
414 pub show: bool,
415 /// The length of the ticks.
416 pub length: Option<f64>,
417 /// The line style of the ticks.
418 pub line_style: Option<LineStyleOption>,
419}
420
421/// The split lines of a gauge.
422#[derive(Clone, Debug, Default, PartialEq)]
423pub struct SplitLineOption {
424 /// Whether the split lines are drawn.
425 pub show: bool,
426 /// The length of the split lines.
427 pub length: Option<f64>,
428 /// The line style of the split lines.
429 pub line_style: Option<LineStyleOption>,
430}
431
432/// The pointer of a gauge.
433#[derive(Clone, Debug, Default, PartialEq)]
434pub struct PointerOption {
435 /// Whether the pointer is drawn.
436 pub show: bool,
437 /// The width of the pointer.
438 pub width: Option<f64>,
439 /// The length of the pointer.
440 pub length: Option<String>,
441 /// The line style of the pointer.
442 pub item_style: Option<ItemStyleOption>,
443}
444
445/// The options specific to a funnel series.
446#[derive(Clone, Debug, Default, PartialEq)]
447pub struct FunnelOptions {
448 /// The centre of the funnel.
449 pub center: Option<Vec<String>>,
450 /// The width of the funnel.
451 pub width: Option<String>,
452 /// The height of the funnel.
453 pub height: Option<String>,
454 /// The gap between two stages, as a fraction of the stage height.
455 pub gap: Option<f64>,
456 /// The label of a stage.
457 pub label: Option<LabelOption>,
458 /// The line between a stage and its label.
459 pub label_line: Option<LineStyleOption>,
460 /// The minimum size of a stage, as a percentage of the widest one.
461 pub min_size: Option<String>,
462 /// The maximum size of a stage, as a percentage of the widest one.
463 pub max_size: Option<String>,
464 /// Whether the stages are sorted by value.
465 pub sort: Option<bool>,
466}
467
468/// The options specific to a heatmap series.
469#[derive(Clone, Debug, Default, PartialEq)]
470pub struct HeatmapOptions {
471 /// The border width between cells.
472 pub border_width: Option<f64>,
473 /// The border colour between cells.
474 pub border_color: Option<String>,
475 /// The radius of the cells' corners.
476 pub item_style: Option<ItemStyleOption>,
477 /// The minimum size of a cell, in pixels.
478 pub min_size: Option<f64>,
479 /// The label of a cell.
480 pub label: Option<LabelOption>,
481}
482
483/// The options specific to a graph series.
484#[derive(Clone, Debug, Default, PartialEq)]
485pub struct GraphOptions {
486 /// The layout used to place the nodes.
487 pub layout: Option<GraphLayout>,
488 /// Whether the graph can be panned and zoomed.
489 pub roam: Option<bool>,
490 /// Whether the nodes are dragged.
491 pub draggable: Option<bool>,
492 /// The size of the node symbols.
493 pub symbol_size: Option<SymbolSize>,
494 /// The shape of the node symbols.
495 pub symbol: Option<SymbolType>,
496 /// The label of a node.
497 pub label: Option<LabelOption>,
498 /// The stroke of the links.
499 pub line_style: Option<LineStyleOption>,
500 /// The curvature of the links.
501 pub edge_curveness: Option<f64>,
502 /// The orientation of the links.
503 pub edge_symbol: Option<Vec<String>>,
504 /// Whether the links are drawn.
505 pub links: Option<Vec<DataValue>>,
506}
507
508/// The options specific to a treemap series.
509#[derive(Clone, Debug, Default, PartialEq)]
510pub struct TreemapOptions {
511 /// The layout of the treemap.
512 pub layout: Option<TreemapLayout>,
513 /// The width of the gap between the tiles.
514 pub left: Option<f64>,
515 /// The right gap between the tiles.
516 pub right: Option<f64>,
517 /// The top gap between the tiles.
518 pub top: Option<f64>,
519 /// The bottom gap between the tiles.
520 pub bottom: Option<f64>,
521 /// Whether the treemap is navigable.
522 pub roam: Option<bool>,
523 /// The depth of the treemap.
524 pub node_click: Option<String>,
525 /// The label of a tile.
526 pub label: Option<LabelOption>,
527 /// The upper level of the label.
528 pub upper_label: Option<LabelOption>,
529}
530
531/// The options specific to a sunburst series.
532#[derive(Clone, Debug, Default, PartialEq)]
533pub struct SunburstOptions {
534 /// The centre of the sunburst.
535 pub center: Option<Vec<String>>,
536 /// The radius of the sunburst.
537 pub radius: Option<Vec<String>>,
538 /// The starting angle of the sunburst, in degrees.
539 pub start_angle: Option<f64>,
540 /// The label of a sector.
541 pub label: Option<LabelOption>,
542 /// Whether the sectors are clickable.
543 pub node_click: Option<String>,
544 /// The level of the highlighted sector.
545 pub highlight: Option<String>,
546}
547
548/// The options specific to a boxplot series.
549#[derive(Clone, Debug, Default, PartialEq)]
550pub struct BoxplotOptions {
551 /// The width of the boxes.
552 pub box_width: Option<f64>,
553 /// The label of a box.
554 pub label: Option<LabelOption>,
555}
556
557/// The options specific to a candlestick series.
558#[derive(Clone, Debug, Default, PartialEq)]
559pub struct CandlestickOptions {
560 /// The width of the candles.
561 pub bar_width: Option<f64>,
562 /// The width of the candle's body.
563 pub bar_max_width: Option<f64>,
564 /// The minimum width of the candle's body.
565 pub bar_min_width: Option<f64>,
566 /// The colour of a rising candle.
567 pub color: Option<String>,
568 /// The colour of a falling candle.
569 pub color0: Option<String>,
570 /// The border colour of a rising candle.
571 pub border_color: Option<String>,
572 /// The border colour of a falling candle.
573 pub border_color0: Option<String>,
574 /// The label of a candle.
575 pub label: Option<LabelOption>,
576}
577
578/// The options specific to a theme-river series.
579#[derive(Clone, Debug, Default, PartialEq)]
580pub struct ThemeRiverOptions {
581 /// The thickness of the river.
582 pub single_width: Option<f64>,
583 /// The gap between the rivers.
584 pub item_style: Option<ItemStyleOption>,
585 /// The label of a river.
586 pub label: Option<LabelOption>,
587}
588
589/// The options specific to a sankey series.
590#[derive(Clone, Debug, Default, PartialEq)]
591pub struct SankeyOptions {
592 /// The alignment of the sankey.
593 pub align: Option<String>,
594 /// The gap between the nodes, in pixels.
595 pub node_gap: Option<f64>,
596 /// The width of the links.
597 pub node_width: Option<f64>,
598 /// The curvature of the links.
599 pub link_curveness: Option<f64>,
600 /// Whether the sankey can be panned and zoomed.
601 pub roam: Option<bool>,
602 /// The label of a node.
603 pub label: Option<LabelOption>,
604 /// The line style of the links.
605 pub line_style: Option<LineStyleOption>,
606}
607
608/// The options specific to a parallel-coordinates series.
609#[derive(Clone, Debug, Default, PartialEq)]
610pub struct ParallelOptions {
611 /// The layout of the axes.
612 pub layout: Option<String>,
613 /// The gap between the axes.
614 pub distance: Option<f64>,
615 /// The width of the axis line.
616 pub line_width: Option<f64>,
617 /// The stroke of the links.
618 pub line_style: Option<LineStyleOption>,
619 /// The label of an axis.
620 pub axis_label: Option<LabelOption>,
621}
622
623/// The options specific to a pictorial-bar series.
624#[derive(Clone, Debug, Default, PartialEq)]
625pub struct PictorialBarOptions {
626 /// The symbol used for the bars.
627 pub symbol: Option<String>,
628 /// The size of the symbol.
629 pub symbol_size: Option<Vec<String>>,
630 /// The position of the symbol relative to the bar.
631 pub symbol_position: Option<String>,
632 /// The offset of the symbol.
633 pub symbol_offset: Option<Vec<f64>>,
634 /// The rotation of the symbol.
635 pub symbol_rotate: Option<f64>,
636 /// Whether the symbol is repeated along the bar.
637 pub symbol_repeat: Option<bool>,
638 /// Whether the symbols are clipped by the bar.
639 pub symbol_clip: Option<bool>,
640}
641
642/// The options specific to a lines series.
643#[derive(Clone, Debug, Default, PartialEq)]
644pub struct LinesOptions {
645 /// The curvature of the lines.
646 pub polyline: bool,
647 /// The stroke of the lines.
648 pub line_style: Option<LineStyleOption>,
649 /// The effect trail of the lines.
650 pub effect: Option<LinesEffectOption>,
651 /// The blend mode of the lines.
652 pub blend_mode: Option<String>,
653}
654
655/// The trail drawn behind a moving line.
656#[derive(Clone, Debug, Default, PartialEq)]
657pub struct LinesEffectOption {
658 /// Whether the trail is drawn.
659 pub show: bool,
660 /// The period of the trail, in milliseconds.
661 pub period: Option<f64>,
662 /// The scale of the trail's constant speed.
663 pub constant_speed: Option<f64>,
664 /// The colour of the trail.
665 pub trail_width: Option<f64>,
666 /// The colour of the trail.
667 pub trail_color: Option<String>,
668 /// The length of the trail.
669 pub trail_length: Option<f64>,
670}
671
672/// The options specific to a map series.
673#[derive(Clone, Debug, Default, PartialEq)]
674pub struct MapOptions {
675 /// The name of the map region.
676 pub map_name: Option<String>,
677 /// The name of the geo component the map is bound to.
678 pub geo_index: Option<usize>,
679 /// Whether the map can be panned and zoomed.
680 pub roam: Option<bool>,
681 /// The label of a region.
682 pub label: Option<LabelOption>,
683 /// The factor that keeps the map from looking stretched.
684 pub aspect_scale: Option<f64>,
685}
686
687/// The options specific to a custom series.
688#[derive(Clone, Debug, Default, PartialEq)]
689pub struct CustomOptions {
690 /// The name of the custom renderer.
691 pub renderer: Option<String>,
692 /// The items the renderer receives.
693 pub data: Vec<DataValue>,
694}
695
696/// The options of one series.
697///
698/// One type covers every ECharts series kind: the fields that only make
699/// sense for some kinds are grouped into the matching options struct, and
700/// the renderer ignores the ones that do not apply to its kind.
701#[derive(Clone, Debug, Default, lombok_macros::Data, PartialEq)]
702pub struct SeriesOption {
703 /// The kind of the series.
704 #[get(type(copy))]
705 pub kind: SeriesType,
706 /// The name of the series, used by the legend and the tooltip.
707 pub name: String,
708 /// The data of the series.
709 pub data: Vec<DataValue>,
710 /// The index of the x-axis the series is bound to.
711 #[get(type(copy))]
712 pub x_axis_index: Option<usize>,
713 /// The index of the y-axis the series is bound to.
714 #[get(type(copy))]
715 pub y_axis_index: Option<usize>,
716 /// The index of the polar coordinate system the series is bound to.
717 #[get(type(copy))]
718 pub polar_index: Option<usize>,
719 /// The index of the radar coordinate system the series is bound to.
720 #[get(type(copy))]
721 pub radar_index: Option<usize>,
722 /// The index of the geo component the series is bound to.
723 #[get(type(copy))]
724 pub geo_index: Option<usize>,
725 /// The index of the calendar component the series is bound to.
726 #[get(type(copy))]
727 pub calendar_index: Option<usize>,
728 /// The name of the dataset the series draws its data from.
729 #[get(type(copy))]
730 pub dataset_index: Option<usize>,
731 /// The stack the series is stacked in.
732 #[get(type(clone))]
733 pub stack: Option<String>,
734 /// The paint order of the series.
735 #[get(type(copy))]
736 pub z: Option<i32>,
737 /// The canvas layer the series is drawn on.
738 #[get(type(copy))]
739 pub zlevel: Option<i32>,
740 /// Whether the series ignores pointer events.
741 #[get(type(copy))]
742 pub silent: bool,
743 /// Whether the series is drawn at all.
744 #[get(type(copy))]
745 pub show: bool,
746 /// Whether the series is animated.
747 #[get(type(copy))]
748 pub animation: Option<bool>,
749 /// The fill of the series' shapes.
750 #[get(type(clone))]
751 pub item_style: Option<ItemStyleOption>,
752 /// The stroke of the series' shapes.
753 #[get(type(clone))]
754 pub line_style: Option<LineStyleOption>,
755 /// The label of the series' data points.
756 #[get(type(clone))]
757 pub label: Option<LabelOption>,
758 /// The rules that move the series' labels out of each other's way.
759 #[get(type(clone))]
760 pub label_layout: Option<LabelLayoutOption>,
761 /// The style applied when a data point is highlighted.
762 #[get(type(clone))]
763 pub emphasis: Option<EmphasisOption>,
764 /// The style applied when a data point is not highlighted.
765 #[get(type(clone))]
766 pub blur: Option<BlurOption>,
767 /// The mark drawn at the series' data points.
768 #[get(type(clone))]
769 pub mark_point: Option<MarkPointOption>,
770 /// The line drawn across the series.
771 #[get(type(clone))]
772 pub mark_line: Option<MarkLineOption>,
773 /// The area highlighted across the series.
774 #[get(type(clone))]
775 pub mark_area: Option<MarkAreaOption>,
776 /// The colour of the series, overriding the theme.
777 #[get(type(clone))]
778 pub color: Option<String>,
779 /// The options specific to a bar series.
780 #[get(type(clone))]
781 pub bar: Option<BarOptions>,
782 /// The options specific to a line series.
783 #[get(type(clone))]
784 pub line: Option<LineOptions>,
785 /// The options specific to a pie series.
786 #[get(type(clone))]
787 pub pie: Option<PieOptions>,
788 /// The options specific to a scatter series.
789 #[get(type(clone))]
790 pub scatter: Option<ScatterOptions>,
791 /// The options specific to a radar series.
792 #[get(type(clone))]
793 pub radar: Option<RadarOptions>,
794 /// The options specific to a gauge series.
795 #[get(type(clone))]
796 pub gauge: Option<GaugeOptions>,
797 /// The options specific to a funnel series.
798 #[get(type(clone))]
799 pub funnel: Option<FunnelOptions>,
800 /// The options specific to a heatmap series.
801 #[get(type(clone))]
802 pub heatmap: Option<HeatmapOptions>,
803 /// The options specific to a graph series.
804 #[get(type(clone))]
805 pub graph: Option<GraphOptions>,
806 /// The options specific to a treemap series.
807 #[get(type(clone))]
808 pub treemap: Option<TreemapOptions>,
809 /// The options specific to a sunburst series.
810 #[get(type(clone))]
811 pub sunburst: Option<SunburstOptions>,
812 /// The options specific to a boxplot series.
813 #[get(type(clone))]
814 pub boxplot: Option<BoxplotOptions>,
815 /// The options specific to a candlestick series.
816 #[get(type(clone))]
817 pub candlestick: Option<CandlestickOptions>,
818 /// The options specific to a theme-river series.
819 #[get(type(clone))]
820 pub theme_river: Option<ThemeRiverOptions>,
821 /// The options specific to a sankey series.
822 #[get(type(clone))]
823 pub sankey: Option<SankeyOptions>,
824 /// The options specific to a parallel-coordinates series.
825 #[get(type(clone))]
826 pub parallel: Option<ParallelOptions>,
827 /// The options specific to a pictorial-bar series.
828 #[get(type(clone))]
829 pub pictorial_bar: Option<PictorialBarOptions>,
830 /// The options specific to a lines series.
831 #[get(type(clone))]
832 pub lines: Option<LinesOptions>,
833 /// The options specific to a map series.
834 #[get(type(clone))]
835 pub map: Option<MapOptions>,
836 /// The options specific to a custom series.
837 #[get(type(clone))]
838 pub custom: Option<CustomOptions>,
839}
840
841/// The options of the chart's title.
842#[derive(Clone, Debug, Default, lombok_macros::Data, PartialEq)]
843pub struct TitleOption {
844 /// The main title.
845 pub text: String,
846 /// The subtitle.
847 pub subtext: String,
848 /// The position of the title.
849 #[get(type(copy))]
850 pub left: Option<Position>,
851 /// The position of the title.
852 #[get(type(copy))]
853 pub top: Option<Position>,
854 /// The position of the title.
855 #[get(type(copy))]
856 pub right: Option<Position>,
857 /// The position of the title.
858 #[get(type(copy))]
859 pub bottom: Option<Position>,
860 /// The style of the main title.
861 #[get(type(clone))]
862 pub text_style: Option<LabelOption>,
863 /// The style of the subtitle.
864 #[get(type(clone))]
865 pub subtext_style: Option<LabelOption>,
866 /// The gap between the title and the subtitle.
867 #[get(type(copy))]
868 pub item_gap: Option<f64>,
869 /// Whether the title is drawn.
870 #[get(type(copy))]
871 pub show: bool,
872 /// The link the title points at.
873 #[get(type(clone))]
874 pub link: Option<String>,
875 /// The link the subtitle points at.
876 #[get(type(clone))]
877 pub sublink: Option<String>,
878}
879
880/// The options of the chart's legend.
881#[derive(Clone, Debug, Default, PartialEq)]
882pub struct LegendOption {
883 /// The names of the series the legend shows.
884 pub data: Vec<String>,
885 /// Whether the legend is drawn.
886 pub show: bool,
887 /// The direction the entries are laid out in.
888 pub orient: Option<Orientation>,
889 /// The position of the legend.
890 pub left: Option<Position>,
891 /// The position of the legend.
892 pub top: Option<Position>,
893 /// The position of the legend.
894 pub right: Option<Position>,
895 /// The position of the legend.
896 pub bottom: Option<Position>,
897 /// The width of the legend's symbol.
898 pub item_width: Option<f64>,
899 /// The height of the legend's symbol.
900 pub item_height: Option<f64>,
901 /// The gap between the legend's symbol and its label.
902 pub item_gap: Option<f64>,
903 /// The gap between the legend's entries.
904 pub item_gap_horizontal: Option<f64>,
905 /// The gap between the legend's entries.
906 pub item_gap_vertical: Option<f64>,
907 /// The style of the legend's labels.
908 pub text_style: Option<LabelOption>,
909 /// The style of the legend's symbols.
910 pub item_style: Option<ItemStyleOption>,
911 /// The names of the series that start out hidden.
912 pub selected: Option<Vec<String>>,
913 /// Whether the legend scrolls when it does not fit.
914 pub type_scroll: Option<String>,
915 /// The background colour of the legend's scrollbar.
916 pub scroll: Option<String>,
917}
918
919/// The options of a cartesian grid.
920#[derive(Clone, Debug, Default, PartialEq)]
921pub struct GridOption {
922 /// The left edge of the grid.
923 pub left: Option<Position>,
924 /// The right edge of the grid.
925 pub right: Option<Position>,
926 /// The top edge of the grid.
927 pub top: Option<Position>,
928 /// The bottom edge of the grid.
929 pub bottom: Option<Position>,
930 /// Whether the grid's size accounts for the axis labels.
931 pub contain_label: Option<bool>,
932 /// The width of the grid.
933 pub width: Option<f64>,
934 /// The height of the grid.
935 pub height: Option<f64>,
936 /// The background colour of the grid.
937 pub background_color: Option<String>,
938 /// Whether the grid is drawn.
939 pub show: bool,
940 /// The border colour of the grid.
941 pub border_color: Option<String>,
942 /// The border width of the grid.
943 pub border_width: Option<f64>,
944}
945
946/// The options of one axis.
947#[derive(Clone, Debug, Default, lombok_macros::Data, PartialEq)]
948pub struct AxisOption {
949 /// The kind of the axis.
950 #[get(type(copy))]
951 pub axis_type: AxisType,
952 /// The categories or the tick values of the axis.
953 pub data: Vec<DataValue>,
954 /// The name of the axis.
955 #[get(type(clone))]
956 pub name: Option<String>,
957 /// The position of the axis' name.
958 #[get(type(clone))]
959 pub name_location: Option<String>,
960 /// The gap between the axis' name and the axis.
961 #[get(type(copy))]
962 pub name_gap: Option<f64>,
963 /// The style of the axis' name.
964 #[get(type(clone))]
965 pub name_text_style: Option<LabelOption>,
966 /// The position of the axis.
967 #[get(type(copy))]
968 pub position: Option<Position>,
969 /// Whether the axis is drawn.
970 #[get(type(copy))]
971 pub show: bool,
972 /// The labels of the axis.
973 #[get(type(clone))]
974 pub axis_label: Option<LabelOption>,
975 /// The line of the axis.
976 #[get(type(clone))]
977 pub axis_line: Option<AxisLineOption>,
978 /// The tick marks of the axis.
979 #[get(type(clone))]
980 pub axis_tick: Option<AxisTickOption>,
981 /// The split lines of the axis.
982 #[get(type(clone))]
983 pub split_line: Option<SplitLineOption>,
984 /// The minimum value of the axis.
985 #[get(type(copy))]
986 pub min: Option<f64>,
987 /// The maximum value of the axis.
988 #[get(type(copy))]
989 pub max: Option<f64>,
990 /// The gap between the axis and its split lines, as a fraction of the
991 /// axis' length.
992 #[get(type(copy))]
993 pub split_gap: Option<f64>,
994 /// The number of split lines.
995 #[get(type(copy))]
996 pub split_number: Option<usize>,
997 /// The interval between two split lines.
998 #[get(type(copy))]
999 pub interval: Option<f64>,
1000 /// The minimum interval between two split lines.
1001 #[get(type(copy))]
1002 pub min_interval: Option<f64>,
1003 /// The maximum interval between two split lines.
1004 #[get(type(copy))]
1005 pub max_interval: Option<f64>,
1006 /// Whether the axis uses a logarithmic scale.
1007 #[get(type(copy))]
1008 pub log_base: Option<f64>,
1009 /// The boundary gap of a category axis.
1010 #[get(type(copy))]
1011 pub boundary_gap: Option<f64>,
1012 /// Whether the axis is aligned with the other axis of the same grid.
1013 #[get(type(copy))]
1014 pub align_ticks: Option<bool>,
1015 /// The index of the grid the axis belongs to.
1016 #[get(type(copy))]
1017 pub grid_index: Option<usize>,
1018 /// Whether the axis is drawn on the other side of the grid.
1019 #[get(type(copy))]
1020 pub offset: Option<f64>,
1021 /// The colour of the axis' area.
1022 #[get(type(clone))]
1023 pub axis_pointer: Option<AxisPointerOption>,
1024 /// The formatter used for the axis' labels.
1025 #[get(type(clone))]
1026 pub formatter: Option<String>,
1027 /// The colour of the axis.
1028 #[get(type(clone))]
1029 pub color: Option<String>,
1030}
1031
1032/// The pointer that follows the mouse along an axis.
1033#[derive(Clone, Debug, Default, PartialEq)]
1034pub struct AxisPointerOption {
1035 /// Whether the pointer is drawn.
1036 pub show: bool,
1037 /// The type of the pointer.
1038 pub pointer_type: Option<String>,
1039 /// The style of the pointer.
1040 pub label: Option<LabelOption>,
1041 /// The line style of the pointer.
1042 pub line_style: Option<LineStyleOption>,
1043 /// The shadow of the pointer.
1044 pub shadow: Option<ShadowOption>,
1045 /// Whether the pointer snaps to the nearest tick.
1046 pub snap: Option<bool>,
1047}
1048
1049/// The options of the chart's tooltip.
1050#[derive(Clone, Debug, Default, lombok_macros::Data, PartialEq)]
1051pub struct TooltipOption {
1052 /// Whether the tooltip is drawn.
1053 #[get(type(copy))]
1054 pub show: bool,
1055 /// What the tooltip describes.
1056 #[get(type(copy))]
1057 pub trigger: TriggerType,
1058 /// The formatter of the tooltip's content.
1059 #[get(type(clone))]
1060 pub formatter: Option<String>,
1061 /// The background colour of the tooltip.
1062 #[get(type(clone))]
1063 pub background_color: Option<String>,
1064 /// The border colour of the tooltip.
1065 #[get(type(clone))]
1066 pub border_color: Option<String>,
1067 /// The border width of the tooltip.
1068 #[get(type(copy))]
1069 pub border_width: Option<f64>,
1070 /// The padding inside the tooltip.
1071 #[get(type(copy))]
1072 pub padding: Option<(f64, f64, f64, f64)>,
1073 /// The style of the tooltip's text.
1074 #[get(type(clone))]
1075 pub text_style: Option<LabelOption>,
1076 /// The position of the tooltip, as `[x, y]` percentages.
1077 #[get(type(clone))]
1078 pub position: Option<Vec<f64>>,
1079 /// Whether the tooltip follows the pointer.
1080 #[get(type(copy))]
1081 pub confine: Option<bool>,
1082 /// Whether the tooltip is shown when the pointer is over the axis.
1083 #[get(type(clone))]
1084 pub axis_pointer: Option<AxisPointerOption>,
1085 /// The extra CSS applied to the tooltip's element.
1086 #[get(type(clone))]
1087 pub extra_css_text: Option<String>,
1088 /// The transition of the tooltip.
1089 #[get(type(copy))]
1090 pub transition_duration: Option<f64>,
1091 /// The order the tooltip's entries are sorted in.
1092 #[get(type(clone))]
1093 pub order: Option<String>,
1094}
1095
1096/// The options of the chart's toolbox.
1097#[derive(Clone, Debug, Default, PartialEq)]
1098pub struct ToolboxOption {
1099 /// Whether the toolbox is drawn.
1100 pub show: bool,
1101 /// The position of the toolbox.
1102 pub left: Option<Position>,
1103 /// The position of the toolbox.
1104 pub top: Option<Position>,
1105 /// The position of the toolbox.
1106 pub right: Option<Position>,
1107 /// The position of the toolbox.
1108 pub bottom: Option<Position>,
1109 /// The features the toolbox offers.
1110 pub feature: Option<ToolboxFeatureOption>,
1111 /// The orientation of the toolbox's icons.
1112 pub orient: Option<Orientation>,
1113 /// The item gap of the toolbox.
1114 pub item_gap: Option<f64>,
1115 /// The item size of the toolbox.
1116 pub item_size: Option<f64>,
1117 /// The style of the toolbox's icons.
1118 pub icon_style: Option<ItemStyleOption>,
1119 /// The emphasis style of the toolbox's icons.
1120 pub emphasis: Option<EmphasisOption>,
1121}
1122
1123/// The features the toolbox offers.
1124#[derive(Clone, Debug, Default, PartialEq)]
1125pub struct ToolboxFeatureOption {
1126 /// The data-zoom feature.
1127 pub data_zoom: Option<ToolboxFeatureSettings>,
1128 /// The restore feature.
1129 pub restore: Option<ToolboxFeatureSettings>,
1130 /// The save-as-image feature.
1131 pub save_as_image: Option<ToolboxFeatureSettings>,
1132 /// The data-view feature.
1133 pub data_view: Option<ToolboxFeatureSettings>,
1134 /// The magic-type feature.
1135 pub magic_type: Option<ToolboxFeatureSettings>,
1136 /// The brush feature.
1137 pub brush: Option<ToolboxFeatureSettings>,
1138}
1139
1140/// A toolbox feature's settings.
1141#[derive(Clone, Debug, Default, PartialEq)]
1142pub struct ToolboxFeatureSettings {
1143 /// Whether the feature is drawn.
1144 pub show: bool,
1145 /// The title of the feature's button.
1146 pub title: Option<String>,
1147}
1148
1149/// The options of one data-zoom control.
1150#[derive(Clone, Debug, Default, PartialEq)]
1151pub struct DataZoomOption {
1152 /// The kind of the control.
1153 pub zoom_type: DataZoomType,
1154 /// The index of the x-axis the control zooms.
1155 pub x_axis_index: Option<usize>,
1156 /// The index of the y-axis the control zooms.
1157 pub y_axis_index: Option<usize>,
1158 /// The index of the grid the control zooms.
1159 pub grid_index: Option<usize>,
1160 /// The start of the zoom window, as a percentage.
1161 pub start: Option<f64>,
1162 /// The end of the zoom window, as a percentage.
1163 pub end: Option<f64>,
1164 /// The start of the zoom window, as a data index.
1165 pub start_value: Option<f64>,
1166 /// The end of the zoom window, as a data index.
1167 pub end_value: Option<f64>,
1168 /// Whether the control is drawn.
1169 pub show: bool,
1170 /// The colour of the selected region.
1171 pub filler_color: Option<String>,
1172 /// The border colour of the selected region.
1173 pub border_color: Option<String>,
1174 /// The width of the selected region's border.
1175 pub border_width: Option<f64>,
1176 /// The handle size of the slider.
1177 pub handle_size: Option<String>,
1178 /// The label of the slider.
1179 pub label: Option<LabelOption>,
1180 /// The background colour of the slider.
1181 pub background_color: Option<String>,
1182 /// The data the control zooms over.
1183 pub data: Vec<DataValue>,
1184 /// The colour of the moved region.
1185 pub move_handle_size: Option<String>,
1186 /// The brush style of the inside control.
1187 pub zoom_lock: Option<bool>,
1188 /// Whether the inside control is disabled.
1189 pub disabled: Option<bool>,
1190 /// The throttle of the control's response, in milliseconds.
1191 pub throttle: Option<f64>,
1192}
1193
1194/// The options of one visual map.
1195#[derive(Clone, Debug, Default, PartialEq)]
1196pub struct VisualMapOption {
1197 /// The kind of the visual map.
1198 pub visual_type: VisualMapType,
1199 /// Whether the visual map is drawn.
1200 pub show: bool,
1201 /// The minimum value of the visual map.
1202 pub min: Option<f64>,
1203 /// The maximum value of the visual map.
1204 pub max: Option<f64>,
1205 /// The dimension the visual map applies to.
1206 pub dimension: Option<usize>,
1207 /// The index of the series the visual map applies to.
1208 pub series_index: Option<usize>,
1209 /// The number of bands of a piecewise visual map.
1210 pub split_number: Option<usize>,
1211 /// The colours of the visual map.
1212 pub colors: Vec<String>,
1213 /// The index of the piece the value falls into.
1214 pub pieces: Vec<DataValue>,
1215 /// The index of the band the value falls into.
1216 pub out_of_range: Option<String>,
1217 /// Whether the visual map is horizontal.
1218 pub orient: Option<Orientation>,
1219 /// The position of the visual map.
1220 pub left: Option<Position>,
1221 /// The position of the visual map.
1222 pub top: Option<Position>,
1223 /// The position of the visual map.
1224 pub right: Option<Position>,
1225 /// The position of the visual map.
1226 pub bottom: Option<Position>,
1227 /// The width of the visual map.
1228 pub item_width: Option<f64>,
1229 /// The height of the visual map.
1230 pub item_height: Option<f64>,
1231 /// The index of the continuous band the value falls into.
1232 pub calculable: Option<bool>,
1233 /// The label of the visual map.
1234 pub text: Option<Vec<String>>,
1235 /// The style of the visual map's labels.
1236 pub text_style: Option<LabelOption>,
1237 /// The range of the visual map's handles.
1238 pub range: Option<Vec<f64>>,
1239 /// The precision of the visual map's labels.
1240 pub precision: Option<usize>,
1241}
1242
1243/// The options of a polar coordinate system.
1244#[derive(Clone, Debug, Default, PartialEq)]
1245pub struct PolarOption {
1246 /// The centre of the polar system.
1247 pub center: Option<Vec<String>>,
1248 /// The radius of the polar system.
1249 pub radius: Option<String>,
1250 /// The starting angle of the polar system, in degrees.
1251 pub start_angle: Option<f64>,
1252 /// Whether the polar system is drawn.
1253 pub show: bool,
1254 /// The axis of the polar system.
1255 pub axis_line: Option<AxisLineOption>,
1256 /// The split lines of the polar system.
1257 pub split_line: Option<SplitLineOption>,
1258 /// The split area of the polar system.
1259 pub split_area: Option<SplitAreaOption>,
1260 /// The angle axis of the polar system.
1261 pub angle_axis: Option<AxisOption>,
1262 /// The radius axis of the polar system.
1263 pub radius_axis: Option<AxisOption>,
1264}
1265
1266/// The alternating background of a polar system's sectors.
1267#[derive(Clone, Debug, Default, PartialEq)]
1268pub struct SplitAreaOption {
1269 /// Whether the split areas are drawn.
1270 pub show: bool,
1271 /// The fill of the split areas.
1272 pub area_style: Option<ItemStyleOption>,
1273}
1274
1275/// The options of a radar coordinate system.
1276#[derive(Clone, Debug, Default, PartialEq)]
1277pub struct RadarOption {
1278 /// The indicators of the radar.
1279 pub indicator: Vec<DataValue>,
1280 /// The centre of the radar.
1281 pub center: Option<Vec<String>>,
1282 /// The radius of the radar.
1283 pub radius: Option<String>,
1284 /// The starting angle of the radar, in degrees.
1285 pub start_angle: Option<f64>,
1286 /// The number of sides of the radar.
1287 pub split_number: Option<usize>,
1288 /// The shape of the radar.
1289 pub shape: Option<String>,
1290 /// Whether the radar is drawn.
1291 pub show: bool,
1292 /// The name of the radar.
1293 pub name: Option<String>,
1294 /// The line of the radar's axes.
1295 pub axis_line: Option<AxisLineOption>,
1296 /// The split lines of the radar.
1297 pub split_line: Option<SplitLineOption>,
1298 /// The split area of the radar.
1299 pub split_area: Option<SplitAreaOption>,
1300}
1301
1302/// The options of a geo component.
1303#[derive(Clone, Debug, Default, PartialEq)]
1304pub struct GeoOption {
1305 /// The name of the map region.
1306 pub map_name: Option<String>,
1307 /// Whether the map can be panned and zoomed.
1308 pub roam: Option<bool>,
1309 /// The centre of the map.
1310 pub center: Option<Vec<f64>>,
1311 /// The zoom level of the map.
1312 pub zoom: Option<f64>,
1313 /// The scale of the map.
1314 pub scale: Option<f64>,
1315 /// The regions of the map.
1316 pub regions: Vec<DataValue>,
1317 /// The label of a region.
1318 pub label: Option<LabelOption>,
1319 /// The fill of a region.
1320 pub item_style: Option<ItemStyleOption>,
1321 /// The stroke of a region.
1322 pub line_style: Option<LineStyleOption>,
1323 /// The emphasis style of a region.
1324 pub emphasis: Option<EmphasisOption>,
1325 /// Whether the map is drawn.
1326 pub show: bool,
1327 /// The factor that keeps the map from looking stretched.
1328 pub aspect_scale: Option<f64>,
1329}
1330
1331/// The options of a calendar component.
1332#[derive(Clone, Debug, Default, PartialEq)]
1333pub struct CalendarOption {
1334 /// The range of dates the calendar covers.
1335 pub range: Option<Vec<String>>,
1336 /// The size of one cell, in pixels.
1337 pub cell_size: Option<f64>,
1338 /// The orientation of the calendar.
1339 pub orient: Option<Orientation>,
1340 /// The top-left corner of the calendar.
1341 pub top: Option<f64>,
1342 /// The left edge of the calendar.
1343 pub left: Option<f64>,
1344 /// The item style of a cell.
1345 pub item_style: Option<ItemStyleOption>,
1346 /// The label of a cell.
1347 pub label: Option<LabelOption>,
1348 /// The line style of the cell borders.
1349 pub line_style: Option<LineStyleOption>,
1350 /// The split lines of the calendar.
1351 pub split_line: Option<SplitLineOption>,
1352 /// The year range the calendar shows.
1353 pub year_label: Option<LabelOption>,
1354 /// The month range the calendar shows.
1355 pub month_label: Option<LabelOption>,
1356 /// The day range the calendar shows.
1357 pub day_label: Option<LabelOption>,
1358 /// The ranges of the calendar.
1359 pub ranges: Vec<DataValue>,
1360}
1361
1362/// The options of a dataset.
1363#[derive(Clone, Debug, Default, PartialEq)]
1364pub struct DatasetOption {
1365 /// The source of the data.
1366 pub source: Vec<DataValue>,
1367 /// The kind of the source.
1368 pub source_type: Option<DatasetSourceType>,
1369 /// The names of the dimensions.
1370 pub dimensions: Vec<String>,
1371 /// The dimensions the source is encoded by.
1372 pub dimensions_defined: Option<String>,
1373 /// The indexes of the dimensions that are not numeric.
1374 pub encode: Option<DataValue>,
1375 /// The mapping of the dimensions to their display names.
1376 pub source_header: Option<bool>,
1377}
1378
1379/// The options of a graphic element.
1380#[derive(Clone, Debug, Default, PartialEq)]
1381pub struct GraphicOption {
1382 /// The kind of the element.
1383 pub element_type: Option<String>,
1384 /// The left position of the element.
1385 pub left: Option<Position>,
1386 /// The top position of the element.
1387 pub top: Option<Position>,
1388 /// The right position of the element.
1389 pub right: Option<Position>,
1390 /// The bottom position of the element.
1391 pub bottom: Option<Position>,
1392 /// The bounding rectangle of the element.
1393 pub bounding: Option<String>,
1394 /// The rotation of the element, in degrees.
1395 pub rotation: Option<f64>,
1396 /// The width of the element.
1397 pub width: Option<f64>,
1398 /// The height of the element.
1399 pub height: Option<f64>,
1400 /// The children of the element.
1401 pub children: Vec<GraphicOption>,
1402 /// The style of the element.
1403 pub style: Option<ItemStyleOption>,
1404 /// The text of the element.
1405 pub text: Option<LabelOption>,
1406 /// The text content of the element.
1407 pub text_content: Option<String>,
1408}
1409
1410/// The options of the brush component.
1411#[derive(Clone, Debug, Default, PartialEq)]
1412pub struct BrushOption {
1413 /// Whether the brush is drawn.
1414 pub show: bool,
1415 /// The areas the brush covers.
1416 pub toolbox: Option<Vec<String>>,
1417 /// The rectangle of the brush.
1418 pub x_axis_index: Option<usize>,
1419 /// The rectangle of the brush.
1420 pub y_axis_index: Option<usize>,
1421 /// The areas the brush covers.
1422 pub brush_link: Option<Vec<String>>,
1423 /// The areas the brush covers.
1424 pub areas: Vec<DataValue>,
1425 /// The style of the brush.
1426 pub brush_style: Option<ItemStyleOption>,
1427 /// The throttle of the brush's response.
1428 pub throttle_type: Option<String>,
1429 /// The throttle of the brush's response.
1430 pub throttle_delay: Option<f64>,
1431}
1432
1433/// The whole configuration of a chart.
1434///
1435/// The field names mirror ECharts' option object, so an ECharts
1436/// configuration can be translated field by field.
1437#[derive(Clone, Debug, Default, lombok_macros::Data, PartialEq)]
1438pub struct ChartOption {
1439 /// The title of the chart.
1440 #[get(type(clone))]
1441 pub title: Option<TitleOption>,
1442 /// The legend of the chart.
1443 #[get(type(clone))]
1444 pub legend: Option<LegendOption>,
1445 /// The cartesian grid of the chart.
1446 #[get(type(clone))]
1447 pub grid: Option<GridOption>,
1448 /// The x-axes of the chart.
1449 pub x_axis: Vec<AxisOption>,
1450 /// The y-axes of the chart.
1451 pub y_axis: Vec<AxisOption>,
1452 /// The polar coordinate systems of the chart.
1453 pub polar: Vec<PolarOption>,
1454 /// The radar coordinate systems of the chart.
1455 pub radar: Vec<RadarOption>,
1456 /// The geo components of the chart.
1457 pub geo: Vec<GeoOption>,
1458 /// The calendar components of the chart.
1459 pub calendar: Vec<CalendarOption>,
1460 /// The dataset the chart draws its data from.
1461 #[get(type(clone))]
1462 pub dataset: Option<DatasetOption>,
1463 /// The series of the chart.
1464 pub series: Vec<SeriesOption>,
1465 /// The tooltip of the chart.
1466 #[get(type(clone))]
1467 pub tooltip: Option<TooltipOption>,
1468 /// The toolbox of the chart.
1469 #[get(type(clone))]
1470 pub toolbox: Option<ToolboxOption>,
1471 /// The data-zoom controls of the chart.
1472 pub data_zoom: Vec<DataZoomOption>,
1473 /// The visual maps of the chart.
1474 pub visual_map: Vec<VisualMapOption>,
1475 /// The graphic elements of the chart.
1476 pub graphic: Vec<GraphicOption>,
1477 /// The brush of the chart.
1478 #[get(type(clone))]
1479 pub brush: Option<BrushOption>,
1480 /// The axis pointer of the chart.
1481 #[get(type(clone))]
1482 pub axis_pointer: Option<AxisPointerOption>,
1483 /// The palette the series take their colours from.
1484 pub color: Vec<String>,
1485 /// The background colour of the chart.
1486 #[get(type(clone))]
1487 pub background_color: Option<String>,
1488 /// The default text style of the chart.
1489 #[get(type(clone))]
1490 pub text_style: Option<LabelOption>,
1491 /// Whether the chart animates.
1492 #[get(type(copy))]
1493 pub animation: bool,
1494 /// The duration of the chart's animation, in milliseconds.
1495 #[get(type(copy))]
1496 pub animation_duration: Option<f64>,
1497 /// The easing of the chart's animation.
1498 #[get(type(clone))]
1499 pub animation_easing: Option<String>,
1500 /// The delay of the chart's animation, in milliseconds.
1501 #[get(type(copy))]
1502 pub animation_delay: Option<f64>,
1503 /// The duration of the update animation, in milliseconds.
1504 #[get(type(copy))]
1505 pub animation_duration_update: Option<f64>,
1506 /// The easing of the update animation.
1507 #[get(type(clone))]
1508 pub animation_easing_update: Option<String>,
1509 /// Whether the chart is rendered on a separate canvas layer.
1510 #[get(type(copy))]
1511 pub use_utc: Option<bool>,
1512 /// The accessible description of the chart.
1513 #[get(type(clone))]
1514 pub aria: Option<AriaOption>,
1515}
1516
1517/// The accessible description of a chart.
1518#[derive(Clone, Debug, Default, PartialEq)]
1519pub struct AriaOption {
1520 /// Whether the description is generated.
1521 pub enabled: bool,
1522 /// The description of the chart.
1523 pub description: Option<String>,
1524 /// The description of the chart's data.
1525 pub decal: Option<DataValue>,
1526}