MCPcopy
hub / github.com/chartjs/Chart.js / _decodeFill

Function _decodeFill

src/plugins/plugin.filler/filler.options.js:46–61  ·  view source on GitHub ↗
(line, index, count)

Source from the content-addressed store, hash-verified

44 * @param {number} count
45 */
46export function _decodeFill(line, index, count) {
47 /** @type {string | {value: number}} */
48 const fill = parseFillOption(line);
49
50 if (isObject(fill)) {
51 return isNaN(fill.value) ? false : fill;
52 }
53
54 let target = parseFloat(fill);
55
56 if (isFinite(target) && Math.floor(target) === target) {
57 return decodeTargetIndex(fill[0], index, target, count);
58 }
59
60 return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;
61}
62
63function decodeTargetIndex(firstCh, index, target, count) {
64 if (firstCh === '-' || firstCh === '+') {

Callers 1

afterDatasetsUpdateFunction · 0.90

Calls 3

parseFillOptionFunction · 0.85
isObjectFunction · 0.85
decodeTargetIndexFunction · 0.85

Tested by

no test coverage detected