libnotcurses_sys/widgets/plot/
mod.rs

1//! `NcPlot[F|U]64` widget.
2
3use crate::c_api::ffi;
4
5/// A histogram, bound to an [`NcPlane`][crate::NcPlane]
6/// (uses non-negative `f64`s)
7pub type NcPlotF64 = ffi::ncdplot;
8
9/// A histogram, bound to an [`NcPlane`][crate::NcPlane] (uses `u64`s)
10pub type NcPlotU64 = ffi::ncuplot;
11
12/// Options struct for
13/// [`NcPlotF64`] or [`NcPlotU64`]
14pub type NcPlotOptions = ffi::ncplot_options;
15
16impl NcPlotOptions {
17    /// Use domain detection only for max
18    pub const DETECTMAXONLY: u32 = c_api::NCPLOT_OPTION_DETECTMAXONLY;
19
20    /// Exponential dependent axis
21    pub const EXPONENTIALD: u32 = c_api::NCPLOT_OPTION_EXPONENTIALD;
22
23    /// Show labels for dependent axis
24    pub const LABELTICKSD: u32 = c_api::NCPLOT_OPTION_LABELTICKSD;
25
26    /// Use domain detection only for max
27    pub const NODEGRADE: u32 = c_api::NCPLOT_OPTION_NODEGRADE;
28
29    /// Independent axis is vertical
30    pub const VERTICALI: u32 = c_api::NCPLOT_OPTION_VERTICALI;
31}
32
33pub(crate) mod c_api {
34    use super::ffi;
35
36    /// Use domain detection only for max
37    pub const NCPLOT_OPTION_DETECTMAXONLY: u32 = ffi::NCPLOT_OPTION_DETECTMAXONLY;
38
39    /// Exponential dependent axis
40    pub const NCPLOT_OPTION_EXPONENTIALD: u32 = ffi::NCPLOT_OPTION_EXPONENTIALD;
41
42    /// Show labels for dependent axis
43    pub const NCPLOT_OPTION_LABELTICKSD: u32 = ffi::NCPLOT_OPTION_LABELTICKSD;
44
45    /// Use domain detection only for max
46    pub const NCPLOT_OPTION_NODEGRADE: u32 = ffi::NCPLOT_OPTION_NODEGRADE;
47
48    /// Independent axis is vertical
49    pub const NCPLOT_OPTION_VERTICALI: u32 = ffi::NCPLOT_OPTION_VERTICALI;
50}