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

Function makeUpdateSliceInterpolator

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

Source from the content-addressed store, hash-verified

368 }
369
370 function makeUpdateSliceInterpolator(pt) {
371 var prev0 = prevLookup[helpers.getPtId(pt)];
372 var prev;
373 var next = { x0: pt.x0, x1: pt.x1, rpx0: pt.rpx0, rpx1: pt.rpx1 };
374
375 if (prev0) {
376 // if pt already on graph, this is easy
377 prev = prev0;
378 } else {
379 // for new pts:
380 if (prevEntry) {
381 // if trace was visible before
382 if (pt.parent) {
383 if (nextX1ofPrevEntry) {
384 // if new branch, twist it in clockwise or
385 // counterclockwise which ever is shorter to
386 // its final angle
387 var a = (pt.x1 > nextX1ofPrevEntry ? 2 * Math.PI : 0) + baseX;
388 prev = { x0: a, x1: a };
389 } else {
390 // if new leaf (when maxdepth is set),
391 // grow it radially and angularly from
392 // its parent node
393 prev = { rpx0: rMax, rpx1: rMax };
394 Lib.extendFlat(prev, interpX0X1FromParent(pt));
395 }
396 } else {
397 // if new root-node, grow it radially
398 prev = { rpx0: 0, rpx1: 0 };
399 }
400 } else {
401 // start sector of new traces from theta=0
402 prev = { x0: baseX, x1: baseX };
403 }
404 }
405
406 return interpolate(prev, next);
407 }
408
409 function makeUpdateTextInterpolator(pt) {
410 var prev0 = prevLookup[helpers.getPtId(pt)];

Callers 2

plotOneFunction · 0.70

Calls 2

interpX0X1FromParentFunction · 0.85
interpolateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…