Skip to content

Commit 3b1d979

Browse files
committed
fix: allow adding groupby channel when spec has a color encoding
1 parent e41db6c commit 3b1d979

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/stack.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,14 @@ export function stack(m: Mark | MarkDef, encoding: Encoding<string>): StackPrope
179179
const hasSameDimensionAndStackedField = dimensionField && dimensionField === stackedField;
180180

181181
// This change breaks cartesian tests, just pushing to start the discussion. When dev'ing locally, try removing this condition.
182+
// TBD: we should only enter this branch if there's also a "color" and maybe a group channel?
182183
const isPolar = isPolarPositionChannel(fieldChannel) || isPolarPositionChannel(dimensionChannel);
183184

184-
if (!hasSameDimensionAndStackedField && (isPolar ? dimensionChannel === fieldChannel : true)) {
185+
if (!hasSameDimensionAndStackedField && (isPolar ? dimensionChannel === fieldChannel || encoding['color'] : true)) {
185186
// avoid grouping by the stacked field
186187
// TKTK: find out why
187188
groupbyChannels.push(dimensionChannel);
188-
groupbyFields.add(dimensionField); // Iinvestigate meee
189+
groupbyFields.add(dimensionField);
189190
}
190191
}
191192

0 commit comments

Comments
 (0)