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

Function handleLabelsAndValues

src/traces/pie/defaults.js:10–34  ·  view source on GitHub ↗
(labels, values)

Source from the content-addressed store, hash-verified

8var coercePattern = require('../../lib').coercePattern;
9
10function handleLabelsAndValues(labels, values) {
11 var hasLabels = Lib.isArrayOrTypedArray(labels);
12 var hasValues = Lib.isArrayOrTypedArray(values);
13 var len = Math.min(hasLabels ? labels.length : Infinity, hasValues ? values.length : Infinity);
14
15 if (!isFinite(len)) len = 0;
16
17 if (len && hasValues) {
18 var hasPositive;
19 for (var i = 0; i < len; i++) {
20 var v = values[i];
21 if (isNumeric(v) && v > 0) {
22 hasPositive = true;
23 break;
24 }
25 }
26 if (!hasPositive) len = 0;
27 }
28
29 return {
30 hasLabels: hasLabels,
31 hasValues: hasValues,
32 len: len
33 };
34}
35
36function handleMarkerDefaults(traceIn, traceOut, layout, coerce, isPie) {
37 var lineWidth = coerce('marker.line.width');

Callers 2

defaults.jsFile · 0.85
supplyDefaultsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…