-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Bar length in milliseconds #4558
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
This is actually a more general problem than "bar lengths", as shown in this scatter example: https://codepen.io/nicolaskruchten/pen/xxwzGBe ... it seems that we interpret numbers in milliseconds as timezone-dependent in general. In fact, it's even funnier without the |
Bars on date axes are meaningless with no base - there's no such thing as zero. So while that's indeed funny behavior, I'm not inclined toward any sort of action to define one behavior as "correct". In the scatter case we've long held this to be an unfortunate early decision that we're now locked into until we either make a new major or add explicit time zone handling. The issue is folks constructing their data client side as For bars with base though I'm 100% on board with considering our interpretation of milliseconds a bug. Using the JS |
Well, we basically identify 1970-01-01 as zero in many contexts, so I could see us just reifying that... |
What about when the base is also specified in milliseconds? |
we could, but I don't really see the point - does that help anyone? We should just push people to choose an explicit
Then it should have the legacy timezone-dependent behavior, matching all other absolute position values on date axes, unless and until we change that behavior for I really think that until we get around to either implementing real time zone support or releasing a v2, we just need to keep the existing meaning of absolute numeric positions on date axes, and make it self-consistent. For new projects (once we fix the bar length bug part of this) the recommendation is straightforward: use strings for absolute dates and milliseconds for relative dates. |
OK, let's tightly-scope this thing to just the cases when there is a One thing that will come up then sometimes is that all your |
Let's move this to at least a minor. |
@archmoj why? |
Assuming you meant
As a tightly-scoped issue this is unambiguously a bug. Of course it will need careful testing but I think it's fine in a patch. |
hehe yes! My original examples are in horizontal/timeline mode (because I see this as being useful for e.g. Gantt charts) but in default orientation,
+1 |
@nicolaskruchten in your codepen the |
Done. |
@nicolaskruchten is it https://codepen.io/nicolaskruchten/pen/qBOKdQG?
Hmm... This is still pretty confusing. |
@archmoj bars with base on date axes are very important for making timelines, and right now their display is browser-timezone-dependent, meaning we cannot make Gantt charts. |
If we want to be precise about the data we're encoding when we make a bar chart, the
So the only 100% meaningful data users can give us for bars on date axes is |
I should add that today, if you specify |
An interesting article: https://medium.com/@toastui/handling-time-zone-in-javascript-547e67aa842d |
Closed via #4900. |
Uh oh!
There was an error while loading. Please reload this page.
Right now we can specify bar lengths in milliseconds on date axes but this is interpreted in a browser-timezone-dependent manner, which seems like a clear bug that makes this feature unusable. See https://codepen.io/nicolaskruchten/pen/qBOKdQG ...
Basically, the following figure JSONs (which differ only in
x
) should probably have the same output, regardless of timezone of browser:The text was updated successfully, but these errors were encountered: