Vega visualisation using href to open an url does not seem to work

I created a vega visualisation that shows a simple rectangle and a text. If you click on it, I would like it to open another tab or window to an URL specified by the HREF. But this does not work, here is my Vega JSON.

{
  "$schema": "https://vega.github.io/schema/vega/v5.json",
  "description": "A green box with 'Offline Systems' and a number '0'.",
  "padding": 0,
  
  "config": {
    "font": "Inter"
  },
    "data": [
  ],
  "marks": [
    {
      "type": "rect",
      
      "encode": {
        "enter": {
            "x": {"value": 0},
            "y": {"value": 0},
            "width": {"signal": "width"},
            "height": {"signal": "height"},
            "cornerRadius": {"value": 0}
        },
        "update": {
          "href": "https://www.google.com",
          "fill": {"value": "#3273a8"},
        }
      }
    },
    {
      "type": "text",
      "encode": {
          "enter": {
              "href": {"value": "https://axsguard.cloud"},
              "text": {"value": "Show Offline Systems"},
              "x": {"signal": "width/2"},
              "y": {"signal": "height/2"},
              "align": {"value": "center"},
              "baseline": {"value": "middle"},
              "fill": {"value": "white"},
              "fontSize": {"value": 17},
              "fontWeight": {"value": "bold"}
          }
      }
    }
  ]
}

Hey Harold,

I have tested the above and it works, in order to get it to work I had to add the following setting to my opensearch dashboards configuration.

vis_type_vega.enableExternalUrls: true

These two settings are also required,

data_source.enabled: true
vis_type_vega.enabled: true

But I imagine you’ve already set these in order to enable using Vega as per - Vega - OpenSearch Documentation .

Leeroy.

1 Like