Skip to content

Commit

Permalink
Updated Chart.js to 4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Aug 27, 2023
1 parent 1da54f8 commit 42e7bef
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 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.4 (unreleased)

- Updated Chart.js to 4.4.0

## 5.0.3 (2023-07-24)

- Updated Chart.js to 4.3.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.3.1",
"chart.js": "4.4.0",
"@kurkle/color": "0.3.2",
"chartjs-adapter-date-fns": "3.0.0",
"date-fns": "2.30.0"
Expand Down
4 changes: 2 additions & 2 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import babel from "@rollup/plugin-babel";
import resolve from "@rollup/plugin-node-resolve";

// use same banner as projects
// https://unpkg.com/chart.js@4.3.1
// https://unpkg.com/chart.js@4.4.0
// https://unpkg.com/@kurkle/color@0.3.2
// https://unpkg.com/chartjs-adapter-date-fns@3.0.0
// https://unpkg.com/date-fns@2.30.0 (no banner)
const banner = `/*!
* Chart.js v4.3.1
* Chart.js v4.4.0
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
Expand Down
25 changes: 15 additions & 10 deletions vendor/assets/javascripts/Chart.bundle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Chart.js v4.3.1
* Chart.js v4.4.0
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
Expand Down Expand Up @@ -2027,6 +2027,7 @@
reverse: false,
beginAtZero: false,
bounds: 'ticks',
clip: true,
grace: 0,
grid: {
display: true,
Expand Down Expand Up @@ -2609,7 +2610,7 @@
h = rect.h,
radius = rect.radius;
// top left arc
ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, -HALF_PI, PI, true);
ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);
// line from top left to bottom left
ctx.lineTo(x, y + h - radius.bottomLeft);
// bottom left arc
Expand Down Expand Up @@ -6476,7 +6477,7 @@
line._chart = this.chart;
line._datasetIndex = this.index;
line._decimated = !!_dataset._decimated;
line.points = points.slice(Math.max(this._drawStart - 1, 0), this._drawStart + this._drawCount);
line.points = points;
var options = this.resolveDatasetElementOptions(mode);
if (!this.options.showLine) {
options.borderWidth = 0;
Expand Down Expand Up @@ -10459,7 +10460,7 @@
}
return false;
}
var version = "4.3.1";
var version = "4.4.0";
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 @@ -10521,17 +10522,21 @@
}
return e;
}
function getDatasetArea(meta) {
function getSizeForArea(scale, chartArea, field) {
return scale.options.clip ? scale[field] : chartArea[field];
}
function getDatasetArea(meta, chartArea) {
var xScale = meta.xScale,
yScale = meta.yScale;
if (xScale && yScale) {
return {
left: xScale.left,
right: xScale.right,
top: yScale.top,
bottom: yScale.bottom
left: getSizeForArea(xScale, chartArea, 'left'),
right: getSizeForArea(xScale, chartArea, 'right'),
top: getSizeForArea(yScale, chartArea, 'top'),
bottom: getSizeForArea(yScale, chartArea, 'bottom')
};
}
return chartArea;
}
var Chart = /*#__PURE__*/function () {
function Chart(item, userConfig) {
Expand Down Expand Up @@ -11124,7 +11129,7 @@
var ctx = this.ctx;
var clip = meta._clip;
var useClip = !clip.disabled;
var area = getDatasetArea(meta) || this.chartArea;
var area = getDatasetArea(meta, this.chartArea);
var args = {
meta: meta,
index: meta.index,
Expand Down

0 comments on commit 42e7bef

Please sign in to comment.