summaryrefslogtreecommitdiffhomepage
path: root/Graphviz.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Graphviz.hs')
-rw-r--r--Graphviz.hs43
1 files changed, 25 insertions, 18 deletions
diff --git a/Graphviz.hs b/Graphviz.hs
index 9d508c8..c6ce8a9 100644
--- a/Graphviz.hs
+++ b/Graphviz.hs
@@ -50,29 +50,36 @@ genGraph opts ls = digraph (Str "debug-me") $ do
forM_ ls $
showactivity [ xcolor Green ]
where
- showactivity s (ActivitySeen { activitySeen = (a, h) }) = do
- node (display h) $ s ++
- [ textLabel $ prettyDisplay $ activity a
- , shape BoxShape
- ]
- case activity a of
- Rejected ar -> do
- let hr = hash ar
- let rejstyle =
- [ xcolor Red
- , Style [dashed, filled]
- ]
- showactivity rejstyle $
- ActivityEntered (ar, hr)
- link hr h rejstyle
- _ -> return ()
- linkprev s a h
- showactivity s (ActivityEntered { activityEntered = (a, h) }) = do
+ showactivity s l = case loggedActivity l of
+ ActivitySeen a -> do
+ node (display h) $ s ++
+ [ textLabel $ prettyDisplay $ activity a
+ , shape BoxShape
+ ]
+ case activity a of
+ Rejected ar -> do
+ let hr = hash ar
+ let rejstyle =
+ [ xcolor Red
+ , Style [dashed, filled]
+ ]
+ showactivity rejstyle $
+ ActivityLog
+ { loggedActivity = ActivityEntered ar
+ , loggedHash = hr
+ , loggedTimestamp = loggedTimestamp l
+ }
+ link hr h rejstyle
+ _ -> return ()
+ linkprev s a h
+ ActivityEntered a -> do
node (display h) $ s ++
[ textLabel $ prettyDisplay $ activity a
, shape Circle
]
linkprev s a h
+ where
+ h = loggedHash l
linkprev s a h = case prevActivity a of
Nothing -> return ()
Just p -> link p h s