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

Function getTJunctions

stackgl_modules/index.js:8947–8962  ·  view source on GitHub ↗
(points, edges, edgeBounds, vertBounds)

Source from the content-addressed store, hash-verified

8945
8946// Find all pairs of crossing vertices in a pslg (given edge/vert bounds)
8947function getTJunctions (points, edges, edgeBounds, vertBounds) {
8948 var result = []
8949 boxIntersect(edgeBounds, vertBounds, function (i, v) {
8950 var e = edges[i]
8951 if (e[0] === v || e[1] === v) {
8952 return
8953 }
8954 var p = points[v]
8955 var a = points[e[0]]
8956 var b = points[e[1]]
8957 if (segseg(a, b, p, p)) {
8958 result.push([i, v])
8959 }
8960 })
8961 return result
8962}
8963
8964// Cut edges along crossings/tjunctions
8965function cutEdges (floatPoints, edges, crossings, junctions, useColor) {

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…