You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using such code to change node's label on 'select' event.
But the labels are not changing. In react dev tools I can see that 'this.graph.nodes' has nodes with new labels but on the rendered graph they're not changing anyway. I could add/remove nodes or edges but can't render them modified.
Could you, please, help me with this problem?
The text was updated successfully, but these errors were encountered:
I am new to ReactJS, but as far as I understand you should not mutate your data directly. The way I chose is to use immutability-helper library. Then changing node's label could look like this:
importimHelpfrom'immutability-helper';letactualNodesState=this.state.graph.nodes;letnodeIndex=3;// index of node in an array (not vis.js node's id)letnewNodes=imHelp(actualNodesState,{[nodeIndex]: label: {$set: label}});this.setState({graph: {nodes: newNodes}});
Hello, @crubier!
I am using such code to change node's label on 'select' event.
But the labels are not changing. In react dev tools I can see that 'this.graph.nodes' has nodes with new labels but on the rendered graph they're not changing anyway. I could add/remove nodes or edges but can't render them modified.
Could you, please, help me with this problem?
The text was updated successfully, but these errors were encountered: