From 7f6ed6d45ae56229bb3ce941afcb4ee253188543 Mon Sep 17 00:00:00 2001 From: Cameron Yick Date: Mon, 20 Jan 2025 11:10:47 -0500 Subject: [PATCH] fix: allow adding groupby channel when spec has a color encoding --- src/stack.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stack.ts b/src/stack.ts index ee4df0a099..a781d345d2 100644 --- a/src/stack.ts +++ b/src/stack.ts @@ -179,13 +179,14 @@ export function stack(m: Mark | MarkDef, encoding: Encoding): 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 } }