chartkick 5.0.7 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8ea7295b63b2df96ea5fe08f39797968f690402e3aa586427ed2c0f62bcf5c9
4
- data.tar.gz: d30b2dbba45bf08b834f1cee99d53dd620bfbc21d9c6fc4382057b06b69daf5b
3
+ metadata.gz: d5ac461e695511a2f9d8ef5dbcb60ddfb451bc6eb1da80db82af9de2f18ce377
4
+ data.tar.gz: a06858d0d5a6380f0422ebcb31654741791f20fa517d6ad97a3cc2e5d8348133
5
5
  SHA512:
6
- metadata.gz: 2b74e4dcbf80c7f03985f879738731b54aec995ea18b2bcfd2cf4c14865dff05a34f7cb316741099834bb92f90d4df8aa3b59a7831d2e2812a0a08a4661f7566
7
- data.tar.gz: be96958ccf4735188db8372b5b4b9762ae6f2d48620c237ff84179e3a8d38a7dc2f077ed197cf5656b2450f6862ec59d7149b2ff0f46f8c72a578333a42fcb1c
6
+ metadata.gz: 16b1eca3fd6d1c0d716c509632d35a093ecd41135d1b55be968a103d6aa8a92555ef7b9f2b86d324bbbf2967223c93355999439ca3f4c131e29cf4e49c78421a
7
+ data.tar.gz: 401394b301c1fd783f5cb2b5456274ffba30913935436c48360311e907b8e24f4dada58c0b526a4f04558f03a130b07625981894654e8d0fa8a3df66b63aaded
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 5.1.0 (2024-08-20)
2
+
3
+ - Updated Chart.js to 4.4.4
4
+ - Dropped support for Ruby < 3.1
5
+
1
6
  ## 5.0.7 (2024-05-21)
2
7
 
3
8
  - Updated Chart.js to 4.4.3
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013-2023 Andrew Kane
1
+ Copyright (c) 2013-2024 Andrew Kane
2
2
 
3
3
  MIT License
4
4
 
@@ -78,7 +78,7 @@ module Chartkick
78
78
  # limit to alphanumeric and % for simplicity
79
79
  # this prevents things like calc() but safety is the priority
80
80
  # dot does not need escaped in square brackets
81
- raise ArgumentError, "Invalid #{k}" unless html_vars[k] =~ /\A[a-zA-Z0-9%.]*\z/
81
+ raise ArgumentError, "Invalid #{k}" unless /\A[a-zA-Z0-9%.]*\z/.match?(html_vars[k])
82
82
  end
83
83
 
84
84
  html_vars.each_key do |k|
@@ -1,3 +1,3 @@
1
1
  module Chartkick
2
- VERSION = "5.0.7"
2
+ VERSION = "5.1.0"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014-2022 Chart.js Contributors
3
+ Copyright (c) 2014-2024 Chart.js Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Chart.js v4.4.3
2
+ * Chart.js v4.4.4
3
3
  * https://www.chartjs.org
4
4
  * (c) 2024 Chart.js Contributors
5
5
  * Released under the MIT License
