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]]
> 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.