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

Unhide overlapping grouped bars within trace #3680

Merged
merged 3 commits into from
Mar 28, 2019

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Mar 25, 2019

fixes #3651 - where I decided to not add another attribute as the problem described in #3651 only affects bar graphs with barmode: 'group'. See #3651 (comment) for more on the topic.

cc @plotly/plotly_js @nicolaskruchten

- convert sieve instantiation to `new Sieve(traces, {/* */}` signature
- more readable barmode switchboard
Copy link
Contributor

@archmoj archmoj left a comment

Choose a reason for hiding this comment

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

@etpinard my questions below are non-blocking to 💃 this awesome fix.


if(fullTrace.offset === undefined) included.push(calcTrace);
else excluded.push(calcTrace);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we put this logic in a function and reuse it for the case of relative below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll pass if you don't mind. That would a pretty ugly function (we would have to pass functions setGroupPositionsInGroupMode, etc) and only save a few lines.


var sieve = new Sieve(calcTraces, {
separateNegativeValues: barmode === 'relative',
dontMergeOverlappingData: !(barnorm || barmode === 'stack' || barmode === 'relative')
Copy link
Contributor

Choose a reason for hiding this comment

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

The function now has a more clear interface block which is great.
Now that the keys would be presented in the .min files could we zip separateNegativeValues into e.g. separateNegVals and dontMergeOverlappingData into a short form?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in c019c5c

@archmoj archmoj mentioned this pull request Mar 26, 2019
6 tasks
@etpinard
Copy link
Contributor Author

Thanks for the review @archmoj - I'll until the waterfall PR is merged before addressing the comments.

@etpinard etpinard merged commit 2a0d960 into master Mar 28, 2019
@etpinard etpinard deleted the unhide-grouped-bars-within-trace branch March 28, 2019 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

same-position/within-trace bar placement when barmode=group
2 participants