@@ -26,9 +26,120 @@
26
26
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Chart = factory());
27
27
  })(this, (function () { 'use strict';
28
28
 
29
+ function _arrayLikeToArray$1(r, a) {
30
+ (null == a || a > r.length) && (a = r.length);
31
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
32
+ return n;
33
+ }
34
+ function _arrayWithHoles(r) {
35
+ if (Array.isArray(r)) return r;
36
+ }
37
+ function _arrayWithoutHoles(r) {
38
+ if (Array.isArray(r)) return _arrayLikeToArray$1(r);
39
+ }
40
+ function _assertThisInitialized$1(e) {
41
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
42
+ return e;
43
+ }
29
44
  function _callSuper(t, o, e) {
30
45
  return o = _getPrototypeOf$1(o), _possibleConstructorReturn$1(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf$1(t).constructor) : o.apply(t, e));
31
46
  }
47
+ function _classCallCheck$1(a, n) {
48
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
49
+ }
50
+ function _defineProperties$1(e, r) {
51
+ for (var t = 0; t < r.length; t++) {
52
+ var o = r[t];
53
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
54
+ }
55
+ }
56
+ function _createClass$1(e, r, t) {
57
+ return r && _defineProperties$1(e.prototype, r), t && _defineProperties$1(e, t), Object.defineProperty(e, "prototype", {
58
+ writable: !1
59
+ }), e;
60
+ }
61
+ function _createForOfIteratorHelper$1(r, e) {
62
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
63
+ if (!t) {
64
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) {
65
+ t && (r = t);
66
+ var n = 0,
67
+ F = function () {};
68
+ return {
69
+ s: F,
70
+ n: function () {
71
+ return n >= r.length ? {
72
+ done: !0
73
+ } : {
74
+ done: !1,
75
+ value: r[n++]
76
+ };
77
+ },
78
+ e: function (r) {
79
+ throw r;
80
+ },
81
+ f: F
82
+ };
83
+ }
84
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
85
+ }
86
+ var o,
87
+ a = !0,
88
+ u = !1;
89
+ return {
90
+ s: function () {
91
+ t = t.call(r);
92
+ },
93
+ n: function () {
94
+ var r = t.next();
95
+ return a = r.done, r;
96
+ },
97
+ e: function (r) {
98
+ u = !0, o = r;
99
+ },
100
+ f: function () {
101
+ try {
102
+ a || null == t.return || t.return();
103
+ } finally {
104
+ if (u) throw o;
105
+ }
106
+ }
107
+ };
108
+ }
109
+ function _defineProperty$1(e, r, t) {
110
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
111
+ value: t,
112
+ enumerable: !0,
113
+ configurable: !0,
114
+ writable: !0
115
+ }) : e[r] = t, e;
116
+ }
117
+ function _get() {
118
+ return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
119
+ var p = _superPropBase(e, t);
120
+ if (p) {
121
+ var n = Object.getOwnPropertyDescriptor(p, t);
122
+ return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
123
+ }
124
+ }, _get.apply(null, arguments);
125
+ }
126
+ function _getPrototypeOf$1(t) {
127
+ return _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
128
+ return t.__proto__ || Object.getPrototypeOf(t);
129
+ }, _getPrototypeOf$1(t);
130
+ }
131
+ function _inherits$1(t, e) {
132
+ if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
133
+ t.prototype = Object.create(e && e.prototype, {
134
+ constructor: {
135
+ value: t,
136
+ writable: !0,
137
+ configurable: !0
138
+ }
139
+ }), Object.defineProperty(t, "prototype", {
140
+ writable: !1
141
+ }), e && _setPrototypeOf$1(t, e);
142
+ }
32
143
  function _isNativeReflectConstruct$1() {
33
144
  try {
34
145
  var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
@@ -37,6 +148,9 @@
37
148
  return !!t;
38
149
  })();
39
150
  }
151
+ function _iterableToArray(r) {
152
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
153
+ }
40
154
  function _iterableToArrayLimit(r, l) {
41
155
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
42
156
  if (null != t) {
@@ -64,6 +178,12 @@
64
178
  return a;
65
179
  }
66
180
  }
181
+ function _nonIterableRest() {
182
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
183
+ }
184
+ function _nonIterableSpread() {
185
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
186
+ }
67
187
  function ownKeys(e, r) {
68
188
  var t = Object.keys(e);
69
189
  if (Object.getOwnPropertySymbols) {
@@ -85,6 +205,32 @@
85
205
  }
86
206
  return e;
87
207
  }
208
+ function _possibleConstructorReturn$1(t, e) {
209
+ if (e && ("object" == typeof e || "function" == typeof e)) return e;
210
+ if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
211
+ return _assertThisInitialized$1(t);
212
+ }
213
+ function _setPrototypeOf$1(t, e) {
214
+ return _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
215
+ return t.__proto__ = e, t;
216
+ }, _setPrototypeOf$1(t, e);
217
+ }
218
+ function _slicedToArray(r, e) {
219
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest();
220
+ }
221
+ function _superPropBase(t, o) {
222
+ for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf$1(t)););
223
+ return t;
224
+ }
225
+ function _superPropGet(t, e, r, o) {
226
+ var p = _get(_getPrototypeOf$1(1 & o ? t.prototype : t), e, r);
227
+ return 2 & o ? function (t) {
228
+ return p.apply(r, t);
229
+ } : p;
230
+ }
231
+ function _toConsumableArray(r) {
232
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread();
233
+ }
88
234
  function _toPrimitive(t, r) {
89
235
  if ("object" != typeof t || !t) return t;
90
236
  var e = t[Symbol.toPrimitive];
@@ -108,192 +254,12 @@
108
254
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
109
255
  }, _typeof$1(o);
110
256
  }
