code: function interpolateLine(line, distance, min_length, layout) {
      let sum = 0;
      let position, angle;
      for (let i = 0; i < line.length-1; i++) {
          let p = line[i];
          let q = line[i+1];
  
          const length = norm(p, q);
          if (length <= min_length) {
              continue;
          }
  
          sum += length;
  
          if (sum > distance) {
              position = interpolateSegment(p, q, sum - distance);
              angle = getAngle(p, q, layout.angle);
              break;
          }
      }
      return {position, angle};
  }
docs: TODO: can be optimized. you don't have to start from the first index every time for placement