Skip to content

Commit eba1b4a

Browse files
author
Jon M. Mease
committed
Cleanup line defaults logic
1 parent 2100d96 commit eba1b4a

File tree

4 files changed

+3
-31
lines changed

4 files changed

+3
-31
lines changed

src/traces/parcats/calc.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
var wrap = require('../../lib/gup').wrap;
1414
var hasColorscale = require('../../components/colorscale/has_colorscale');
1515
var colorscaleCalc = require('../../components/colorscale/calc');
16-
var parcatConstants = require('./constants');
1716
var filterUnique = require('../../lib/filter_unique.js');
1817
var Drawing = require('../../components/drawing');
1918
var Lib = require('../../lib');
@@ -101,9 +100,7 @@ module.exports = function calc(gd, trace) {
101100
// Build color generation function
102101
function getMarkerColorInfo(index) {
103102
var value;
104-
if(!line) {
105-
value = parcatConstants.defaultColor;
106-
} else if(Lib.isArrayOrTypedArray(line.color)) {
103+
if(Lib.isArrayOrTypedArray(line.color)) {
107104
value = line.color[index % line.color.length];
108105
} else {
109106
value = line.color;

src/traces/parcats/constants.js

-17
This file was deleted.

src/traces/parcats/defaults.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ var mergeLength = require('../parcoords/merge_length');
1919

2020
function handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce) {
2121

22-
if(traceIn.line) {
23-
coerce('line.shape');
24-
}
25-
22+
coerce('line.shape');
2623
var lineColor = coerce('line.color', defaultColor);
2724
if(hasColorscale(traceIn, 'line') && Lib.isArrayOrTypedArray(lineColor)) {
2825
if(lineColor.length) {

src/traces/parcats/parcats.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -1465,12 +1465,7 @@ function createParcatsViewModel(graphDiv, layout, wrappedParcatsModel) {
14651465

14661466
// Handle path shape
14671467
// -----------------
1468-
var pathShape;
1469-
if(trace.line && trace.line.shape) {
1470-
pathShape = trace.line.shape;
1471-
} else {
1472-
pathShape = 'linear';
1473-
}
1468+
var pathShape = trace.line.shape;
14741469

14751470
// Handle hover info
14761471
// -----------------

0 commit comments

Comments
 (0)