almende / vis

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

wrong results of getPositions() when start from node 1 #4120

Open fdambrosio opened 6 years ago

fdambrosio commented 6 years ago

I'm having problems using export/import functions on the 'save and load' demo link http://visjs.org/examples/network/other/saveAndLoad.html

the result is correct if my node is starting from id '0', but I have no correct result if I export 3 nodes starting from node id '1'. I'm experiencing this error trying to use only 3 node (1 -> 2 -> 3) but the getPositions() returns an incorrect connections result. I've attached two images that shows the draw before and after the export/import.

STARTING NETWORK, CLICK EXPORT AND I GET WRONG JSON visjs-export3nodes

CLICK 'IMPORT' FROM PREVIOUS EXPORTED JSON, NETWORK DRAW IS WRONG visjs-imported3nodes

fdambrosio commented 5 years ago

thanks