diff --git a/src/traces/scatter/cross_trace_calc.js b/src/traces/scatter/cross_trace_calc.js index 4bff13e0e5f..64db8eaad7d 100644 --- a/src/traces/scatter/cross_trace_calc.js +++ b/src/traces/scatter/cross_trace_calc.js @@ -136,10 +136,6 @@ module.exports = function crossTraceCalc(gd, plotinfo) { sumj = cd0[j][valAttr] = cd0[j].s; for(i = 1; i < indices.length; i++) { cd = calcTraces[indices[i]]; - if(cd.length !== serieslen) { - // TODO: verify this never happens and remove - throw new Error('length mismatch!'); - } cd[0].trace._rawLength = cd[0].trace._length; cd[0].trace._length = serieslen; sumj += cd[j].s; diff --git a/test/image/baselines/stacked_area_duplicates.png b/test/image/baselines/stacked_area_duplicates.png new file mode 100644 index 00000000000..3b35f75ba3c Binary files /dev/null and b/test/image/baselines/stacked_area_duplicates.png differ diff --git a/test/image/mocks/stacked_area_duplicates.json b/test/image/mocks/stacked_area_duplicates.json new file mode 100644 index 00000000000..1f013ba231f --- /dev/null +++ b/test/image/mocks/stacked_area_duplicates.json @@ -0,0 +1,42 @@ +{ + "data": [ + { + "x": [1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 6, 8], + "y": [1, 3, 2, 5, 4, 5, 4, 3, 2, 4, 6, 3, 5, 4, 3], + "stackgroup": "a", "mode": "lines+markers" + }, { + "x": [1, 2, 2, 2, 2, 3, 5, 5, 5, 5, 6, 6, 6, 6, 8], + "y": [4, 4, 4, 4, 6, 5, 6, 5, 7, 6, 5, 6, 7, 8, 7], + "stackgroup": "a", "mode": "lines+markers" + }, { + "x": [2, 2, 2, 2, 3, 4, 4, 4, 4, 5, 7, 7, 7, 7, 8], + "y": [5, 5, 4, 5, 6, 7, 6, 5, 4, 5, 4, 5, 6, 3, 4], + "stackgroup": "a", "mode": "lines+markers" + }, + + { + "x": [1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 6, 8], + "y": [1, 3, 2, 5, 4, 5, 4, 3, 2, 4, 6, 3, 5, 4, 3], + "stackgroup": "a", "mode": "lines+markers", + "xaxis": "x2", "yaxis": "y2", "stackgaps": "interpolate" + }, { + "x": [1, 2, 2, 2, 2, 3, 5, 5, 5, 5, 6, 6, 6, 6, 8], + "y": [4, 4, 4, 4, 6, 5, 6, 5, 7, 6, 5, 6, 7, 8, 7], + "stackgroup": "a", "mode": "lines+markers", + "xaxis": "x2", "yaxis": "y2", "stackgaps": "interpolate" + }, { + "x": [2, 2, 2, 2, 3, 4, 4, 4, 4, 5, 7, 7, 7, 7, 8], + "y": [5, 5, 4, 5, 6, 7, 6, 5, 4, 5, 4, 5, 6, 3, 4], + "stackgroup": "a", "mode": "lines+markers", + "xaxis": "x2", "yaxis": "y2", "stackgaps": "interpolate" + } + ], + "layout": { + "width": 500, + "height": 500, + "title": "Duplicate positions", + "xaxis": {"title": "infer zero"}, + "xaxis2": {"title": "interpolate"}, + "grid": {"columns": 1, "rows": 2, "pattern": "independent"} + } +}