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: avoid repetitive labels for integer/year/yearmonth axes #8868

Closed
wants to merge 4 commits into from

Conversation

kanitw
Copy link
Member

@kanitw kanitw commented Apr 27, 2023

Fixes #8867

avoid repetitive labels for integer/year/yearmonth axes

@kanitw kanitw force-pushed the kw/8967-repetitive-label branch 2 times, most recently from eb9c73f to 1fdae12 Compare April 27, 2023 21:50
@kanitw kanitw marked this pull request as ready for review April 27, 2023 22:17
return minOfDefaultTickCountAndSpan(scaleName, defaultSignal, val => `year(${val})`);
} else if (unit === 'yearmonth') {
return minOfDefaultTickCountAndSpan(scaleName, defaultSignal, val => `(year(${val}) * 12 + month(${val}))`);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Since we are doing this for month, why not also do it for quarter?

Copy link
Contributor

@fandu-db fandu-db left a comment

Choose a reason for hiding this comment

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

LGTM. Two nit comments

  1. About quarter
  2. The new behavior seems not captured in any of the test PNGs

Copy link
Member

@domoritz domoritz left a comment

Choose a reason for hiding this comment

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

This feels complicated. We should instead use tickMinStep as suggested in vega/vega#1503. Ideally this was fixed at the Vega level.

@kanitw
Copy link
Member Author

kanitw commented Apr 28, 2023

We should instead use tickMinStep as suggested in vega/vega#1503.
Ideally this was fixed at the Vega level.

I'll look a bit but if it's too complicated, I don't think we should block this PR on that.

@kanitw
Copy link
Member Author

kanitw commented Apr 28, 2023

The new behavior seems not captured in any of the test PNGs

It does -- see all the SVG changes in the 4th commit:

image

Note that some Vega spec may have diffs, but have no visual change since the cap rule still return the original default value.

@kanitw
Copy link
Member Author

kanitw commented Apr 28, 2023

Replaced with #8872

@kanitw kanitw closed this Apr 28, 2023
@kanitw kanitw deleted the kw/8967-repetitive-label branch April 28, 2023 21:54
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.

Repetitive labels for integer / time unit
3 participants