Skip to content

Fix #3013 - broken stacked area gap insertion case #3017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 17, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix #3013 - inserting new first gap points in previous traces
  • Loading branch information
alexcjohnson committed Sep 15, 2018
commit c602148e7946a5244f5c94fd48e1c16de5351bd0
8 changes: 4 additions & 4 deletions src/traces/scatter/cross_trace_calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ module.exports = function crossTraceCalc(gd, plotinfo) {
}
if(!index) {
// t and trace need to stay on the first cd entry
cd[0].t = cd[1].t;
cd[0].trace = cd[1].trace;
delete cd[1].t;
delete cd[1].trace;
calcTrace[0].t = calcTrace[1].t;
calcTrace[0].trace = calcTrace[1].trace;
delete calcTrace[1].t;
delete calcTrace[1].trace;
}
}

Expand Down
Binary file modified test/image/baselines/stacked_area.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions test/image/mocks/stacked_area.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
{
"data": [
{
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b"
}, {
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m"
}, {
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b"
}, {
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "a", "name": "top", "legendgroup": "t"
},

{
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
"showlegend": false, "xaxis": "x2", "yaxis": "y2"
}, {
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
"showlegend": false, "xaxis": "x2", "yaxis": "y2",
"stackgaps": "interpolate"
}, {
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
"showlegend": false, "xaxis": "x2", "yaxis": "y2"
}, {
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "a", "name": "top", "legendgroup": "t",
"showlegend": false, "xaxis": "x2", "yaxis": "y2"
},

{
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "b", "name": "middle", "legendgroup": "m",
"showlegend": false, "xaxis": "x3", "yaxis": "y3", "mode": "lines+markers"
}, {
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "b", "name": "bottom", "legendgroup": "b",
"showlegend": false, "xaxis": "x3", "yaxis": "y3", "mode": "lines+markers",
"groupnorm": "fraction"
}, {
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "b", "name": "middle", "legendgroup": "m",
"showlegend": false, "xaxis": "x3", "yaxis": "y3", "mode": "lines+markers"
}, {
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "b", "name": "top", "legendgroup": "t",
"showlegend": false, "xaxis": "x3", "yaxis": "y3", "mode": "lines+markers"
},

{
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
"showlegend": false, "xaxis": "x4", "yaxis": "y4", "mode": "lines+markers"
}, {
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
"showlegend": false, "xaxis": "x4", "yaxis": "y4", "mode": "lines+markers",
"stackgaps": "interpolate", "groupnorm": "fraction"
}, {
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
"showlegend": false, "xaxis": "x4", "yaxis": "y4", "mode": "lines+markers"
}, {
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "a", "name": "top", "legendgroup": "t",
"showlegend": false, "xaxis": "x4", "yaxis": "y4", "mode": "lines+markers"
},

{
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
"showlegend": false, "xaxis": "x5", "yaxis": "y5"
}, {
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
"showlegend": false, "xaxis": "x5", "yaxis": "y5"
}, {
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "a", "name": "top", "legendgroup": "t",
Expand All @@ -57,12 +57,12 @@
},

{
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
"showlegend": false, "xaxis": "x6", "yaxis": "y6"
}, {
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
"showlegend": false, "xaxis": "x6", "yaxis": "y6",
"groupnorm": "percent"
}, {
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
"showlegend": false, "xaxis": "x6", "yaxis": "y6"
}, {
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "a", "name": "top", "legendgroup": "t",
"showlegend": false, "xaxis": "x6", "yaxis": "y6",
Expand Down