1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Spectral signature plot implementation
//!
//! Creates line plots showing normalized spectral signatures (1.0 to 0.0 vs channels)
//! for flow cytometry fluorophores.
use cratePlotBytes;
// Spectral plot implementation
use cratePlot;
use crateRenderConfig;
use craterender_spectral_signature;
use Result;
/// Spectral signature plot implementation
///
/// Creates a line plot showing normalized spectral signatures across detector channels.
/// The y-axis represents normalized intensity (0.0 to 1.0), and the x-axis represents
/// detector channels.
///
/// # Example
///
/// ```rust,no_run
/// use flow_plots::plots::spectral::SpectralSignaturePlot;
/// use flow_plots::plots::traits::Plot;
/// use flow_plots::options::spectral::SpectralSignaturePlotOptions;
/// use flow_plots::options::BasePlotOptions;
/// use flow_plots::render::RenderConfig;
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let plot = SpectralSignaturePlot::new();
/// let options = SpectralSignaturePlotOptions::new()
/// .base(BasePlotOptions::new().width(1200u32).height(600u32).build()?)
/// .build()?;
/// let data: Vec<(usize, f64)> = vec![(0, 0.1), (1, 0.5), (2, 1.0), (3, 0.8)];
/// let channel_names: Vec<String> = vec!["UV1-A".into(), "UV2-A".into(), "UV3-A".into(), "UV4-A".into()];
/// let mut render_config = RenderConfig::default();
/// let bytes = plot.render((data, channel_names), &options, &mut render_config)?;
/// # Ok(())
/// # }
/// ```
;