Skip to content

Commit d1db299

Browse files
committed
clip scattercarpet traces with clipPath of ref'ed carpet
1 parent 84e24aa commit d1db299

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed

src/traces/scattercarpet/plot.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ module.exports = function plot(gd, plotinfoproxy, data, layer) {
3737
// separately to all scattercarpet traces, but that would require
3838
// lots of reorganization of scatter traces that is otherwise not
3939
// necessary. That makes this a potential optimization.
40-
Drawing.setClipUrl(node, carpet._clipPathId, gd);
40+
Drawing.setClipUrl(node, data[i][0].carpet._clipPathId, gd);
4141
}
4242
};
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"data": [
3+
{
4+
"type": "carpet",
5+
"a": [ 4, 4, 4, 4.5, 4.5, 4.5, 5, 5, 5, 6, 6, 6 ],
6+
"b": [ 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 ],
7+
"y": [ 2, 3.5, 4, 3, 4.5, 5, 5.5, 6.5, 7.5, 8, 8.5, 10 ],
8+
"aaxis": {
9+
"tickprefix": "a = ",
10+
"ticksuffix": "m",
11+
"smoothing": 1,
12+
"minorgridcount": 9
13+
},
14+
"baxis": {
15+
"tickprefix": "b = ",
16+
"ticksuffix": "Pa",
17+
"smoothing": 1,
18+
"minorgridcount": 9
19+
},
20+
"carpet": "c0"
21+
},
22+
{
23+
"type": "carpet",
24+
"a": [ 4, 4, 4, 4.5, 4.5, 4.5, 5, 5, 5, 6, 6, 6 ],
25+
"b": [ 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 ],
26+
"y": [ 22, 23.5, 24, 23, 24.5, 25, 25.5, 26.5, 27.5, 28, 28.5, 30 ],
27+
"aaxis": {
28+
"tickprefix": "a = ",
29+
"ticksuffix": "m",
30+
"smoothing": 1,
31+
"minorgridcount": 9
32+
},
33+
"baxis": {
34+
"tickprefix": "b = ",
35+
"ticksuffix": "Pa",
36+
"smoothing": 1,
37+
"minorgridcount": 9
38+
},
39+
"carpet": "c1"
40+
},
41+
{
42+
"type": "scattercarpet",
43+
"a": [ 4, 4.5, 5, 6 ],
44+
"b": [ 2.5, 2.5, 2.5, 2.5 ],
45+
"line": {
46+
"shape": "spline",
47+
"smoothing": 1,
48+
"color": "blue"
49+
},
50+
"mode": "lines",
51+
"carpet": "c0"
52+
},
53+
{
54+
"type": "scattercarpet",
55+
"a": [ 4, 4.5, 5, 6 ],
56+
"b": [ 2.5, 2.5, 2.5, 2.5 ],
57+
"line": {
58+
"shape": "spline",
59+
"smoothing": 1,
60+
"color": "red"
61+
},
62+
"mode": "lines",
63+
"carpet": "c1"
64+
}
65+
]
66+
}

0 commit comments

Comments
 (0)