Unrecognized signal name: "_source" when using calculate in Vega-Lite

Hi all,

I am trying to compute the sum of the absolute value of three fields in a dataset but I am getting an 'Unrecognized signal name: "_source" ' error in the calculate clause. I tried substituting the '_source' for 'datum' and the error dissapears but it then shows the warning ' Infinite extent for field "_source.tas": [Infinity, -Infinity]'

Anyone would know why I am not able to compute this addition and plot it?

Thanks! Find the simplified Vega-Lite code below

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "url": {
      "index": "stats",
      "body": {
        "size": 10000,
        "_source": [ "tas", "p_rate", "q_rate", "r_rate", "serial"]
      },
      "format": {"property": "hits.hits"}
    },
    "format": {"property": "hits.hits"}
  },
    "transform": [
    {
      "calculate": "_source.p_rate + _source.q_rate + _source.r_rate",
      "as": "sum_of_pqr"
    }]
  "layer": [
    {
    "mark": {"type": "point", "filled": true, size: 60},
    "encoding": {
      "x": {
        "field": "_source.tas",
        "type": "quantitative",
        "axis": {"title": "TAS (m/s)"}
      },
      "y": {
        "field": "_source.sum_pqr",
        "type": "quantitative",
        "axis": {"title": "Sum of absolute values of p, q and r (deg/s)"}
        "scale": {"domain": [-300, 300]},
      },  
    }
  },
  ],
  "title": "TAS vs p+q+r"
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.