#[derive(Clone, Debug)]
pub struct VisualNode {
pub id: String,
pub label: String,
pub layer: String,
pub role: String,
pub color: String,
pub shape: String,
}
impl VisualNode {
pub fn from_hex_node(
node: &crate::graph::hex_node::HexNode,
style: &crate::graph::visualization::domain::visual_style::VisualStyle,
) -> Self {
let color = style.color_for_layer(&node.layer);
let shape = String::from("box");
Self {
id: node.id.to_string(),
label: node.type_name.to_string(),
layer: format!("{:?}", node.layer),
role: format!("{:?}", node.role),
color,
shape,
}
}
}