-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Vis Network + vue.js: When adding a new edge - all nodes become red and edges overlap #2567
Comments
There was a similar problem with the dataset where all nodes got the title 4 after an update here? Looks like visjs does not work properly with vue.js or something is missing on the vue.js side in order to work properly with visjs. This issue is really strange. However, I think it is easier to debug the |
With Vis version 4.10.0 nodes don't turn red but the edges still overlap. |
@FilipQL It looks like it works with v4.18.0: https://jsfiddle.net/k5z587tv/ |
@mojoaxel doesn't work for me with your Fsfiddle. Once I attach an edge to a created node, all nodes become red. |
@mojoaxel It doesn't work for me. @Tooa I'm not sure where is the problem because without Vue - everything works fine. I have started a new thread on the Vue Forum: https://forum.vuejs.org/t/vis-js-does-not-work-properly-with-vue-when-adding-a-new-edge-all-nodes-become-red-and-edges-overlap/5132 and on Laracasts: https://laracasts.com/discuss/channels/vue/visjs-does-not-work-properly-with-vue but there's no response for now. I'll write here when there is any interesting response, if I find out what's the problem. |
I'm also working on an app that uses Vue and Vis Network and have reproduced this. I've found that it only happens if the Any suggestions of why this difference might affect the main Network object are appreciated! |
Thank you @pmackay, it works! |
@pmackay it does work, however, the code seems not so elegant in my aspect |
@DanielWLam I agree its not elegant, a better way would be to fix this bug :) But its a rather odd bug... |
Analysis of This IssueSo....I spent a whole morning looking at this. Please accept my nomination for 'Hardest Bug to Find, Ever'. If this category does not exist, please establish it so I can win it. I'll need to describe the scenario first: 1.
|
This continues the text in the previous comment 3. Creation of options without
|
Continues previous comment. 5. Explanation of the IssueThis is what is happening here:
6. Resolution of this issuea. The most practical solution for this is to move the options out of the This, of course, mutes the whole point of using
Please let me know, because I really do not see the point. b. An alternative is to adjust I have the following objections on this:
c. The way to get This entails specifically tailored code adjustments in d. Beyond this, I have no clue what else can be done. I'm really hoping for some external input on this. If I think of anything, I'll add it here. This concludes my analysis for this issue. Is there reason enough to keep it open? |
Feedback from a
So, moving the options out of |
As for me, if options object is set once before network init, it has to be in a single module and exported as const (using ES6) |
Closing because I feel this issue has been amply addressed. Will server as a reference for future similar issues. |
终于解决了,非常感谢,开心 |
Hi,
In which case Vis changes the color of nodes to red?
I have created a very simple app using Vue.js & Vis Network. You can take a look at it here: https://jsfiddle.net/Filip_Z/2ewtzh7w/1/
For some reason, when I add a new edge - all nodes become red and every newly added edge will overlap with the existing one:
Now, here is the same version of this app without Vue: https://jsfiddle.net/Filip_Z/63jcj26y/2/
... and there is no this problem. But, the problem for me is that there are no errors in the browser console and I cannot figure out why is this happening. Do you know in what case Vis changes the color of nodes to red (and every newly added edge will overlap with the existing ones), in which cases Vis behaves like that? I'm asking because I don't know how to debug/solve this, I have no idea what is causing this behavior.
The text was updated successfully, but these errors were encountered: