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

Function computeCircularBoundary

src/plugins/plugin.filler/filler.target.js:73–94  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

71}
72
73function computeCircularBoundary(source) {
74 const {scale, fill} = source;
75 const options = scale.options;
76 const length = scale.getLabels().length;
77 const start = options.reverse ? scale.max : scale.min;
78 const value = _getTargetValue(fill, scale, start);
79 const target = [];
80
81 if (options.grid.circular) {
82 const center = scale.getPointPositionForValue(0, start);
83 return new simpleArc({
84 x: center.x,
85 y: center.y,
86 radius: scale.getDistanceFromCenterForValue(value)
87 });
88 }
89
90 for (let i = 0; i < length; ++i) {
91 target.push(scale.getPointPositionForValue(i, value));
92 }
93 return target;
94}
95

Callers 1

computeBoundaryFunction · 0.85

Calls 4

_getTargetValueFunction · 0.90
getLabelsMethod · 0.65

Tested by

no test coverage detected