pub struct DagChart<'a, S, V>where
S: Schema,
V: View<S>,{ /* private fields */ }Expand description
The dag-chart widget.
A dag-chart represents each unique tuple of the view’s display dimensions as a path in a directed acyclic graph. Paths with common sub-paths, starting from the primary dimension (1st), are collapsed in the frame.
See also: PathChart
use flat::*;
let schema = Schemas::two("Animal", "Size");
let dataset = DatasetBuilder::new(schema)
.add(("whale".to_string(), "large".to_string()))
.add(("shark".to_string(), "medium".to_string()))
.add(("shark".to_string(), "small".to_string()))
.add(("tiger".to_string(), "medium".to_string()))
.add(("tiger".to_string(), "medium".to_string()))
.add(("tiger".to_string(), "small".to_string()))
.build();
let view = dataset.count();
let flat = DagChart::new(&view)
.render(Render::default());
assert_eq!(
format!("\n{}", flat.to_string()),
r#"
Size Animal |Sum(Count)
medium - shark |**
small ┘
medium - tiger |***
small ┘
large - whale |*"#);Implementations§
Auto Trait Implementations§
impl<'a, S, V> Freeze for DagChart<'a, S, V>
impl<'a, S, V> RefUnwindSafe for DagChart<'a, S, V>where
V: RefUnwindSafe,
S: RefUnwindSafe,
impl<'a, S, V> Send for DagChart<'a, S, V>
impl<'a, S, V> Sync for DagChart<'a, S, V>
impl<'a, S, V> Unpin for DagChart<'a, S, V>where
S: Unpin,
impl<'a, S, V> UnwindSafe for DagChart<'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