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

Plot bar/histogram traces in bar layer update selection #1365

Merged
merged 2 commits into from
Feb 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/traces/bar/plot.js
Original file line number Diff line number Diff line change
@@ -37,8 +37,9 @@ module.exports = function plot(gd, plotinfo, cdbar) {

var bartraces = plotinfo.plot.select('.barlayer')
.selectAll('g.trace.bars')
.data(cdbar)
.enter().append('g')
.data(cdbar);

bartraces.enter().append('g')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rreusser you probably did this already as part of your animatable bars work, but I couldn't resist making a two-line bug fix to wrap up my day 😏

Copy link
Contributor

@rreusser rreusser Feb 8, 2017

Choose a reason for hiding this comment

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

Yeah, I'd love to finish off the bar PR. It's 90% done, but the remaining 90% of the work requires a moderate dive into the subtleties of bars.

.attr('class', 'trace bars');

bartraces.append('g')
Binary file added test/image/baselines/bar_and_histogram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions test/image/mocks/bar_and_histogram.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"data": [
{ "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram" },
{ "x": [1,2,3], "y":[-1,-2,-3], "type": "bar" },
{ "x": [1,2,3], "y":[-1,-2,-3], "type": "bar", "yaxis":"y2" },
{ "x": [1,1,1,1,1,2,2,2,3,3], "type": "histogram", "yaxis":"y2" }
],
"layout": {
"yaxis": { "domain": [0,0.49] },
"yaxis2": { "domain": [0.51, 1] },
"showlegend": false
}
}