"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dist/chart.esm.js" between
chart.js-3.0.1.tgz and chart.js-3.0.2.tgz

About: Chart.js offers simple JavaScript charting (HTML5) for designers & developers.

chart.esm.js  (chart.js-3.0.1.tgz):chart.esm.js  (chart.js-3.0.2.tgz)
/*! /*!
* Chart.js v3.0.1 * Chart.js v3.0.2
* https://www.chartjs.org * https://www.chartjs.org
* (c) 2021 Chart.js Contributors * (c) 2021 Chart.js Contributors
* Released under the MIT License * Released under the MIT License
*/ */
import { r as requestAnimFrame, a as resolve, e as effects, c as color, i as isO bject, b as isArray, d as defaults, v as valueOrDefault, u as unlistenArrayEvent s, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as defi ned, s as sign, j as isNullOrUndef, k as clipArea, m as unclipArea, _ as _arrayU nique, t as toRadians, n as toPercentage, o as toDimension, T as TAU, p as forma tNumber, q as _angleBetween, H as HALF_PI, P as PI, w as isNumber, x as _limitVa lue, y as _lookupByKey, z as getRelativePosition$1, A as _isPointInArea, B as _r lookupByKey, C as toPadding, D as each, E as getMaximumSize, F as _getParentNode , G as readUsedSize, I as throttled, J as supportsEventListenerOptions, K as log 10, L as _factorize, M as finiteOrDefault, N as callback, O as toDegrees, Q as _ measureText, R as _int16Range, S as _alignPixel, U as renderText, V as toFont, W as _toLeftRightCenter, X as _alignStartEnd, Y as overrides, Z as merge, $ as _c apitalize, a0 as descriptors, a1 as isFunction, a2 as _attachContext, a3 as _cre ateResolver, a4 as _descriptors, a5 as mergeIf, a6 as uid, a7 as debounce, a8 as retinaScale, a9 as clearCanvas, aa as _elementsEqual, ab as getAngleFromPoint, ac as _updateBezierControlPoints, ad as _computeSegments, ae as _boundSegments, af as _steppedInterpolation, ag as _bezierInterpolation, ah as _pointInLine, ai as _steppedLineTo, aj as _bezierCurveTo, ak as drawPoint, al as toTRBL, am as to TRBLCorners, an as _boundSegment, ao as _normalizeAngle, ap as getRtlAdapter, aq as overrideTextDirection, ar as _textX, as as restoreTextDirection, at as noop, au as distanceBetweenPoints, av as _addGrace, aw as _setMinAndMaxByKey, ax as n iceNum, ay as almostWhole, az as almostEquals, aA as _decimalPlaces, aB as _long estText, aC as _filterBetween, aD as _lookup } from './chunks/helpers.segment.js '; import { r as requestAnimFrame, a as resolve, e as effects, c as color, i as isO bject, b as isArray, d as defaults, v as valueOrDefault, u as unlistenArrayEvent s, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as defi ned, s as sign, j as isNullOrUndef, k as clipArea, m as unclipArea, _ as _arrayU nique, t as toRadians, n as toPercentage, o as toDimension, T as TAU, p as forma tNumber, q as _angleBetween, H as HALF_PI, P as PI, w as isNumber, x as _limitVa lue, y as _lookupByKey, z as getRelativePosition$1, A as _isPointInArea, B as _r lookupByKey, C as toPadding, D as each, E as getMaximumSize, F as _getParentNode , G as readUsedSize, I as throttled, J as supportsEventListenerOptions, K as log 10, L as _factorize, M as finiteOrDefault, N as callback, O as toDegrees, Q as _ measureText, R as _int16Range, S as _alignPixel, U as renderText, V as toFont, W as _toLeftRightCenter, X as _alignStartEnd, Y as overrides, Z as merge, $ as _c apitalize, a0 as descriptors, a1 as isFunction, a2 as _attachContext, a3 as _cre ateResolver, a4 as _descriptors, a5 as mergeIf, a6 as uid, a7 as debounce, a8 as retinaScale, a9 as clearCanvas, aa as _elementsEqual, ab as getAngleFromPoint, ac as _updateBezierControlPoints, ad as _computeSegments, ae as _boundSegments, af as _steppedInterpolation, ag as _bezierInterpolation, ah as _pointInLine, ai as _steppedLineTo, aj as _bezierCurveTo, ak as drawPoint, al as toTRBL, am as to TRBLCorners, an as _boundSegment, ao as _normalizeAngle, ap as getRtlAdapter, aq as overrideTextDirection, ar as _textX, as as restoreTextDirection, at as noop, au as distanceBetweenPoints, av as _addGrace, aw as _setMinAndMaxByKey, ax as n iceNum, ay as almostWhole, az as almostEquals, aA as _decimalPlaces, aB as _long estText, aC as _filterBetween, aD as _lookup } from './chunks/helpers.segment.js ';
export { d as defaults } from './chunks/helpers.segment.js'; export { d as defaults } from './chunks/helpers.segment.js';
class Animator { class Animator {
constructor() { constructor() {
this._request = null; this._request = null;
skipping to change at line 4983 skipping to change at line 4983
const {isScriptable, isIndexable} = _descriptors(proxy); const {isScriptable, isIndexable} = _descriptors(proxy);
for (const prop of names) { for (const prop of names) {
if ((isScriptable(prop) && isFunction(proxy[prop])) if ((isScriptable(prop) && isFunction(proxy[prop]))
|| (isIndexable(prop) && isArray(proxy[prop]))) { || (isIndexable(prop) && isArray(proxy[prop]))) {
return true; return true;
} }
} }
return false; return false;
} }
var version = "3.0.1"; var version = "3.0.2";
const KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea']; const KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];
function positionIsHorizontal(position, axis) { function positionIsHorizontal(position, axis) {
return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf (position) === -1 && axis === 'x'); return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf (position) === -1 && axis === 'x');
} }
function compare2Level(l1, l2) { function compare2Level(l1, l2) {
return function(a, b) { return function(a, b) {
return a[l1] === b[l1] return a[l1] === b[l1]
? a[l2] - b[l2] ? a[l2] - b[l2]
: a[l1] - b[l1]; : a[l1] - b[l1];
skipping to change at line 6577 skipping to change at line 6577
} }
decimated.push(point); decimated.push(point);
prevX = truncX; prevX = truncX;
countX = 0; countX = 0;
minY = maxY = y; minY = maxY = y;
minIndex = maxIndex = startIndex = i; minIndex = maxIndex = startIndex = i;
} }
} }
return decimated; return decimated;
} }
function cleanDecimatedData(chart) {
chart.data.datasets.forEach((dataset) => {
if (dataset._decimated) {
const data = dataset._data;
delete dataset._decimated;
delete dataset._data;
Object.defineProperty(dataset, 'data', {value: data});
}
});
}
var plugin_decimation = { var plugin_decimation = {
id: 'decimation', id: 'decimation',
defaults: { defaults: {
algorithm: 'min-max', algorithm: 'min-max',
enabled: false, enabled: false,
}, },
beforeElementsUpdate: (chart, args, options) => { beforeElementsUpdate: (chart, args, options) => {
if (!options.enabled) { if (!options.enabled) {
cleanDecimatedData(chart);
return; return;
} }
const availableWidth = chart.width; const availableWidth = chart.width;
chart.data.datasets.forEach((dataset, datasetIndex) => { chart.data.datasets.forEach((dataset, datasetIndex) => {
const {_data, indexAxis} = dataset; const {_data, indexAxis} = dataset;
const meta = chart.getDatasetMeta(datasetIndex); const meta = chart.getDatasetMeta(datasetIndex);
const data = _data || dataset.data; const data = _data || dataset.data;
if (resolve([indexAxis, chart.options.indexAxis]) === 'y') { if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {
return; return;
} }
skipping to change at line 6637 skipping to change at line 6648
case 'min-max': case 'min-max':
decimated = minMaxDecimation(data, availableWidth); decimated = minMaxDecimation(data, availableWidth);
break; break;
default: default:
throw new Error(`Unsupported decimation algorithm '${options.algorithm}' `); throw new Error(`Unsupported decimation algorithm '${options.algorithm}' `);
} }
dataset._decimated = decimated; dataset._decimated = decimated;
}); });
}, },
destroy(chart) { destroy(chart) {
chart.data.datasets.forEach((dataset) => { cleanDecimatedData(chart);
if (dataset._decimated) {
const data = dataset._data;
delete dataset._decimated;
delete dataset._data;
Object.defineProperty(dataset, 'data', {value: data});
}
});
} }
}; };
function getLineByIndex(chart, index) { function getLineByIndex(chart, index) {
const meta = chart.getDatasetMeta(index); const meta = chart.getDatasetMeta(index);
const visible = meta && chart.isDatasetVisible(index); const visible = meta && chart.isDatasetVisible(index);
return visible ? meta.dataset : null; return visible ? meta.dataset : null;
} }
function parseFillOption(line) { function parseFillOption(line) {
const options = line.options; const options = line.options;
skipping to change at line 8777 skipping to change at line 8781
} else { } else {
numSpaces = Math.ceil(numSpaces); numSpaces = Math.ceil(numSpaces);
} }
} }
factor = Math.pow(10, isNullOrUndef(precision) ? _decimalPlaces(spacing) : pre cision); factor = Math.pow(10, isNullOrUndef(precision) ? _decimalPlaces(spacing) : pre cision);
niceMin = Math.round(niceMin * factor) / factor; niceMin = Math.round(niceMin * factor) / factor;
niceMax = Math.round(niceMax * factor) / factor; niceMax = Math.round(niceMax * factor) / factor;
let j = 0; let j = 0;
if (minDefined) { if (minDefined) {
ticks.push({value: min}); ticks.push({value: min});
if (niceMin < min) { if (niceMin <= min) {
j++; j++;
} }
if (almostWhole(Math.round((niceMin + j * spacing) * factor) / factor / min, spacing / 1000)) { if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, spacing / 10)) {
j++; j++;
} }
} }
for (; j < numSpaces; ++j) { for (; j < numSpaces; ++j) {
ticks.push({value: Math.round((niceMin + j * spacing) * factor) / factor}); ticks.push({value: Math.round((niceMin + j * spacing) * factor) / factor});
} }
if (maxDefined) { if (maxDefined) {
if (almostWhole(ticks[ticks.length - 1].value / max, spacing / 1000)) { if (almostEquals(ticks[ticks.length - 1].value, max, spacing / 10)) {
ticks[ticks.length - 1].value = max; ticks[ticks.length - 1].value = max;
} else { } else {
ticks.push({value: max}); ticks.push({value: max});
} }
} else { } else {
ticks.push({value: niceMax}); ticks.push({value: niceMax});
} }
return ticks; return ticks;
} }
class LinearScaleBase extends Scale { class LinearScaleBase extends Scale {
skipping to change at line 9055 skipping to change at line 9059
const start = me.min; const start = me.min;
super.configure(); super.configure();
me._startValue = log10(start); me._startValue = log10(start);
me._valueRange = log10(me.max) - log10(start); me._valueRange = log10(me.max) - log10(start);
} }
getPixelForValue(value) { getPixelForValue(value) {
const me = this; const me = this;
if (value === undefined || value === 0) { if (value === undefined || value === 0) {
value = me.min; value = me.min;
} }
if (value === null || isNaN(value)) {
return NaN;
}
return me.getPixelForDecimal(value === me.min return me.getPixelForDecimal(value === me.min
? 0 ? 0
: (log10(value) - me._startValue) / me._valueRange); : (log10(value) - me._startValue) / me._valueRange);
} }
getValueForPixel(pixel) { getValueForPixel(pixel) {
const me = this; const me = this;
const decimal = me.getDecimalForPixel(pixel); const decimal = me.getDecimalForPixel(pixel);
return Math.pow(10, me._startValue + decimal * me._valueRange); return Math.pow(10, me._startValue + decimal * me._valueRange);
} }
} }
 End of changes. 9 change blocks. 
13 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)