MCPcopy
hub / github.com/microsoft/SandDance / minMaxPoints

Function minMaxPoints

docs/app/js/sanddance-app.js:10244–10270  ·  view source on GitHub ↗
(lines)

Source from the content-addressed store, hash-verified

10242 return polygons;
10243}
10244function minMaxPoints(lines) {
10245 const points = [];
10246 lines.forEach((line)=>{
10247 [
10248 line.sourcePosition,
10249 line.targetPosition
10250 ].forEach((point)=>{
10251 points.push(point);
10252 });
10253 });
10254 return [
10255 0,
10256 1
10257 ].map((dim)=>{
10258 let minMax = {
10259 min: null,
10260 max: null
10261 };
10262 points.forEach((point)=>{
10263 if (minMax.max == null) minMax.max = point[dim];
10264 else minMax.max = Math.max(minMax.max, point[dim]);
10265 if (minMax.min == null) minMax.min = point[dim];
10266 else minMax.min = Math.min(minMax.min, point[dim]);
10267 });
10268 return minMax;
10269 });
10270}
10271
10272},{"./expression":"2iReT","./search":"aBDlu","@msrvida/sanddance-specs":"gDvQs","@msrvida/vega-deck.gl":"dKeDo","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"2iReT":[function(require,module,exports) {
10273var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

Callers 1

facetSelectionPolygonsFunction · 0.70

Calls 3

forEachMethod · 0.45
maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected