(traceIn, traceOut, defaultColor, layout, coerce)
| 13 | var mergeLength = require('./merge_length'); |
| 14 | |
| 15 | function handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce) { |
| 16 | var lineColor = coerce('line.color', defaultColor); |
| 17 | |
| 18 | if(hasColorscale(traceIn, 'line') && Lib.isArrayOrTypedArray(lineColor)) { |
| 19 | if(lineColor.length) { |
| 20 | coerce('line.colorscale'); |
| 21 | colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'line.', cLetter: 'c'}); |
| 22 | // TODO: I think it would be better to keep showing lines beyond the last line color |
| 23 | // but I'm not sure what color to give these lines - probably black or white |
| 24 | // depending on the background color? |
| 25 | return lineColor.length; |
| 26 | } else { |
| 27 | traceOut.line.color = defaultColor; |
| 28 | } |
| 29 | } |
| 30 | return Infinity; |
| 31 | } |
| 32 | |
| 33 | function dimensionDefaults(dimensionIn, dimensionOut, parentOut, opts) { |
| 34 | function coerce(attr, dflt) { |
no test coverage detected
searching dependent graphs…