pub struct ScaleSqrt { /* private fields */ }Expand description
Square root scale for bubble sizes. Maps continuous domain to continuous range
via sqrt transformation. Equivalent to D3’s scaleSqrt().
This is a power scale with exponent 0.5.
Implementations§
Source§impl ScaleSqrt
impl ScaleSqrt
Sourcepub fn new(domain: (f64, f64), range: (f64, f64)) -> Self
pub fn new(domain: (f64, f64), range: (f64, f64)) -> Self
Create a new sqrt scale with the given domain and range.
Sourcepub fn map(&self, value: f64) -> f64
pub fn map(&self, value: f64) -> f64
Map a domain value to a range value using sqrt interpolation. Negative domain values are clamped to 0 before sqrt.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScaleSqrt
impl RefUnwindSafe for ScaleSqrt
impl Send for ScaleSqrt
impl Sync for ScaleSqrt
impl Unpin for ScaleSqrt
impl UnsafeUnpin for ScaleSqrt
impl UnwindSafe for ScaleSqrt
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