How to update/redraw graph?
- Dominant language
- JavaScript
- Stars
- 779
- Forks
- 178
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to make a dynamic graph that updates every few seconds.
What I'd ideally want is something like this:
```javascript
var G = new jsnx.Graph();
G.addNode(0);
jsnx.draw(G, {
element: '#canvas',
weighted: true,
edgeStyle: {
'stroke-width': 10
}
});
var i = 1;
setInterval(function () {
G.addNode(i);
i++;
jsnx.redraw();
}, 2000);
```
But I get a ```Uncaught TypeError: jsnx.redraw is not a function``` error.
Otherwise I have to draw() every time I update the graph, which doesn't look good at all...
Anyone know a way to do this?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.