diff --git a/src/components/drawing/index.js b/src/components/drawing/index.js index e4b83300f67..4ea11ea87de 100644 --- a/src/components/drawing/index.js +++ b/src/components/drawing/index.js @@ -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); + } }); }; diff --git a/test/jasmine/tests/scatter_test.js b/test/jasmine/tests/scatter_test.js index d88e1c10351..19dea8d9ffd 100644 --- a/test/jasmine/tests/scatter_test.js +++ b/test/jasmine/tests/scatter_test.js @@ -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() {