fkling / fkling/JSNetworkX

How can I visualize MultiGraph?

Open
#73 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
779
Forks
178
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have tried to visualize simple graph. Everything looks good. However, how can I visualize multigraph?

Here is my sample code

```


Sample

var G = new jsnx.MultiGraph();

G.addNodesFrom([1,2,3]);
G.addEdgesFrom([[1,3],[1,3],[1,2],[1,2],[2,3],[2,3]]);
console.log(G.edges()); // I can see 6 edges printed on console
jsnx.draw(G, {
element: '#canvas',
withLabels: true,
nodeStyle: {
fill: function(d) {
return d.data.color;
}
},
labelStyle: {fill: 'white'},
stickyDrag: true
});

```

And the result is

![image](https://user-images.githubusercontent.com/30331417/35129010-18994d5a-fc7f-11e7-9034-f3ca5642ba9e.png)

How to draw multiple parallel edges between two nodes?

Any help will be appreciated.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.