Skip to main content

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

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct TimeSeriesEnumPlot {
16    #[builder(custom(type = super::ColorStyle, convert = Box::new))]
17    #[serde(rename = "color")]
18    color: Box<super::ColorStyle>,
19    #[serde(rename = "position")]
20    position: super::Position,
21    #[builder(custom(type = super::PersistValueOverlay, convert = Box::new))]
22    #[serde(rename = "persistValueOverlays")]
23    persist_value_overlays: Box<super::PersistValueOverlay>,
24    #[serde(rename = "overlayScope")]
25    overlay_scope: super::OverlayScope,
26    #[builder(default, into)]
27    #[serde(rename = "displayInline", skip_serializing_if = "Option::is_none", default)]
28    display_inline: Option<bool>,
29    #[builder(
30        default,
31        custom(
32            type = impl
33            Into<Option<super::EnumDisplayStyle>>,
34            convert = |v|v.into().map(Box::new)
35        )
36    )]
37    #[serde(rename = "displayStyle", skip_serializing_if = "Option::is_none", default)]
38    display_style: Option<Box<super::EnumDisplayStyle>>,
39}
40impl TimeSeriesEnumPlot {
41    /// How to color the value ranges
42    #[inline]
43    pub fn color(&self) -> &super::ColorStyle {
44        &*self.color
45    }
46    /// Where to place the plot within the row
47    #[inline]
48    pub fn position(&self) -> &super::Position {
49        &self.position
50    }
51    /// Render certain values' full-row/full-panel color overlays
52    /// even when not interacting with the plot
53    #[inline]
54    pub fn persist_value_overlays(&self) -> &super::PersistValueOverlay {
55        &*self.persist_value_overlays
56    }
57    /// How far to extend the overlay
58    #[inline]
59    pub fn overlay_scope(&self) -> &super::OverlayScope {
60        &self.overlay_scope
61    }
62    #[deprecated(note = "Use displayStyle instead")]
63    #[inline]
64    pub fn display_inline(&self) -> Option<bool> {
65        self.display_inline.as_ref().map(|o| *o)
66    }
67    /// How to display the enum values on the chart
68    #[inline]
69    pub fn display_style(&self) -> Option<&super::EnumDisplayStyle> {
70        self.display_style.as_ref().map(|o| &**o)
71    }
72}