orbital_charts/context/
heatmap_context.rs1use leptos::prelude::*;
4
5use crate::{ColorScale, HeatmapCell};
6
7#[derive(Clone, Debug)]
9pub struct HeatmapPlotContext {
10 pub cells: Vec<HeatmapCell>,
12 pub color_scale: ColorScale,
14 pub value_min: Option<f64>,
16 pub value_max: Option<f64>,
18}
19
20pub fn use_heatmap_plot_context() -> HeatmapPlotContext {
22 expect_context::<HeatmapPlotContext>()
23}
24
25#[component]
27pub fn HeatmapPlotProvider(context: HeatmapPlotContext, children: Children) -> impl IntoView {
28 provide_context(context);
29 children()
30}