I would like to create a network graph with curvescurved edges. To do this, I wrote wthis funcytionthis function:
edgeFun[pts_, e_] := Module[{controlPts}, controlPts = pts /. {a_, b_} :> {a, {a[[1]] + .1 b[[1]], a[[2]]}, {a[[1]] + 0.1 b[[1]], b[[2]]}, b}; BezierCurve[controlPts]];
pts = {1 -> 2, 2 -> 3, 3 -> 1}
edgeFun[pts_, e_] := Module[{controlPts}, controlPts = pts /. {a_, b_} :> {a, {a[[1]] + .1 b[[1]], a[[2]]}, {a[[1]] + 0.1 b[[1]], b[[2]]}, b}; BezierCurve[controlPts] ]; With onley Undirected edgesno multiedges the edgeFun funcgtionedgeFun function works fine:
pts = {1 -> 2, 2 -> 3, 3 -> 1}; Graph[pts, VertexLabels -> Placed["Name", Center], EdgeShapeFunction -> edgeFun] Graph[pts, VertexLabels -> Placed["Name", Center], EdgeShapeFunction -> edgeFun].
But when I want to create a network with DirectedEdges like
pts1 = {1multiple edges -> 2, 2(note -> 3, 31 -> 2 and -> 12 -> 1, 2 -> 1}
Then Mathemativca givesMathematica complains and the messagesgraph is pinked out:
Part::partd: "Part specification 0.496922[[1]] is longer than depth of object"
pts1 = {1 -> 2, 2 -> 3, 3 -> 1, 2 -> 1}; Graph[pts1, VertexLabels -> Placed["Name", Center], EdgeShapeFunction -> edgeFun] Part::partd: "Part specification 0.496922[[1]] is longer than depth of object"
Does anyone knowsknow how to solve this problem.?