1module ProjectM36.TransactionGraph.Show.Dot where
2import ProjectM36.Transaction
4import qualified Data.Text as T
5import qualified Data.Set as S
6import qualified Data.Map as M
8graphAsDot :: TransactionGraph -> String
9graphAsDot (TransactionGraph heads transSet) = "digraph {" ++ dot ++ headInfo ++ "}"
11 dot = S.foldr transactionAsDot "" transSet
12 transactionAsDot trans acc = acc ++ childArrows trans ++ parentArrows trans
13 arrows trans = S.foldr (\c acc' -> acc' ++ oneArrow trans c) ""
14 childArrows trans = arrows trans (transactionChildIds trans)
15 parentArrows trans = arrows trans (transactionParentIds trans)
16 transLabel t = tidLabel (transactionId t)
17 tidLabel l = "\"" ++ show l ++ "\""
18 oneArrow trans tid = transLabel trans ++ " -> " ++ tidLabel tid ++ ";"
19 headInfo = M.foldrWithKey (\headName t acc -> transLabel t ++ " [label=\"" ++ (show . transactionId) t ++ ":" ++ T.unpack headName ++ "\"];" ++ acc) "" heads
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list