Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditions in color encodings are not reflected in legend #9497

Open
1 task done
rlm1023 opened this issue Dec 12, 2024 · 0 comments
Open
1 task done

Conditions in color encodings are not reflected in legend #9497

rlm1023 opened this issue Dec 12, 2024 · 0 comments
Labels

Comments

@rlm1023
Copy link

rlm1023 commented Dec 12, 2024

Bug Description

If you have a color encoding with a conditional re-coloring on it for particular values, those re-colorings are not reflected in the legend.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {"url": "data/cars.json"},
  "mark": "point",
  "encoding": {
    "x": {"field": "Horsepower", "type": "quantitative"},
    "y": {"field": "Miles_per_Gallon", "type": "quantitative"},
    "color": {
      "field": "Origin",
      "type": "nominal",
      "condition": {"test": "datum['Origin'] === 'USA'", "value": "red"},
      "scale": {"scheme": "category10"}
    }
  }
}

Produces:
Image

Repro

Checklist

  • I checked for duplicate issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant