pub enum Layering {
Merge,
PerDataset,
}Expand description
How a Chart puts its datasets together where they share a cell.
use rich::Console;
use rich_ext::chart::{Axis, Chart, Dataset, Layering, Marker};
let console = Console::builder().width(1).color_system(None).build();
// Two Braille dots in one cell, from two datasets.
let chart = Chart::new(vec![
Dataset::new([(0.0, 1.0)]).marker(Marker::Braille),
Dataset::new([(0.0, 0.0)]).marker(Marker::Braille),
])
.x_axis(Axis::default().bounds(0.0, 1.0))
.y_axis(Axis::default().bounds(0.0, 1.0))
.width(1)
.height(1);
assert_eq!(console.render_export(&chart), "⡁\n");
let layered = chart.layering(Layering::PerDataset);
assert_eq!(console.render_export(&layered), "⡀\n");Variants§
Merge
Datasets with the same marker share the dots of a cell, which takes the style of the last dataset to set one (the default).
PerDataset
Each dataset is drawn over the ones before it, as ratatui 0.29 draws a canvas per dataset: a cell a later dataset draws in shows only its dots, in its style.
Trait Implementations§
impl Copy for Layering
impl Eq for Layering
impl StructuralPartialEq for Layering
Auto Trait Implementations§
impl Freeze for Layering
impl RefUnwindSafe for Layering
impl Send for Layering
impl Sync for Layering
impl Unpin for Layering
impl UnsafeUnpin for Layering
impl UnwindSafe for Layering
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.