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

Function cleanPSLG

stackgl_modules/index.js:9216–9249  ·  view source on GitHub ↗
(points, edges, colors)

Source from the content-addressed store, hash-verified

9214
9215// Main loop, runs PSLG clean up until completion
9216function cleanPSLG (points, edges, colors) {
9217 // If using colors, augment edges with color data
9218 var prevEdges
9219 if (colors) {
9220 prevEdges = edges
9221 var augEdges = new Array(edges.length)
9222 for (var i = 0; i < edges.length; ++i) {
9223 var e = edges[i]
9224 augEdges[i] = [e[0], e[1], colors[i]]
9225 }
9226 edges = augEdges
9227 }
9228
9229 // First round: remove duplicate edges and points
9230 var modified = preRound(points, edges, !!colors)
9231
9232 // Run snap rounding until convergence
9233 while (snapRound(points, edges, !!colors)) {
9234 modified = true
9235 }
9236
9237 // Strip color tags
9238 if (!!colors && modified) {
9239 prevEdges.length = 0
9240 colors.length = 0
9241 for (var i = 0; i < edges.length; ++i) {
9242 var e = edges[i]
9243 prevEdges.push([e[0], e[1]])
9244 colors.push(e[2])
9245 }
9246 }
9247
9248 return modified
9249}
9250
9251
9252/***/ }),

Callers 1

processPixelsImplFunction · 0.85

Calls 2

preRoundFunction · 0.85
snapRoundFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…