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

Function supplyDefaults

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

Source from the content-addressed store, hash-verified

13var attributes = require('./attributes');
14
15function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
16 function coerce(attr, dflt) {
17 return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
18 }
19
20 var len = handleRThetaDefaults(traceIn, traceOut, layout, coerce);
21 if (!len) {
22 traceOut.visible = false;
23 return;
24 }
25
26 coerce('thetaunit');
27 coerce('mode', len < PTS_LINESONLY ? 'lines+markers' : 'lines');
28 coerce('text');
29 coerce('hovertext');
30 if (traceOut.hoveron !== 'fills') {
31 coerce('hovertemplate');
32 coerce('hovertemplatefallback');
33 }
34
35 if (subTypes.hasMarkers(traceOut)) {
36 handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, { gradient: true });
37 }
38
39 if (subTypes.hasLines(traceOut)) {
40 handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce, { backoff: true });
41 handleLineShapeDefaults(traceIn, traceOut, coerce);
42 coerce('connectgaps');
43 }
44
45 if (subTypes.hasText(traceOut)) {
46 coerce('texttemplate');
47 coerce('texttemplatefallback');
48 handleTextDefaults(traceIn, traceOut, layout, coerce);
49 }
50
51 var dfltHoverOn = [];
52
53 if (subTypes.hasMarkers(traceOut) || subTypes.hasText(traceOut)) {
54 coerce('cliponaxis');
55 coerce('marker.maxdisplayed');
56 dfltHoverOn.push('points');
57 }
58
59 coerce('fill');
60
61 if (traceOut.fill !== 'none') {
62 handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);
63 if (!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);
64 }
65
66 if (traceOut.fill === 'tonext' || traceOut.fill === 'toself') {
67 dfltHoverOn.push('fills');
68 }
69 coerce('hoveron', dfltHoverOn.join('+') || 'points');
70
71 Lib.coerceSelectionMarkerOpacity(traceOut, coerce);
72}

Callers

nothing calls this directly

Calls 4

handleRThetaDefaultsFunction · 0.85
handleMarkerDefaultsFunction · 0.85
coerceFunction · 0.70
handleLineDefaultsFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…