-
Notifications
You must be signed in to change notification settings - Fork 263
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
Graph reloading when hovering the menu #518
Comments
@uhessbai thanks for reaching out. It's more practical if you submit an online example on https://codesandbox.io/. However in your case most likely this is happening because you're not memoizing the functions that you're passing to the component, for instance: nodeVal={node => 100 / (node.level * node.level + 1)} Therefore at every rerender the component receives a new function and needs to recompute every node position and re-heat the layout. Same thing might be true with your |
@vasturiano thanks for your reply ! I will come back in a few days at home, I will try that soon :) |
Ok so i tried some things, for nodeVal i can use a static value which works ! As adviced i also put the code on codesanbox (config is not on point tho) at this link But for "data" its another kind of issue : my problem is that my app component hosts the drawer and the forcetree, and the info goes from one component to the other to help the highlight of nodes and i dont know if i there is a way to solve this issue, i tried by myself and with the help of ai but my knowledge of react seems not clear enough because even though i tried multiple things i was going around in circles Could you bring more details about your clue on this issue ? Also our answer greatly helped me to better understand how the layout works, thanks for that too ! |
@uhessbai essentially you should try to keep your |
@vasturiano thank you very much ! I will try that soon, i'll post the solution there if it might help someone! |
Hello !
I have an issue with a context menu which is coloring a node when hovering the linked part of the menu, therefore when i'm hovering a part of the menu, the graph is completely refreshing, which creates bumps
Here is an example :
The app is containing the drawer and the graph :
My drawer looks like this :
And here is the graph with its interactions :
Could you help me ?
I hope this code is not too long, let me know if you prefer getting the repository or if the question is not appropriate
Thanks for reading, have a good day !
The text was updated successfully, but these errors were encountered: