Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

Edge attributes not processed by to_dot() #221

Closed
mathtd opened this issue Apr 29, 2016 · 1 comment
Closed

Edge attributes not processed by to_dot() #221

mathtd opened this issue Apr 29, 2016 · 1 comment

Comments

@mathtd
Copy link

mathtd commented Apr 29, 2016

The following code builds a graph with two vertices and two edges but when using to_dot() the attributes of the edges do not show up in the output file.

using Graphs

nnodes = 2
nedges = 2

vlist = Array(ExVertex, nnodes)
for i = 1:nnodes
    vlist[i] = ExVertex(i,"$i")
    vlist[i].attributes["height"] = i
end

elist = Array(ExEdge{typeof(vlist[1])}, nedges)

elist[1] = ExEdge(1, vlist[1], vlist[2])
elist[1].attributes["color"] = "blue"

elist[2] = ExEdge(2, vlist[2], vlist[1])
elist[2].attributes["color"] = "red"

g = graph(vlist, elist, is_directed = true)

to_dot(g,"temp.txt")

The content of temp.txt is

digraph graphname {
1   ["height"="1"]
2   ["height"="2"]
1 -> 2
2 -> 1
}

The vertices have their attributes but note the edges. Is that a bug or is there something wrong with my code?

Many thanks for any help!

@mathtd mathtd changed the title Edge attributes not processes by to_dot Edge attributes not processed by to_dot Apr 29, 2016
@mathtd mathtd changed the title Edge attributes not processed by to_dot Edge attributes not processed by to_dot() Apr 29, 2016
@mathtd mathtd closed this as completed Apr 30, 2016
@mathtd
Copy link
Author

mathtd commented Apr 30, 2016

Nevermind. I saw that pull request #206 fixes this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants