From 42e7beff809d238c2ce24acb2692c173fff5a754 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 27 Aug 2023 15:29:47 -0700 Subject: [PATCH] Updated Chart.js to 4.4.0 --- CHANGELOG.md | 4 ++++ build/package.json | 2 +- build/rollup.config.js | 4 ++-- vendor/assets/javascripts/Chart.bundle.js | 25 ++++++++++++++--------- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a328db7..f4c2209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/build/package.json b/build/package.json index dedc7cd..eaaeace 100644 --- a/build/package.json +++ b/build/package.json @@ -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" diff --git a/build/rollup.config.js b/build/rollup.config.js index 5bf7ac4..665ed6e 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -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 diff --git a/vendor/assets/javascripts/Chart.bundle.js b/vendor/assets/javascripts/Chart.bundle.js index 27e1440..7a0b50d 100644 --- a/vendor/assets/javascripts/Chart.bundle.js +++ b/vendor/assets/javascripts/Chart.bundle.js @@ -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 @@ -2027,6 +2027,7 @@ reverse: false, beginAtZero: false, bounds: 'ticks', + clip: true, grace: 0, grid: { display: true, @@ -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 @@ -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; @@ -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'; @@ -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) { @@ -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,