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

Function addPoint

stackgl_modules/index.js:8492–8530  ·  view source on GitHub ↗
(cells, hulls, points, p, idx)

Source from the content-addressed store, hash-verified

8490}
8491
8492function addPoint(cells, hulls, points, p, idx) {
8493 var lo = bsearch.lt(hulls, p, testPoint)
8494 var hi = bsearch.gt(hulls, p, testPoint)
8495 for(var i=lo; i<hi; ++i) {
8496 var hull = hulls[i]
8497
8498 //Insert p into lower hull
8499 var lowerIds = hull.lowerIds
8500 var m = lowerIds.length
8501 while(m > 1 && orient(
8502 points[lowerIds[m-2]],
8503 points[lowerIds[m-1]],
8504 p) > 0) {
8505 cells.push(
8506 [lowerIds[m-1],
8507 lowerIds[m-2],
8508 idx])
8509 m -= 1
8510 }
8511 lowerIds.length = m
8512 lowerIds.push(idx)
8513
8514 //Insert p into upper hull
8515 var upperIds = hull.upperIds
8516 var m = upperIds.length
8517 while(m > 1 && orient(
8518 points[upperIds[m-2]],
8519 points[upperIds[m-1]],
8520 p) < 0) {
8521 cells.push(
8522 [upperIds[m-2],
8523 upperIds[m-1],
8524 idx])
8525 m -= 1
8526 }
8527 upperIds.length = m
8528 upperIds.push(idx)
8529 }
8530}
8531
8532function findSplit(hull, edge) {
8533 var d

Callers 1

monotoneTriangulateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…