Reaction system activation

I use react-graph-vis to visualize networks. According to vis.js documentation, I can enable the manipulation system by providing the corresponding manipulationobject to the key options. I am trying to add a button Add Edgeto the visualization GUI, and this is more or less how I configured my component:

class MyComponent extends React.Component {
   constructor(props) {
      var graph = /* initial graph */;
      this.state = {
         options: {
            manipulation: {
               enabled: true, initiallyActive: true, addEdge: true
            }
         },
         graph: graph
      }
   }

   render() {
      return <Graph graph={this.state.graph}, options={this.state.options}/>
   }
}

graph, . manipulation options . , edit Add Edge, . , , . (, ) . , manipulation .

+4
1

, vis.js. .

html CDN:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.19.1/vis-network.min.css">

webpack, , JavaScript:

import 'vis/dist/vis.css';
+1

Source: https://habr.com/ru/post/1672534/


All Articles