Skip to content

Commit 28a7252

Browse files
committed
apply sunburst rotation as the base angle during transitions
1 parent 7f2ea46 commit 28a7252

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/traces/sunburst/plot.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ function plotOne(gd, cd, element, transitionOpts) {
311311
var next;
312312

313313
if(entryPrev) {
314-
var a = pt.x1 > entryPrev.x1 ? 2 * Math.PI : 0;
314+
var a = (pt.x1 > entryPrev.x1 ? 2 * Math.PI : 0) + baseX;
315315
// if pt to remove:
316316
// - if 'below' where the root-node used to be: shrink it radially inward
317317
// - otherwise, collapse it clockwise or counterclockwise which ever is shortest to theta=0
@@ -361,7 +361,7 @@ function plotOne(gd, cd, element, transitionOpts) {
361361
// if new branch, twist it in clockwise or
362362
// counterclockwise which ever is shorter to
363363
// its final angle
364-
var a = pt.x1 > nextX1ofPrevEntry ? 2 * Math.PI : 0;
364+
var a = (pt.x1 > nextX1ofPrevEntry ? 2 * Math.PI : 0) + baseX;
365365
prev = {x0: a, x1: a};
366366
} else {
367367
// if new leaf (when maxdepth is set),
@@ -376,7 +376,7 @@ function plotOne(gd, cd, element, transitionOpts) {
376376
}
377377
} else {
378378
// start sector of new traces from theta=0
379-
prev = {x0: 0, x1: 0};
379+
prev = {x0: baseX, x1: baseX};
380380
}
381381
}
382382

@@ -419,11 +419,11 @@ function plotOne(gd, cd, element, transitionOpts) {
419419
}
420420
} else {
421421
// if new root-node
422-
prev.x0 = prev.x1 = 0;
422+
prev.x0 = prev.x1 = baseX;
423423
}
424424
} else {
425425
// on new traces
426-
prev.x0 = prev.x1 = 0;
426+
prev.x0 = prev.x1 = baseX;
427427
}
428428
}
429429

0 commit comments

Comments
 (0)