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

violin: handle zero standard deviation #3625

Closed
wants to merge 4 commits into from
Closed

Conversation

antoinerg
Copy link
Contributor

@antoinerg antoinerg commented Mar 12, 2019

Closes issue #3622

This is by far the most concise way I could fix the issue. I only added 4 lines to src/traces/violin/calc.js (starting from line 38).

span = cdi.span = [cdi.min, cdi.max];
cdi.density = [{v:1, t: span[0]}];
maxKDE = Math.max(maxKDE, 1);
} else {
Copy link
Contributor Author

@antoinerg antoinerg Mar 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What follows is exactly the same code we had before.

@antoinerg antoinerg added bug something broken status: reviewable labels Mar 12, 2019
@alexcjohnson
Copy link
Collaborator

Much better 🍻
Question though: what if someone wants a nonzero bandwidth despite the single-valued data? Ideally they should still be able to provide a trace.bandwidth and get that behavior. I might even suggest doing that in the groups-over-matching-axes and violin-offsetgroups mocks to restore the previous look and make it easier to see what's going on.

@antoinerg
Copy link
Contributor Author

Question though: what if someone wants a nonzero bandwidth despite the single-valued data? Ideally they should still be able to provide a trace.bandwidth and get that behavior. I might even suggest doing that in the groups-over-matching-axes and violin-offsetgroups mocks to restore the previous look and make it easier to see what's going on.

Right... I was approaching this the wrong way. Closing in favor of #3626

@antoinerg antoinerg closed this Mar 12, 2019
@antoinerg antoinerg deleted the fix-violin-3622 branch March 12, 2019 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants