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

Binned, stacked area charts can have gaps #7930

Closed
paulrosenzweig opened this issue Jan 18, 2022 · 3 comments · Fixed by #7973
Closed

Binned, stacked area charts can have gaps #7930

paulrosenzweig opened this issue Jan 18, 2022 · 3 comments · Fixed by #7973
Labels
Bug 🐛 Help Wanted Good tasks for contributors (try https://github.com/vega/vega-lite/issues/1486 first) P3 Should be fixed at some point

Comments

@paulrosenzweig
Copy link
Contributor

paulrosenzweig commented Jan 18, 2022

Broken Chart

broken chart

link

The chart shouldn't have that gap at the bottom. Also, the areas on top are truncated too early on the right. The correct version would look like this:

Fixed Chart

fixed chart
link

The Change

The current generated code is using the original binned field rather than the _mid version. The diff between those chart's Vega code is changing the area's defined channel from this

{
  "signal": "isValid(datum[\"bin_maxbins_10_Body Mass (g)\"]) && isFinite(+datum[\"bin_maxbins_10_Body Mass (g)\"]) && isValid(datum[\"__count\"]) && isFinite(+datum[\"__count\"])"
}

to

{
  "signal": "isValid(datum[\"bin_maxbins_10_Body Mass (g)_mid\"]) && isFinite(+datum[\"bin_maxbins_10_Body Mass (g)_mid\"]) && isValid(datum[\"__count\"]) && isFinite(+datum[\"__count\"])"
}

Another issue

I think ideally, the areas would slope down to zero at the edges of the x-extent for consistency. That seems like a slightly different and less severe bug though. I believe fixing that would require changing (and complicating) the imputation transform or adding another transform step.

@domoritz
Copy link
Member

Nice catch and since you already dug into the issue, do you want to send a pull request to fix it?

@domoritz domoritz added P3 Should be fixed at some point Help Wanted Good tasks for contributors (try https://github.com/vega/vega-lite/issues/1486 first) labels Jan 18, 2022
@paulrosenzweig
Copy link
Contributor Author

@domoritz Yup! Just opened #7931. It looks I need to be approved to allow running the workflows. I'll un-draft it once those pass.

@domoritz
Copy link
Member

Unfortunately I have to reapprove every change but I can do that. Make sure that tests are passing locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Help Wanted Good tasks for contributors (try https://github.com/vega/vega-lite/issues/1486 first) P3 Should be fixed at some point
Projects
None yet
2 participants