summaryrefslogtreecommitdiffhomepage
path: root/Graphviz.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-18 10:48:07 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-18 10:48:07 -0400
commitd19059948fe938ad9a4e1fb851e25cff49e4ac3c (patch)
treebbcdcc66e0d56613a92fff979cc53d643cf89fac /Graphviz.hs
parent3c70b91b97dff3624e5d6682e50fd588d756ab67 (diff)
downloaddebug-me-d19059948fe938ad9a4e1fb851e25cff49e4ac3c.tar.gz
add short hash to edges
Diffstat (limited to 'Graphviz.hs')
-rw-r--r--Graphviz.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/Graphviz.hs b/Graphviz.hs
index d3a599e..d13e386 100644
--- a/Graphviz.hs
+++ b/Graphviz.hs
@@ -63,18 +63,22 @@ genGraph ls = digraph (Str "debug-me") $ do
]
showactivity rejstyle $
ActivityEntered (ar, hr)
- edge (display hr) (display h) rejstyle
+ link hr h rejstyle
_ -> return ()
- chain s a h
+ linkprev s a h
showactivity s (ActivityEntered { activityEntered = (a, h) }) = do
node (display h) $ s ++
[ textLabel $ display $ activity a
, shape Circle
]
- chain s a h
- chain s a h = case prevActivity a of
+ linkprev s a h
+ linkprev s a h = case prevActivity a of
Nothing -> return ()
- Just p -> edge (display p) (display h) s
+ Just p -> link p h s
+ link a b s = edge (display a) (display b) $ s ++
+ [ textLabel (shorthash a)
+ ]
+ shorthash h = display $ Val $ B.take 5 $ val $ hashValue h
xcolor :: X11Color -> Attribute
xcolor c = Color [toWC $ X11Color c]