Skip to main content

nominal_api/conjure/objects/scout/compute/api/
scatter.rs

1/// A scatter plot comprised of the values from one input series on the x-axis
2/// and values from another input series on the y-axis, for all points within a requested time range.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    conjure_object::private::DeriveWith
9)]
10#[serde(crate = "conjure_object::serde")]
11#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
12#[conjure_object::private::staged_builder::staged_builder]
13#[builder(crate = conjure_object::private::staged_builder, update, inline)]
14pub struct Scatter {
15    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
16    #[serde(rename = "x")]
17    x: Box<super::NumericSeries>,
18    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
19    #[serde(rename = "y")]
20    y: Box<super::NumericSeries>,
21}
22impl Scatter {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(x: super::NumericSeries, y: super::NumericSeries) -> Self {
26        Self::builder().x(x).y(y).build()
27    }
28    #[inline]
29    pub fn x(&self) -> &super::NumericSeries {
30        &*self.x
31    }
32    #[inline]
33    pub fn y(&self) -> &super::NumericSeries {
34        &*self.y
35    }
36}