i am my json data stored in a variable and i am trying to pass the data (nodes and edge array)in the netgraph
here is my related code
var sample = {nodes: [
{ id: "foo" },
{ id: "bar" },
{ id: "baz" }
],
links: [
{ id: "foo-bar", from: "foo", to: "bar" },
{ id: "bar-baz", from: "bar", to: "baz" },
{ id: "baz-foo", from: "baz", to: "foo" }
]};
var t = new NetChart({
container: document.getElementById("demo"),
area: { height: 350 },
data: { dataFunction: {sample}},
interaction: { selection: { lockNodesOnMove: false } }
});
</script>