Skip to content

Commit

Permalink
test duplicate position stacking
Browse files Browse the repository at this point in the history
and remove error check added just for debugging during dev
  • Loading branch information
alexcjohnson committed Sep 4, 2018
1 parent be38e93 commit 8547cf8
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/traces/scatter/cross_trace_calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Binary file added test/image/baselines/stacked_area_duplicates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions test/image/mocks/stacked_area_duplicates.json
Original file line number Diff line number Diff line change
@@ -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"}
}
}

0 comments on commit 8547cf8

Please sign in to comment.