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

Network - does updating an edge cause it to reset automatically in Hierarchical view? #67

Closed
DarylMcCullough opened this issue Jun 5, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@DarylMcCullough
Copy link
Contributor

This bug was reported for vis.js, but was never resolved, as far as I know. I believe that it is still a bug for visjs-network, as well.

datastorm-open/visNetwork#162

The behavior is the following: For a very simple network with one hidden edge, if you change the shape of the network manually by dragging a node, then the network will reset to the original position. A working example is here:

javascript-example-from-visjs.zip

Open the html file test.html. You'll see a tiny network with three nodes. Drag the node in the lower left to a new position farther right. If you then hover over the node with your mouse, the network will reset to its original shape.

@DarylMcCullough
Copy link
Contributor Author

I looked at the javascript code, and apparently the line that is causing the problem is this one (in lib/network/modules/components/Edge.js,)

if (options.hidden !== undefined || options.physics !== undefined) { dataChanged = true; }

I'm not sure why this line is there. It seems that it should only be if options.hidden has changed, not if it's been set.

@micahstubbs
Copy link
Member

hi @DarylMcCullough, thanks for reporting this one!

I'd be happy to review a pull request if you would like to submit the fix, along with an example that shows the bug (and the fix).

@micahstubbs micahstubbs added the bug Something isn't working label Jun 9, 2019
DarylMcCullough added a commit to DarylMcCullough/visjs-network that referenced this issue Jun 10, 2019
@DarylMcCullough
Copy link
Contributor Author

DarylMcCullough commented Jun 10, 2019 via email

DarylMcCullough added a commit to DarylMcCullough/visjs-network that referenced this issue Jun 10, 2019
@micahstubbs
Copy link
Member

Thanks for sending the PR! I hope to review the PR and get it in sometime over the upcoming July 4th holiday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants