Skip to content

Commit 9ddad4c

Browse files
committed
use makeTraceGroups in pie
1 parent e892923 commit 9ddad4c

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/traces/pie/plot.js

+5-12
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,17 @@ module.exports = function plot(gd, cdpie) {
2424

2525
scalePies(cdpie, fullLayout._size);
2626

27-
var pieGroups = fullLayout._pielayer.selectAll('g.trace').data(cdpie);
28-
29-
pieGroups.enter().append('g')
30-
.attr({
31-
'stroke-linejoin': 'round', // TODO: miter might look better but can sometimes cause problems
32-
// maybe miter with a small-ish stroke-miterlimit?
33-
'class': 'trace'
34-
});
35-
pieGroups.exit().remove();
36-
pieGroups.order();
37-
38-
pieGroups.each(function(cd) {
27+
var pieGroups = Lib.makeTraceGroups(fullLayout._pielayer, cdpie, 'trace').each(function(cd) {
3928
var pieGroup = d3.select(this);
4029
var cd0 = cd[0];
4130
var trace = cd0.trace;
4231

4332
setCoords(cd);
4433

34+
// TODO: miter might look better but can sometimes cause problems
35+
// maybe miter with a small-ish stroke-miterlimit?
36+
pieGroup.attr('stroke-linejoin', 'round');
37+
4538
pieGroup.each(function() {
4639
var slices = d3.select(this).selectAll('g.slice').data(cd);
4740

0 commit comments

Comments
 (0)