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

Function supplyDefaults

src/traces/waterfall/defaults.js:23–81  ·  view source on GitHub ↗
(traceIn, traceOut, defaultColor, layout)

Source from the content-addressed store, hash-verified

21}
22
23function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
24 function coerce(attr, dflt) {
25 return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
26 }
27
28 var len = handleXYDefaults(traceIn, traceOut, layout, coerce);
29 if (!len) {
30 traceOut.visible = false;
31 return;
32 }
33
34 handlePeriodDefaults(traceIn, traceOut, layout, coerce);
35 coerce('xhoverformat');
36 coerce('yhoverformat');
37
38 coerce('measure');
39
40 coerce('orientation', traceOut.x && !traceOut.y ? 'h' : 'v');
41 coerce('base');
42 coerce('offset');
43 coerce('width');
44
45 coerce('text');
46
47 coerce('hovertext');
48 coerce('hovertemplate');
49 coerce('hovertemplatefallback');
50
51 var textposition = coerce('textposition');
52 handleText(traceIn, traceOut, layout, coerce, textposition, {
53 moduleHasSelected: false,
54 moduleHasUnselected: false,
55 moduleHasConstrain: true,
56 moduleHasCliponaxis: true,
57 moduleHasTextangle: true,
58 moduleHasInsideanchor: true
59 });
60
61 if (traceOut.textposition !== 'none') {
62 coerce('texttemplate');
63 coerce('texttemplatefallback');
64 if (!traceOut.texttemplate) coerce('textinfo');
65 }
66
67 handleDirection(coerce, 'increasing', INCREASING_COLOR);
68 handleDirection(coerce, 'decreasing', DECREASING_COLOR);
69 handleDirection(coerce, 'totals', TOTALS_COLOR);
70
71 var connectorVisible = coerce('connector.visible');
72 if (connectorVisible) {
73 coerce('connector.mode');
74 var connectorLineWidth = coerce('connector.line.width');
75 if (connectorLineWidth) {
76 coerce('connector.line.color');
77 coerce('connector.line.dash');
78 }
79 }
80 coerce('zorder');

Callers

nothing calls this directly

Calls 3

handleTextFunction · 0.85
coerceFunction · 0.70
handleDirectionFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…