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

Function interpX0X1FromParent

src/traces/sunburst/plot.js:500–520  ·  view source on GitHub ↗
(pt)

Source from the content-addressed store, hash-verified

498 }
499
500 function interpX0X1FromParent(pt) {
501 var parent = pt.parent;
502 var parentPrev = prevLookup[helpers.getPtId(parent)];
503 var out = {};
504
505 if (parentPrev) {
506 // if parent is visible
507 var parentChildren = parent.children;
508 var ci = parentChildren.indexOf(pt);
509 var n = parentChildren.length;
510 var interp = interpolate(parentPrev.x0, parentPrev.x1);
511 out.x0 = interp(ci / n);
512 out.x1 = interp(ci / n);
513 } else {
514 // w/o visible parent
515 // TODO !!! HOW ???
516 out.x0 = out.x1 = 0;
517 }
518
519 return out;
520 }
521}
522
523// x[0-1] keys are angles [radians]

Callers 2

Calls 1

interpolateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…