use super::*;
pub struct Shapes {
pub edge_color: String, pub face_color: String, pub is_closed: bool, pub scale: f64, pub style: String,
pub(crate) buffer: String,
}
impl Shapes {
pub fn new() -> Self {
Shapes {
edge_color: String::new(),
face_color: String::new(),
is_closed: false,
scale: 0.0,
style: String::new(),
buffer: String::new(),
}
}
pub(crate) fn options(&self) -> String {
let mut options = String::new();
if self.edge_color != "" {
options.push_str(&format!(",edgecolor='{}'", self.edge_color));
}
if self.face_color != "" {
options.push_str(&format!(",facecolor='{}'", self.face_color));
}
options
}
}
impl GraphMaker for Shapes {
fn get_buffer<'a>(&'a self) -> &'a String {
&self.buffer
}
}