Skip to content
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

Fix scattergl missing lines after non-line trace #2990

Merged
merged 3 commits into from
Sep 11, 2018
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
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"gl-streamtube3d": "^1.0.0",
"gl-surface3d": "^1.3.5",
"gl-text": "^1.1.6",
"glslify": "^6.2.1",
"glslify": "^6.3.1",
"has-hover": "^1.0.1",
"has-passive-events": "^1.0.0",
"mapbox-gl": "0.45.0",
Expand All @@ -101,7 +101,7 @@
"polybooljs": "^1.2.0",
"regl": "^1.3.7",
"regl-error2d": "^2.0.5",
"regl-line2d": "^3.0.9",
"regl-line2d": "^3.0.11",
"regl-scatter2d": "^3.0.6",
"regl-splom": "^1.0.4",
"right-now": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/traces/scattergl/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ function plot(gd, subplot, cdata) {
if(scene.fill2d) {
scene.fillOptions = scene.fillOptions.map(function(fillOptions, i) {
var cdscatter = cdata[i];
if(!fillOptions || !cdscatter || !cdscatter[0] || !cdscatter[0].trace) return null;
if(!fillOptions || !cdscatter || !cdscatter[0] || !cdscatter[0].trace) return;
var cd = cdscatter[0];
var trace = cd.trace;
var stash = cd.t;
Expand Down
Binary file added test/image/baselines/gl2d_fill-ordering.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_text_chart_basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_text_chart_single-string.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions test/image/mocks/gl2d_fill-ordering.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"data": [
{
"x": [1, 2, 3, 4, 5, 6],
"y": [100, 100, 0, 0, 0, 0],
"fill": "tozeroy",
"type": "scattergl"
},
{
"x": [1, 2, 3, 4, 5, 6],
"y": [0, 0, 0, 100, 100, 0],
"fill": "tozeroy",
"type": "scattergl",
"mode": "none"
},
{
"x": [1, 2, 3, 4, 5, 6],
"y": [99, 99, 99, 100, 100, 100],
"type": "scattergl",
"mode": "lines+markers"
},
{
"x": [1, 2, 3, 4, 5, 6],
"y": [0, 0, 0, null, 50, 50],
"fill": "tozeroy",
"type": "scattergl",
"mode": "none"
},
{
"x": [1, 2, 3, 4, 5, 6],
"y": [100, 0, 0, 0, 0, 100],
"type": "scattergl",
"mode": "lines+markers"
}
],
"layout": {
"margin": {"l": 40, "r": 50, "b": 80, "t": 40},
"legend": {"orientation": "h", "x": "0.5", "xanchor": "center"}
}
}