ggplot_rs/stat/identity.rs
1use crate::aes::Aesthetic;
2use crate::data::DataFrame;
3use crate::scale::ScaleSet;
4
5use super::Stat;
6
7/// Passthrough stat — no transformation.
8pub struct StatIdentity;
9
10impl Stat for StatIdentity {
11 fn compute_group(&self, data: &DataFrame, _scales: &ScaleSet) -> DataFrame {
12 data.clone()
13 }
14
15 fn required_aes(&self) -> Vec<Aesthetic> {
16 vec![]
17 }
18
19 fn name(&self) -> &str {
20 "identity"
21 }
22}