vis-react icon indicating copy to clipboard operation
vis-react copied to clipboard

Add Item is being called twice for when reading nodes/ edges from redux and local storage

Open KevinZhou1 opened this issue 6 years ago • 1 comments

<Graph graph={{ nodes: this.props.lineageReducer.nodesDisplayed, edges: this.props.lineageReducer.edges, }} options={this.options} events={{ select: (e) => this.expandNode(e), }} />

We read our nodes and edges from redux reducer like so. I have implemented a function that reads data from local storage and sets nodes and edges correctly, I've went into redux and verified it is valid. However, when running my code, an error appears saying that we are adding nodes edges with duplicate id. I debugged through the code and came to the conclusion the in the vis index.js, addNode and addEdge functions are being called twice. I attemted to modify the library code to make a check to prevent it calling again but now icons don't render their image defined by their group correctly. Is someone able to help with this?

KevinZhou1 avatar May 08 '19 19:05 KevinZhou1

sure, please elaborate in more details and share sample snippets

anishmprasad avatar May 11 '19 18:05 anishmprasad