Skip to main content

flow_plots/plots/
mod.rs

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