Skip to content

Commit 9f0600a

Browse files
committed
Style groups *after* computing data
1 parent 1544e71 commit 9f0600a

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/transforms/groupby.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function transformOne(trace, state) {
137137
var groups = trace.transforms[state.transformIndex].groups;
138138

139139
if(!(Array.isArray(groups)) || groups.length === 0) {
140-
return trace;
140+
return [trace];
141141
}
142142

143143
var groupNames = Lib.filterUnique(groups),
@@ -177,12 +177,6 @@ function transformOne(trace, state) {
177177
for(j = 0; j < arrayAttrs.length; j++) {
178178
Lib.nestedProperty(newTrace, arrayAttrs[j]).set([]);
179179
}
180-
181-
Plots.clearExpandedTraceDefaultColors(newTrace);
182-
183-
// there's no need to coerce styleLookup[groupName] here
184-
// as another round of supplyDefaults is done on the transformed traces
185-
newTrace = Lib.extendDeepNoArrays(newTrace, styleLookup[groupName] || {});
186180
}
187181

188182

@@ -201,5 +195,16 @@ function transformOne(trace, state) {
201195
}
202196
}
203197

198+
for(i = 0; i < groupNames.length; i++) {
199+
groupName = groupNames[i];
200+
newTrace = newData[i];
201+
202+
Plots.clearExpandedTraceDefaultColors(newTrace);
203+
204+
// there's no need to coerce styleLookup[groupName] here
205+
// as another round of supplyDefaults is done on the transformed traces
206+
newTrace = Lib.extendDeepNoArrays(newTrace, styleLookup[groupName] || {});
207+
}
208+
204209
return newData;
205210
}

0 commit comments

Comments
 (0)