MCPcopy Index your code
hub / github.com/plotly/plotly.js / getCrossings

Function getCrossings

stackgl_modules/index.js:8926–8944  ·  view source on GitHub ↗
(points, edges, edgeBounds)

Source from the content-addressed store, hash-verified

8924
8925// Find all pairs of crossing edges in a pslg (given edge bounds)
8926function getCrossings (points, edges, edgeBounds) {
8927 var result = []
8928 boxIntersect(edgeBounds, function (i, j) {
8929 var e = edges[i]
8930 var f = edges[j]
8931 if (e[0] === f[0] || e[0] === f[1] ||
8932 e[1] === f[0] || e[1] === f[1]) {
8933 return
8934 }
8935 var a = points[e[0]]
8936 var b = points[e[1]]
8937 var c = points[f[0]]
8938 var d = points[f[1]]
8939 if (segseg(a, b, c, d)) {
8940 result.push([i, j])
8941 }
8942 })
8943 return result
8944}
8945
8946// Find all pairs of crossing vertices in a pslg (given edge/vert bounds)
8947function getTJunctions (points, edges, edgeBounds, vertBounds) {

Callers 1

snapRoundFunction · 0.85

Calls 1

boxIntersectFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…