use lievisual::geometry::{Color, Point, Size};
use lievisual::scene::{Fill, Stroke};
use lievisual::text::{RichSpan, TextStyle};
use super::common::*;
use super::geograph::RoutePath;
use super::shape::*;
use super::unigraph::EdgeKind;
#[derive(Debug, Clone, Default)]
pub struct SceneGraph {
pub size: Size,
pub background: Color,
pub items: Vec<SceneItem>,
}
#[derive(Debug, Clone)]
pub enum SceneItem {
Shape {
geometry: ShapeGeometry,
fill: Option<Fill>,
stroke: Option<Stroke>,
name: Option<String>,
z: i32,
},
Edge {
path: RoutePath,
stroke: Stroke,
ends: (EdgeEnds, EdgeEnds),
z: i32,
},
Label {
text: Vec<RichSpan>,
position: Point,
style: TextStyle,
anchor: Anchor,
z: i32,
},
Group { children: Vec<SceneItem>, z: i32 },
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum Anchor {
#[default]
Center,
Left,
Right,
Top,
Bottom,
}
#[derive(Debug, Clone, Default)]
pub struct StyleIntent {
pub node_styles: Vec<(NodeId, StyleRef)>,
pub edge_styles: Vec<(EdgeId, EdgeKind, ArrowSpec)>,
pub container_styles: Vec<(ContainerId, ContainerKind)>,
}