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

WARN Missing type for channel "order", using "quantitative" instead. #190

Open
mars0i opened this issue May 7, 2022 · 0 comments
Open

Comments

@mars0i
Copy link

mars0i commented May 7, 2022

The warning message in the title of this issue is generated when using oz/export! with a spec containing the Vega-Lite :order encoding key without specifying :type "ordinal". The warning doesn't occur with oz/view!. This isn't a serious problem. It doesn't seem to cause any trouble apart from slightly annoying warning messages. (I'm making a lot of plots, so I've been seeing it repeatedly, but I can make the messages go away.)

The following example is the EDN version (from https://behrica.github.io/vl-galery/convert) for one of the examples on the Vega-Lite examples page (see https://vega.github.io/vega-lite/examples/connected_scatterplot.html):

(def connected-scatterplot
  {:$schema "https://vega.github.io/schema/vega-lite/v5.json"
   :data {:url "https://vega.github.io/vega-lite/data/driving.json"}
   :encoding {:order {:field "year"}
              :x {:field "miles" :scale {:zero false} :type "quantitative"}
              :y {:field "gas" :scale {:zero false} :type "quantitative"}}
   :mark {:point true :type "line"}})

(oz/export! connected-scatterplot "foo.svg")
;; WARN Missing type for channel "order", using "quantitative" instead.
;; WARN Missing type for channel "order", using "quantitative" instead.
;; context,response

The "Missing type" warnings go away if I add :type "ordinal" after :field "year". I assume the warnings are coming from Vega-Lite, not oz, but I would have thought that an example in the Vega-Lite gallery would not generate an avoidable warning. It's apparently legal to leave out the :type in this case:
https://vega.github.io/vega-lite/docs/type.html:

ordinal"" is the default type if ... or (3) the encoding channel is order.

It's kind of odd that the warning says 'using "quantitative" instead', given that the default is supposed to be "ordinal". However, this doesn't prevent oz+vega-lite from producing the expected SVG file.

(Based on a not-really-related issue for a different repo queryverse/VegaLite.jl#341, I wonder whether oz might be using an older version of Vega-Lite, and the warning would not occur with a newer version. I don't know how Vega-Lite gets pulled into oz, so I don't know how to check this.)

Anyway, as I said, it's a not serious problem, but I thought I'd submit an issue in case there's an easy fix such as bumping up the Vega-Lite version. If it's just Vega-Lite's intended behavior whenever it chooses a default type, that's OK.

(I don't know what the "context,response" message is about. It doesn't appear when I use :order with my own code.)

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

No branches or pull requests

1 participant