Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
13 changes: 13 additions & 0 deletions src/traces/sunburst/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,18 @@ module.exports = {
},
sort: pieAttrs.sort,

root: {
color: {
valType: 'color',
editType: 'style',
role: 'style',
dflt: 'rgba(0,0,0,0)',
description: [
'sets the color of the root node for a sunburst or a treemap trace.'
].join(' ')
},
editType: 'calc'
},

domain: domainAttrs({name: 'sunburst', trace: true, editType: 'calc'})
};
4 changes: 2 additions & 2 deletions src/traces/sunburst/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ exports._runCrossTraceCalc = function(desiredType, gd) {
dfltColorCount++;
}
} else {
// root gets no coloring by default
cdi.color = 'rgba(0,0,0,0)';
// set root color. no coloring by default.
cdi.color = cdi.trace.root.color;
}
}
}
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 @@ -77,6 +77,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout

coerce('rotation');

coerce('root.color');

handleDomainDefaults(traceOut, layout, coerce);

// do not support transforms for now
Expand Down
1 change: 1 addition & 0 deletions src/traces/treemap/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ module.exports = {
].join(' ')
},
sort: pieAttrs.sort,
root: sunburstAttrs.root,

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

coerce('sort');

coerce('root.color');

handleDomainDefaults(traceOut, layout, coerce);

// do not support transforms for now
Expand Down