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 by using tickMinStep #8872

Merged
merged 5 commits into from
May 1, 2023

Conversation

kanitw
Copy link
Member

@kanitw kanitw commented Apr 28, 2023

Fix #8867 - Avoid repetitive labels by using tickMinStep

(replacing #8868 to use tickMinStep as @domoritz suggested)

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.

Looks good. The method definitely doesn't cover many cases where you have a format such as .1f for example but parsing that would be difficult so this looks like a good start to cover a lot of cases.

@@ -74,6 +74,9 @@
"gridScale": "y",
"grid": true,
"tickCount": {"signal": "ceil(width/40)"},
"tickMinStep": {
"signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)"
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we could precompute this so that we don't need a signal here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer using signal given it's not that expensive to calculate once, but it's gonna be more readable than some magic constant that presents duration timestamps.

@kanitw kanitw merged commit 0b1c385 into main May 1, 2023
@kanitw kanitw deleted the kw/8967-repetitive-label-tickMinStep branch May 1, 2023 16:17
BradyJ27 pushed a commit to BradyJ27/vega-lite that referenced this pull request Oct 19, 2023
Co-authored-by: GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>
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
2 participants