How to use path-intersection - 2 common examples

To help you get started, we’ve selected a few path-intersection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bpmn-io / diagram-js / lib / util / LineIntersection.js View on Github external
function getPathIntersection(waypoints, reference) {

  var intersections = intersectPaths(circlePath(reference, INTERSECTION_THRESHOLD), linePath(waypoints));

  var a = intersections[0],
      b = intersections[intersections.length - 1],
      idx;

  if (!a) {

    // no intersection
    return null;
  }

  if (a !== b) {

    if (a.segment2 !== b.segment2) {

      // we use the bendpoint in between both segments
github bpmn-io / diagram-js / lib / layout / LayoutUtil.js View on Github external
export function getIntersections(a, b) {
  return intersectPaths(a, b);
}

path-intersection

Computes the intersection between two SVG paths

MIT
Latest version published 8 months ago

Package Health Score

67 / 100
Full package analysis

Popular path-intersection functions