MCPcopy Create free account
hub / github.com/plotly/plotly.js / findEnclosingVertexAngles

Function findEnclosingVertexAngles

src/plots/polar/helpers.js:198–206  ·  view source on GitHub ↗

* find vertex angles (in 'vangles') the enclose angle 'a' * * @param {number} a : angle in *radians* * @param {array} vangles : angles of polygon vertices in *radians* * @return {2-item array}

(a, vangles)

Source from the content-addressed store, hash-verified

196 * @return {2-item array}
197 */
198function findEnclosingVertexAngles(a, vangles) {
199 var minFn = function(v) {
200 var adelta = angleDelta(v, a);
201 return adelta > 0 ? adelta : Infinity;
202 };
203 var i0 = findIndexOfMin(vangles, minFn);
204 var i1 = Lib.mod(i0 + 1, vangles.length);
205 return [vangles[i0], vangles[i1]];
206}
207
208// to more easily catch 'almost zero' numbers in if-else blocks
209function clampTiny(v) {

Callers 1

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