OldGraphs.jl
OldGraphs.jl copied to clipboard
trouble creating plots with attributes
I was trying to create a more advanced graph plot by using ExEdge and ExVertex objects in a graph but passing them to to_dot() function resulted in skipping the attributes.
I fixed it by bypassing an if-block in dot.jl, line 27:
if false#implements_edge_list(graph) && implements_vertex_map(graph)
This is, of course, not an ideal solution, hopefully somebody who has a better understanding of the package structure can fix this properly.
Also, this seems to be an edge-only problem. An example would be:
using Graphs
attr_vert = Dict{String,Any}("color"=>"red") #aiming for red nodes
attr_edges = Dict{String,Any}("label"=>"edge") #... and labels on edges
vs = [ ExVertex(i,"$i") for i in 1:3 ] #3 vertices
for i in vs; i.attributes = attr_vert; end #adding attributes to vertices
eds = [ExEdge(1,vs[1],vs[2],attr_edges)] #array of 1 edge
g = graph(vs,eds)
plot(g) #Graphs.plot()