Skip to content

Commit ef83a6b

Browse files
committed
#581 fixing up line coloring
1 parent 901fd24 commit ef83a6b

5 files changed

+26
-19
lines changed

src/traces/scatter/line_defaults.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**
2-
* Copyright 2012-2016, Plotly, Inc.
3-
* All rights reserved.
4-
*
5-
* This source code is licensed under the MIT license found in the
6-
* LICENSE file in the root directory of this source tree.
7-
*/
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
88

99

1010
'use strict';
@@ -18,6 +18,9 @@ module.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout,
1818

1919
var markerColor = (traceIn.marker || {}).color;
2020

21+
//if(traceIn.line) defaultColor = markerColor;
22+
23+
coerce('line.color', defaultColor);
2124
if(hasColorscale(traceIn, 'line')) {
2225
colorscaleDefaults(
2326
traceIn, traceOut, layout, coerce, {prefix: 'line.', cLetter: 'c'}
Loading
487 Bytes
Loading

test/image/mocks/gl3d_scatter-color-palette-with-default-marker.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
"x":[-4,-3,-2,-1,0,1,2,3,4,5,6],
44
"y":[7,5,6,4,2,3,1,3,-1,-4,-2],
55
"z":[2,3,4,5,4,3,2,1,0,-1,-2],
6-
"mode": "lines+markers",
7-
"marker": {
8-
"size": 5,
6+
"mode": "lines",
7+
"line": {
8+
"width": 10,
99
"colorscale": "Viridis",
10-
"color": [1,2,3,4,5,6,7,8,9,10]
10+
"color": [1,2,3,4,5,6,7,8,9,10],
11+
"cmin": 1,
12+
"cmax": 10
1113
},
1214
"type":"scatter3d"
1315
}],

test/jasmine/tests/gl_plot_interact_basic_test.js

+11-9
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,22 @@ describe('gl3d plots', function() {
6464
gd = createGraphDiv();
6565
});
6666

67-
afterEach(function() {
67+
afterEach(function() {return
6868
Plotly.purge(gd);
6969
destroyGraphDiv();
7070
});
7171

72-
it('should respond to drag interactions with mock of unset camera', function(done) {
73-
testEvents(makePlot(gd, require('@mocks/gl3d_scatter3d-connectgaps.json')))
74-
.then(null, failTest) // current linter balks on .catch with 'dot-notation'; fixme a linter
75-
.then(done);
76-
});
72+
fit('should respond to drag interactions with mock of partially set camera', function(done) {
73+
74+
var mock = require('@mocks/gl3d_scatter-color-palette-with-default-marker.json')
7775

78-
it('should respond to drag interactions with mock of partially set camera', function(done) {
79-
testEvents(makePlot(gd, require('@mocks/gl3d_errorbars_zx.json')))
80-
.then(null, failTest)
76+
var data = mock.data
77+
var s = data[0]
78+
79+
var layout = mock.layout
80+
81+
Plotly.plot(gd, data, layout)
8182
.then(done);
8283
});
84+
8385
});

0 commit comments

Comments
 (0)