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

Function convertPoly

src/components/selections/select.js:1054–1078  ·  view source on GitHub ↗
(polygonsIn, isOpenMode)

Source from the content-addressed store, hash-verified

1052}
1053
1054function convertPoly(polygonsIn, isOpenMode) { // add M and L command to draft positions
1055 var polygonsOut = [];
1056 for(var i = 0; i < polygonsIn.length; i++) {
1057 polygonsOut[i] = [];
1058 for(var j = 0; j < polygonsIn[i].length; j++) {
1059 polygonsOut[i][j] = [];
1060 polygonsOut[i][j][0] = j ? 'L' : 'M';
1061 for(var k = 0; k < polygonsIn[i][j].length; k++) {
1062 polygonsOut[i][j].push(
1063 polygonsIn[i][j][k]
1064 );
1065 }
1066 }
1067
1068 if(!isOpenMode) {
1069 polygonsOut[i].push([
1070 'Z',
1071 polygonsOut[i][0][1], // initial x
1072 polygonsOut[i][0][2] // initial y
1073 ]);
1074 }
1075 }
1076
1077 return polygonsOut;
1078}
1079
1080function _doSelect(selectionTesters, searchTraces) {
1081 var allSelections = [];

Callers 2

prepSelectFunction · 0.85
selectOnClickFunction · 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…