use crate::{
datatype::CompositeValue,
element::{Color, DataBackground, Orient, TextStyle},
};
use charming_macros::CharmingSetters;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, PartialEq, PartialOrd, Clone, Copy)]
#[serde(rename_all = "camelCase")]
pub enum FilterMode {
Filter,
WeakFilter,
Empty,
None,
}
#[derive(Serialize, Deserialize, Debug, PartialEq, PartialOrd, Clone, Copy)]
#[serde(rename_all = "snake_case")]
pub enum DataZoomType {
Inside,
Slider,
Select,
}
#[serde_with::apply(
Option => #[serde(skip_serializing_if = "Option::is_none")],
Vec => #[serde(default, skip_serializing_if = "Vec::is_empty")]
)]
#[derive(Serialize, Deserialize, CharmingSetters, Debug, PartialEq, PartialOrd, Clone)]
#[serde(rename_all = "camelCase")]
pub struct DataZoom {
#[serde(rename = "type")]
type_: Option<DataZoomType>,
id: Option<String>,
show: Option<bool>,
realtime: Option<bool>,
background_color: Option<Color>,
data_background: Option<DataBackground>,
selected_data_background: Option<DataBackground>,
filler_color: Option<Color>,
border_color: Option<Color>,
start: Option<f64>,
end: Option<f64>,
start_value: Option<CompositeValue>,
end_value: Option<CompositeValue>,
min_span: Option<f64>,
max_span: Option<f64>,
min_value_span: Option<f64>,
max_value_span: Option<f64>,
orient: Option<Orient>,
zoom_lock: Option<bool>,
throttle: Option<f64>,
left: Option<CompositeValue>,
top: Option<CompositeValue>,
right: Option<CompositeValue>,
bottom: Option<CompositeValue>,
x_axis_index: Option<CompositeValue>,
y_axis_index: Option<CompositeValue>,
disabled: Option<bool>,
radius_axis_index: Option<f64>,
angle_axis_index: Option<f64>,
filter_mode: Option<FilterMode>,
text_style: Option<TextStyle>,
handle_icon: Option<String>,
brush_select: Option<bool>,
}