crate::ix!();
#[derive(Debug,Clone)]
pub enum HistogramDisplayStrategy {
Short,
ShowTransactionsInBinsWithManyItems {
threshold_item_count_in_bin: usize,
},
ShowHeavyTransactionsBasedOnPrice {
maybe_price_threshold: Option<MonetaryAmount>,
},
}
impl Default for HistogramDisplayStrategy {
fn default() -> Self {
Self::show_full_histogram()
}
}
impl HistogramDisplayStrategy {
pub fn show_full_histogram() -> Self {
HistogramDisplayStrategy::ShowHeavyTransactionsBasedOnPrice {
maybe_price_threshold: None
}
}
pub fn with_price_threshold(x: f64) -> Self {
HistogramDisplayStrategy::ShowHeavyTransactionsBasedOnPrice {
maybe_price_threshold: Some(MonetaryAmount::from(x))
}
}
}