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.62k stars 598 forks source link

theta encoding wrong for text mark #9392

Open ondave opened 1 month ago

ondave commented 1 month ago

When using a text mark with theta ordinal encoding, the values get wrapped back onto the start rather than distributed evenly around the circle.

Example:

{
  "data":{
    "values":[
      {"quadrant":"N"},
      {"quadrant":"E"},
      {"quadrant":"S"},
      {"quadrant":"W"}
    ]
  },
  "encoding": {
    "theta":{
          "field":"quadrant",
          "type":"ordinal",
          "sort":null
        },
    "text":{
          "field":"quadrant", 
        }
  },
  "layer": [
    {
      "mark": {
        "type": "text",
        "radius":50
      }
    }
  ]
}

visualization (5)

However, this example for an arc mark give 4 equal segments as expected:

{
  "data":{
    "values":[
      {"quadrant":"N"},
      {"quadrant":"E"},
      {"quadrant":"S"},
      {"quadrant":"W"}
    ]
  },
  "encoding": {
    "theta":{
          "field":"quadrant",
          "type":"ordinal",
          "sort":null
        },
    "text":{
          "field":"quadrant", 
        }
  },
  "layer": [
    {
      "mark": {
        "type": "arc",
        "radius":50
      }
    }
  ]
}

visualization (7)

PBI-David commented 1 month ago

The first generates a point scale and the second a band scale for some reason.