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

Implement connectGaps #361

Merged
merged 8 commits into from
Apr 1, 2016
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
1 change: 1 addition & 0 deletions devtools/test_dashboard/test_gl3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ plots['marker-arrays'] = require('@mocks/gl3d_marker-arrays.json');
plots['scatter3d-colorscale'] = require('@mocks/gl3d_scatter3d-colorscale.json');
plots['autocolorscale'] = require('@mocks/gl3d_autocolorscale.json');
plots['nan-holes'] = require('@mocks/gl3d_nan-holes.json');
plots['scatter3d-connectgaps'] = require('@mocks/gl3d_scatter3d-connectgaps.json');
plots['tet'] = require('@mocks/gl3d_tet.json');
plots['surface_intensity'] = require('@mocks/gl3d_surface_intensity.json');

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"gl-error2d": "^1.0.0",
"gl-error3d": "^1.0.0",
"gl-line2d": "^1.2.1",
"gl-line3d": "^1.0.1",
"gl-line3d": "^1.1.0",
"gl-mat4": "^1.1.2",
"gl-mesh3d": "^1.0.7",
"gl-plot2d": "^1.1.6",
Expand Down
1 change: 1 addition & 0 deletions src/traces/scatter3d/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ module.exports = {
y: makeProjectionAttr('y'),
z: makeProjectionAttr('z')
},
connectgaps: scatterAttrs.connectgaps,
line: {
color: scatterLineAttrs.color,
width: scatterLineAttrs.width,
Expand Down
3 changes: 2 additions & 1 deletion src/traces/scatter3d/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ proto.update = function(data) {
lineWidth: options.lineWidth || 1,
dashes: dashPattern[0],
dashScale: dashPattern[1],
opacity: data.opacity
opacity: data.opacity,
connectGaps: data.connectgaps
};

if(this.mode.indexOf('lines') !== -1) {
Expand Down
1 change: 1 addition & 0 deletions src/traces/scatter3d/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
coerce('mode');

if(subTypes.hasLines(traceOut)) {
coerce('connectgaps');
handleLineDefaults(traceIn, traceOut, defaultColor, coerce);
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions test/image/mocks/gl3d_scatter3d-connectgaps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"data": [{
"type": "scatter3d",
"mode": "lines",
"x": [0, 0, null, null, 0, 0],
"y": [0, 1, 2, 3, 4, 5],
"z": [2, 1, null, null, 0, 3],
"connectgaps": false,
"name": "gap in z"
}, {
"type": "scatter3d",
"mode": "lines",
"x": [1, 1, 1, 1, 1, 1],
"y": [0, 1, null, null, 4, 5],
"z": [2, 1, 2, 0, 0, 3],
"connectgaps": false,
"name": "gap in y"
},{
"type": "scatter3d",
"mode": "lines",
"x": [2, 2, null, null, 2, 2],
"y": [0, 1, 2, 3, 4, 5],
"z": [2, 1, 2, 0, 0, 3],
"connectgaps": false,
"name": "gap in x"
}],
"layout": {
"title": "connect gaps test"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check that gaps in x and y also work as expected using:

{
  "data": [{
    "type": "scatter3d",
    "mode": "lines",
    "x": [0, 0, null, null, 0, 0],
    "y": [0, 1, 2, 3, 4, 5],
    "z": [2, 1, null, null, 0, 3],
    "connectgaps": false,
    "name": "gap in z"
  }, {
    "type": "scatter3d",
    "mode": "lines",
    "x": [1, 1, 1, 1, 1, 1],
    "y": [0, 1, null, null, 4, 5],
    "z": [2, 1, 2, 0, 0, 3],
    "connectgaps": false,
    "name": "gap in y"
  },{
    "type": "scatter3d",
    "mode": "lines",
    "x": [2, 2, null, null, 2, 2],
    "y": [0, 1, 2, 3, 4, 5],
    "z": [2, 1, 2, 0, 0, 3],
    "connectgaps": false,
    "name": "gap in x"
  }],
  "layout": {
    "title": "connect gaps test",
  }
}

}
}