computeOrderConstraints()

in src/models/Node.js [66:93]


  computeOrderConstraints() {
    const rules = [];

    if (this.getRightNodes().length > 1) {
      const nodes = this.getRightNodes();
      for (let i = 1; i < nodes.length; i++) {
        rules.push({
          axis: 'y',
          left: nodes[i - 1].id,
          right: nodes[i].id,
          gap: 5,
        });
      }
    }
    if (this.getLeftNodes().length > 1) {
      const nodes = this.getLeftNodes();
      for (let i = 1; i < nodes.length; i++) {
        rules.push({
          axis: 'y',
          left: nodes[i - 1].id,
          right: nodes[i].id,
          gap: 5,
        });
      }
    }

    return rules;
  }