use crate::chart::Chart;
use crate::error::ChartonError;
use crate::mark::Mark;
use polars::prelude::*;
impl<T: Mark> Chart<T> {
pub fn transform_calculate<E1, E2>(mut self, ymin: E1, ymax: E2) -> Result<Self, ChartonError>
where
E1: Into<Expr>,
E2: Into<Expr>,
{
let ymin_expr = ymin.into();
let ymax_expr = ymax.into();
let df = self
.data
.df
.clone()
.lazy()
.with_columns([ymin_expr, ymax_expr])
.collect()?;
self.data.df = df;
Ok(self)
}
}