aysylu / loom

Graph library for Clojure. Mailing list https://groups.google.com/forum/#!forum/loom-clj
http://aysy.lu/loom/
887 stars 108 forks source link

Nodes with same label are merged under dot-str? #86

Open boyentenbi opened 8 years ago

boyentenbi commented 8 years ago

Hi all,

Every method I've tried for labelling distinct nodes with the same string makes dot-str return them as merged!

It may be that I've misunderstood terms and have hence implemented wrongly, but here is a simple way to reproduce the issue:

(def g (digraph [2 1] [3 1])) ;; graph looks like this 2 -> 1 <- 3
(def g-labelled (-> g
                    (add-label 2 "label")
                    (add-label 3 "label")))
(dot-str g-labelled)
(view g-labelled)

This produces the very strange DOT text:

digraph "graph" { "mylabel" -> "1" "mylabel" -> "1" "1" "mylabel" ["label"="mylabel"] "mylabel" ["label"="mylabel"] }

Please let me know if I'm doing something wrong; otherwise I'll dip into the source and see if I can fix this.

Cheers