pub struct Histogram<'a, S, V>where
S: Schema,
V: View<S>,{ /* private fields */ }Expand description
The histogram widget.
A histogram represents the sole display dimension as a Binnable type.
The dataset’s values are collected based off how they bin across the range defined by 1st dimension.
The number of bins is configured at initialization.
use flat::*;
let schema = Schemas::one("Things");
let dataset = DatasetBuilder::new(schema)
.add((0,))
.add((0,))
.add((1,))
.build();
let view = dataset.count();
let flat = Histogram::new(&view, 2)
.render(Render::default());
assert_eq!(
format!("\n{}", flat.to_string()),
r#"
Things |Sum(Count)
[0, 1) |**
[1, 2] |*"#);Implementations§
Source§impl<'a, S, V> Histogram<'a, S, V>where
S: Schema,
V: View<S>,
<V as View<S>>::PrimaryDimension: Clone + Display + PartialEq + PartialOrd + Add<<V as View<S>>::PrimaryDimension, Output = <V as View<S>>::PrimaryDimension> + Sub<<V as View<S>>::PrimaryDimension, Output = <V as View<S>>::PrimaryDimension> + Binnable,
<V as View<S>>::BreakdownDimension: Clone + Display + PartialEq + Eq + Hash + Ord,
impl<'a, S, V> Histogram<'a, S, V>where
S: Schema,
V: View<S>,
<V as View<S>>::PrimaryDimension: Clone + Display + PartialEq + PartialOrd + Add<<V as View<S>>::PrimaryDimension, Output = <V as View<S>>::PrimaryDimension> + Sub<<V as View<S>>::PrimaryDimension, Output = <V as View<S>>::PrimaryDimension> + Binnable,
<V as View<S>>::BreakdownDimension: Clone + Display + PartialEq + Eq + Hash + Ord,
Auto Trait Implementations§
impl<'a, S, V> Freeze for Histogram<'a, S, V>
impl<'a, S, V> RefUnwindSafe for Histogram<'a, S, V>where
V: RefUnwindSafe,
S: RefUnwindSafe,
impl<'a, S, V> Send for Histogram<'a, S, V>
impl<'a, S, V> Sync for Histogram<'a, S, V>
impl<'a, S, V> Unpin for Histogram<'a, S, V>where
S: Unpin,
impl<'a, S, V> UnwindSafe for Histogram<'a, S, V>where
V: RefUnwindSafe,
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more