Skip to content

Commit

Permalink
fix: allow adding groupby channel when spec has a color encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrosquall committed Jan 20, 2025
1 parent e41db6c commit 7f6ed6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,14 @@ export function stack(m: Mark | MarkDef, encoding: Encoding<string>): StackPrope
const hasSameDimensionAndStackedField = dimensionField && dimensionField === stackedField;

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

if (!hasSameDimensionAndStackedField && (isPolar ? dimensionChannel === fieldChannel : true)) {
if (!hasSameDimensionAndStackedField && (isPolar ? dimensionChannel === fieldChannel || encoding['color'] : true)) {
// avoid grouping by the stacked field
// TKTK: find out why
groupbyChannels.push(dimensionChannel);
groupbyFields.add(dimensionField); // Iinvestigate meee
groupbyFields.add(dimensionField); // Investigate me
}
}

Expand Down

0 comments on commit 7f6ed6d

Please sign in to comment.