summaryrefslogtreecommitdiff
path: root/Utility/Dot.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-12-13 00:24:19 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-12-13 00:24:19 -0400
commit94554782894ec6c26da3b46312d5d1d16d596458 (patch)
tree78746106bfb153945ccbfd2bbae536081c005e91 /Utility/Dot.hs
parent55bd61d8c42aaf36a3c57f8444c493f6b045f4cd (diff)
finished where indentation changes
Diffstat (limited to 'Utility/Dot.hs')
-rw-r--r--Utility/Dot.hs28
1 files changed, 14 insertions, 14 deletions
diff --git a/Utility/Dot.hs b/Utility/Dot.hs
index 83f52a3cc..e57bf009f 100644
--- a/Utility/Dot.hs
+++ b/Utility/Dot.hs
@@ -10,9 +10,9 @@ module Utility.Dot where -- import qualified
{- generates a graph description from a list of lines -}
graph :: [String] -> String
graph s = unlines $ [header] ++ map indent s ++ [footer]
- where
- header = "digraph map {"
- footer= "}"
+ where
+ header = "digraph map {"
+ footer= "}"
{- a node in the graph -}
graphNode :: String -> String -> String
@@ -21,8 +21,8 @@ graphNode nodeid desc = label desc $ quote nodeid
{- an edge between two nodes -}
graphEdge :: String -> String -> Maybe String -> String
graphEdge fromid toid desc = indent $ maybe edge (`label` edge) desc
- where
- edge = quote fromid ++ " -> " ++ quote toid
+ where
+ edge = quote fromid ++ " -> " ++ quote toid
{- adds a label to a node or edge -}
label :: String -> String -> String
@@ -46,18 +46,18 @@ subGraph subid l color s =
ii setcolor ++
ii s ++
indent "}"
- where
- -- the "cluster_" makes dot draw a box
- name = quote ("cluster_" ++ subid)
- setlabel = "label=" ++ quote l
- setfilled = "style=" ++ quote "filled"
- setcolor = "fillcolor=" ++ quote color
- ii x = indent (indent x) ++ "\n"
+ where
+ -- the "cluster_" makes dot draw a box
+ name = quote ("cluster_" ++ subid)
+ setlabel = "label=" ++ quote l
+ setfilled = "style=" ++ quote "filled"
+ setcolor = "fillcolor=" ++ quote color
+ ii x = indent (indent x) ++ "\n"
indent ::String -> String
indent s = '\t' : s
quote :: String -> String
quote s = "\"" ++ s' ++ "\""
- where
- s' = filter (/= '"') s
+ where
+ s' = filter (/= '"') s