111
- function _classCallCheck$1(instance, Constructor) {
112
- if (!(instance instanceof Constructor)) {
113
- throw new TypeError("Cannot call a class as a function");
114
- }
115
- }
116
- function _defineProperties$1(target, props) {
117
- for (var i = 0; i < props.length; i++) {
118
- var descriptor = props[i];
119
- descriptor.enumerable = descriptor.enumerable || false;
120
- descriptor.configurable = true;
121
- if ("value" in descriptor) descriptor.writable = true;
122
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
123
- }
124
- }
125
- function _createClass$1(Constructor, protoProps, staticProps) {
126
- if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
127
- if (staticProps) _defineProperties$1(Constructor, staticProps);
128
- Object.defineProperty(Constructor, "prototype", {
129
- writable: false
130
- });
131
- return Constructor;
132
- }
133
- function _defineProperty$1(obj, key, value) {
134
- key = _toPropertyKey(key);
135
- if (key in obj) {
136
- Object.defineProperty(obj, key, {
137
- value: value,
138
- enumerable: true,
139
- configurable: true,
140
- writable: true
141
- });
142
- } else {
143
- obj[key] = value;
144
- }
145
- return obj;
146
- }
147
- function _inherits$1(subClass, superClass) {
148
- if (typeof superClass !== "function" && superClass !== null) {
149
- throw new TypeError("Super expression must either be null or a function");
150
- }
151
- subClass.prototype = Object.create(superClass && superClass.prototype, {
152
- constructor: {
153
- value: subClass,
154
- writable: true,
155
- configurable: true
156
- }
157
- });
158
- Object.defineProperty(subClass, "prototype", {
159
- writable: false
160
- });
161
- if (superClass) _setPrototypeOf$1(subClass, superClass);
162
- }
163
- function _getPrototypeOf$1(o) {
164
- _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
165
- return o.__proto__ || Object.getPrototypeOf(o);
166
- };
167
- return _getPrototypeOf$1(o);
168
- }
169
- function _setPrototypeOf$1(o, p) {
170
- _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
171
- o.__proto__ = p;
172
- return o;
173
- };
174
- return _setPrototypeOf$1(o, p);
175
- }
176
- function _assertThisInitialized$1(self) {
177
- if (self === void 0) {
178
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
257
+ function _unsupportedIterableToArray$1(r, a) {
258
+ if (r) {
259
+ if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
260
+ var t = {}.toString.call(r).slice(8, -1);
261
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
179
262
  }
180
- return self;
181
- }
182
- function _possibleConstructorReturn$1(self, call) {
183
- if (call && (typeof call === "object" || typeof call === "function")) {
184
- return call;
185
- } else if (call !== void 0) {
186
- throw new TypeError("Derived constructors may only return object or undefined");
187
- }
188
- return _assertThisInitialized$1(self);
189
- }
190
- function _superPropBase(object, property) {
191
- while (!Object.prototype.hasOwnProperty.call(object, property)) {
192
- object = _getPrototypeOf$1(object);
193
- if (object === null) break;
194
- }
195
- return object;
196
- }
197
- function _get() {
198
- if (typeof Reflect !== "undefined" && Reflect.get) {
199
- _get = Reflect.get.bind();
200
- } else {
201
- _get = function _get(target, property, receiver) {
202
- var base = _superPropBase(target, property);
203
- if (!base) return;
204
- var desc = Object.getOwnPropertyDescriptor(base, property);
205
- if (desc.get) {
206
- return desc.get.call(arguments.length < 3 ? target : receiver);
207
- }
208
- return desc.value;
209
- };
210
- }
211
- return _get.apply(this, arguments);
212
- }
213
- function _slicedToArray(arr, i) {
214
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
215
- }
216
- function _toConsumableArray(arr) {
217
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread();
218
- }
219
- function _arrayWithoutHoles(arr) {
220
- if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
221
- }
222
- function _arrayWithHoles(arr) {
223
- if (Array.isArray(arr)) return arr;
224
- }
225
- function _iterableToArray(iter) {
226
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
227
- }
228
- function _unsupportedIterableToArray$1(o, minLen) {
229
- if (!o) return;
230
- if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
231
- var n = Object.prototype.toString.call(o).slice(8, -1);
232
- if (n === "Object" && o.constructor) n = o.constructor.name;
233
- if (n === "Map" || n === "Set") return Array.from(o);
234
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
235
- }
236
- function _arrayLikeToArray$1(arr, len) {
237
- if (len == null || len > arr.length) len = arr.length;
238
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
239
- return arr2;
240
- }
241
- function _nonIterableSpread() {
242
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
243
- }
244
- function _nonIterableRest() {
245
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
246
- }
247
- function _createForOfIteratorHelper$1(o, allowArrayLike) {
248
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
249
- if (!it) {
250
- if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
251
- if (it) o = it;
252
- var i = 0;
253
- var F = function () {};
254
- return {
255
- s: F,
256
- n: function () {
257
- if (i >= o.length) return {
258
- done: true
259
- };
260
- return {
261
- done: false,
262
- value: o[i++]
263
- };
264
- },
265
- e: function (e) {
266
- throw e;
267
- },
268
- f: F
269
- };
270
- }
271
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
272
- }
273
- var normalCompletion = true,
274
- didErr = false,
275
- err;
276
- return {
277
- s: function () {
278
- it = it.call(o);
279
- },
280
- n: function () {
281
- var step = it.next();
282
- normalCompletion = step.done;
283
- return step;
284
- },
285
- e: function (e) {
286
- didErr = true;
287
- err = e;
288
- },
289
- f: function () {
290
- try {
291
- if (!normalCompletion && it.return != null) it.return();
292
- } finally {
293
- if (didErr) throw err;
294
- }
295
- }
296
- };
297
263
  }
298
264
 
299
265
  /*!
@@ -5641,7 +5607,7 @@
5641
5607
  }, {
5642
5608
  key: "updateRangeFromParsed",
5643
5609
  value: function updateRangeFromParsed(range, scale, parsed, stack) {
5644
- _get(_getPrototypeOf$1(BarController.prototype), "updateRangeFromParsed", this).call(this, range, scale, parsed, stack);
5610
+ _superPropGet(BarController, "updateRangeFromParsed", this, 3)([range, scale, parsed, stack]);
5645
5611
  var custom = parsed._custom;
5646
5612
  if (custom && scale === this._cachedMeta.vScale) {
5647
5613
  range.min = Math.min(range.min, custom.min);
@@ -5671,7 +5637,7 @@
5671
5637
  key: "initialize",
5672
5638
  value: function initialize() {
5673
5639
  this.enableOptionSharing = true;
5674
- _get(_getPrototypeOf$1(BarController.prototype), "initialize", this).call(this);
5640
+ _superPropGet(BarController, "initialize", this, 3)([]);
5675
5641
  var meta = this._cachedMeta;
5676
5642
  meta.stack = this.getDataset().stack;
5677
5643
  }
@@ -5728,8 +5694,12 @@
5728
5694
  });
5729
5695
  var stacked = iScale.options.stacked;
5730
5696
  var stacks = [];
5697
+ var currentParsed = this._cachedMeta.controller.getParsed(dataIndex);
5698
+ var iScaleValue = currentParsed && currentParsed[iScale.axis];
5731
5699
  var skipNull = function skipNull(meta) {
5732
- var parsed = meta.controller.getParsed(dataIndex);
5700
+ var parsed = meta._parsed.find(function (item) {
5701
+ return item[iScale.axis] === iScaleValue;
5702
+ });
5733
5703
  var val = parsed && parsed[meta.vScale.axis];
5734
5704
  if (isNullOrUndef(val) || isNaN(val)) {
5735
5705
  return true;
@@ -5941,12 +5911,12 @@
5941
5911
  key: "initialize",
5942
5912
  value: function initialize() {
5943
5913
  this.enableOptionSharing = true;
5944
- _get(_getPrototypeOf$1(BubbleController.prototype), "initialize", this).call(this);
5914
+ _superPropGet(BubbleController, "initialize", this, 3)([]);
5945
5915
  }
5946
5916
  }, {
5947
5917
  key: "parsePrimitiveData",
5948
5918
  value: function parsePrimitiveData(meta, data, start, count) {
5949
- var parsed = _get(_getPrototypeOf$1(BubbleController.prototype), "parsePrimitiveData", this).call(this, meta, data, start, count);
5919
+ var parsed = _superPropGet(BubbleController, "parsePrimitiveData", this, 3)([meta, data, start, count]);
5950
5920
  for (var i = 0; i < parsed.length; i++) {
5951
5921
  parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;
5952
5922
  }
@@ -5955,7 +5925,7 @@
5955
5925
  }, {
5956
5926
  key: "parseArrayData",
5957
5927
  value: function parseArrayData(meta, data, start, count) {
5958
- var parsed = _get(_getPrototypeOf$1(BubbleController.prototype), "parseArrayData", this).call(this, meta, data, start, count);
5928
+ var parsed = _superPropGet(BubbleController, "parseArrayData", this, 3)([meta, data, start, count]);
5959
5929
  for (var i = 0; i < parsed.length; i++) {
5960
5930
  var item = data[start + i];
5961
5931
  parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);
@@ -5965,7 +5935,7 @@
5965
5935
  }, {
5966
5936
  key: "parseObjectData",
5967
5937
  value: function parseObjectData(meta, data, start, count) {
5968
- var parsed = _get(_getPrototypeOf$1(BubbleController.prototype), "parseObjectData", this).call(this, meta, data, start, count);
5938
+ var parsed = _superPropGet(BubbleController, "parseObjectData", this, 3)([meta, data, start, count]);
5969
5939
  for (var i = 0; i < parsed.length; i++) {
5970
5940
  var item = data[start + i];
5971
5941
  parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);
@@ -6036,7 +6006,7 @@
6036
6006
  key: "resolveDataElementOptions",
6037
6007
  value: function resolveDataElementOptions(index, mode) {
6038
6008
  var parsed = this.getParsed(index);
6039
- var values = _get(_getPrototypeOf$1(BubbleController.prototype), "resolveDataElementOptions", this).call(this, index, mode);
6009
+ var values = _superPropGet(BubbleController, "resolveDataElementOptions", this, 3)([index, mode]);
6040
6010
  if (values.$shared) {
6041
6011
  values = Object.assign({}, values, {
6042
6012
  $shared: false
@@ -6430,7 +6400,7 @@
6430
6400
  value: function initialize() {
6431
6401
  this.enableOptionSharing = true;
6432
6402
  this.supportsDecimation = true;
6433
- _get(_getPrototypeOf$1(LineController.prototype), "initialize", this).call(this);
6403
+ _superPropGet(LineController, "initialize", this, 3)([]);
6434
6404
  }
6435
6405
  }, {
6436
6406
  key: "update",
@@ -6532,7 +6502,7 @@
6532
6502
  value: function draw() {
6533
6503
  var meta = this._cachedMeta;
6534
6504
  meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);
6535
- _get(_getPrototypeOf$1(LineController.prototype), "draw", this).call(this);
6505
+ _superPropGet(LineController, "draw", this, 3)([]);
6536
6506
  }
6537
6507
  }]);
6538
6508
  }(DatasetController);
@@ -6920,7 +6890,7 @@
6920
6890
  if (!this.datasetElementType && showLine) {
6921
6891
  this.datasetElementType = this.chart.registry.getElement('line');
6922
6892
  }
6923
- _get(_getPrototypeOf$1(ScatterController.prototype), "addElements", this).call(this);
6893
+ _superPropGet(ScatterController, "addElements", this, 3)([]);
6924
6894
  }
6925
6895
  }, {
6926
6896
  key: "updateElements",
@@ -7240,7 +7210,7 @@
7240
7210
  var rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';
7241
7211
  var intersectsItem = false;
7242
7212
  evaluateInteractionItems(chart, axis, position, function (element, datasetIndex, index) {
7243
- if (element[rangeMethod](position[axis], useFinalPosition)) {
7213
+ if (element[rangeMethod] && element[rangeMethod](position[axis], useFinalPosition)) {
7244
7214
  items.push({
7245
7215
  element: element,
7246
7216
  datasetIndex: datasetIndex,
@@ -10426,7 +10396,7 @@
10426
10396
  }
10427
10397
  return false;
10428
10398
  }
10429
- var version = "4.4.3";
10399
+ var version = "4.4.4";
10430
10400
  var KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];
10431
10401
  function positionIsHorizontal(position, axis) {
10432
10402
  return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';
@@ -11034,8 +11004,8 @@
11034
11004
  var _this$_resizeBeforeDr = this._resizeBeforeDraw,
11035
11005
  width = _this$_resizeBeforeDr.width,
11036
11006
  height = _this$_resizeBeforeDr.height;
11037
- this._resize(width, height);
11038
11007
  this._resizeBeforeDraw = null;
11008
+ this._resize(width, height);
11039
11009
  }
11040
11010
  this.clear();
11041
11011
  if (this.width <= 0 || this.height <= 0) {
@@ -11325,8 +11295,8 @@
11325
11295
  }
11326
11296
  };
11327
11297
  var detached;
11328
- var attached = function attached() {
11329
- _remove('attach', attached);
11298
+ var _attached = function attached() {
11299
+ _remove('attach', _attached);
11330
11300
  _this19.attached = true;
11331
11301
  _this19.resize();
11332
11302
  _add('resize', listener);
@@ -11337,10 +11307,10 @@
11337
11307
  _remove('resize', listener);
11338
11308
  _this19._stop();
11339
11309
  _this19._resize(0, 0);
11340
- _add('attach', attached);
11310
+ _add('attach', _attached);
11341
11311
  };
11342
11312
  if (platform.isAttached(this.canvas)) {
11343
- attached();
11313
+ _attached();
11344
11314
  } else {
11345
11315
  detached();
11346
11316
  }
@@ -11781,7 +11751,8 @@
11781
11751
  circumference = _this$getProps2.circumference;
11782
11752
  var rAdjust = (this.options.spacing + this.options.borderWidth) / 2;
11783
11753
  var _circumference = valueOrDefault(circumference, endAngle - startAngle);
11784
- var betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);
11754
+ var nonZeroBetween = _angleBetween(angle, startAngle, endAngle) && startAngle !== endAngle;
11755
+ var betweenAngles = _circumference >= TAU || nonZeroBetween;
11785
11756
  var withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);
11786
11757
  return betweenAngles && withinRadius;
11787
11758
  }
@@ -14316,6 +14287,9 @@
14316
14287
  ++count;
14317
14288
  }
14318
14289
  }
14290
+ if (count === 0 || xSet.size === 0) {
14291
+ return false;
14292
+ }
14319
14293
  var xAverage = _toConsumableArray(xSet).reduce(function (a, b) {
14320
14294
  return a + b;
14321
14295
  }) / xSet.size;
@@ -15464,7 +15438,7 @@
15464
15438
  }
15465
15439
  this._addedLabels = [];
15466
15440
  }
15467
- _get(_getPrototypeOf$1(CategoryScale.prototype), "init", this).call(this, scaleOptions);
15441
+ _superPropGet(CategoryScale, "init", this, 3)([scaleOptions]);
15468
15442
  }
15469
15443
  }, {
15470
15444
  key: "parse",
@@ -15522,7 +15496,7 @@
15522
15496
  }, {
15523
15497
  key: "configure",
15524
15498
  value: function configure() {
15525
- _get(_getPrototypeOf$1(CategoryScale.prototype), "configure", this).call(this);
15499
+ _superPropGet(CategoryScale, "configure", this, 3)([]);
15526
15500
  if (!this.isHorizontal()) {
15527
15501
  this._reversePixels = !this._reversePixels;
15528
15502
  }
@@ -15802,7 +15776,7 @@
15802
15776
  var ticks = this.ticks;
15803
15777
  var start = this.min;
15804
15778
  var end = this.max;
15805
- _get(_getPrototypeOf$1(LinearScaleBase.prototype), "configure", this).call(this);
15779
+ _superPropGet(LinearScaleBase, "configure", this, 3)([]);
15806
15780
  if (this.options.offset && ticks.length) {
15807
15781
  var offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;
15808
15782
  start -= offset;
@@ -16031,7 +16005,7 @@
16031
16005
  key: "configure",
16032
16006
  value: function configure() {
16033
16007
  var start = this.min;
16034
- _get(_getPrototypeOf$1(LogarithmicScale.prototype), "configure", this).call(this);
16008
+ _superPropGet(LogarithmicScale, "configure", this, 3)([]);
16035
16009
  this._startValue = log10(start);
16036
16010
  this._valueRange = log10(this.max) - log10(start);
16037
16011
  }
@@ -16525,7 +16499,7 @@
16525
16499
  ctx.strokeStyle = color;
16526
16500
  ctx.setLineDash(optsAtIndex.borderDash);
16527
16501
  ctx.lineDashOffset = optsAtIndex.borderDashOffset;
16528
- offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);
16502
+ offset = this.getDistanceFromCenterForValue(opts.reverse ? this.min : this.max);
16529
16503
  position = this.getPointPosition(i, offset);
16530
16504
  ctx.beginPath();
16531
16505
  ctx.moveTo(this.xCenter, this.yCenter);
@@ -16796,7 +16770,7 @@
16796
16770
  round: time.round,
16797
16771
  isoWeekday: time.isoWeekday
16798
16772
  };
16799
- _get(_getPrototypeOf$1(TimeScale.prototype), "init", this).call(this, scaleOpts);
16773
+ _superPropGet(TimeScale, "init", this, 3)([scaleOpts]);
16800
16774
  this._normalized = opts.normalized;
16801
16775
  }
16802
16776
  }, {
@@ -16810,7 +16784,7 @@
16810
16784
  }, {
16811
16785
  key: "beforeLayout",
16812
16786
  value: function beforeLayout() {
16813
- _get(_getPrototypeOf$1(TimeScale.prototype), "beforeLayout", this).call(this);
16787
+ _superPropGet(TimeScale, "beforeLayout", this, 3)([]);
16814
16788
  this._cache = {
16815
16789
  data: [],
16816
16790
  labels: [],
@@ -17153,7 +17127,7 @@
17153
17127
  var table = this._table = this.buildLookupTable(timestamps);
17154
17128
  this._minPos = interpolate(table, this.min);
17155
17129
  this._tableRange = interpolate(table, this.max) - this._minPos;
17156
- _get(_getPrototypeOf$1(TimeSeriesScale.prototype), "initOffsets", this).call(this, timestamps);
17130
+ _superPropGet(TimeSeriesScale, "initOffsets", this, 3)([timestamps]);
17157
17131
  }
17158
17132
  }, {
17159
17133
  key: "buildLookupTable",
@@ -17196,7 +17170,7 @@
17196
17170
  value: function _generate() {
17197
17171
  var min = this.min;
17198
17172
  var max = this.max;
17199
- var timestamps = _get(_getPrototypeOf$1(TimeSeriesScale.prototype), "getDataTimestamps", this).call(this);
17173
+ var timestamps = _superPropGet(TimeSeriesScale, "getDataTimestamps", this, 3)([]);
17200
17174
  if (!timestamps.includes(min) || !timestamps.length) {
17201
17175
  timestamps.splice(0, 0, min);
17202
17176
  }
@@ -20822,110 +20796,97 @@
20822
20796
  return target;
20823
20797
  }
20824
20798
 
20825
- function _arrayLikeToArray(arr, len) {
20826
- if (len == null || len > arr.length) len = arr.length;
20827
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
20828
- return arr2;
20799
+ function _arrayLikeToArray(r, a) {
20800
+ (null == a || a > r.length) && (a = r.length);
20801
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
20802
+ return n;
20829
20803
  }
20830
20804
 
20831
- function _unsupportedIterableToArray(o, minLen) {
20832
- if (!o) return;
20833
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
20834
- var n = Object.prototype.toString.call(o).slice(8, -1);
20835
- if (n === "Object" && o.constructor) n = o.constructor.name;
20836
- if (n === "Map" || n === "Set") return Array.from(o);
20837
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
20805
+ function _unsupportedIterableToArray(r, a) {
20806
+ if (r) {
20807
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
20808
+ var t = {}.toString.call(r).slice(8, -1);
20809
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
20810
+ }
20838
20811
  }
20839
20812
 
20840
- function _createForOfIteratorHelper(o, allowArrayLike) {
20841
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
20842
- if (!it) {
20843
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
20844
- if (it) o = it;
20845
- var i = 0;
20846
- var F = function F() {};
20813
+ function _createForOfIteratorHelper(r, e) {
20814
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
20815
+ if (!t) {
20816
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
20817
+ t && (r = t);
20818
+ var _n = 0,
20819
+ F = function F() {};
20847
20820
  return {
20848
20821
  s: F,
20849
20822
  n: function n() {
20850
- if (i >= o.length) return {
20851
- done: true
20852
- };
20853
- return {
20854
- done: false,
20855
- value: o[i++]
20823
+ return _n >= r.length ? {
20824
+ done: !0
20825
+ } : {
20826
+ done: !1,
20827
+ value: r[_n++]
20856
20828
  };
20857
20829
  },
20858
- e: function e(_e) {
20859
- throw _e;
20830
+ e: function e(r) {
20831
+ throw r;
20860
20832
  },
20861
20833
  f: F
20862
20834
  };
20863
20835
  }
20864
20836
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
20865
20837
  }
20866
- var normalCompletion = true,
20867
- didErr = false,
20868
- err;
20838
+ var o,
20839
+ a = !0,
20840
+ u = !1;
20869
20841
  return {
20870
20842
  s: function s() {
20871
- it = it.call(o);
20843
+ t = t.call(r);
20872
20844
  },
20873
20845
  n: function n() {
20874
- var step = it.next();
20875
- normalCompletion = step.done;
20876
- return step;
20846
+ var r = t.next();
20847
+ return a = r.done, r;
20877
20848
  },
20878
- e: function e(_e2) {
20879
- didErr = true;
20880
- err = _e2;
20849
+ e: function e(r) {
20850
+ u = !0, o = r;
20881
20851
  },
20882
20852
  f: function f() {
20883
20853
  try {
20884
- if (!normalCompletion && it["return"] != null) it["return"]();
20854
+ a || null == t["return"] || t["return"]();
20885
20855
  } finally {
20886
- if (didErr) throw err;
20856
+ if (u) throw o;
20887
20857
  }
20888
20858
  }
20889
20859
  };
20890
20860
  }
20891
20861
 
20892
- function _assertThisInitialized(self) {
20893
- if (self === void 0) {
20894
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
20895
- }
20896
- return self;
20862
+ function _assertThisInitialized(e) {
20863
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
20864
+ return e;
20897
20865
  }
20898
20866
 
20899
- function _setPrototypeOf(o, p) {
20900
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
20901
- o.__proto__ = p;
20902
- return o;
20903
- };
20904
- return _setPrototypeOf(o, p);
20867
+ function _setPrototypeOf(t, e) {
20868
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
20869
+ return t.__proto__ = e, t;
20870
+ }, _setPrototypeOf(t, e);
20905
20871
  }
20906
20872
 
20907
- function _inherits(subClass, superClass) {
20908
- if (typeof superClass !== "function" && superClass !== null) {
20909
- throw new TypeError("Super expression must either be null or a function");
20910
- }
20911
- subClass.prototype = Object.create(superClass && superClass.prototype, {
20873
+ function _inherits(t, e) {
20874
+ if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
20875
+ t.prototype = Object.create(e && e.prototype, {
20912
20876
  constructor: {
20913
- value: subClass,
20914
- writable: true,
20915
- configurable: true
20877
+ value: t,
20878
+ writable: !0,
20879
+ configurable: !0
20916
20880
  }
20917
- });
20918
- Object.defineProperty(subClass, "prototype", {
20919
- writable: false
20920
- });
20921
- if (superClass) _setPrototypeOf(subClass, superClass);
20881
+ }), Object.defineProperty(t, "prototype", {
20882
+ writable: !1
20883
+ }), e && _setPrototypeOf(t, e);
20922
20884
  }
20923
20885
 
20924
- function _getPrototypeOf(o) {
20925
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
20926
- return o.__proto__ || Object.getPrototypeOf(o);
20927
- };
20928
- return _getPrototypeOf(o);
20886
+ function _getPrototypeOf(t) {
20887
+ return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
20888
+ return t.__proto__ || Object.getPrototypeOf(t);
20889
+ }, _getPrototypeOf(t);
20929
20890
  }
20930
20891
 
20931
20892
  function _isNativeReflectConstruct() {
@@ -20937,34 +20898,27 @@
20937
20898
  })();
20938
20899
  }
20939
20900
 
20940
- function _possibleConstructorReturn(self, call) {
20941
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
20942
- return call;
20943
- } else if (call !== void 0) {
20944
- throw new TypeError("Derived constructors may only return object or undefined");
20945
- }
20946
- return _assertThisInitialized(self);
20901
+ function _possibleConstructorReturn(t, e) {
20902
+ if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
20903
+ if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
20904
+ return _assertThisInitialized(t);
20947
20905
  }
20948
20906
 
20949
- function _createSuper(Derived) {
20950
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
20951
- return function _createSuperInternal() {
20952
- var Super = _getPrototypeOf(Derived),
20953
- result;
20954
- if (hasNativeReflectConstruct) {
20955
- var NewTarget = _getPrototypeOf(this).constructor;
20956
- result = Reflect.construct(Super, arguments, NewTarget);
20957
- } else {
20958
- result = Super.apply(this, arguments);
20959
- }
20960
- return _possibleConstructorReturn(this, result);
20907
+ function _createSuper(t) {
20908
+ var r = _isNativeReflectConstruct();
20909
+ return function () {
20910
+ var e,
20911
+ o = _getPrototypeOf(t);
20912
+ if (r) {
20913
+ var s = _getPrototypeOf(this).constructor;
20914
+ e = Reflect.construct(o, arguments, s);
20915
+ } else e = o.apply(this, arguments);
20916
+ return _possibleConstructorReturn(this, e);
20961
20917
  };
20962
20918
  }
20963
20919
 
20964
- function _classCallCheck(instance, Constructor) {
20965
- if (!(instance instanceof Constructor)) {
20966
- throw new TypeError("Cannot call a class as a function");
20967
- }
20920
+ function _classCallCheck(a, n) {
20921
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
20968
20922
  }
20969
20923
 
20970
20924
  function toPrimitive(t, r) {
@@ -20983,37 +20937,25 @@
20983
20937
  return "symbol" == _typeof(i) ? i : i + "";
20984
20938
  }
20985
20939
 
20986
- function _defineProperties(target, props) {
20987
- for (var i = 0; i < props.length; i++) {
20988
- var descriptor = props[i];
20989
- descriptor.enumerable = descriptor.enumerable || false;
20990
- descriptor.configurable = true;
20991
- if ("value" in descriptor) descriptor.writable = true;
20992
- Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
20993
- }
20994
- }
20995
- function _createClass(Constructor, protoProps, staticProps) {
20996
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
20997
- if (staticProps) _defineProperties(Constructor, staticProps);
20998
- Object.defineProperty(Constructor, "prototype", {
20999
- writable: false
21000
- });
21001
- return Constructor;
20940
+ function _defineProperties(e, r) {
20941
+ for (var t = 0; t < r.length; t++) {
20942
+ var o = r[t];
20943
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
20944
+ }
20945
+ }
20946
+ function _createClass(e, r, t) {
20947
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
20948
+ writable: !1
20949
+ }), e;
21002
20950
  }
21003
20951
 
21004
- function _defineProperty(obj, key, value) {
21005
- key = toPropertyKey(key);
21006
- if (key in obj) {
21007
- Object.defineProperty(obj, key, {
21008
- value: value,
21009
- enumerable: true,
21010
- configurable: true,
21011
- writable: true
21012
- });
21013
- } else {
21014
- obj[key] = value;
21015
- }
21016
- return obj;
20952
+ function _defineProperty(e, r, t) {
20953
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
20954
+ value: t,
20955
+ enumerable: !0,
20956
+ configurable: !0,
20957
+ writable: !0
20958
+ }) : e[r] = t, e;
21017
20959
  }
21018
20960
 
21019
20961
  var TIMEZONE_UNIT_PRIORITY = 10;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chartkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.7
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-21 00:00:00.000000000 Z
11
+ date: 2024-08-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: andrew@ankane.org
@@ -45,14 +45,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '2.7'
48
+ version: '3.1'
49
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  requirements: []
55
- rubygems_version: 3.5.9
55
+ rubygems_version: 3.5.11
56
56
  signing_key:
57
57
  specification_version: 4
58
58
  summary: Create beautiful JavaScript charts with one line of Ruby