diff options
Diffstat (limited to 'Graphviz.hs')
-rw-r--r-- | Graphviz.hs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Graphviz.hs b/Graphviz.hs index 81ff71a..0809468 100644 --- a/Graphviz.hs +++ b/Graphviz.hs @@ -47,18 +47,16 @@ genGraph ls = digraph (Str "debug-me") $ do forM_ ls $ \l -> case l of ActivitySeen { activitySeen = (a, h) } -> do node (display h) - [ textLabel $ display $ seenData $ activity a - , shape Circle + [ textLabel $ display $ activity a + , shape BoxShape , xcolor Green ] chain a h ActivityEntered { activityEntered = (a, h) } -> do node (display h) - [ textLabel $ display $ enteredData $ activity a - , shape Square - , if activityEnteredAccepted l - then xcolor Green - else xcolor Red + [ textLabel $ display $ activity a + , shape Circle + , xcolor Green ] chain a h where @@ -77,3 +75,13 @@ instance Display Val where instance Display Hash where display (Hash m h) = T.pack (show m) <> display h + +instance Display Seen where + display = display . seenData + +instance Display Entered where + display = display . enteredData + +instance Display a => Display (Proto a) where + display (Proto a) = display a + display (Rejected a) = "Rejected " <> display (activity a) |