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

trouble creating plots with attributes #249

Open
tungli opened this issue May 26, 2018 · 1 comment
Open

trouble creating plots with attributes #249

tungli opened this issue May 26, 2018 · 1 comment

Comments

@tungli
Copy link

tungli commented May 26, 2018

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.

@tungli
Copy link
Author

tungli commented May 26, 2018

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()

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