pub struct PositionFill {
pub vjust: f64,
}Expand description
Normalized stacking to 100% (ggplot2’s position_fill(vjust = )) —
like PositionStack but
scaled to [0, 1] per x group.
vjust places the row’s y within its stacked segment, same as
PositionStack: 1 (the default) is the segment’s top, byte-
identical to before B3-4 (no ymax column). Anything else writes
y = (1 − vjust)·ymin + vjust·ymax plus the ymax column.
Fields§
§vjust: f64Implementations§
Source§impl PositionFill
impl PositionFill
Sourcepub fn with_vjust(self, vjust: f64) -> Self
pub fn with_vjust(self, vjust: f64) -> Self
Place y within each stacked segment (0 = bottom, 0.5 =
middle, 1 = top, the default).
Trait Implementations§
Source§impl Clone for PositionFill
impl Clone for PositionFill
Source§impl Debug for PositionFill
impl Debug for PositionFill
Source§impl Default for PositionFill
impl Default for PositionFill
Source§impl PartialEq for PositionFill
impl PartialEq for PositionFill
Source§impl Position for PositionFill
impl Position for PositionFill
Source§fn compute(&self, data: &mut DataFrame, _params: &PositionParams)
fn compute(&self, data: &mut DataFrame, _params: &PositionParams)
Adjust positions for data.
fn name(&self) -> &str
Source§fn per_panel(&self) -> bool
fn per_panel(&self) -> bool
Whether this position must run separately per facet panel rather
than once on the pooled rows before facets are split (B3-3, D8).
Default
false. PositionStack/PositionFill override this to
true — a shared x category’s stack height must not mix rows from
different panels. PositionDodge/PositionDodge2/PositionJitter
also override this to true (sipemu/ggplot-rs#153): ggplot2
computes a dodge’s group count/offset via compute_panel (per
panel), and position_jitter’s default width/height — 40% of
resolution() — is likewise measured from each panel’s own x/y,
not the rows pooled across panels (verified against ggplot2 4.0.3
with layer_data() on faceted plots; see tests/position_panels_r.rs).Source§fn validate(&self, warnings: &mut Vec<String>)
fn validate(&self, warnings: &mut Vec<String>)
Validate this position’s own parameters once per layer (D2);
default no-op. Implementations push a warning and fall back to a
sane default rather than panicking or silently miscomputing.
Source§fn group_order(&self, _data: &DataFrame) -> Option<Vec<String>>
fn group_order(&self, _data: &DataFrame) -> Option<Vec<String>>
The whole layer’s group rank order (first-appearance, pre-panel-
split), for a
per_panel position whose group ranking must come
from the whole layer even though its per-x counting stays
per-panel (review #167 finding 2; sipemu/ggplot-rs#153).
build::compute_position_per_panel calls this on the pooled data
before splitting and threads the result through
PositionParams::group_order to every panel’s compute call.
Default None — positions that don’t need this (stack/fill/
jitter) are unaffected.impl StructuralPartialEq for PositionFill
Auto Trait Implementations§
impl Freeze for PositionFill
impl RefUnwindSafe for PositionFill
impl Send for PositionFill
impl Sync for PositionFill
impl Unpin for PositionFill
impl UnsafeUnpin for PositionFill
impl UnwindSafe for PositionFill
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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