pub struct BinParamsBuilder { /* private fields */ }
Expand description

Builder for BinParams.

Implementations§

source§

impl BinParamsBuilder

source

pub fn anchor<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

A value in the binned domain at which to anchor the bins, shifting the bin boundaries if necessary to ensure that a boundary aligns with the anchor value.

Default value: the minimum bin extent value

source

pub fn base<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

The number base to use for automatic bin determination (default is base 10).

Default value: 10

source

pub fn binned<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

When set to true, Vega-Lite treats the input data as already binned.

source

pub fn divide<VALUE: Into<Vec<f64>>>(&mut self, value: VALUE) -> &mut Self

Scale factors indicating allowable subdivisions. The default value is [5, 2], which indicates that for base 10 numbers (the default base), the method may consider dividing bin sizes by 5 and/or 2. For example, for an initial step size of 10, the method can check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the given constraints.

Default value: [5, 2]

source

pub fn extent<VALUE: Into<BinExtent>>(&mut self, value: VALUE) -> &mut Self

A two-element ([min, max]) array indicating the range of desired bin values.

source

pub fn maxbins<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

Maximum number of bins.

Default value: 6 for row, column and shape channels; 10 for other channels

source

pub fn minstep<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

A minimum allowable step size (particularly useful for integer values).

source

pub fn nice<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

If true, attempts to make the bin boundaries use human-friendly boundaries, such as multiples of ten.

Default value: true

source

pub fn step<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

An exact step size to use between bins.

Note: If provided, options such as maxbins will be ignored.

source

pub fn steps<VALUE: Into<Vec<f64>>>(&mut self, value: VALUE) -> &mut Self

An array of allowable step sizes to choose from.

source

pub fn build(&self) -> Result<BinParams, BinParamsBuilderError>

Builds a new BinParams.

Errors

If a required field has not been initialized.

Trait Implementations§

source§

impl Clone for BinParamsBuilder

source§

fn clone(&self) -> BinParamsBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for BinParamsBuilder

source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.