Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hydrosquall
Copy link
Member

@hydrosquall hydrosquall commented Jan 20, 2025

Motivation

Changes

  • Do not include groupBy field when the dimension field is using a quantitative scale. This ensures that stacking is applied correctly.
  • I've made this change only impact polar coordinate channels to keep the impact radius minimal since this customization may be specific to the arc mark.
  • Try the VL Spec from the original bug report

Testing

  • API design: does this approach make sense for how stacks should apply for arc marks?
  • See unit test suite : Let me know if additional cases should be added to either the image snapshots or the unit test suite.
  • Compare with similar cartesian plot

@hydrosquall hydrosquall changed the title [draft] [draft] Radial chart does not render as expected when different fields are used for theta and radius Jan 20, 2025
@hydrosquall hydrosquall changed the title [draft] Radial chart does not render as expected when different fields are used for theta and radius fix: Radial chart does not render as expected when different fields are used for theta and radius [draft] Jan 20, 2025
@hydrosquall hydrosquall force-pushed the cameron.yick/fix-compile-pie-stack branch 2 times, most recently from 0b7380a to 7f6ed6d Compare January 20, 2025 16:15
Copy link

cloudflare-workers-and-pages bot commented Jan 20, 2025

Deploying vega-lite with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6d37199
Status: ✅  Deploy successful!
Preview URL: https://8b6f6244.vega-lite.pages.dev
Branch Preview URL: https://cameron-yick-fix-compile-pie.vega-lite.pages.dev

View logs

@hydrosquall hydrosquall force-pushed the cameron.yick/fix-compile-pie-stack branch from 7f6ed6d to 3b1d979 Compare January 20, 2025 16:16
@hydrosquall hydrosquall changed the title fix: Radial chart does not render as expected when different fields are used for theta and radius [draft] fix: Radial mark does not render as expected when different fields used for theta and radius [draft] Jan 20, 2025
src/stack.ts Outdated
// avoid grouping by the stacked field
// TKTK: find out why
Copy link
Member Author

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)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before I removed the color encoding check, the graph rendered like this:

image

@hydrosquall hydrosquall force-pushed the cameron.yick/fix-compile-pie-stack branch 5 times, most recently from 89b647c to 369fa1e Compare January 26, 2025 02:31
@hydrosquall hydrosquall changed the title fix: Radial mark does not render as expected when different fields used for theta and radius [draft] fix: Radial mark does not stack for quantitative definitions when different fields are used for theta and radius [draft] Jan 26, 2025
@hydrosquall hydrosquall changed the title fix: Radial mark does not stack for quantitative definitions when different fields are used for theta and radius [draft] fix: Arc mark does not stack for quantitative definitions when different fields are used for theta and radius [draft] Jan 26, 2025
@hydrosquall hydrosquall force-pushed the cameron.yick/fix-compile-pie-stack branch from a21fed9 to 905e53c Compare January 26, 2025 02:55
@hydrosquall hydrosquall marked this pull request as ready for review January 26, 2025 03:23
@hydrosquall hydrosquall requested a review from a team as a code owner January 26, 2025 03:23
@hydrosquall hydrosquall force-pushed the cameron.yick/fix-compile-pie-stack branch from 905e53c to 6d37199 Compare January 30, 2025 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Radial chart radius field unexpectedly changes arc stack behavior
1 participant