Skip to content

Commit

Permalink
Cleanup line defaults logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon M. Mease committed Sep 28, 2018
1 parent 2100d96 commit eba1b4a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 31 deletions.
5 changes: 1 addition & 4 deletions src/traces/parcats/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
var wrap = require('../../lib/gup').wrap;
var hasColorscale = require('../../components/colorscale/has_colorscale');
var colorscaleCalc = require('../../components/colorscale/calc');
var parcatConstants = require('./constants');
var filterUnique = require('../../lib/filter_unique.js');
var Drawing = require('../../components/drawing');
var Lib = require('../../lib');
Expand Down Expand Up @@ -101,9 +100,7 @@ module.exports = function calc(gd, trace) {
// Build color generation function
function getMarkerColorInfo(index) {
var value;
if(!line) {
value = parcatConstants.defaultColor;
} else if(Lib.isArrayOrTypedArray(line.color)) {
if(Lib.isArrayOrTypedArray(line.color)) {
value = line.color[index % line.color.length];
} else {
value = line.color;
Expand Down
17 changes: 0 additions & 17 deletions src/traces/parcats/constants.js

This file was deleted.

5 changes: 1 addition & 4 deletions src/traces/parcats/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ var mergeLength = require('../parcoords/merge_length');

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

if(traceIn.line) {
coerce('line.shape');
}

coerce('line.shape');
var lineColor = coerce('line.color', defaultColor);
if(hasColorscale(traceIn, 'line') && Lib.isArrayOrTypedArray(lineColor)) {
if(lineColor.length) {
Expand Down
7 changes: 1 addition & 6 deletions src/traces/parcats/parcats.js
Original file line number Diff line number Diff line change
Expand Up @@ -1465,12 +1465,7 @@ function createParcatsViewModel(graphDiv, layout, wrappedParcatsModel) {

// Handle path shape
// -----------------
var pathShape;
if(trace.line && trace.line.shape) {
pathShape = trace.line.shape;
} else {
pathShape = 'linear';
}
var pathShape = trace.line.shape;

// Handle hover info
// -----------------
Expand Down

0 comments on commit eba1b4a

Please sign in to comment.