Pimp the graph
This commit is contained in:
parent
bacd2a2f5f
commit
77da1bf687
1 changed files with 13 additions and 5 deletions
|
@ -2,18 +2,26 @@
|
|||
(:use [tangle.core])
|
||||
(:require [mailhead.parser :as parser]))
|
||||
|
||||
(defn nodes [receive-path] [:a :b :c])
|
||||
(defn nodes [receive-path] ["home" "servera" "target"])
|
||||
|
||||
(defn edges [receive-path] [[:a :b {:label "200ms"}]
|
||||
[:b :c {:label "50min"}]])
|
||||
(defn edges [receive-path] [["home" "servera" {:label "200ms" :fillcolor "gray" :color "gray"}]
|
||||
["servera" "target" {:label "50min" :fillcolor "gray" :color "gray"}]])
|
||||
|
||||
(defn draw-path [receive-path]
|
||||
(-> (graph->dot
|
||||
(nodes receive-path)
|
||||
(edges receive-path)
|
||||
{:node {:shape :box}
|
||||
{:node {:shape :box
|
||||
:fontname "Arial"
|
||||
:fontsize 12
|
||||
:style "filled"
|
||||
:fillcolor "darkgoldenrod1"
|
||||
:color "darkgoldenrod3"}
|
||||
:edge {:fontname "Arial"
|
||||
:fontsize 10}
|
||||
:directed? true
|
||||
:graph {:rankdir :LR}})
|
||||
:graph {:rankdir :LR
|
||||
:color "transparent"}})
|
||||
(dot->image "png")))
|
||||
|
||||
(defn draw [filename]
|
||||
|
|
Loading…
Reference in a new issue