From c1b69d1511cd9a6d63981f74f6d926d59dba7c8c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Feb 2011 18:17:46 -0400 Subject: [PATCH] fill color for host boxes --- Command/Map.hs | 2 +- Dot.hs | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Command/Map.hs b/Command/Map.hs index 05fa258857..74005b521d 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 fcd0c19cc2..a21d705365 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