Drill down using vega lite

Hi, I want to drill down my chart using Vega Lite. I made a heat map and when I clicked on one point, it will become a filter or it can to move to another dashboard. This is my code, I try to make the simple one when I clicked the point it will go to url. I followed this source and not works Scatterplot with External Links and Tooltips | Vega-Lite

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "params": [
    {
      "name": "pts",
      "select": {
        "type": "point",
        "fields": ["penyakit", "kabupaten"],
        "toggle": true
      }
    }
  ],
  "data": {
    "url": {
      "%timefield%": "tanggal",
      "%context%": true,
      "index": "dummy_data",
      "body": {
        "aggs": {
          "eqpt_buckets": {
            "composite": {
              "size": 5000,
              "sources": [
                {"no": {"terms": {"field": "no"}}},
                {"tanggal": {"terms": {"field": "tanggal"}}},
                {"penyakit": {"terms": {"field": "penyakit"}}},
                {"umur": {"terms": {"field": "umur"}}},
                {"provinsi": {"terms": {"field": "provinsi"}}},
                {"kabupaten": {"terms": {"field": "kabupaten"}}},
                {"gender": {"terms": {"field": "gender"}}}
              ]
            }
          }
        }
      }
    },
    "format": {"property": "aggregations.eqpt_buckets.buckets"}
  },
  "transform": [
    {"calculate": "datum.key.no", "as": "no"},
    {"calculate": "datum.key.tanggal", "as": "tanggal"},
    {"calculate": "datum.key.penyakit", "as": "penyakit"},
    {"calculate": "datum.key.umur", "as": "umur"},
    {"calculate": "datum.key.provinsi", "as": "provinsi"},
    {"calculate": "datum.key.kabupaten", "as": "kabupaten"},
    {"calculate": "datum.key.gender", "as": "gender"},
    {
      "calculate": " datum.key.umur >= 0 ? '0-11 yrs' : datum.key.umur",
      "as": "groupUmur"
    },
    {
      "calculate": " datum.key.umur > 11 ? '12-17 yrs' : datum.groupUmur",
      "as": "groupUmur"
    },
    {
      "calculate": " datum.key.umur > 17 ? '18-49 yrs' : datum.groupUmur",
      "as": "groupUmur"
    },
    {
      "calculate": " datum.key.umur > 49 ? '50-64 yrs' : datum.groupUmur",
      "as": "groupUmur"
    },
    {
      "calculate": " datum.key.umur > 64 ? '>= 65 yrs' : datum.groupUmur",
      "as": "groupUmur"
    },
    {
      "calculate": "'https://www.google.com/search?q=' + datum.penyakit",
      "as": "url"
    }
  ],
  "mark": {"type": "rect", "tooltip": true},
  "encoding": {
    "x": {"field": "kabupaten", "type": "nominal", "title": null},
    "color": {
      "condition": {
        "name": "test",
        "aggregate": "count",
        "field": "no,",
        "type": "quantitative",
        "title": "Cases",
        "scale": {
          "domainMid": 3,
          "domainMax": 20,
          "range": "diverging",
          "scheme": "yelloworangebrown"
        },
        "param": "pts"
      },
      "value": "grey"
    },
    "y": {"field": "penyakit", "type": "nominal", "title": null},
    "href": {"field": "url", "type": "nominal"}
  }
}

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