placeLinks()

in src/vis/SentenTreeVis.js [174:198]


  placeLinks() {
    // draw directed edges with proper padding from node centers
    const graphs = this.data();

    graphs.forEach(graph => {
      graph.nodes.forEach(node => {
        node.updateAttachPoints();
      });
    });

    this.sLinks
      .attr('d', link => {
        const points = [
          link.source.rightEdge(),
          link.attachPoints.y1,
          link.target.leftEdge(),
          link.attachPoints.y2,
        ];
        // const xGap = link.target.leftEdge() - link.source.rightEdge();
        // if (xGap > 30) {
        //   return line(...points);
        // }
        return diagonal(...points);
      });
  }