Skip to content

Clip scattercarpet traces with clipPath of ref'ed carpet #3512

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 1 commit into from
Feb 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/traces/scattercarpet/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ module.exports = function plot(gd, plotinfoproxy, data, layer) {
// separately to all scattercarpet traces, but that would require
// lots of reorganization of scatter traces that is otherwise not
// necessary. That makes this a potential optimization.
Drawing.setClipUrl(node, carpet._clipPathId, gd);
Drawing.setClipUrl(node, data[i][0].carpet._clipPathId, gd);
}
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions test/image/mocks/scattercarpet-on-two-carpets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"data": [
{
"type": "carpet",
"a": [ 4, 4, 4, 4.5, 4.5, 4.5, 5, 5, 5, 6, 6, 6 ],
"b": [ 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 ],
"y": [ 2, 3.5, 4, 3, 4.5, 5, 5.5, 6.5, 7.5, 8, 8.5, 10 ],
"aaxis": {
"tickprefix": "a = ",
"ticksuffix": "m",
"smoothing": 1,
"minorgridcount": 9
},
"baxis": {
"tickprefix": "b = ",
"ticksuffix": "Pa",
"smoothing": 1,
"minorgridcount": 9
},
"carpet": "c0"
},
{
"type": "carpet",
"a": [ 4, 4, 4, 4.5, 4.5, 4.5, 5, 5, 5, 6, 6, 6 ],
"b": [ 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 ],
"y": [ 22, 23.5, 24, 23, 24.5, 25, 25.5, 26.5, 27.5, 28, 28.5, 30 ],
"aaxis": {
"tickprefix": "a = ",
"ticksuffix": "m",
"smoothing": 1,
"minorgridcount": 9
},
"baxis": {
"tickprefix": "b = ",
"ticksuffix": "Pa",
"smoothing": 1,
"minorgridcount": 9
},
"carpet": "c1"
},
{
"type": "scattercarpet",
"a": [ 4, 4.5, 5, 6 ],
"b": [ 2.5, 2.5, 2.5, 2.5 ],
"line": {
"shape": "spline",
"smoothing": 1,
"color": "blue"
},
"mode": "lines",
"carpet": "c0"
},
{
"type": "scattercarpet",
"a": [ 4, 4.5, 5, 6 ],
"b": [ 2.5, 2.5, 2.5, 2.5 ],
"line": {
"shape": "spline",
"smoothing": 1,
"color": "red"
},
"mode": "lines",
"carpet": "c1"
}
]
}