Skip to main content

Stat

Trait Stat 

Source
pub trait Stat: Send + Sync {
    // Required methods
    fn compute_group(&self, data: &DataFrame, scales: &ScaleSet) -> DataFrame;
    fn required_aes(&self) -> Vec<Aesthetic>;
    fn name(&self) -> &str;

    // Provided methods
    fn default_aes(&self) -> Aes { ... }
    fn panelwise(&self) -> bool { ... }
}
Expand description

Trait for statistical transformations.

Required Methods§

Source

fn compute_group(&self, data: &DataFrame, scales: &ScaleSet) -> DataFrame

Transform data for a single group.

Source

fn required_aes(&self) -> Vec<Aesthetic>

Required aesthetics this stat needs.

Source

fn name(&self) -> &str

Name for debug/display.

Provided Methods§

Source

fn default_aes(&self) -> Aes

Default aesthetic mappings this stat produces.

Source

fn panelwise(&self) -> bool

If true, the stat receives every row of a panel at once (grouped only by facet variables) instead of once per aesthetic group. Needed for cross-group comparisons such as stat_compare_means, which must see all groups together. Defaults to per-group behaviour.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§