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

onNodePositionChange is not called every time #312

Closed
NoMercy235 opened this issue Mar 22, 2020 · 10 comments
Closed

onNodePositionChange is not called every time #312

NoMercy235 opened this issue Mar 22, 2020 · 10 comments
Labels
duplicate already reported wontfix

Comments

@NoMercy235
Copy link

Describe the bug
I've seen this problem discussed here: #264 and it seems like the bug was closed, but I'm still experiencing the same issue.

To Reproduce
I cannot pinpoint what the problem is. It just seems to randomly work/not work regardless of what I'm doing. Sometimes it doesn't trigger even when I move a node halfway across the screen, but then it does trigger if I move it again just a tiny bit.

Expected behavior
The onNodePositionChange callback should be triggered every time a node is moved.

Screenshots
image
The console.log statement is triggered every time a node is moved. In my case, I moved the Employee Lounge - more dialogue node two times, but the console.log statement was triggered only once.

Environment:

  • OS: Ubuntu 18.04
  • Browser Chrome
  • Version 80
  • Node version 10.12.0
  • react-d3-graph version 2.4.0
  • d3 version 5.15.0
  • react version 16.8.6

Additional context
Add any other context about the problem here.

@danielcaldas
Copy link
Owner

Hi @NoMercy235 @lynameni, please make sure you're running your project with react-d3-graph@2.4.0. I believe this is fixed in the last release. Please clean up your node_modules and/or offline cached packages and give it another try.

@danielcaldas danielcaldas added the needs more info not enough proof to specify issue label Mar 29, 2020
@NoMercy235
Copy link
Author

NoMercy235 commented Mar 29, 2020

Hi @danielcaldas ! As mentioned on the other ticket, I've just recently installed react-d3-graph so there shouldn't be any issues with cache or versioning. In any case, I did clean the cache and reinstalled the library, but the result was the same. Is there anything else I could check?

@danielcaldas
Copy link
Owner

If you had a link to the repository I could have a look

@NoMercy235
Copy link
Author

NoMercy235 commented Mar 29, 2020

You can try directly using my repository. Follow these steps:

git clone git@github.com:NoMercy235/cyoa-frontend.git
cd cyoa-frontend
git checkout feature/write-story-v2
cat package.json | grep react-d3-graph
# should output: "react-d3-graph": "^2.4.0"
npm i
cat package-lock.json | grep react-d3-graph
# Should output
# "react-d3-graph": {
#     "resolved": "https://registry.npmjs.org/react-d3-graph/-/react-d3-graph-2.4.0.tgz",
cat node_modules/react-d3-graph/src/components/graph/graph.builder.js| grep link.type
# Should output: const type = link.type || config.link.type;

After this, check the contents of the file node_modules/react-d3-graph/lib/components/graph/graph.builder.js (in the lib folder) and you will not find any changes related to link.type.

@danielcaldas
Copy link
Owner

danielcaldas commented Mar 29, 2020

Indeed lib seems not to be up to date 🤔
I'm working on releasing a patch version 2.4.1 that hopefully should fix this. Thanks for catching this one @NoMercy235 🙏

@NoMercy235
Copy link
Author

Cool! Thank you!

@danielcaldas
Copy link
Owner

Hey there @NoMercy235 version 2.4.1 should now be available in npm. Give it another try with the new version and let me know if we can close this issue and #314.

@danielcaldas danielcaldas removed the needs more info not enough proof to specify issue label Mar 29, 2020
@danielcaldas
Copy link
Owner

Hopefully, this should be a duplicate of #264. Let's hope that react-d3-graph@2.4.1 does the trick for you.

@NoMercy235
Copy link
Author

Yup, everything works correctly now! The links follow the custom type property and I've tested the onNodePositionChange callback for a few minutes and it was called every time. Thank you for the release! :) I will close this ticket and the other one.

@danielcaldas
Copy link
Owner

Duplicate of #314

@danielcaldas danielcaldas marked this as a duplicate of #314 Mar 29, 2020
@danielcaldas danielcaldas added duplicate already reported wontfix labels Mar 29, 2020
Repository owner locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate already reported wontfix
Projects
None yet
Development

No branches or pull requests

2 participants