pub struct ScaleBand { /* private fields */ }Expand description
Maps discrete domain values (categories) to continuous range positions.
Equivalent to D3’s scaleBand(), used for bar chart x-axes.
Implementations§
Source§impl ScaleBand
impl ScaleBand
Sourcepub fn new(domain: Vec<String>, range: (f64, f64)) -> Self
pub fn new(domain: Vec<String>, range: (f64, f64)) -> Self
Create a new band scale with the given domain and range. Default padding: inner=0.1, outer=0.1.
Sourcepub fn padding_inner(self, padding: f64) -> Self
pub fn padding_inner(self, padding: f64) -> Self
Set inner padding (between bands). Returns self for chaining.
Sourcepub fn padding_outer(self, padding: f64) -> Self
pub fn padding_outer(self, padding: f64) -> Self
Set outer padding (before first and after last band). Returns self for chaining.
Auto Trait Implementations§
impl Freeze for ScaleBand
impl RefUnwindSafe for ScaleBand
impl Send for ScaleBand
impl Sync for ScaleBand
impl Unpin for ScaleBand
impl UnsafeUnpin for ScaleBand
impl UnwindSafe for ScaleBand
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