getPositions(ids) {
    const dataArray = {};
    if (ids !== undefined) {
      if (Array.isArray(ids) === true) {
        for (let i = 0; i < ids.length; i++) {
          if (this.body.nodes[ids[i]] !== undefined) {
            const node = this.body.nodes[ids[i]];
            dataArray[ids[i]] = {
              x: Math.round(node.x),
              y: Math.round(node.y),
            };
          }
        }
      } else {
        if (this.body.nodes[ids] !== undefined) {
          const node = this.body.nodes[ids];
          dataArray[ids] = { x: Math.round(node.x), y: Math.round(node.y) };
        }
      }
    } else {
      for (let i = 0; i < this.body.nodeIndices.length; i++) {
        const node = this.body.nodes[this.body.nodeIndices[i]];
        dataArray[this.body.nodeIndices[i]] = {
          x: Math.round(node.x),
          y: Math.round(node.y),
        };
      }
    }
    return dataArray;
  }
Returns the positions of the nodes.
@param {Array.<Node.id> | string} [ids]  --> optional, can be array of nodeIds, can be string
@returns {{}}