Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
numeric_raw_visualisation_v2.rs

1/// A raw numeric visualisation with optional coloring based on numeric thresholds.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    conjure_object::private::DeriveWith
8)]
9#[serde(crate = "conjure_object::serde")]
10#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
11#[conjure_object::private::staged_builder::staged_builder]
12#[builder(crate = conjure_object::private::staged_builder, update, inline)]
13pub struct NumericRawVisualisationV2 {
14    #[builder(default, into)]
15    #[serde(rename = "thresholds", skip_serializing_if = "Option::is_none", default)]
16    thresholds: Option<Vec<super::Threshold>>,
17}
18impl NumericRawVisualisationV2 {
19    /// Constructs a new instance of the type.
20    #[inline]
21    pub fn new() -> Self {
22        Self::builder().build()
23    }
24    /// Modifies the visualisation based on the highest threshold value that
25    /// the computed value surpasses.
26    #[inline]
27    pub fn thresholds(&self) -> Option<&[super::Threshold]> {
28        self.thresholds.as_ref().map(|o| &**o)
29    }
30}