Skip to content

Commit

Permalink
Updated Chart.js to 4.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 28, 2024
1 parent d64cbd3 commit 190a34b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.0.6 (unreleased)

- Updated Chart.js to 4.4.2

## 5.0.5 (2023-12-07)

- Updated Chart.js to 4.4.1
Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"rollup": "^3.9.1"
},
"dependencies": {
"chart.js": "4.4.1",
"chart.js": "4.4.2",
"@kurkle/color": "0.3.2",
"chartjs-adapter-date-fns": "3.0.0",
"date-fns": "2.30.0"
Expand Down
6 changes: 3 additions & 3 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import babel from "@rollup/plugin-babel";
import resolve from "@rollup/plugin-node-resolve";

// use same banner as projects
// https://unpkg.com/[email protected].1
// https://unpkg.com/[email protected].2
// https://unpkg.com/@kurkle/[email protected]
// https://unpkg.com/[email protected]
// https://unpkg.com/[email protected] (no banner)
const banner = `/*!
* Chart.js v4.4.1
* Chart.js v4.4.2
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*
* @kurkle/color v0.3.2
Expand Down
27 changes: 17 additions & 10 deletions vendor/assets/javascripts/Chart.bundle.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Chart.js v4.4.1
* Chart.js v4.4.2
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*
* @kurkle/color v0.3.2
Expand Down Expand Up @@ -7825,10 +7825,14 @@
passive: true
} : false;
function addListener(node, type, listener) {
node.addEventListener(type, listener, eventListenerOptions);
if (node) {
node.addEventListener(type, listener, eventListenerOptions);
}
}
function removeListener(chart, type, listener) {
chart.canvas.removeEventListener(type, listener, eventListenerOptions);
if (chart && chart.canvas) {
chart.canvas.removeEventListener(type, listener, eventListenerOptions);
}
}
function fromNativeEvent(event, chart) {
var type = EVENT_TYPES[event.type] || event.type;
Expand Down Expand Up @@ -10465,7 +10469,7 @@
}
return false;
}
var version = "4.4.1";
var version = "4.4.2";
var KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];
function positionIsHorizontal(position, axis) {
return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';
Expand Down Expand Up @@ -14357,20 +14361,23 @@
return false;
}
var i, len;
var x = 0;
var xSet = new Set();
var y = 0;
var count = 0;
for (i = 0, len = items.length; i < len; ++i) {
var el = items[i].element;
if (el && el.hasValue()) {
var pos = el.tooltipPosition();
x += pos.x;
xSet.add(pos.x);
y += pos.y;
++count;
}
}
var xAverage = _toConsumableArray(xSet).reduce(function (a, b) {
return a + b;
}) / xSet.size;
return {
x: x / count,
x: xAverage,
y: y / count
};
},
Expand Down Expand Up @@ -16564,7 +16571,7 @@
}
if (grid.display) {
this.ticks.forEach(function (tick, index) {
if (index !== 0) {
if (index !== 0 || index === 0 && _this41.min < 0) {
offset = _this41.getDistanceFromCenterForValue(tick.value);
var context = _this41.getContext(index);
var optsAtIndex = grid.setContext(context);
Expand Down Expand Up @@ -16617,7 +16624,7 @@
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
this.ticks.forEach(function (tick, index) {
if (index === 0 && !opts.reverse) {
if (index === 0 && _this42.min >= 0 && !opts.reverse) {
return;
}
var optsAtIndex = tickOpts.setContext(_this42.getContext(index));
Expand Down

0 comments on commit 190a34b

Please sign in to comment.