MCPcopy Create free account
hub / github.com/chartjs/Chart.js / scaleClip

Function scaleClip

src/core/core.datasetController.js:12–21  ·  view source on GitHub ↗

* @typedef { import('./core.controller.js').default } Chart * @typedef { import('./core.scale.js').default } Scale

(scale, allowedOverflow)

Source from the content-addressed store, hash-verified

10 */
11
12function scaleClip(scale, allowedOverflow) {
13 const opts = scale && scale.options || {};
14 const reverse = opts.reverse;
15 const min = opts.min === undefined ? allowedOverflow : 0;
16 const max = opts.max === undefined ? allowedOverflow : 0;
17 return {
18 start: reverse ? max : min,
19 end: reverse ? min : max
20 };
21}
22
23function defaultClip(xScale, yScale, allowedOverflow) {
24 if (allowedOverflow === false) {

Callers 1

defaultClipFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected