ScottieB
ScottieB

Reputation: 4052

Plot directional edges as non-overlapping lines

I have a networkx directional graph. I'd like to plot it so that nodes that interact (A->B, B->A) have two edges displayed and the colors correspond to the relative weights.

Currently I have a simple three-node graph. Naturally the flow is "order created" -> "order closed" but on not-so-rare occasions the flow can be reversed!

my simple graph

Since this is going on a dashboard, I need to avoid the "download it and use another software package" to visualize it. Ideally I'd just use igraph (love it in R), but it's not supported in my environment (Mode Analytics).

Is the best solution to just create a hack where I split every node to a pair: "node-sender" and "node-receiver"? At least that would have the bonus of seeing self-edges too. Or maybe switch to plotly's chord diagram?

Edit: What I'm looking for

Ideally I could just use something like the qgraph package in R.

edges <- data.frame(from = from_node, to = to_node, thickness = weights)
qgraph(edges, esize=10, gray=TRUE)

enter image description here

Upvotes: 0

Views: 401

Answers (0)

Related Questions