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

Function supplyDefaults

src/traces/funnel/defaults.js:12–66  ·  view source on GitHub ↗
(traceIn, traceOut, defaultColor, layout)

Source from the content-addressed store, hash-verified

10var Color = require('../../components/color');
11
12function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
13 function coerce(attr, dflt) {
14 return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
15 }
16
17 var len = handleXYDefaults(traceIn, traceOut, layout, coerce);
18 if (!len) {
19 traceOut.visible = false;
20 return;
21 }
22
23 handlePeriodDefaults(traceIn, traceOut, layout, coerce);
24 coerce('xhoverformat');
25 coerce('yhoverformat');
26
27 coerce('orientation', traceOut.y && !traceOut.x ? 'v' : 'h');
28 coerce('offset');
29 coerce('width');
30
31 var text = coerce('text');
32
33 coerce('hovertext');
34 coerce('hovertemplate');
35 coerce('hovertemplatefallback');
36
37 var textposition = coerce('textposition');
38 handleText(traceIn, traceOut, layout, coerce, textposition, {
39 moduleHasSelected: false,
40 moduleHasUnselected: false,
41 moduleHasConstrain: true,
42 moduleHasCliponaxis: true,
43 moduleHasTextangle: true,
44 moduleHasInsideanchor: true
45 });
46
47 if (traceOut.textposition !== 'none' && !traceOut.texttemplate) {
48 coerce('textinfo', Lib.isArrayOrTypedArray(text) ? 'text+value' : 'value');
49 }
50
51 var markerColor = coerce('marker.color', defaultColor);
52 coerce('marker.line.color', Color.defaultLine);
53 coerce('marker.line.width');
54
55 var connectorVisible = coerce('connector.visible');
56 if (connectorVisible) {
57 coerce('connector.fillcolor', defaultFillColor(markerColor));
58
59 var connectorLineWidth = coerce('connector.line.width');
60 if (connectorLineWidth) {
61 coerce('connector.line.color');
62 coerce('connector.line.dash');
63 }
64 }
65 coerce('zorder');
66}
67
68function defaultFillColor(markerColor) {
69 var cBase = Lib.isArrayOrTypedArray(markerColor) ? '#000' : markerColor;

Callers

nothing calls this directly

Calls 3

handleTextFunction · 0.85
defaultFillColorFunction · 0.85
coerceFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…