Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion src/traces/waterfall/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ module.exports = {
connector: {
line: {
color: extendFlat({}, lineAttrs.color, {dflt: Color.defaultLine}),
width: lineAttrs.width,
width: extendFlat({}, lineAttrs.width, {
Copy link
Contributor

Choose a reason for hiding this comment

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

does a similar fix need to be applied anywhere else in this trace? I haven't rigorously tested each attr, I just happened to test this one a lot due to our conversations around the line extensions etc :)

editType: 'plot', // i.e. to adjust bars is mode: 'between'. See https://github.com/plotly/plotly.js/issues/3787
}),
dash: lineAttrs.dash,
editType: 'plot'
},
Expand Down
35 changes: 35 additions & 0 deletions test/jasmine/tests/waterfall_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,41 @@ describe('A waterfall plot', function() {
.catch(failTest)
.then(done);
});

it('should be able to adjust bars when reacting with new connector.line.width ', function(done) {
Plotly.plot(gd, {
data: [{
type: 'waterfall',
y: [1, 2, 3],
}],
layout: {
width: 500,
height: 500
}
})
.then(function() {
var traceNodes = getAllTraceNodes(gd);
var waterfallNodes = getAllWaterfallNodes(traceNodes[0]);
var path = waterfallNodes[0].querySelector('path');
var d = d3.select(path).attr('d');
expect(d).toBe('M11.33,321V268.33H102V321Z');
})
.then(function() {
gd.data[0].connector = {
line: { width: 10 }
};
return Plotly.react(gd, gd.data);
})
.then(function() {
var traceNodes = getAllTraceNodes(gd);
var waterfallNodes = getAllWaterfallNodes(traceNodes[0]);
var path = waterfallNodes[0].querySelector('path');
var d = d3.select(path).attr('d');
expect(d).toBe('M11.33,325V264.33H102V325Z');
})
.catch(failTest)
.then(done);
});
});

describe('waterfall visibility toggling:', function() {
Expand Down