pub struct StatBinHex {
pub bins_x: usize,
pub bins_y: usize,
pub binwidth: Option<(f64, f64)>,
pub origin: Option<(f64, f64)>,
}Expand description
Hexagonal binning on a fixed hex lattice (data units), unlike the
floor-binned staggered rectangles this replaces (see the 0.20.0
CHANGELOG). Output: x, y (hex centres), count, density, ncount,
ndensity, width, height, fill (= count, back-compat), n
(unweighted point count), q, r.
Fields§
§bins_x: usize§bins_y: usize§binwidth: Option<(f64, f64)>§origin: Option<(f64, f64)>Implementations§
Source§impl StatBinHex
impl StatBinHex
pub fn new() -> Self
pub fn bins_xy(self, x: usize, y: usize) -> Self
Sourcepub fn binwidth(self, w: f64, h: f64) -> Self
pub fn binwidth(self, w: f64, h: f64) -> Self
Fix the bin width/height in data units (overrides bins).
Sourcepub fn lattice(&self, xs: &[f64], ys: &[f64]) -> HexLattice
pub fn lattice(&self, xs: &[f64], ys: &[f64]) -> HexLattice
Build the HexLattice this stat would use for (xs, ys), following
the origin rules:
binwidthandoriginboth given: the lattice is fixed exactly.binwidthonly: anchored at(0, 0).- neither:
w, hfrom the range and bin counts, anchored at the data minimum (ggplot2) — or atorigin, if given withoutbinwidth.
Trait Implementations§
Source§impl Default for StatBinHex
impl Default for StatBinHex
Source§impl Stat for StatBinHex
impl Stat for StatBinHex
Source§fn compute_group(&self, data: &DataFrame, _scales: &ScaleSet) -> DataFrame
fn compute_group(&self, data: &DataFrame, _scales: &ScaleSet) -> DataFrame
Transform data for a single group.
Source§fn required_aes(&self) -> Vec<Aesthetic>
fn required_aes(&self) -> Vec<Aesthetic>
Required aesthetics this stat needs.
Source§fn validate(&self, warnings: &mut Vec<String>)
fn validate(&self, warnings: &mut Vec<String>)
Validate the stat’s own fixed configuration (not the data) and push
a human-readable warning for each problem found — e.g.
StatBinHex::binwidth being NaN, zero or negative. Called once per
layer, before compute_group runs (which has
no warnings channel of its own: the per-group call only sees
&DataFrame and &ScaleSet, not the plot’s warnings sink). Default:
no-op.Source§fn default_aes(&self) -> Aes
fn default_aes(&self) -> Aes
Default aesthetic mappings this stat produces.
Auto Trait Implementations§
impl Freeze for StatBinHex
impl RefUnwindSafe for StatBinHex
impl Send for StatBinHex
impl Sync for StatBinHex
impl Unpin for StatBinHex
impl UnsafeUnpin for StatBinHex
impl UnwindSafe for StatBinHex
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
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