-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Arc mark does not stack for quantitative
definitions when different fields are used for theta
and radius
[draft]
#9512
base: main
Are you sure you want to change the base?
Conversation
theta
and radius
theta
and radius
theta
and radius
[draft]
0b7380a
to
7f6ed6d
Compare
Deploying vega-lite with
|
Latest commit: |
ca62a23
|
Status: | ✅ Deploy successful! |
Preview URL: | https://d4c82713.vega-lite.pages.dev |
Branch Preview URL: | https://cameron-yick-fix-compile-pie.vega-lite.pages.dev |
7f6ed6d
to
3b1d979
Compare
theta
and radius
[draft]theta
and radius
[draft]
src/stack.ts
Outdated
// avoid grouping by the stacked field | ||
// TKTK: find out why |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this works here, we may need a similar change for the code block under dimensionOffsetChannel
.
src/stack.ts
Outdated
@@ -182,7 +182,7 @@ export function stack(m: Mark | MarkDef, encoding: Encoding<string>): StackPrope | |||
// 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 || encoding['color'] : true)) { | |||
if (!hasSameDimensionAndStackedField && (isPolar ? dimensionChannel === fieldChannel : true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
89b647c
to
369fa1e
Compare
theta
and radius
[draft]quantitative
definitions when different fields are used for theta
and radius
[draft]
quantitative
definitions when different fields are used for theta
and radius
[draft]quantitative
definitions when different fields are used for theta
and radius
[draft]
a21fed9
to
905e53c
Compare
905e53c
to
6d37199
Compare
@@ -176,8 +176,13 @@ export function stack(m: Mark | MarkDef, encoding: Encoding<string>): StackPrope | |||
if (encoding[dimensionChannel]) { | |||
const dimensionDef = encoding[dimensionChannel]; | |||
const dimensionField = isFieldDef(dimensionDef) ? vgField(dimensionDef, {}) : undefined; | |||
const hasSameDimensionAndStackedField = dimensionField && dimensionField === stackedField; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just having the same input field doesn't mean that it's the same transformed field? I think we need to check if they have the same aggregate/bin/timeUnit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah interesting. Do you know if we have helper utilities for checking if two encodings are "equivalent"? (I.e. matching in field name and any relevant inline transformations like bin/timeUnit/bin?
I looked in channelDef just now and didn't see anything that matches. I can add one if it seems like it would be appropriate here.
const isPolar = isPolarPositionChannel(fieldChannel) || isPolarPositionChannel(dimensionChannel); | ||
const shouldAddPolarGroupBy = !isUnbinnedQuantitative(dimensionDef); | ||
|
||
if (isPolar ? shouldAddPolarGroupBy : !hasSameDimensionAndStackedField) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we really need isPolar ? shouldAddPolarGroupBy :
clause? If we strictly check the field above, would that be sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By strictly check, do you mean we'd check if dimensionDef
and stackedFieldDef
have the same
field
(the current check)bin
aggregator
timeUnit
for both polar and cartesian graphs?
Currently if I just remove the isPolar ? shouldAddPolarGroupBy
clause and use the existing check, we'd introduce this bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a PoC commit to see if this is what you had in mind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I think the test and regression case look good, but I wonder if the condition added can be more precise/simpler.
…el and stackChannel are same
…hannels are matching
6d37199
to
ca62a23
Compare
Motivation
arc
mark with stacks, change graph renderingChanges
groupBy
field when thedimension
field is using aquantitative
scale. This ensures that stacking is applied correctly.radius
rather thantheta
Testing
stack
s should apply forarc
marks?