Is from and to reversed in the toDotR function in the graph package?
1
0
Entering edit mode
@altmann-michael-3022
Last seen 9.7 years ago
The source code for the toDotR method in the graph package has the following E <- edgeL(G) enms <- names(E) nds <- nodes(G) out <- paste(out, buildEdge( from=nds[ E[[i]]$edges[j] ], to=enms[i], optList, E[[i]][[ optList$edgeLabelField ]] ), sep=" ") I believe that the storage methanism for edges implies that enms[i] is the from and nds[ E[[i]]$edges[j] ] is the to The implementor of the toDotR "fixed" this bug by putting "dir=back" on every edge, but it seems like a better fix would have been to reverse to and from. Thanks Michael Altmann [[alternative HTML version deleted]]
graph graph • 631 views
ADD COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 2 days ago
United States
> The source code for the toDotR method in the graph package has the > following > > > > E <- edgeL(G) > > enms <- names(E) > > nds <- nodes(G) > > out <- paste(out, buildEdge( from=nds[ E[[i]]$edges[j] ], > > to=enms[i], optList, E[[i]][[ optList$edgeLabelField ]] ), > sep=" ") > > > > I believe that the storage methanism for edges implies that > > enms[i] is the from > > and nds[ E[[i]]$edges[j] ] is the to > > > > > > The implementor of the toDotR "fixed" this bug by putting "dir=back" on > every edge, but it seems like a better fix would have been to reverse to > and from. > The toDotR function was added in 2005. To my knowledge it has gotten very little use. The motivation for the dir="back" kludge is hard to recall but I think it has something to do with getting a more rational vertical layout for a certain graph type that needed to be rendered. Both graph and graphviz have changed a lot since toDotR was introduced and essentially left dormant. Perhaps it should be revisited. There are not many resources available for designing/maintaining this interface so if you want to see changes it might be best to propose some patches. Propagation of specific rendering information from nodeData or edgeData or renderInfo structures, all of which AFAIK came subsequent to the toDotR contribution, could be worthwhile.
ADD COMMENT

Login before adding your answer.

Traffic: 534 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6