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

Function pathPolygonAnnulus

src/plots/polar/helpers.js:260–274  ·  view source on GitHub ↗

* path a polygon 'annulus' * i.e. a polygon with a concentric hole * * N.B. this routine uses the evenodd SVG rule * * @param {number} r0 : first radial coordinate * @param {number} r1 : second radial coordinate * @param {number} a0 : first angular coordinate in *radians* * @param {number} a

(r0, r1, a0, a1, vangles, cx, cy)

Source from the content-addressed store, hash-verified

258 *
259 */
260function pathPolygonAnnulus(r0, r1, a0, a1, vangles, cx, cy) {
261 var rStart, rEnd;
262
263 if(r0 < r1) {
264 rStart = r0;
265 rEnd = r1;
266 } else {
267 rStart = r1;
268 rEnd = r0;
269 }
270
271 var inner = transformForSVG(makePolygon(rStart, a0, a1, vangles), cx, cy);
272 var outer = transformForSVG(makePolygon(rEnd, a0, a1, vangles), cx, cy);
273 return 'M' + outer.reverse().join('L') + 'M' + inner.join('L');
274}
275
276module.exports = {
277 isPtInsidePolygon: isPtInsidePolygon,

Callers

nothing calls this directly

Calls 2

transformForSVGFunction · 0.85
makePolygonFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…