Skip to main content

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

1/// Buckets the input by time range into equally sized buckets.
2/// The number of buckets is determined by the maxPoints parameter.
3/// Returns a CartesianPlot.
4#[derive(
5    Debug,
6    Clone,
7    conjure_object::serde::Serialize,
8    conjure_object::serde::Deserialize,
9    PartialEq,
10    Eq,
11    PartialOrd,
12    Ord,
13    Hash
14)]
15#[serde(crate = "conjure_object::serde")]
16#[conjure_object::private::staged_builder::staged_builder]
17#[builder(crate = conjure_object::private::staged_builder, update, inline)]
18pub struct TemporalDecimateStrategy {
19    #[serde(rename = "xAggregation")]
20    x_aggregation: super::ScatterTemporalAggregation,
21    #[serde(rename = "yAggregation")]
22    y_aggregation: super::ScatterTemporalAggregation,
23}
24impl TemporalDecimateStrategy {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(
28        x_aggregation: super::ScatterTemporalAggregation,
29        y_aggregation: super::ScatterTemporalAggregation,
30    ) -> Self {
31        Self::builder().x_aggregation(x_aggregation).y_aggregation(y_aggregation).build()
32    }
33    /// The strategy to use for aggregating the x values in each bucket.
34    #[inline]
35    pub fn x_aggregation(&self) -> &super::ScatterTemporalAggregation {
36        &self.x_aggregation
37    }
38    /// The strategy to use for aggregating the y values in each bucket.
39    #[inline]
40    pub fn y_aggregation(&self) -> &super::ScatterTemporalAggregation {
41        &self.y_aggregation
42    }
43}