Skip to content

Commit 08eee28

Browse files
committed
Update chart.js. Resolves #86
1 parent 3515380 commit 08eee28

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/Chartjs/Resources/assets/dist/controller.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ exports["default"] = void 0;
1717

1818
var _stimulus = require("stimulus");
1919

20-
var _chart = require("chart.js");
20+
var _auto = _interopRequireDefault(require("chart.js/auto"));
21+
22+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
2123

2224
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2325

@@ -35,7 +37,7 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
3537

3638
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3739

38-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
40+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3941

4042
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
4143

@@ -63,7 +65,7 @@ var _default = /*#__PURE__*/function (_Controller) {
6365
options: payload.options
6466
});
6567

66-
var chart = new _chart.Chart(this.element.getContext('2d'), payload);
68+
var chart = new _auto["default"](this.element.getContext('2d'), payload);
6769

6870
this._dispatchEvent('chartjs:connect', {
6971
chart: chart

src/Chartjs/Resources/assets/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"lint": "eslint src test"
2020
},
2121
"peerDependencies": {
22-
"chart.js": "^2.9.4",
22+
"chart.js": "^3.4.1",
2323
"stimulus": "^2.0.0"
2424
},
2525
"devDependencies": {
@@ -28,7 +28,7 @@
2828
"@babel/plugin-proposal-class-properties": "^7.12.1",
2929
"@babel/preset-env": "^7.12.7",
3030
"@symfony/stimulus-testing": "^1.1.0",
31-
"chart.js": "^2.9.4",
31+
"chart.js": "^3.4.1",
3232
"jest-canvas-mock": "^2.3.0",
3333
"stimulus": "^2.0.0"
3434
},

src/Chartjs/Resources/assets/src/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'use strict';
1111

1212
import { Controller } from 'stimulus';
13-
import { Chart } from 'chart.js';
13+
import Chart from 'chart.js/auto';
1414

1515
export default class extends Controller {
1616
connect() {

0 commit comments

Comments
 (0)