Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/traces/sunburst/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ module.exports = {
'this option won\'t have any effect and `insidetextfont` would be used.'
].join(' ')
}),
rotation: pieAttrs.rotation,
sort: pieAttrs.sort,

domain: domainAttrs({name: 'sunburst', trace: true, editType: 'calc'})
Expand Down
2 changes: 2 additions & 0 deletions src/traces/sunburst/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout

coerce('sort');

coerce('rotation');

handleDomainDefaults(traceOut, layout, coerce);

// do not support transforms for now
Expand Down
4 changes: 4 additions & 0 deletions src/traces/sunburst/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ function plotOne(gd, cd, element, transitionOpts) {
s.style('pointer-events', 'all');
});

var extraAngle = trace.rotation * Math.PI / 180;
pt.x0 = pt.x0 + extraAngle;
pt.x1 = pt.x1 + extraAngle;

pt.rpx0 = y2rpx(pt.y0);
pt.rpx1 = y2rpx(pt.y1);
pt.xmid = (pt.x0 + pt.x1) / 2;
Expand Down