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

Function boundVal

src/components/legend/style.js:183–196  ·  view source on GitHub ↗
(attrIn, arrayToValFn, bounds, cst)

Source from the content-addressed store, hash-verified

181 // use d0.trace to infer arrayOk attributes
182
183 function boundVal(attrIn, arrayToValFn, bounds, cst) {
184 var valIn = Lib.nestedProperty(trace, attrIn).get();
185 var valToBound = Lib.isArrayOrTypedArray(valIn) && arrayToValFn ? arrayToValFn(valIn) : valIn;
186
187 if (constantItemSizing && valToBound && cst !== undefined) {
188 valToBound = cst;
189 }
190
191 if (bounds) {
192 if (valToBound < bounds[0]) return bounds[0];
193 else if (valToBound > bounds[1]) return bounds[1];
194 }
195 return valToBound;
196 }
197
198 function pickFirst(array) {
199 if (d0._distinct && d0.index && array[d0.index]) return array[d0.index];

Callers 1

stylePointsFunction · 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…