vega / vega-lite

A concise grammar of interactive graphics, built on Vega.
https://vega.github.io/vega-lite/
BSD 3-Clause "New" or "Revised" License
4.61k stars 598 forks source link

Stacked area charts broken in >=5.14.1 #9337

Open lukasmasuch opened 3 months ago

lukasmasuch commented 3 months ago

Bug Description

We would like to update the vega-lite dependency in Streamlit to the latest version. However, the stacked area charts seem to be broken in vega-lite >=5.14.1. This might be related to this PR: https://github.com/vega/vega-lite/pull/9018

in 5.14.0 (expected):

Screenshot 2024-05-03 at 20 00 15

in 5.14.1 (broken):

Screenshot 2024-05-03 at 19 57 59

Here is the current spec based on st.area_chart in Streamlit. I will try to provide a reproducible example within the next couple of days:

{
  "data": {"name": "6275643184"},
  "mark": {"type": "area"},
  "encoding": {
    "color": {
      "field": "color--p5bJXXpQgvPz6yvQMFiy",
      "legend": {"titlePadding": 5, "offset": 5, "orient": "bottom"},
      "title": " ",
      "type": "nominal"
    },
    "opacity": {"value": 0.7},
    "tooltip": [
      {
        "field": "index--p5bJXXpQgvPz6yvQMFiy",
        "title": "index",
        "type": "quantitative"
      },
      {
        "field": "value--p5bJXXpQgvPz6yvQMFiy",
        "title": "value",
        "type": "quantitative"
      },
      {
        "field": "color--p5bJXXpQgvPz6yvQMFiy",
        "title": "color",
        "type": "nominal"
      }
    ],
    "x": {
      "axis": {"grid": false, "tickMinStep": 1},
      "field": "index--p5bJXXpQgvPz6yvQMFiy",
      "scale": {},
      "title": "",
      "type": "quantitative"
    },
    "y": {
      "axis": {"grid": true},
      "field": "value--p5bJXXpQgvPz6yvQMFiy",
      "scale": {},
      "title": "",
      "type": "quantitative"
    }
  },
  "height": 0,
  "params": [
    {
      "name": "param_6",
      "select": {"type": "interval", "encodings": ["x", "y"]},
      "bind": "scales"
    }
  ],
  "width": 704,
  "$schema": "https://vega.github.io/schema/vega-lite/v5.17.0.json",
  "autosize": {"type": "fit", "contains": "padding"},
}

Checklist

domoritz commented 3 months ago

@yhoonkim @kanitw can you look at this?