My intention is to create simple graph editor using vis.js and the first feature I'm thinking about is to position nodes manually and save that. However, unlike setting options a straight-forward method to get all the options doesn't seem to exist. Is there any reasonable approach to get them (aside trying to track all the changes using events like dragEnd
which sounds way too fragile)?
In fact, I'm looking for a way to extract both data (nodes/edges and their settings) and options so that once the network is rendered using those options, it looks the same (or at least similar) to what was saved.
network.getPositions()
andnetwork.getConnectedNodes(index)
helpers are what I'll note. However, this example doesn't provide any tools to extract the network's options which is the most problematic issue here. – Tchad