code: function tick() {
          //(3)打点path格式是：Msource.x,source.yArr00,1target.x,target.y  
          path.attr("d", function (d) {
              let dx = d.target.x - d.source.x,//增量  
                  dy = d.target.y - d.source.y,
                  dr = Math.sqrt(dx * dx + dy * dy);
              return "M" + d.source.x + ","
                  + d.source.y + "A" + dr + ","
                  + dr + " 0 0,1 " + d.target.x + ","
                  + d.target.y;
          });
  
          circle.attr("transform", function (d) {
              return "translate(" + d.x + "," + d.y + ")";
          });
  
          text.attr("transform", function (d) {
              return "translate(" + d.x + "," + d.y + ")";
          });
      }
docs: 使用椭圆弧路径段双向编码。