almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.85k stars 1.48k forks source link

DataSet.add(edgeArray) adds labels to center of the canvas instead 'middle' position #4239

Open kyle-foster-96 opened 5 years ago

kyle-foster-96 commented 5 years ago

Working with vis 4.18.1 networks on Chrome OS, Windows 10 computer. Has anyone see any behavior with their labels similar to the screenshot? This only seems to be happening when I call the add method of Dataset and pass in an object array of edges. One of the labels was rendered correctly in the middle position. Before I called Dataset.add(edgesArray) the labels of the graph were working correctly. I can post additional information if this behavior hasn't been seen before.

visjslabelsproblem
mojoaxel commented 5 years ago

Please provide a minimal code example that demonstrates your issue. We recommend using jsbin for that.

@Aridmango Also: You you please try this with the latest version. Thanks!

softwareCobbler commented 5 years ago

spitballing here - you say the edge labels were working fine before calling dataset.add, perhaps you want to dataset.update instead?

kyle-foster-96 commented 5 years ago

Did some troubleshooting and figured out what was causing the problem. My edges have value properties, and if one of the values happens to be an object instead of a string or number then it resulted in a network with edges being rendered in the middle. I was unable to replicated it in jsbin sorry, but hopefully this description helps.