Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/graphLayout.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ buildEdgeList <- function(graph, recipEdges=c("combined", "distinct"),
})

## Generate the list of pEdge objects
.Call("Rgraphviz_buildEdgeList", aa, edgemode(graph),
.Call("Rgraphviz_buildEdgeList", nodes(graph), aa, edgemode(graph),
subGList, edgeNames, removed, edgeAttrs, defAttrs,
PACKAGE="Rgraphviz")
}
Expand Down
2 changes: 1 addition & 1 deletion src/RgraphvizInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ static const R_CallMethodDef R_CallDef[] = {
{"Rgraphviz_graphvizVersion", (DL_FUNC)&Rgraphviz_graphvizVersion, 0},
{"Rgraphviz_bezier", (DL_FUNC)&Rgraphviz_bezier, 3},
{"Rgraphviz_buildNodeList", (DL_FUNC)&Rgraphviz_buildNodeList, 4},
{"Rgraphviz_buildEdgeList", (DL_FUNC)&Rgraphviz_buildEdgeList, 7},
{"Rgraphviz_buildEdgeList", (DL_FUNC)&Rgraphviz_buildEdgeList, 8},

{"Rgraphviz_toFile", (DL_FUNC)&Rgraphviz_toFile, 4},

Expand Down
14 changes: 9 additions & 5 deletions src/buildEdgeList.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#include "common.h"
#include "util.h"

SEXP Rgraphviz_buildEdgeList(SEXP edgeL, SEXP edgeMode, SEXP subGList,
SEXP edgeNames, SEXP removedEdges,
SEXP edgeAttrs, SEXP defAttrs) {
SEXP Rgraphviz_buildEdgeList(SEXP nodes, SEXP edgeL, SEXP edgeMode,
SEXP subGList, SEXP edgeNames,
SEXP removedEdges, SEXP edgeAttrs,
SEXP defAttrs) {
int x, y, curEle = 0;
SEXP from;
SEXP peList;
SEXP peClass, curPE;
SEXP curAttrs, curFrom, curTo, curWeights = R_NilValue;
SEXP attrNames;
SEXP tmpToSTR, tmpWtSTR, tmpW;
SEXP curSubG, subGEdgeL, subGEdges, elt;
SEXP curSubG, subGEdgeL, subGEdges, subGNodes, elt;
SEXP recipAttrs, newRecipAttrs, recipAttrNames, newRecipAttrNames;
SEXP goodEdgeNames;
SEXP toName;
Expand Down Expand Up @@ -158,13 +159,16 @@ SEXP Rgraphviz_buildEdgeList(SEXP edgeL, SEXP edgeMode, SEXP subGList,
for (i = 0; i < nSubG; i++) {
curSubG = getListElement(VECTOR_ELT(subGList, i), "graph");
subGEdgeL = GET_SLOT(curSubG, Rf_install("edgeL"));
subGNodes = GET_SLOT(curSubG, Rf_install("nodes"));
elt = getListElement(subGEdgeL, STR(curFrom));
if (elt == R_NilValue)
continue;
/* Extract out the edges */
subGEdges = VECTOR_ELT(elt, 0);
for (j = 0; j < length(subGEdges); j++) {
if (INTEGER(subGEdges)[j] == INTEGER(curTo)[y])
int subGIdx = INTEGER(subGEdges)[j]-1;
int graphIdx = INTEGER(curTo)[y]-1;
if(strcmp(CHAR(STRING_ELT(subGNodes, subGIdx)),CHAR(STRING_ELT(nodes, graphIdx))) == 0)
break;
}
if (j == length(subGEdges))
Expand Down
2 changes: 1 addition & 1 deletion src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SEXP Rgraphviz_agread(SEXP);
SEXP Rgraphviz_agwrite(SEXP, SEXP);
SEXP Rgraphviz_bezier(SEXP, SEXP, SEXP);
SEXP Rgraphviz_buildNodeList(SEXP, SEXP, SEXP, SEXP);
SEXP Rgraphviz_buildEdgeList(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
SEXP Rgraphviz_buildEdgeList(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
SEXP Rgraphviz_doLayout(SEXP, SEXP);
SEXP Rgraphviz_graphvizVersion(void);
SEXP Rgraphviz_init(void);
Expand Down