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

Function removeVertex

src/components/shapes/display_outlines.js:174–200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172 }
173
174 function removeVertex() {
175 if(!polygons.length) return;
176 if(!polygons[indexI]) return;
177 if(!polygons[indexI].length) return;
178
179 var newPolygon = [];
180 for(var j = 0; j < polygons[indexI].length; j++) {
181 if(j !== indexJ) {
182 newPolygon.push(
183 polygons[indexI][j]
184 );
185 }
186 }
187
188 if(newPolygon.length > 1 && !(
189 newPolygon.length === 2 && newPolygon[1][0] === 'Z')
190 ) {
191 if(indexJ === 0) {
192 newPolygon[0][0] = 'M';
193 }
194
195 polygons[indexI] = newPolygon;
196
197 redraw();
198 update();
199 }
200 }
201
202 function clickVertexController(numClicks, evt) {
203 if(numClicks === 2) {

Callers 1

clickVertexControllerFunction · 0.85

Calls 2

redrawFunction · 0.70
updateFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…