pub struct PositionDodge2 {
pub padding: f64,
pub width: Option<f64>,
pub reverse: bool,
pub preserve_single: bool,
}Expand description
Like position_dodge but preserves total width and adds padding between
groups (ggplot2’s position_dodge2(width, padding, reverse)). Elements
are centred exactly as PositionDodge
places them; on a continuous axis xmin/xmax shrink to
(1 − padding) of each group’s share.
Fields§
§padding: f64§width: Option<f64>Total dodge width; None = the layer default (0.9).
reverse: boolReverse the group order.
preserve_single: boolpreserve = "single" (see
PositionDodge::preserve_single).
Implementations§
Source§impl PositionDodge2
impl PositionDodge2
pub fn new(padding: f64) -> Self
Sourcepub fn with_width(self, width: f64) -> Self
pub fn with_width(self, width: f64) -> Self
Set the total dodge width.
Sourcepub fn with_reverse(self, reverse: bool) -> Self
pub fn with_reverse(self, reverse: bool) -> Self
Reverse the order of the dodged groups (reverse = TRUE).
Sourcepub fn with_preserve_single(self) -> Self
pub fn with_preserve_single(self) -> Self
preserve = "single": elements keep one group’s width in a slot with
fewer groups.
Trait Implementations§
Source§impl Clone for PositionDodge2
impl Clone for PositionDodge2
Source§impl Debug for PositionDodge2
impl Debug for PositionDodge2
Source§impl Default for PositionDodge2
impl Default for PositionDodge2
Source§impl PartialEq for PositionDodge2
impl PartialEq for PositionDodge2
Source§impl Position for PositionDodge2
impl Position for PositionDodge2
Source§fn per_panel(&self) -> bool
fn per_panel(&self) -> bool
Same per-panel rule as PositionDodge (#153): dodge_rows is
shared between the two.
Source§fn group_order(&self, data: &DataFrame) -> Option<Vec<String>>
fn group_order(&self, data: &DataFrame) -> Option<Vec<String>>
Same whole-layer group ranking as PositionDodge (review #167
finding 2): dodge_rows is shared between the two.
Source§fn compute(&self, data: &mut DataFrame, params: &PositionParams)
fn compute(&self, data: &mut DataFrame, params: &PositionParams)
fn name(&self) -> &str
impl StructuralPartialEq for PositionDodge2
Auto Trait Implementations§
impl Freeze for PositionDodge2
impl RefUnwindSafe for PositionDodge2
impl Send for PositionDodge2
impl Sync for PositionDodge2
impl Unpin for PositionDodge2
impl UnsafeUnpin for PositionDodge2
impl UnwindSafe for PositionDodge2
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
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> ⓘ
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> ⓘ
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