add multiple node box selector on the canvas of VisJS network graph in ReactJS

后端 未结 2 501
后悔当初
后悔当初 2021-02-04 19:08

Examples

Here is a jQuery example of canvas drawing on the network to select multiple nodes:

  • http://jsfiddle.net/kbj54bas/ (or Github)

How ca

2条回答
  •  生来不讨喜
    2021-02-04 19:41

    I threw this together using the JSSampler example you shared.

    Solution

    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

    Cleanup suggestions

    • move global variables into react class
    • split VisJS highlight code into own file

提交回复
热议问题