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

Density visualizations with group by are not stacking correctly #6624

Closed
domoritz opened this issue Jun 15, 2020 · 2 comments
Closed

Density visualizations with group by are not stacking correctly #6624

domoritz opened this issue Jun 15, 2020 · 2 comments
Labels
Bug 🐛 P3 Should be fixed at some point

Comments

@domoritz
Copy link
Member

Open the Chart in the Vega Editor

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "width": 400,
  "height": 100,
  "data": {
    "url": "data/cars.json"
  },
  "mark": "area",
  "transform": [
    {
      "fold": ["Displacement", "Horsepower"],
      "as": ["measurement", "value"]
    },
    {
      "density": "value",
      "groupby": ["measurement"]
    }
  ],
  "encoding": {
    "x": {"field": "value", "type": "quantitative"},
    "y": {"field": "density", "type": "quantitative", "stack": "zero"},
    "color": {"field": "measurement", "type": "nominal"}
  }
}

image

@domoritz domoritz added Bug 🐛 P2 Important Issues that should be fixed soon labels Jun 15, 2020
@domoritz
Copy link
Member Author

domoritz commented Jun 15, 2020

The issue is that we use impute to fill in missing densities as 0 but the densities are not aligned.

It works if we set the extent explicitly.

Open the Chart in the Vega Editor

@domoritz domoritz added P3 Should be fixed at some point and removed P2 Important Issues that should be fixed soon labels Jun 15, 2020
@domoritz domoritz changed the title Density Visualizations with group by often look broken Density visualizations with group by are not stacking correctly Jun 15, 2020
@joelostblom
Copy link
Contributor

This is currently working as intended, so I'm closing the issue. I believe it was solved in #9106

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 P3 Should be fixed at some point
Projects
None yet
Development

No branches or pull requests

2 participants