vega / vega-lite

A concise grammar of interactive graphics, built on Vega.
https://vega.github.io/vega-lite/
BSD 3-Clause "New" or "Revised" License
4.69k stars 612 forks source link

timeUnit clearing the chart #5453

Closed maliky closed 5 years ago

maliky commented 5 years ago

Since a few hours ago, I noticed that setting time units to simple charts such as the one for the timeUnit exemple (below) do not display any chart. Removing the timeUnit makes the chart appear. I tried with firefox and chromium.

Is there a problem with my cache? Is it something local or do you experience the same thing ?

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "data": {"url": "data/seattle-temps.csv"},
  "mark": {"type": "line", "interpolate": "monotone"},
  "encoding": {
    "x": {"timeUnit": "month", "field": "date", "type": "temporal"},
    "y": {"aggregate": "mean", "field": "temp", "type": "quantitative"}
  },
  "config": {"axis": {"shortTimeLabels": true}}
}
maliky commented 5 years ago

Looking at the Vega spec. Somethings is not right with isFinite(datum[\"month_date\"])

see the table of this online example

All dates look finite to me but the test fails.

Another thing that confuses me is the presence of data in the table (wo isFinite test) while the debug console through a 404 Failed to load ressource:.. https://vega.github.io/data/seattle-temps.csv

domoritz commented 5 years ago

Hmm, we shouldn’t use isFinite for dates. We’ll take a look.

maliky commented 5 years ago

Hi Domoritz,

I'm trying to understand how your fix fixes the issue.

You were saying that we shouldn't use isFinite for date but you left the tests in place. Also, the documentation examples (e.g. TimeUnit example) don't seem to reflect your changes. They are still generating vega code with old datum[\"month_date\"] !== null tests. (website updated)

I'm beginning to grasp typed js and the node environnement so I may be able to help with some guidance.