diff --git a/src/rsprocess/grammar.lalrpop b/src/rsprocess/grammar.lalrpop index ce53229..9cdddbf 100644 --- a/src/rsprocess/grammar.lalrpop +++ b/src/rsprocess/grammar.lalrpop @@ -488,7 +488,7 @@ ColorEdge: graph::EdgeColor = { GraphSaveOptions: presets::GraphSaveOptions = { - "Dot" "|" "|" + "Dot" "|"? "|" "|" "|" ">" => presets::GraphSaveOptions::Dot { node_display: s_node, @@ -496,7 +496,7 @@ GraphSaveOptions: presets::GraphSaveOptions = { node_color: c_node, edge_color: c_edge, so }, - "GraphML" "|" ">" + "GraphML" "|"? "|" ">" => presets::GraphSaveOptions::GraphML { node_display: s_node, edge_display: s_edge, diff --git a/src/rsprocess/graph.rs b/src/rsprocess/graph.rs index faf152c..441b4fb 100644 --- a/src/rsprocess/graph.rs +++ b/src/rsprocess/graph.rs @@ -566,7 +566,7 @@ pub fn edge_formatter_base_color( base_color: String ) -> String { - ", fillcolor=".to_string() + &base_color + ", color=".to_string() + &base_color } pub fn edge_formatter( @@ -581,7 +581,7 @@ pub fn edge_formatter( move |_, e| { let rssystem = original_graph.edge_weight(e.id()).unwrap(); if ot.evaluate(&rssystem.available_entities, &set) { - Some(", fillcolor=".to_string() + &color) + Some(", color=".to_string() + &color) } else { None } @@ -593,7 +593,7 @@ pub fn edge_formatter( move |_, e| { let rssystem = original_graph.edge_weight(e.id()).unwrap(); if ot.evaluate(&rssystem.context, &set) { - Some(", fillcolor=".to_string() + &color) + Some(", color=".to_string() + &color) } else { None } @@ -605,7 +605,7 @@ pub fn edge_formatter( move |_, e| { let rssystem = original_graph.edge_weight(e.id()).unwrap(); if ot.evaluate(&rssystem.t, &set) { - Some(", fillcolor=".to_string() + &color) + Some(", color=".to_string() + &color) } else { None } @@ -617,7 +617,7 @@ pub fn edge_formatter( move |_, e| { let rssystem = original_graph.edge_weight(e.id()).unwrap(); if ot.evaluate(&rssystem.reactants, &set) { - Some(", fillcolor=".to_string() + &color) + Some(", color=".to_string() + &color) } else { None } @@ -629,7 +629,7 @@ pub fn edge_formatter( move |_, e| { let rssystem = original_graph.edge_weight(e.id()).unwrap(); if ot.evaluate(&rssystem.reactants_absent, &set) { - Some(", fillcolor=".to_string() + &color) + Some(", color=".to_string() + &color) } else { None } @@ -641,7 +641,7 @@ pub fn edge_formatter( move |_, e| { let rssystem = original_graph.edge_weight(e.id()).unwrap(); if ot.evaluate(&rssystem.inhibitors, &set) { - Some(", fillcolor=".to_string() + &color) + Some(", color=".to_string() + &color) } else { None } @@ -653,7 +653,7 @@ pub fn edge_formatter( move |_, e| { let rssystem = original_graph.edge_weight(e.id()).unwrap(); if ot.evaluate(&rssystem.inhibitors_present, &set) { - Some(", fillcolor=".to_string() + &color) + Some(", color=".to_string() + &color) } else { None } @@ -665,7 +665,7 @@ pub fn edge_formatter( move |_, e| { let rssystem = original_graph.edge_weight(e.id()).unwrap(); if ot.evaluate(&rssystem.products, &set) { - Some(", fillcolor=".to_string() + &color) + Some(", color=".to_string() + &color) } else { None } diff --git a/testing/first.system b/testing/first.system index 3063fa6..561accc 100644 --- a/testing/first.system +++ b/testing/first.system @@ -4,4 +4,10 @@ Context: [({a,b}.{a}.{a,c}.x + {a,b}.{a}.{a}.nill)] Reactions: ([{a,b}, {c}, {b}]) -Digraph > Dot Context | Hide | Context.EntitySet ⊆ {a, c} ? "HERE" || Context.NonDeterministicChoice ? "ASDASDSAD" ! "#123" | ! "#987" > Print +Digraph + > Dot + | Context + | Hide + | Context.EntitySet ⊆ {a, c} ? "lightblue" || Context.NonDeterministicChoice ? "yellow" ! "#123" + | Entities < {a} ? "white" ! "#lightgreen" + > Print