Here is a jQuery example of canvas drawing on the network to select multiple nodes:
How can this be translated to React?
I setup react-graph-vis
(source) in this sandbox, and added a ref to the Graph:
https://codesandbox.io/s/5m2vv1yo04
.getContext("2d")
react-graph-vis
methods mentioned heremouseup
, select nodes in the box drawn on the canvas, and clear drawingMaybe I'm going in the wrong direction with this.
I threw this together using the JSSampler example you shared.
You just needed to use the ref to connect the Network and canvas. Everything else pretty much fell into place. https://codesandbox.io/s/5m2vv1yo04