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
Hi, I am serving the data directly from an API in the specified format. I am rendering the graph inside a Class component.
the initial state is as follows graph = {nodes : [], edges : []}
I am fetching the data inside Component Did Mount and then setting the state of the Graph.
However while rendering it always gives me the error Node with ID "some id" already exist.
Please help I have been struggling with this for a long time now.
The text was updated successfully, but these errors were encountered:
@SHASHANK9743 I ran into a similar issue on one of my own projects, in which I was also fetching data to add to the graph.
I discovered that this error is thrown when a node with an image property has a nuill value before being pushed to the nodes array. This happens even if all the nodes actually have unique IDs. I got around this by setting the value to an empty string instead of null. Empty strings seem to work just fine, and result in a blank node when drawn. Not sure if this is the issue for you, but I suggest double checking this.
Below is an example object that I push onto the nodes array of my graph. If artistImage is null, the error you encountered is thrown. Again, I got around this by making sure artistImage is an empty string if there's no associated image url.
Hi, I am serving the data directly from an API in the specified format. I am rendering the graph inside a Class component.
the initial state is as follows
graph = {nodes : [], edges : []}
I am fetching the data inside Component Did Mount and then setting the state of the Graph.
However while rendering it always gives me the error Node with ID "some id" already exist.
Please help I have been struggling with this for a long time now.
The text was updated successfully, but these errors were encountered: