pub trait Position: Send + Sync {
// Required methods
fn compute(&self, data: &mut DataFrame, params: &PositionParams);
fn name(&self) -> &str;
// Provided methods
fn per_panel(&self) -> bool { ... }
fn validate(&self, _warnings: &mut Vec<String>) { ... }
}Expand description
Trait for position adjustments.
Required Methods§
Sourcefn compute(&self, data: &mut DataFrame, params: &PositionParams)
fn compute(&self, data: &mut DataFrame, params: &PositionParams)
Adjust positions for data.
fn name(&self) -> &str
Provided Methods§
Sourcefn 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. Dodge and jitter stay pooled across panels for
now (a follow-up, sipemu/ggplot-rs#154).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".