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 { ... }
    fn validate(&self, _warnings: &mut Vec<String>) { ... }
}
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.

Source

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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Stat for StatAlign

Source§

impl Stat for StatArcdiagram

Source§

impl Stat for StatBin

Source§

impl Stat for StatBin2d

Source§

impl Stat for StatBinHex

Source§

impl Stat for StatBindot

Source§

impl Stat for StatBoxplot

Source§

impl Stat for StatCalendar

Source§

impl Stat for StatCensored

Source§

impl Stat for StatChord

Source§

impl Stat for StatContour

Source§

impl Stat for StatContourFilled

Source§

impl Stat for StatCount

Source§

impl Stat for StatDensity

Source§

impl Stat for StatDensity2d

Source§

impl Stat for StatEcdf

Source§

impl Stat for StatEcdfBand

Source§

impl Stat for StatEllipse

Source§

impl Stat for StatFunction

Source§

impl Stat for StatFunnel

Source§

impl Stat for StatHeikinAshi

Source§

impl Stat for StatIdentity

Source§

impl Stat for StatIndicator

Source§

impl Stat for StatLoess

Source§

impl Stat for StatMarimekko

Source§

impl Stat for StatNetwork

Source§

impl Stat for StatPack

Source§

impl Stat for StatPareto

Source§

impl Stat for StatPartition

Source§

impl Stat for StatPointFigure

Source§

impl Stat for StatQQ

Source§

impl Stat for StatQQBand

Source§

impl Stat for StatQQDist

Source§

impl Stat for StatQQLine

Source§

impl Stat for StatQQLineDist

Source§

impl Stat for StatRenko

Source§

impl Stat for StatSankey

Source§

impl Stat for StatSmooth

Source§

impl Stat for StatSum

Source§

impl Stat for StatSummary

Source§

impl Stat for StatSummary2d

Source§

impl Stat for StatSummaryBin

Source§

impl Stat for StatTree

Source§

impl Stat for StatTreemap

Source§

impl Stat for StatVenn

Source§

impl Stat for StatWaffle

Source§

impl Stat for StatWaterfall

Source§

impl Stat for StatYDensity