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

Function computeRectAndRanges

src/components/selections/select.js:1485–1510  ·  view source on GitHub ↗
(poly)

Source from the content-addressed store, hash-verified

1483}
1484
1485function computeRectAndRanges(poly) {
1486 poly.isRect = poly.length === 5 &&
1487 poly[0][0] === poly[4][0] &&
1488 poly[0][1] === poly[4][1] &&
1489 (
1490 poly[0][0] === poly[1][0] &&
1491 poly[2][0] === poly[3][0] &&
1492 poly[0][1] === poly[3][1] &&
1493 poly[1][1] === poly[2][1]
1494 ) ||
1495 (
1496 poly[0][1] === poly[1][1] &&
1497 poly[2][1] === poly[3][1] &&
1498 poly[0][0] === poly[3][0] &&
1499 poly[1][0] === poly[2][0]
1500 );
1501
1502 if(poly.isRect) {
1503 poly.xmin = Math.min(poly[0][0], poly[2][0]);
1504 poly.xmax = Math.max(poly[0][0], poly[2][0]);
1505 poly.ymin = Math.min(poly[0][1], poly[2][1]);
1506 poly.ymax = Math.max(poly[0][1], poly[2][1]);
1507 }
1508
1509 return poly;
1510}
1511
1512function makeFillRangeItems(allAxes) {
1513 return function(eventData, poly) {

Callers 1

castMultiPolygonFunction · 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…