-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Tick labels when using hourly rangebreaks #4722
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
Comments
With bounds: [18, 6] they are spaced well | demo. |
Yeah, please see if you can come up with a reasonable heuristic here. |
There are 2 pieces of this: first, both hour and day ticks have positioning bugs if you use
Second is the question about how to display nice evenly-spaced ticks. I don't think this will be a problem with day ticks, once the bug part is solved those will be fine. But hour ticks are an interesting case. 1-hour dtick should be fine, unless users start specifying nightly breaks in increments of fractional hours... at that level of generality there's probably nothing we can do to ensure even tick spacing, we'll just need to live with funny spacing near the break. The multi-hour dtick values we have in our auto-dtick output are 2, 3, 6, and 12 hours, and none of those will make sense in all conditions, but going straight from 1 hour to 1 day won't be a great experience (even for 8-hour workdays that's a factor of 8 jump) so we need something in the middle. A proposal:
|
Demo demostrate similar issue using |
@archmoj let's split this issue into two pieces, as I describe in my comment, so we can be very clear about the behavior we're targeting:
Image tests may not be the best way to cover this, especially the second part. Certainly one or two images but jasmine tests will let us lock down many more cases. We want many different axes showing all spans of range (leading to any autodtick from 1 to 24 hours, with a focus on the values between 1 and 24 but showing exactly where we transition from 1 or 24 to the next intermediate value) and different spans of hour rangebreaks (removing anything from ~4 hours up to ~20 hours with different starting points. The most common I guess will be removing either 8 hours (eg [0, 8] or [21, 5]), 12 hours (eg [21, 9], [20, 8]), or 16 hours (eg [16, 8] or [17, 9]), maybe 15 too (eg [17, 8] or [18, 9]) so you see 9 hours in a day, showing both ends of an 8-hour workday ie 9am and 5pm or 8am and 4pm. |
Uh oh!
There was an error while loading. Please reload this page.
This pen https://codepen.io/nicolaskruchten/pen/qBdwQKw?editors=0010 shows oddly-spaced tick labels both by default, and when setting
dtick
to24*60*60*1000
(daily) or60*60*1000
(hourly).The text was updated successfully, but these errors were encountered: