From ea859d4c79fed82a426affa2dcc7cf95821e1614 Mon Sep 17 00:00:00 2001 From: Andrew Speed Date: Mon, 17 Oct 2016 11:54:02 +0100 Subject: [PATCH] Add example to export to JSON and import it again. (#2152) Networks are exported as a JSON array containing an array of objects representing each node in the network. Each node contains an Id, it's x and y coordinates and the nodes it is connected to. Import converts the JSON to a vis DataSet and then regenerates the network using each node's attributes, inserting it in the same coordinates and with the same number of connections as before. fixes #2073 --- examples/network/other/saveAndLoad.html | 177 ++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 examples/network/other/saveAndLoad.html diff --git a/examples/network/other/saveAndLoad.html b/examples/network/other/saveAndLoad.html new file mode 100644 index 000000000..08165c854 --- /dev/null +++ b/examples/network/other/saveAndLoad.html @@ -0,0 +1,177 @@ + + + + + + Network | Saving and loading networks + + + + + + + + + + + +

+ In this example, the network data can be exported to JSON and imported back into the network. + + Try this out by exporting the network to JSON, clearing the network and then importing it again. The nodes will all appear in the same position as they were before the network was destroyed. +

+ +
+ +
+ + + + +
+ + + + \ No newline at end of file