getConnectedNodes方向参数

I have a small issue with the parameter direction of the function getConnectedNodes() based on the Vis.js documentation (search for "getConnectedNodes" in the link)

任何想法使用参数获取边缘的方向(我不知道如何)?

JSON范例

[ 
  { "x": 0, "y": 0, "id": "0", "connections": [ 2 ] // i think here should be a from?},
  { "x": 200, "y": 0, "id": "1", "connections": [ 3, 2 ] },
  { "x": 500, "y": 500, "id": "2", "connections": [ 0, 1 ] },
  { "x": 300, "y": -200, "id": "3", "connections": [ 1 ] } 
]

这是部分代码

google.script.run.withSuccessHandler(([nodes, edges]) => new vis.Network(container, {nodes: nodes, edges: edges}, options)).sample();

let network;

function init() {
  container = document.getElementById('mynetwork');
  exportArea = document.getElementById('input_output');
  network = google.script.run.withSuccessHandler(([nodes, edges]) => {network = new vis.Network(container, {nodes: nodes, edges: edges}, options);}).sample();
};

function addConnections(elem, index) {
  elem.connections = network.getConnectedNodes(index);               < I THINK THE PROBLEM IS HERE
}

function exportNetwork() {
  var nodes = objectToArray(network.getPositions());
  nodes.forEach(addConnections);
  var exportValue = JSON.stringify(nodes, undefined, 2);
  exportArea.innerHTML = exportValue;
}

function objectToArray(obj) {
  return Object.keys(obj).map(function(key) {
    obj[key].id = key;
    return obj[key];
  });
}

在此之前,非常感谢!