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

Temporal scale domains broken in vega-lite 4.5 #6060

Closed
jakevdp opened this issue Mar 10, 2020 · 7 comments · Fixed by #6061
Closed

Temporal scale domains broken in vega-lite 4.5 #6060

jakevdp opened this issue Mar 10, 2020 · 7 comments · Fixed by #6061
Labels
Bug 🐛 P1 Critical -- to fix ASAP

Comments

@jakevdp
Copy link
Contributor

jakevdp commented Mar 10, 2020

First reported in https://stackoverflow.com/questions/60623578/how-do-i-set-the-max-and-min-of-the-x-axis-of-vega-lite-time-series-chart/60623883

Here is an example spec:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "data": {
    "values": [
      {"ts": 1500400000000, "v": 1},
      {"ts": 1500500000000, "v": 2},
      {"ts": 1500600000000, "v": 3},
      {"ts": 1500700000000, "v": 2}
    ]
  },
  "width": 800,
  "height": 300,
  "mark": {"type": "line"},
  "encoding": {
    "x": {"field": "ts", "type": "temporal", "scale": {"domain": [1500000000000, 1500900000000]}},
    "y": {"field": "v", "type": "quantitative", "scale": {"domain": [0, 5]}}
  }
}

In Vega-Lite 4.4, the result is this:
visualization - 2020-03-10T113016 527

In Vega-Lite 4.5, the result is this:
visualization - 2020-03-10T113440 545

@kanitw kanitw added the P1 Critical -- to fix ASAP label Mar 10, 2020
@kanitw
Copy link
Member

kanitw commented Mar 10, 2020

@domoritz Looks like #5957 is wrong.

Currently the spec outputs:

{
        "fields": [
          {"signal": "datetime(1500000000000)"},
          {"signal": "datetime(1500900000000)"}
        ]
      }

But if we revert to:

 [
          {"signal": "{data: datetime(1500000000000)}"},
          {"signal": "{data: datetime(1500900000000)}"}
        ]

It works correctly.

kanitw added a commit that referenced this issue Mar 10, 2020
* docs: add `line_timestamp_domain.vl.json`

* chore: update examples [CI]

* fix: Revert "refactor: simplify date domains (#5957)"

This reverts commit 5dd9ad4.

* chore: update examples [CI]

Co-authored-by: GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>
@SyntaxRules
Copy link

Here is a another use case for the same bug: Vega Editor

@domoritz
Copy link
Member

Looks like it's not the same. @SyntaxRules can you file a separate issue?

Screen Shot 2020-03-10 at 14 03 24

@kanitw
Copy link
Member

kanitw commented Mar 10, 2020

I think it's the same.

@domoritz
Copy link
Member

Hmm, the screenshot above is from master just now.

@SyntaxRules
Copy link

@domoritz Issue created per your request. Testing this on the version 4.6.0 online editor produces the same error state.

Issue here: #6068

@domoritz
Copy link
Member

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 P1 Critical -- to fix ASAP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants