use super::types::NodeShape;
use crate::style::Color;
#[derive(Clone, Debug)]
pub struct DiagramNode {
pub id: String,
pub label: String,
pub shape: NodeShape,
pub color: Option<Color>,
pub bg: Option<Color>,
}
impl DiagramNode {
pub fn new(id: impl Into<String>, label: impl Into<String>) -> Self {
Self {
id: id.into(),
label: label.into(),
shape: NodeShape::default(),
color: None,
bg: None,
}
}
pub fn shape(mut self, shape: NodeShape) -> Self {
self.shape = shape;
self
}
pub fn color(mut self, color: Color) -> Self {
self.color = Some(color);
self
}
pub fn bg(mut self, color: Color) -> Self {
self.bg = Some(color);
self
}
}