Skip to content

Commit c602148

Browse files
committed
fix #3013 - inserting new first gap points in previous traces
1 parent e545415 commit c602148

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

src/traces/scatter/cross_trace_calc.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ module.exports = function crossTraceCalc(gd, plotinfo) {
5757
}
5858
if(!index) {
5959
// t and trace need to stay on the first cd entry
60-
cd[0].t = cd[1].t;
61-
cd[0].trace = cd[1].trace;
62-
delete cd[1].t;
63-
delete cd[1].trace;
60+
calcTrace[0].t = calcTrace[1].t;
61+
calcTrace[0].trace = calcTrace[1].trace;
62+
delete calcTrace[1].t;
63+
delete calcTrace[1].trace;
6464
}
6565
}
6666

test/image/baselines/stacked_area.png

-2.54 KB
Loading

test/image/mocks/stacked_area.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
{
22
"data": [
33
{
4-
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b"
5-
}, {
64
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m"
5+
}, {
6+
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b"
77
}, {
88
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "a", "name": "top", "legendgroup": "t"
99
},
1010

1111
{
12+
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
13+
"showlegend": false, "xaxis": "x2", "yaxis": "y2"
14+
}, {
1215
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
1316
"showlegend": false, "xaxis": "x2", "yaxis": "y2",
1417
"stackgaps": "interpolate"
15-
}, {
16-
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
17-
"showlegend": false, "xaxis": "x2", "yaxis": "y2"
1818
}, {
1919
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "a", "name": "top", "legendgroup": "t",
2020
"showlegend": false, "xaxis": "x2", "yaxis": "y2"
2121
},
2222

2323
{
24+
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "b", "name": "middle", "legendgroup": "m",
25+
"showlegend": false, "xaxis": "x3", "yaxis": "y3", "mode": "lines+markers"
26+
}, {
2427
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "b", "name": "bottom", "legendgroup": "b",
2528
"showlegend": false, "xaxis": "x3", "yaxis": "y3", "mode": "lines+markers",
2629
"groupnorm": "fraction"
27-
}, {
28-
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "b", "name": "middle", "legendgroup": "m",
29-
"showlegend": false, "xaxis": "x3", "yaxis": "y3", "mode": "lines+markers"
3030
}, {
3131
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "b", "name": "top", "legendgroup": "t",
3232
"showlegend": false, "xaxis": "x3", "yaxis": "y3", "mode": "lines+markers"
3333
},
3434

3535
{
36-
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
37-
"showlegend": false, "xaxis": "x4", "yaxis": "y4", "mode": "lines+markers"
38-
}, {
3936
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
4037
"showlegend": false, "xaxis": "x4", "yaxis": "y4", "mode": "lines+markers",
4138
"stackgaps": "interpolate", "groupnorm": "fraction"
39+
}, {
40+
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
41+
"showlegend": false, "xaxis": "x4", "yaxis": "y4", "mode": "lines+markers"
4242
}, {
4343
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "a", "name": "top", "legendgroup": "t",
4444
"showlegend": false, "xaxis": "x4", "yaxis": "y4", "mode": "lines+markers"
4545
},
4646

4747
{
48-
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
48+
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
4949
"showlegend": false, "xaxis": "x5", "yaxis": "y5"
5050
}, {
51-
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
51+
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
5252
"showlegend": false, "xaxis": "x5", "yaxis": "y5"
5353
}, {
5454
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "a", "name": "top", "legendgroup": "t",
@@ -57,12 +57,12 @@
5757
},
5858

5959
{
60+
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
61+
"showlegend": false, "xaxis": "x6", "yaxis": "y6"
62+
}, {
6063
"x": [1, 3, 5, 7], "y": [2, 6, 4, 5], "line": {"color": "red"}, "stackgroup": "a", "name": "bottom", "legendgroup": "b",
6164
"showlegend": false, "xaxis": "x6", "yaxis": "y6",
6265
"groupnorm": "percent"
63-
}, {
64-
"x": [2, 5, 6], "y": [1, 3, 4], "line": {"color": "green"}, "stackgroup": "a", "name": "middle", "legendgroup": "m",
65-
"showlegend": false, "xaxis": "x6", "yaxis": "y6"
6666
}, {
6767
"x": [3, 4 ,5], "y": [1, 2, 1], "line": {"color": "blue"}, "stackgroup": "a", "name": "top", "legendgroup": "t",
6868
"showlegend": false, "xaxis": "x6", "yaxis": "y6",

0 commit comments

Comments
 (0)