Skip to content

cornerRadius breaks bar chart when there is a interval select parameter #9750

Open

Description

@Light2Dark

Bug Description

{
    "data": {
        "values": [
            {"a": "A", "b": 28},
            {"a": "B", "b": 55},
            {"a": "C", "b": 43},
            {"a": "D", "b": 91},
            {"a": "E", "b": 81},
            {"a": "F", "b": 53},
            {"a": "G", "b": 19},
            {"a": "H", "b": 87},
            {"a": "I", "b": 52}
        ]
    },
    "mark": {
        "type": "bar",
        "cornerRadius": 1
    },
    "encoding": {
        "x": {
            "field": "a"
        },
        "y": {
            "field": "b",
            "type": "quantitative"
        },
    },
    "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
    "params": [
        {
            "name": "pan_zoom",
            "bind": "scales",
            "select": {
                "type": "interval"
            }
        }
    ]
}

When cornerRadius is 0, it renders correctly

Image

If cornerRadius is 1 and select.type is "interval", the bars don't show up. The bars show up if select.type changes to "point"
Image

Similar issue:
#6759

Checklist

  • I checked for duplicate issues.

Activity

  1. changed the title [-]cornerRadius breaks bar chart when there is a parameter with interval select parameter[/-] [+]cornerRadius breaks bar chart when there is a interval select parameter[/+] on Jan 17, 2026
  2. domoritz commented on Jan 17, 2026

    @domoritz
    Member

    It's probably because of some changes to the nesting in the Vega spec. Could you check how they compare?

  3. Light2Dark commented on Jan 19, 2026

    @Light2Dark
    Author

    Checked the compiled vega spec, the marks section is the only diff I could see

    corner radius 0

    "marks": [
        {
          "name": "marks",
          "type": "rect",
          "clip": true,
          "style": ["bar"],
          "interactive": true,
          "from": {"data": "data_0"},
          "encode": {
            "update": {
              "cornerRadius": {"value": 0},
              "fill": {"value": "#4c78a8"},
              "ariaRoleDescription": {"value": "bar"},
              "description": {
                "signal": "\"a: \" + (isValid(datum[\"a\"]) ? isArray(datum[\"a\"]) ? join(datum[\"a\"], ' ') : datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
              },
              "x": {"scale": "x", "field": "a"},
              "width": {"signal": "max(0.25, bandwidth('x'))"},
              "y": {"scale": "y", "field": "b_end"},
              "y2": {"scale": "y", "field": "b_start"}
            }
          }
        }
      ],

    corner radius 1

      "marks": [
        {
          "type": "group",
          "from": {
            "facet": {
              "data": "data_0",
              "name": "stack_group_main",
              "groupby": ["a"],
              "aggregate": {
                "fields": ["b_start", "b_start", "b_end", "b_end"],
                "ops": ["min", "max", "min", "max"]
              }
            }
          },
          "encode": {
            "update": {
              "x": {"scale": "x", "field": "a"},
              "width": {"signal": "max(0.25, bandwidth('x'))"},
              "y": {
                "signal": "min(scale('y',datum[\"min_b_start\"]),scale('y',datum[\"max_b_start\"]),scale('y',datum[\"min_b_end\"]),scale('y',datum[\"max_b_end\"]))"
              },
              "y2": {
                "signal": "max(scale('y',datum[\"min_b_start\"]),scale('y',datum[\"max_b_start\"]),scale('y',datum[\"min_b_end\"]),scale('y',datum[\"max_b_end\"]))"
              },
              "clip": {"value": true},
              "cornerRadius": {"value": 1}
            }
          },
          "marks": [
            {
              "type": "group",
              "encode": {
                "update": {
                  "y": {"field": {"group": "y"}, "mult": -1},
                  "width": {"field": {"group": "width"}}
                }
              },
              "marks": [
                {
                  "name": "marks",
                  "type": "rect",
                  "clip": true,
                  "style": ["bar"],
                  "interactive": true,
                  "from": {"data": "stack_group_main"},
                  "encode": {
                    "update": {
                      "fill": {"value": "#4c78a8"},
                      "ariaRoleDescription": {"value": "bar"},
                      "description": {
                        "signal": "\"a: \" + (isValid(datum[\"a\"]) ? isArray(datum[\"a\"]) ? join(datum[\"a\"], ' ') : datum[\"a\"] : \"\"+datum[\"a\"]) + \"; b: \" + (format(datum[\"b\"], \"\"))"
                      },
                      "width": {"field": {"group": "width"}},
                      "y": {"scale": "y", "field": "b_end"},
                      "y2": {"scale": "y", "field": "b_start"}
                    }
                  }
                }
              ]
            }
          ]
        }
      ],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions