pub struct ViolinChart { /* private fields */ }Expand description
Violin plot widget.
§Example
use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget};
use tui_chart::{ViolinChart, ViolinGroup};
let chart = ViolinChart::new([ViolinGroup::new("a", (0..60).map(|i| (i % 13) as f64))]);
let area = Rect::new(0, 0, 40, 12);
let mut buf = Buffer::empty(area);
chart.render(area, &mut buf);Implementations§
Source§impl ViolinChart
impl ViolinChart
Sourcepub fn new(groups: impl IntoIterator<Item = ViolinGroup>) -> Self
pub fn new(groups: impl IntoIterator<Item = ViolinGroup>) -> Self
Create a chart.
Sourcepub fn bandwidth(self, v: f64) -> Self
pub fn bandwidth(self, v: f64) -> Self
Kernel bandwidth in data units (default: Silverman’s rule).
Sourcepub fn show_box(self, v: bool) -> Self
pub fn show_box(self, v: bool) -> Self
Draw the inner quartile box and median dot (default on).
Sourcepub fn marker(self, v: Marker) -> Self
pub fn marker(self, v: Marker) -> Self
Dot resolution (default braille; half blocks fill solid but are coarser).
Sourcepub fn base_style(self, style: Style) -> Self
pub fn base_style(self, style: Style) -> Self
Base style painted over the whole area (beats the theme).
Trait Implementations§
Source§impl Clone for ViolinChart
impl Clone for ViolinChart
Source§impl Debug for ViolinChart
impl Debug for ViolinChart
Source§impl Default for ViolinChart
impl Default for ViolinChart
Source§impl Themed for ViolinChart
Available on crate feature theme only.
impl Themed for ViolinChart
Available on crate feature
theme only.Source§fn apply_theme(self, theme: &Theme) -> Self
fn apply_theme(self, theme: &Theme) -> Self
Return
self styled from theme. Explicit per-item colors set on the
widget should keep winning over the theme.Source§fn themed(self, provider: &impl ThemeProvider) -> Self
fn themed(self, provider: &impl ThemeProvider) -> Self
Apply the theme produced by any
ThemeProvider.Source§impl Widget for &ViolinChart
impl Widget for &ViolinChart
Auto Trait Implementations§
impl Forget for ViolinChart
impl Freeze for ViolinChart
impl RefUnwindSafe for ViolinChart
impl Send for ViolinChart
impl Sync for ViolinChart
impl Unpin for ViolinChart
impl UnsafeUnpin for ViolinChart
impl UnwindSafe for ViolinChart
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more