use crate::{details::format_custom_style, Color, NodeShape};
#[derive(Debug, Clone, PartialEq)]
pub struct NodeAttributes {
pub label: Option<String>,
pub shape: Option<NodeShape>,
pub fill_color: Option<Color>,
pub stroke_color: Option<Color>,
pub stroke_width: Option<f64>,
pub dash_array: Option<Vec<f64>>,
}
impl NodeAttributes {
pub fn new(
label: Option<String>,
shape: Option<NodeShape>,
fill_color: Option<Color>,
stroke_color: Option<Color>,
stroke_width: Option<f64>,
dash_array: Option<Vec<f64>>,
) -> Self {
Self {
label,
shape,
fill_color,
stroke_color,
stroke_width,
dash_array,
}
}
pub fn custom_style(&self) -> Option<String> {
format_custom_style(
self.fill_color.as_ref(),
self.stroke_color.as_ref(),
self.stroke_width,
self.dash_array.as_deref(),
)
}
}