Fixing color for edge formatter

This commit is contained in:
elvis
2025-07-13 19:32:11 +02:00
parent 75028fbf38
commit 3be9939c09
3 changed files with 18 additions and 12 deletions

View File

@ -488,7 +488,7 @@ ColorEdge: graph::EdgeColor = {
GraphSaveOptions: presets::GraphSaveOptions = {
"Dot" <s_node: SeparatorNode> "|" <s_edge: SeparatorEdge> "|"
"Dot" "|"? <s_node: SeparatorNode> "|" <s_edge: SeparatorEdge> "|"
<c_node: ColorNode> "|" <c_edge: ColorEdge> ">"
<so: SaveOptions> =>
presets::GraphSaveOptions::Dot { node_display: s_node,
@ -496,7 +496,7 @@ GraphSaveOptions: presets::GraphSaveOptions = {
node_color: c_node,
edge_color: c_edge,
so },
"GraphML" <s_node: SeparatorNode> "|" <s_edge: SeparatorEdge> ">"
"GraphML" "|"? <s_node: SeparatorNode> "|" <s_edge: SeparatorEdge> ">"
<so: SaveOptions> =>
presets::GraphSaveOptions::GraphML { node_display: s_node,
edge_display: s_edge,

View File

@ -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
}

View File

@ -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