pub struct DicePlot {Show 17 fields
pub points: Vec<DicePoint>,
pub x_categories: Vec<String>,
pub y_categories: Vec<String>,
pub category_labels: Vec<String>,
pub ndots: usize,
pub cell_width: f64,
pub cell_height: f64,
pub pad: f64,
pub dot_radius: f64,
pub color_map: ColorMap,
pub fill_range: Option<(f64, f64)>,
pub size_range: Option<(f64, f64)>,
pub fill_legend_label: Option<String>,
pub size_legend_label: Option<String>,
pub dot_legend: Vec<(String, String)>,
pub position_legend_label: Option<String>,
pub grid_lines: bool,
}Expand description
A DicePlot: a grid of cells where each cell shows up to 6 dots arranged like a die face.
Fields§
§points: Vec<DicePoint>§x_categories: Vec<String>§y_categories: Vec<String>§category_labels: Vec<String>§ndots: usize§cell_width: f64§cell_height: f64§pad: f64§dot_radius: f64§color_map: ColorMap§fill_range: Option<(f64, f64)>§size_range: Option<(f64, f64)>§fill_legend_label: Option<String>§size_legend_label: Option<String>§dot_legend: Vec<(String, String)>§position_legend_label: Option<String>§grid_lines: boolDraw a 3×3 sub-grid inside each die tile, showing the pip slot boundaries.
Implementations§
Source§impl DicePlot
impl DicePlot
pub fn new(ndots: usize) -> Self
pub fn with_points<I, Sx, Sy>(self, iter: I) -> Self
pub fn with_records<I, Sx, Sy, Sd, Sc>(self, iter: I) -> Selfwhere
I: IntoIterator<Item = (Sx, Sy, Sd, Sc)>,
Sx: Into<String>,
Sy: Into<String>,
Sd: Into<String>,
Sc: Into<String>,
pub fn with_dot_data<I, Sx, Sy>(self, iter: I) -> Self
pub fn with_x_categories(self, cats: Vec<String>) -> Self
pub fn with_y_categories(self, cats: Vec<String>) -> Self
pub fn with_category_labels(self, labels: Vec<String>) -> Self
pub fn with_color_map(self, map: ColorMap) -> Self
pub fn with_fill_range(self, min: f64, max: f64) -> Self
pub fn with_size_range(self, min: f64, max: f64) -> Self
pub fn with_fill_legend<S: Into<String>>(self, label: S) -> Self
pub fn with_size_legend<S: Into<String>>(self, label: S) -> Self
pub fn with_dot_legend<I, S1, S2>(self, entries: I) -> Self
pub fn with_position_legend<S: Into<String>>(self, label: S) -> Self
pub fn with_grid_lines(self, v: bool) -> Self
pub fn with_dot_radius(self, r: f64) -> Self
pub fn with_cell_size(self, width: f64, height: f64) -> Self
pub fn with_pad(self, pad: f64) -> Self
Sourcepub fn dot_grid_positions(&self) -> Vec<(usize, usize)>
pub fn dot_grid_positions(&self) -> Vec<(usize, usize)>
Returns (grid_row, grid_col) for each pip position in order, 0-indexed, row-major. grid_row: 0=top, 1=middle, 2=bottom; grid_col: 0=left, 1=center, 2=right.
pub fn dot_offsets(&self) -> Vec<(f64, f64)>
pub fn fill_extent(&self) -> (f64, f64)
pub fn size_extent(&self) -> (f64, f64)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DicePlot
impl !UnwindSafe for DicePlot
impl Freeze for DicePlot
impl Send for DicePlot
impl Sync for DicePlot
impl Unpin for DicePlot
impl UnsafeUnpin for DicePlot
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<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.