Skip to main content

libpetri_export/
styles.rs

1// GENERATED from spec/petri-net-styles.json — do not edit manually.
2// Regenerate with: scripts/generate-styles.sh
3
4/// Node visual style.
5pub struct NodeVisual {
6    pub shape: &'static str,
7    pub fill: &'static str,
8    pub stroke: &'static str,
9    pub penwidth: f64,
10    pub style: Option<&'static str>,
11    pub height: Option<f64>,
12    pub width: Option<f64>,
13}
14
15/// Edge visual style.
16pub struct EdgeVisual {
17    pub color: &'static str,
18    pub style: &'static str,
19    pub penwidth: Option<f64>,
20    pub arrowhead: &'static str,
21}
22
23// Node styles
24pub const PLACE: NodeVisual = NodeVisual {
25    shape: "circle",
26    fill: "#FFFFFF",
27    stroke: "#333333",
28    penwidth: 1.5,
29    style: None,
30    height: None,
31    width: Some(0.35),
32};
33
34pub const START_PLACE: NodeVisual = NodeVisual {
35    shape: "circle",
36    fill: "#d4edda",
37    stroke: "#28a745",
38    penwidth: 2.0,
39    style: None,
40    height: None,
41    width: Some(0.35),
42};
43
44pub const END_PLACE: NodeVisual = NodeVisual {
45    shape: "doublecircle",
46    fill: "#cce5ff",
47    stroke: "#004085",
48    penwidth: 2.0,
49    style: None,
50    height: None,
51    width: Some(0.35),
52};
53
54pub const ENVIRONMENT_PLACE: NodeVisual = NodeVisual {
55    shape: "circle",
56    fill: "#f8d7da",
57    stroke: "#721c24",
58    penwidth: 2.0,
59    style: Some("dashed"),
60    height: None,
61    width: Some(0.35),
62};
63
64pub const TRANSITION: NodeVisual = NodeVisual {
65    shape: "box",
66    fill: "#fff3cd",
67    stroke: "#856404",
68    penwidth: 1.0,
69    style: None,
70    height: Some(0.4),
71    width: Some(0.8),
72};
73
74// Edge styles
75pub const INPUT_EDGE: EdgeVisual = EdgeVisual {
76    color: "#333333",
77    style: "solid",
78    penwidth: None,
79    arrowhead: "normal",
80};
81
82pub const OUTPUT_EDGE: EdgeVisual = EdgeVisual {
83    color: "#333333",
84    style: "solid",
85    penwidth: None,
86    arrowhead: "normal",
87};
88
89pub const INHIBITOR_EDGE: EdgeVisual = EdgeVisual {
90    color: "#dc3545",
91    style: "solid",
92    penwidth: None,
93    arrowhead: "odot",
94};
95
96pub const READ_EDGE: EdgeVisual = EdgeVisual {
97    color: "#6c757d",
98    style: "dashed",
99    penwidth: None,
100    arrowhead: "normal",
101};
102
103pub const RESET_EDGE: EdgeVisual = EdgeVisual {
104    color: "#fd7e14",
105    style: "bold",
106    penwidth: Some(2.0),
107    arrowhead: "normal",
108};
109
110// Font settings
111pub const FONT_FAMILY: &str = "Helvetica,Arial,sans-serif";
112pub const FONT_NODE_SIZE: f64 = 12.0;
113pub const FONT_EDGE_SIZE: f64 = 10.0;
114
115// Graph spacing
116pub const NODESEP: f64 = 0.5;
117pub const RANKSEP: f64 = 0.75;
118pub const FORCE_LABELS: &str = "true";
119pub const OVERLAP: &str = "false";