Vega radio input don't show defaul

Hi to all
I have Vega visualization with radio input signal.

"signals": [
 {"name": "Zobrazení", "value": "Celkově", "bind": {"input": "radio", "options": ["Celkově", "Po zaměstnancích"]}},
 {"name": "Období", "value": "Den", "bind": {"input": "radio", "options": ["Den", "Hodina"]}}
],

When I apply my code, i dont see default values as checked.

currently using

"$schema": "https://vega.github.io/schema/vega/v4.3.0.json",

Thank you

Misa

@flash1293 can we please get some help?

Thanks,
Bhavya

Hi Misa,

to remove all ambiguities, could you please follow the steps outlined here: https://gist.github.com/nyurik/736c34970ba3c32f3fe3d45d66719b3e

This will give a complete picture of your case and make it much easier to suggest a solution

flash1293,

I see the same thing even with the simplest of items:

"{"$schema":"https://vega.github.io/schema/vega/v4.3.0.json","signals":[{"name":"color","value":"both","bind":{"input":"radio","options":["fill","stroke","both"]}}],"config":{"range":{"category":{"scheme":"elastic"}},"arc":{"fill":"#54B399"},"area":{"fill":"#54B399"},"line":{"stroke":"#54B399"},"path":{"stroke":"#54B399"},"rect":{"fill":"#54B399"},"rule":{"stroke":"#54B399"},"shape":{"stroke":"#54B399"},"symbol":{"fill":"#54B399"},"trail":{"fill":"#54B399"}},"autosize":{"type":"fit","contains":"padding"}}"

-Midas

Hi @Midas,

I tested the spec you provided and this is how it looks for me:

Are you seeing something else?

flash1293,

I am seeing it the same way as Misa is. I am using Kibana OSS v7.6.1, Vega 4.3.0. I tried with the Kibana XPack v7.6.1, Vega 4.3.0 as well, same thing. When I used Kibana XPack 6.5.4, Vega 3.3.1, I had no issues and saw what you see there.

-Midas.

I am showing the same using elastic cloud.

It produces valid HTML. Something with CSS might be overriding it but haven't found what yet.

<input id="vega-option-Zobrazení-Celkově" type="radio" name="Zobrazení" value="Celkově" checked="true">

I was testing with the latest unreleased Kibana version using a more recent version of vega, let me check on 7.6

Here is 7.8.0

I was referring to https://github.com/elastic/kibana/pull/68639 (will be released soon with 7.9). I will check on Monday whether there is a workaround for older versions, otherwise you should be able to get it working by upgrading once 7.9 is out.

1 Like

I tested 7.8 locally and I have the same issue there. Seems like vega fixed the problem in the most recent version - I suggest waiting for 7.9 and then upgrading.

Till then, maybe you can use a text mark to show the current value of the signal besides the checkboxes as a workaround?

  marks: [
  {
      "type": "text",
      "encode": {
        "update": {
          "fill": {"value": "#000"},
          "text": {"signal": "color"}
        }
      }
    }
    ],