Skip to main content

flow_plots/plots/
mod.rs

1pub mod density;
2pub mod histogram;
3pub mod spectral;
4pub mod traits;
5
6pub use density::DensityPlot;
7pub use histogram::HistogramPlot;
8pub use spectral::SpectralSignaturePlot;
9pub use traits::Plot;
10
11/// Plot type enumeration
12///
13/// Maps to UI labels: Scatterplot (Solid), Scatterplot (Density), etc.
14#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
15#[serde(rename_all = "snake_case")]
16pub enum PlotType {
17    /// Monocolor scatter (Scatterplot Solid)
18    ScatterSolid,
19    /// Density heatmap (Scatterplot Density)
20    Density,
21    /// Z-axis colored scatter (Scatterplot Colored-continuous)
22    ScatterColoredContinuous,
23    /// Metadata-group colored (Scatterplot Overlay)
24    ScatterOverlay,
25    /// Contour lines from KDE
26    Contour,
27    /// Contour with metadata groups
28    ContourOverlay,
29    /// Legacy alias for ScatterSolid
30    #[serde(alias = "dot")]
31    Dot,
32    /// Legacy alias for Contour
33    Zebra,
34    /// Histogram plot
35    Histogram,
36}
37
38impl Default for PlotType {
39    fn default() -> Self {
40        PlotType::Density
41    }
42}
43
44impl PlotType {
45    /// Normalize legacy variants to canonical form for dispatch
46    pub fn canonical(self) -> Self {
47        match self {
48            PlotType::Dot => PlotType::ScatterSolid,
49            other => other,
50        }
51    }
52}