Vega-lite: Sort Property of Mark Not Working

Created on 19 Jun 2017  路  9Comments  路  Source: vega/vega-lite

Sort property seems to be broken for the example in the docs.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "data": {"url": "data/cars.json"},
  "mark": "tick",
  "encoding": {
    "x": {"field": "Horsepower", "type": "quantitative", "sort": "descending"}
  }
}

image

All 9 comments

Hmm, in this case we should reverse the scale, right?

Yes, at least thats what the documentation says. I am using the online editor https://vega.github.io/new-editor/?mode=vega-lite

Does sort make sense at all for quantitative given the existence of scale.reverse?

@g3o2 -- good point. I think there are distinction between scale.reverse and scale sort order in Vega. We should add reverse and correctly distinguish their behaviors.

It is only now that I've realised that there is indeed no scale.reverse in vega-lite :-)

@g3o2 Previously sort: "descending" maps to reverse in the underlying Vega. However, there is a case where they are different and thus we no longer map sort order to reverse. We still need to add reverse back.

Not yet -- that will require a release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kanitw picture kanitw  路  3Comments

kanitw picture kanitw  路  3Comments

paintdog picture paintdog  路  4Comments

domoritz picture domoritz  路  3Comments

ijlyttle picture ijlyttle  路  3Comments