summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-02-08 18:17:46 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-02-08 18:17:46 -0400
commitc1b69d1511cd9a6d63981f74f6d926d59dba7c8c (patch)
tree7c6ed590595b24d6a65e6587c94a1bdf300b7764
parentc0ec5a35db54f45b14971ae61b42ccc64cb92f62 (diff)
fill color for host boxes
-rw-r--r--Command/Map.hs2
-rw-r--r--Dot.hs11
2 files changed, 9 insertions, 4 deletions
diff --git a/Command/Map.hs b/Command/Map.hs
index 05fa25885..74005b521 100644
--- a/Command/Map.hs
+++ b/Command/Map.hs
@@ -100,7 +100,7 @@ nodeId r =
node :: (M.Map UUID String) -> [Git.Repo] -> Git.Repo -> String
node umap fullinfo r = unlines $ n:edges
where
- n = Dot.subGraph (hostname r) (basehostname r) $
+ n = Dot.subGraph (hostname r) (basehostname r) "grey" $
decorate $ Dot.graphNode (nodeId r) (repoName umap r)
edges = map (edge umap fullinfo r) (Git.remotes r)
decorate
diff --git a/Dot.hs b/Dot.hs
index fcd0c19cc..a21d70536 100644
--- a/Dot.hs
+++ b/Dot.hs
@@ -41,13 +41,18 @@ fillColor :: String -> String -> String
fillColor color s = attr "fillcolor" color $ attr "style" "filled" $ s
{- apply to graphNode to put the node in a labeled box -}
-subGraph :: String -> String -> String -> String
-subGraph subid l s =
- "subgraph " ++ name ++ " {\n" ++ ii setlabel ++ ii s ++ indent "}"
+subGraph :: String -> String -> String -> String -> String
+subGraph subid l color s =
+ "subgraph " ++ name ++ " {\n" ++
+ ii setlabel ++
+ ii setcolor ++
+ ii s ++
+ indent "}"
where
-- the "cluster_" makes dot draw a box
name = quote ("cluster_" ++ subid)
setlabel = "label=" ++ quote l
+ setcolor = "fillcolor=" ++ quote color
ii x = (indent $ indent x) ++ "\n"
indent ::String -> String