MCPcopy Index your code
hub / github.com/plotly/plotly.js / handleLineDefaults

Function handleLineDefaults

src/traces/parcoords/defaults.js:15–31  ·  view source on GitHub ↗
(traceIn, traceOut, defaultColor, layout, coerce)

Source from the content-addressed store, hash-verified

13var mergeLength = require('./merge_length');
14
15function 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
33function dimensionDefaults(dimensionIn, dimensionOut, parentOut, opts) {
34 function coerce(attr, dflt) {

Callers 1

defaults.jsFile · 0.70

Calls 2

hasColorscaleFunction · 0.85
coerceFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…