Edge color updating bug.
Hi Everyone,
I am trying to update edges' color by providing an array of edges (every single edge has different color), but it updated all edges' color. But if I update just one edge it works correct, other edges remain the same, if number of updated data is more than one it updates all colors, basically sets the last element's color.
Is this bug or I am not doing it in a right way?
Here is how I update edge data
dataSetsObject.update(edges);
I'm just supposed to just know what's the content of edges by looking into my crystal ball or what?
Sorry, I missed to provide it. An edges is an array of JSON objects and format of every single object is this (real example)

@Thomaash so the color object's color field is different for every single edge, but as a result I see the latest object's color for all edges instead of different colors. Any recommendations ?
Hmmm, it doesn't happen to me. Could you tweak the following MWE https://jsfiddle.net/thomaash/ov0nfkw9/ to show your issue, please?
Thanks @Thomaash!. Interesting, I do the same but in a big project. I am assigning color object dynamically do you think that it can cause the problem? may be it creates one value and multiple links.
I don't see how this could happen. But you can simply try JSON.parse(JSON.stringify(edges)) and see if it makes the issues disappear.
I tried but it didn't help. This is really strange because I do update for nodes using the same methods.
Hmm, could you post console.log(edges._data) output (fully unpack at least one edge)?
See the result of the console.log(edges._data) for one item. Just wanted you to know that colors are different after update operation only here not in UI.
Also, I can give you access to repo if you wish so you can see how I designed it.

Oh, the color values are getters. This could mess things up. Where do these getters get their values?
Oops, I do not modify edge object after this dataSets.edges = new vis.DataSet(edges); operation. Any recommendations how can I debug it and figure it out?
I would put a break point (or console.log) into the getters to see what's actually going on there.
Feel free to see (link) the results in console mode where I print edges._object after update operation. Let me know you thoughts please.
Do you have the whole data set observed by Vue?
I don't think so. Do you want me to change the code and you will see whole data set object?
Actually looking through your source code (VisGraph.vue:65-68) you have it observed. I would try to define it without observing to see if it changes anything.
@Thomaash , I am not sure that I got you properly, but I need a value in Vue to keep it kind of global right? as DataSet and update not in the same scope.
Check https://github.com/rpkilby/vue-nonreactive out. Then you should be able to put data: Vue.nonreactive({ nodes: [], edges: [] }) into VisGraph.vue:65-68. This should prevent the data sets from being observed and maybe (really not sure here) resolve the issues.
Okay, thanks a lot I appreciate it. Let me check it out and will keep you updated. I just wanted you to notice one thing that in the same they everything works for Nodes, and I cannot explain it, on the other side when I do this edges.update(edge[0]) it works prefect. Problem occures when I am trying to update more than one edges.
BTW, when I use the old version of vis.js (version to 4.9.0) it works without any problem.