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

Function updateLimits

src/scales/scale.radialLinear.js:118–137  ·  view source on GitHub ↗
(limits, orig, angle, hLimits, vLimits)

Source from the content-addressed store, hash-verified

116}
117
118function updateLimits(limits, orig, angle, hLimits, vLimits) {
119 const sin = Math.abs(Math.sin(angle));
120 const cos = Math.abs(Math.cos(angle));
121 let x = 0;
122 let y = 0;
123 if (hLimits.start < orig.l) {
124 x = (orig.l - hLimits.start) / sin;
125 limits.l = Math.min(limits.l, orig.l - x);
126 } else if (hLimits.end > orig.r) {
127 x = (hLimits.end - orig.r) / sin;
128 limits.r = Math.max(limits.r, orig.r + x);
129 }
130 if (vLimits.start < orig.t) {
131 y = (orig.t - vLimits.start) / cos;
132 limits.t = Math.min(limits.t, orig.t - y);
133 } else if (vLimits.end > orig.b) {
134 y = (vLimits.end - orig.b) / cos;
135 limits.b = Math.max(limits.b, orig.b + y);
136 }
137}
138
139function createPointLabelItem(scale, index, itemOpts) {
140 const outerDistance = scale.drawingArea;

Callers 1

fitWithPointLabelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected