File tree 2 files changed +494
-682
lines changed
2 files changed +494
-682
lines changed Original file line number Diff line number Diff line change 10
10
(defn to-graph [[& args]]
11
11
(condp = (first args)
12
12
'defdecision
13
- (let [[name then else] (apply extract args)]
14
- (format (str " \" %s\" [id = \" %s\" ] \n "
13
+ (let [[name then else] (apply extract args)
14
+ internal? (#{" is-options?"
15
+ " method-put?"
16
+ " method-delete?"
17
+ " method-patch?"
18
+ " post-to-existing?"
19
+ " post-to-missing?"
20
+ " post-to-gone?"
21
+ " put-to-existing?" } (str name))]
22
+ (format (str " \" %s\" [id = \" %s\" %s] \n "
15
23
" \" %s\" -> \" %s\" [label = \" true\" , id = \" %s\" ] \n "
16
24
" \" %s\" -> \" %s\" [label=\" false\" , id = \" %s\" ]\n " )
17
- name (clean-id name)
25
+ name (clean-id name) ( if internal? " style= \" filled \" fillcolor= \" #CCCCCC \" " " " )
18
26
name then (clean-id (str name " _" then))
19
27
name else (clean-id (str name " _" else ))))
20
28
'defaction
31
39
:else " #ffffff" )]
32
40
(format " \" %s\" [id=\" %s\" label=\" %s\\ n%s\" style=\" filled\" fillcolor=\" %s\" ];\n "
33
41
name (clean-id name) status (clojure.string/replace name #"^handle-" " " ) color))
34
- nil )
35
-
36
- )
42
+ nil ))
37
43
38
44
(defn rank-max [names]
39
45
(str " subgraph {\n rank=max;\n "
77
83
(let [{:keys [nodes handlers actions]} (parse-source-definitions )]
78
84
(->> nodes
79
85
(map to-graph)
80
- (filter identity )
86
+ (remove nil? )
81
87
(concat (rank-handler-groups handlers))
82
88
(concat (rank-same actions))
83
89
(apply str)
You can’t perform that action at this time.
0 commit comments