Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links are not updating correctly #488

Open
sivarasan-sph opened this issue Jan 23, 2024 · 4 comments
Open

Links are not updating correctly #488

sivarasan-sph opened this issue Jan 23, 2024 · 4 comments

Comments

@sivarasan-sph
Copy link

Describe the bug
When using ForceGraph3D from the react-force-graph library in a React application, I encounter an issue with dynamically updating the graph. Initially, the graph renders correctly with data fetched from Firebase. However, problems arise when attempting to update the graphData object with new data. After adding new entries to the graphData, particularly to the links array, the ForceGraph3D component fails to render the updated graph and produces an error. This suggests an issue with how the new data is formatted or merged into the existing graph data.

Additional Context:

The issue seems to specifically involve the formatting or integration of new data into the links array of the graphData object.
The initial rendering with Firebase data works seamlessly, but the graph fails to update correctly with subsequent additions of new data.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Screenshot 2024-01-23 at 12 56 49 PM

@vasturiano
Copy link
Owner

@sivarasan-sph thanks for reaching out.

It's difficult to say without more context, so if you still need more dedicated help it's better if you create a simple example with your issue.

It looks like in this case you are updating the source/target attributes with timestamps instead of node links or ids?

Another thing you can try is using different source/target attribute names, via the linkSource/linkTarget props, so that it doesn't conflict with the inner attributes of the component.

@Nek97
Copy link

Nek97 commented Feb 14, 2024

@vasturiano unfortunately i'm having a similar issue, please let me know if for you is better have 2 different issues, but it's happening on a 2D Graph.

I have a button to hide a node, (with all the nodes and all the links no more needed), but as i update the list of nodes and links, other links will disappear.
I double checked the list of nodes and links and it appear absolutely perfect.
As i show again the deleted node, so i put it back with all the needed links and nodes, also the other links will be showed again.

Dragging a "detached" node i see the link is still working, so it seems to be only a visualization problem.

It happens not only on "large" set of data, but it can happen also in a graph with more of less 10 nodes and links.

I'm using:
Browser: google chrome version 121.0.6167.139 (Official Build) (64-bit)
Os: Ubuntu 22.04.3 LTS

@vasturiano
Copy link
Owner

@Nek97 could you please create a simple repro example? It's difficult to diagnose this without deeper context into your data structure changes.

@Jimflip
Copy link

Jimflip commented Feb 19, 2024

Also having this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants