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
6 changes: 5 additions & 1 deletion src/components/drawing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ drawing.fillGroupStyle = function(s) {
s.style('stroke-width', 0)
.each(function(d) {
var shape = d3.select(this);
shape.call(Color.fill, d[0].trace.fillcolor);
// N.B. 'd' won't be a calcdata item when
// fill !== 'none' on a segment-less and marker-less trace
if(d[0].trace) {
shape.call(Color.fill, d[0].trace.fillcolor);
}
});
};

Expand Down
14 changes: 14 additions & 0 deletions test/jasmine/tests/scatter_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,20 @@ describe('end-to-end scatter tests', function() {
.catch(failTest)
.then(done);
});

it('should not error out when segment-less marker-less fill traces', function(done) {
Plotly.plot(gd, [{
x: [1, 2, 3, 4],
y: [null, null, null, null],
fill: 'tonexty'
}])
.then(function() {
expect(d3.selectAll('.js-fill').size()).toBe(1, 'js-fill is there');
expect(d3.select('.js-fill').attr('d')).toBe('M0,0Z', 'js-fill has an empty path');
})
.catch(failTest)
.then(done);
});
});

describe('stacked area', function() {
Expand Down