Skip to main content

DicePlot

Struct DicePlot 

Source
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: bool

Draw a 3×3 sub-grid inside each die tile, showing the pip slot boundaries.

Implementations§

Source§

impl DicePlot

Source

pub fn new(ndots: usize) -> Self

Source

pub fn with_points<I, Sx, Sy>(self, iter: I) -> Self
where I: IntoIterator<Item = (Sx, Sy, Vec<usize>, Option<f64>, Option<f64>)>, Sx: Into<String>, Sy: Into<String>,

Source

pub fn with_records<I, Sx, Sy, Sd, Sc>(self, iter: I) -> Self
where I: IntoIterator<Item = (Sx, Sy, Sd, Sc)>, Sx: Into<String>, Sy: Into<String>, Sd: Into<String>, Sc: Into<String>,

Source

pub fn with_dot_data<I, Sx, Sy>(self, iter: I) -> Self
where I: IntoIterator<Item = (Sx, Sy, usize, Option<f64>, Option<f64>)>, Sx: Into<String>, Sy: Into<String>,

Source

pub fn with_x_categories(self, cats: Vec<String>) -> Self

Source

pub fn with_y_categories(self, cats: Vec<String>) -> Self

Source

pub fn with_category_labels(self, labels: Vec<String>) -> Self

Source

pub fn with_color_map(self, map: ColorMap) -> Self

Source

pub fn with_fill_range(self, min: f64, max: f64) -> Self

Source

pub fn with_size_range(self, min: f64, max: f64) -> Self

Source

pub fn with_fill_legend<S: Into<String>>(self, label: S) -> Self

Source

pub fn with_size_legend<S: Into<String>>(self, label: S) -> Self

Source

pub fn with_dot_legend<I, S1, S2>(self, entries: I) -> Self
where I: IntoIterator<Item = (S1, S2)>, S1: Into<String>, S2: Into<String>,

Source

pub fn with_position_legend<S: Into<String>>(self, label: S) -> Self

Source

pub fn with_grid_lines(self, v: bool) -> Self

Source

pub fn with_dot_radius(self, r: f64) -> Self

Source

pub fn with_cell_size(self, width: f64, height: f64) -> Self

Source

pub fn with_pad(self, pad: f64) -> Self

Source

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.

Source

pub fn dot_offsets(&self) -> Vec<(f64, f64)>

Source

pub fn fill_extent(&self) -> (f64, f64)

Source

pub fn size_extent(&self) -> (f64, f64)

Trait Implementations§

Source§

impl Default for DicePlot

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<DicePlot> for Plot

Source§

fn from(p: DicePlot) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Finish for T

Source§

fn finish(self)

Does nothing but move self, equivalent to drop.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.