File tree Expand file tree Collapse file tree 2 files changed +494
-682
lines changed
Expand file tree Collapse file tree 2 files changed +494
-682
lines changed Original file line number Diff line number Diff line change 1010(defn to-graph [[& args]]
1111 (condp = (first args)
1212 '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 "
1523 " \" %s\" -> \" %s\" [label = \" true\" , id = \" %s\" ] \n "
1624 " \" %s\" -> \" %s\" [label=\" false\" , id = \" %s\" ]\n " )
17- name (clean-id name)
25+ name (clean-id name) ( if internal? " style= \" filled \" fillcolor= \" #CCCCCC \" " " " )
1826 name then (clean-id (str name " _" then))
1927 name else (clean-id (str name " _" else ))))
2028 'defaction
3139 :else " #ffffff" )]
3240 (format " \" %s\" [id=\" %s\" label=\" %s\\ n%s\" style=\" filled\" fillcolor=\" %s\" ];\n "
3341 name (clean-id name) status (clojure.string/replace name #"^handle-" " " ) color))
34- nil )
35-
36- )
42+ nil ))
3743
3844(defn rank-max [names]
3945 (str " subgraph {\n rank=max;\n "
7783 (let [{:keys [nodes handlers actions]} (parse-source-definitions )]
7884 (->> nodes
7985 (map to-graph)
80- (filter identity )
86+ (remove nil? )
8187 (concat (rank-handler-groups handlers))
8288 (concat (rank-same actions))
8389 (apply str)
You can’t perform that action at this time.
0 commit comments