@@ -28,9 +28,11 @@ type Graph struct {
2828
2929func New (ns string ) * Graph {
3030 g := dot .NewGraph ("G" )
31+ _ = g .Set ("tooltip" , "Graph View" )
3132 _ = g .Set ("shape" , "box" )
3233 _ = g .Set ("label" , "Triggers in " + ns )
3334 _ = g .Set ("rankdir" , "LR" )
35+
3436 //_ = g.Set("compound", "true")
3537
3638 graph := & Graph {
@@ -360,8 +362,17 @@ func setNodeShapeForKind(node *dot.Node, kind, apiVersion string) {
360362
361363func setNodeColorForStatus (node * dot.Node , status duckv1beta1.Status ) {
362364 cond := status .GetCondition (apis .ConditionReady )
365+ _ = node .Set ("fillcolor" , "white" )
366+ _ = node .Set ("style" , "filled" )
363367 if cond .IsTrue () {
364- _ = node .Set ("color" , "darkgreen" )
368+ _ = node .Set ("color" , "black" )
369+ _ = node .Set ("tooltip" , fmt .Sprintf ("Ready as of %s" , cond .LastTransitionTime .Inner .String ()))
370+ } else if cond .IsUnknown () {
371+ _ = node .Set ("color" , "goldenrod" )
372+ _ = node .Set ("tooltip" , fmt .Sprintf ("[%s] %s: %s" , cond .Status , cond .Reason , cond .Message ))
373+ } else if cond .IsFalse () {
374+ _ = node .Set ("color" , "deeppink" )
375+ _ = node .Set ("tooltip" , fmt .Sprintf ("[%s] %s: %s" , cond .Status , cond .Reason , cond .Message ))
365376 }
366377}
367378
0 commit comments