@@ -166,6 +166,9 @@ def build_pydot(
166166
167167 steps_thickness = 3
168168 fill_color = "wheat"
169+ failed_color = "LightCoral"
170+ cancel_color = "Grey"
171+ overwrite_color = "SkyBlue"
169172 steps_color = "#009999"
170173 new_clusters = {}
171174
@@ -214,7 +217,11 @@ def get_node_name(a):
214217 # LABEL change with solution.
215218 if solution and nx_node in solution :
216219 kw ["style" ] = "filled"
217- kw ["fillcolor" ] = fill_color
220+ kw ["fillcolor" ] = (
221+ overwrite_color
222+ if nx_node in getattr (solution , "overwrites" , ())
223+ else fill_color
224+ )
218225 ## NOTE: SVG tooltips not working without URL:
219226 # https://gitlab.com/graphviz/graphviz/issues/1425
220227 kw ["tooltip" ] = str (solution .get (nx_node ))
@@ -225,9 +232,15 @@ def get_node_name(a):
225232 if steps and nx_node in steps :
226233 kw ["penwdth" ] = steps_thickness
227234 shape = "egg" if isinstance (nx_node , NetworkOperation ) else "oval"
228- if nx_node in getattr (solution , "executed" , ()):
235+ if nx_node in getattr (solution , "failures" , ()):
236+ kw ["style" ] = "filled"
237+ kw ["fillcolor" ] = failed_color
238+ elif nx_node in getattr (solution , "executed" , ()):
229239 kw ["style" ] = "filled"
230240 kw ["fillcolor" ] = fill_color
241+ elif nx_node in getattr (solution , "canceled" , ()):
242+ kw ["style" ] = "filled"
243+ kw ["fillcolor" ] = cancel_color
231244 try :
232245 kw ["URL" ] = f"file://{ inspect .getfile (nx_node .fn )} "
233246 except Exception as ex :
0 commit comments