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

Function processPixelsImpl

stackgl_modules/index.js:39271–39319  ·  view source on GitHub ↗
(pixels, options, size, simplify)

Source from the content-addressed store, hash-verified

39269}
39270
39271function processPixelsImpl(pixels, options, size, simplify) {
39272 //Extract contour
39273 var contour = getContour(pixels, simplify)
39274
39275 //Apply warp to positions
39276 var positions = transformPositions(contour.positions, options, size)
39277 var edges = contour.edges
39278 var flip = "ccw" === options.orientation
39279
39280 //Clean up the PSLG, resolve self intersections, etc.
39281 cleanPSLG(positions, edges)
39282
39283 //If triangulate flag passed, triangulate the result
39284 if(options.polygons || options.polygon || options.polyline) {
39285 var result = toPolygonCrappy(edges, positions)
39286 var nresult = new Array(result.length)
39287 for(var i=0; i<result.length; ++i) {
39288 var loops = result[i]
39289 var nloops = new Array(loops.length)
39290 for(var j=0; j<loops.length; ++j) {
39291 var loop = loops[j]
39292 var nloop = new Array(loop.length)
39293 for(var k=0; k<loop.length; ++k) {
39294 nloop[k] = positions[loop[k]].slice()
39295 }
39296 if(flip) {
39297 nloop.reverse()
39298 }
39299 nloops[j] = nloop
39300 }
39301 nresult[i] = nloops
39302 }
39303 return nresult
39304 } else if(options.triangles || options.triangulate || options.triangle) {
39305 return {
39306 cells: cdt2d(positions, edges, {
39307 delaunay: false,
39308 exterior: false,
39309 interior: true
39310 }),
39311 positions: positions
39312 }
39313 } else {
39314 return {
39315 edges: edges,
39316 positions: positions
39317 }
39318 }
39319}
39320
39321function processPixels(pixels, options, size) {
39322 try {

Callers 1

processPixelsFunction · 0.85

Calls 4

getContourFunction · 0.85
transformPositionsFunction · 0.85
cleanPSLGFunction · 0.85
cdt2dFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…