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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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