use crate::artist::LineArtist;
use crate::decimate::DecimateMethod;
use crate::primitives::Color;
use crate::theme::LineStyle;
impl LineArtist {
pub fn color(&mut self, color: Color) -> &mut Self {
self.color = color;
self
}
pub fn width(&mut self, width: f64) -> &mut Self {
self.width = width;
self
}
pub fn style(&mut self, style: LineStyle) -> &mut Self {
self.style = style;
self
}
pub fn label(&mut self, label: &str) -> &mut Self {
self.label = Some(label.to_string());
self
}
pub fn alpha(&mut self, alpha: f64) -> &mut Self {
self.alpha = alpha.clamp(0.0, 1.0);
self
}
pub fn decimate(&mut self, threshold: usize) -> &mut Self {
self.decimate = Some((threshold, DecimateMethod::Lttb));
self
}
pub fn decimate_with(&mut self, threshold: usize, method: DecimateMethod) -> &mut Self {
self.decimate = Some((threshold, method));
self
}
}