pub struct ScaleBand<T> { /* private fields */ }Implementations§
Source§impl<T> ScaleBand<T>
impl<T> ScaleBand<T>
Sourcepub fn new(domain: impl IntoIterator<Item = T>, range: [f32; 2]) -> ScaleBand<T>
pub fn new(domain: impl IntoIterator<Item = T>, range: [f32; 2]) -> ScaleBand<T>
Lay the distinct values of domain out as bands across range, from
its lower end in domain order.
Sourcepub fn band_width(&self) -> f32
pub fn band_width(&self) -> f32
The width of a band: the range divided among the bands, less the inner
padding, and no wider than Self::max_band_width when set.
Sourcepub fn max_band_width(self, width: f32) -> ScaleBand<T>
pub fn max_band_width(self, width: f32) -> ScaleBand<T>
Cap the band width at width, so a few bands in a wide range stay
narrow; a band still starts where it would uncapped. Unset by default.
Sourcepub fn step(&self) -> f32
pub fn step(&self) -> f32
The distance between the starts of two adjacent bands: the band width plus the inner padding. The whole range for a single band.
Sourcepub fn band_count(self, count: usize) -> ScaleBand<T>
pub fn band_count(self, count: usize) -> ScaleBand<T>
Lay the range out for count bands, the domain taking the leading ones
in order and the rest staying empty. A count below the domain’s length
has no effect.
Sourcepub fn padding_inner(self, padding_inner: f32) -> ScaleBand<T>
pub fn padding_inner(self, padding_inner: f32) -> ScaleBand<T>
Set the padding inner of the band.
Sourcepub fn padding_outer(self, padding_outer: f32) -> ScaleBand<T>
pub fn padding_outer(self, padding_outer: f32) -> ScaleBand<T>
Set the padding outer of the band.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ScaleBand<T>
impl<T> RefUnwindSafe for ScaleBand<T>
impl<T> Send for ScaleBand<T>
impl<T> Sync for ScaleBand<T>
impl<T> Unpin for ScaleBand<T>
impl<T> UnsafeUnpin for ScaleBand<T>
impl<T> UnwindSafe for ScaleBand<T>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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