change rankdir based on number of connected nodes

integration-tests
Josha von Gizycki 6 years ago
parent b0c7055fa1
commit 879345355e

@ -17,8 +17,13 @@
relationships-in (map (fn [{:keys [link source schema]}] relationships-in (map (fn [{:keys [link source schema]}]
[(:uuid source) :> (:uuid instance) [(:uuid source) :> (:uuid instance)
{:label (:name link)}]) {:label (:name link)}])
(:links-in instance))] (:links-in instance))
(-> [[(:uuid instance) {:label (:name instance) rankdir (if (or (> (count in-nodes) 7)
(> (count out-nodes) 7))
"LR"
"TD")]
(-> [{:rankdir rankdir}
[(:uuid instance) {:label (:name instance)
:shape "cylinder"}]] :shape "cylinder"}]]
(into out-nodes) (into out-nodes)
(into in-nodes) (into in-nodes)

Loading…
Cancel
Save