File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -178,19 +178,12 @@ export function stack(m: Mark | MarkDef, encoding: Encoding<string>): StackPrope
178178 const dimensionField = isFieldDef ( dimensionDef ) ? vgField ( dimensionDef , { } ) : undefined ;
179179 const hasSameDimensionAndStackedField = dimensionField && dimensionField === stackedField ;
180180
181- // 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?
181+ // For polar coordinates, do not set a groupBy when working with quantitative fields.
183182 const isPolar = isPolarPositionChannel ( fieldChannel ) || isPolarPositionChannel ( dimensionChannel ) ;
183+ const shouldAddPolarGroupBy = ! isUnbinnedQuantitative ( dimensionDef ) ;
184184
185- // TODO: Figure out why groupBy is only sometimes necessary?
186- // Unclear why the test case and the bug report differ in whether a groupBy should be supplied to vega or not
187- // const shouldAddPolarGroupBy = dimensionField === 'dir' || (fieldChannel === dimensionChannel);
188- const shouldAddPolarGroupBy = ( fieldChannel === dimensionChannel ) ;
189-
190- // if (!hasSameDimensionAndStackedField) {
191- if ( ! hasSameDimensionAndStackedField && ( isPolar ? ( shouldAddPolarGroupBy ) : true ) ) {
185+ if ( isPolar ? shouldAddPolarGroupBy : ! hasSameDimensionAndStackedField ) {
192186 // avoid grouping by the stacked field
193- // TKTK: find out why
194187 groupbyChannels . push ( dimensionChannel ) ;
195188 groupbyFields . add ( dimensionField ) ;
196189 }
You can’t perform that action at this time.
0 commit comments