use super::*;
#[derive(Clone, Debug)]
pub(crate) struct ChartDrawFrame<'a> {
pub(crate) tokens: ThemeTokens,
pub(crate) palette: &'a [Color],
pub(crate) visual_eval: Option<&'a EuvChartVisualEvaluator>,
pub(crate) dataset: Option<&'a EuvChartDataset>,
pub(crate) hover_pos: Option<Point>,
pub(crate) selected_pie_slice: Option<usize>,
}
#[derive(Clone, Copy, Debug)]
pub(crate) struct SeriesMeta<'a> {
pub(crate) index: usize,
pub(crate) name: &'a str,
pub(crate) color: Color,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct EuvChartDatumHit {
#[get(type(copy))]
pub(crate) series_index: usize,
pub(crate) series_name: String,
#[get(type(copy))]
pub(crate) data_index: usize,
pub(crate) category_label: String,
#[get(type(copy))]
pub(crate) value: f32,
pub(crate) detail: String,
#[get(type(copy))]
pub(crate) color: Color,
#[get(type(copy))]
pub(crate) anchor: Point,
#[get(type(copy))]
pub(crate) hit_radius: f32,
#[get(skip)]
pub(crate) hit_rect: Option<Rect>,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct EuvChartLegendHit {
#[get(type(copy))]
pub(crate) series_index: usize,
pub(crate) name: String,
#[get(type(copy))]
pub(crate) color: Color,
#[get(type(copy))]
pub(crate) visible: bool,
#[get(type(copy))]
pub(crate) rect: Rect,
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct EuvChartSliderRects {
#[get(type(copy))]
pub(crate) track_rect: Rect,
#[get(type(copy))]
pub(crate) window_rect: Rect,
#[get(type(copy))]
pub(crate) left_handle: Rect,
#[get(type(copy))]
pub(crate) right_handle: Rect,
}
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub struct EuvChartDataViewTable {
pub(crate) headers: Vec<String>,
pub(crate) rows: Vec<Vec<String>>,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct EuvChartState {
pub(crate) hidden_series: Vec<String>,
#[get(type(copy))]
pub(crate) zoom_start_pct: f32,
#[get(type(copy))]
pub(crate) zoom_end_pct: f32,
#[get(type(copy))]
pub(crate) magic_type: EuvChartMagicType,
#[get(type(copy))]
pub(crate) data_view_open: bool,
#[get(skip)]
pub(crate) selected_pie_slice: Option<usize>,
#[get(skip)]
pub(crate) hover_pos: Option<Point>,
}
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub struct EuvChartRenderResult {
#[get(type(copy))]
pub(crate) plot_rect: Rect,
pub(crate) hits: Vec<EuvChartDatumHit>,
pub(crate) legend_hits: Vec<EuvChartLegendHit>,
#[get(skip)]
pub(crate) slider_rects: Option<EuvChartSliderRects>,
pub(crate) active_tooltip_hits: Vec<EuvChartDatumHit>,
pub(crate) x_scales: Vec<EuvChartAxisScale>,
pub(crate) y_scales: Vec<EuvChartAxisScale>,
}
#[derive(Clone, Copy, Debug)]
pub(crate) struct SubplotRenderInput<'a> {
pub(crate) option: &'a EuvChartOption,
pub(crate) state: &'a EuvChartState,
pub(crate) series: &'a [EuvChartSeries],
pub(crate) visible: &'a [bool],
}