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

Conditional opacity does not respect default opacity #9401

Open
kanitw opened this issue Jul 31, 2024 · 0 comments
Open

Conditional opacity does not respect default opacity #9401

kanitw opened this issue Jul 31, 2024 · 0 comments
Labels

Comments

@kanitw
Copy link
Member

kanitw commented Jul 31, 2024

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "A scatterplot showing horsepower and miles per gallons for various cars.",
  "data": {"url": "data/cars.json"},
  "mark": "point",
  "encoding": {
    "x": {"field": "Horsepower", "type": "quantitative"},
    "y": {"field": "Miles_per_Gallon", "type": "quantitative"},
    "opacity": {
      "condition": [{"test": "datum.Horsepower > 100", "value": 0.25}]
    }
  },
  "config": {"point": {"opacity": 0.5}}
}
image

The left half should get opacity = 0.5, not 1.

kanitw added a commit that referenced this issue Jul 31, 2024
## PR Description

Conditional opacity should respect default value


Before:

<img width="854" alt="image"
src="https://github.com/user-attachments/assets/07f590c3-a293-4e08-9d0d-d3b1dd2e15ef">

`config.point.opacity = 0.5` is ignored

After: 

<img width="794" alt="image"
src="https://github.com/user-attachments/assets/78e5b3ad-aa0f-40a2-8fe7-58f68a551fe7">

---------

Co-authored-by: GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>
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