# Setting Graph3D Edge Thickness With Edge Weights [duplicate]

So I'm very (very, very) new to Mathematica. I have a 3D graph (generated with Graph3D from a graph generated by WeightedAdjacencyGraph) and I would like to use edge weights from the original, 2D weighted graph to set the thickness of the edges on the 3D graph. I'm aware that I can use EdgeShapeFunction -> (Tube[#, radius] &) with some preset radius to make all of the edges have some thickness, but I can't figure out how to (or if it's possible to) make the edges have differing thicknesses.

• I believe I already described everything you need in the link above, both with pure Mathematica and IGraph/M. You need to set a different EdgeShapeFunction for each edge. Probably the most compact way is with IGraph/M, IGEdgeMap[ Function[weight, {CapForm["Rounded"], Tube[#, 0.1 weight]} &], EdgeShapeFunction -> IGEdgeProp[EdgeWeight], g ] Commented Jun 6, 2017 at 15:23

myEdges = {1 <-> 2, 2 <-> 3, 3 <-> 1};

myEdgeWeights = {.01, .02, .03};

myAssociation = AssociationThread[Sort /@ myEdges -> myEdgeWeights];

Graph3D[myEdges,
EdgeShapeFunction -> ({Tube[{First[#1], Last[#1]}, myAssociation@Sort[#2]]} &)]


• What about doing it in 3D? Commented Jun 6, 2017 at 15:14
• The issue is that a) that's 2D, I need to do it in 3D, and b) I can't set the thicknesses manually like that, they need to be automatically extracted from the edge weights (because the edge weights change every time I run my code, it's non-deterministic). Commented Jun 6, 2017 at 15:16
• OK... I'm on it... just a few minutes... Commented Jun 6, 2017 at 15:16