chartkick 5.0.3 → 5.0.5

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: 64aeef8738559b3bc68cd4fdcb6b0c35d6d422f9c546682604a3629cdb336c1a
4
- data.tar.gz: 25fbeaa2c09039fa0d37b358c7abaaa62dd7327a784cea81cdd7b2904371b711
3
+ metadata.gz: b4c12b23eada9f3616245b3db795ebe98d71f7edc9cc3a325ff5359c8998ccf7
4
+ data.tar.gz: 1af2f8289b768f28847bf6c75e61f3803ed43a3850d7e52d990381f43440a95d
5
5
  SHA512:
6
- metadata.gz: ee29227239ea30e2af8dcc19387c3191a2fc543f662c6541589e469e86c4717748ad996b68383fdc42c29d3db72b1493279da909e22ee6e950e936a4e50e21b5
7
- data.tar.gz: 6537e0a58427e8ef48564b3c1369597776bc46619d18cf5bad8a40f19d035e1e3206c46447ea553f22fe975ecc5904bf209a6f2f3f15c6ea38bec4cd84a15c66
6
+ metadata.gz: efb010cad8e5501514b25debf313ea6e9ed4facc5d6d1feae5c914d3e0ebc72485a64659bca83cdc772709e96eea6b70773e80dd98187c0c66a4aecf984b0e65
7
+ data.tar.gz: ca7305dbb9765f35c1e085e11d40d3ab95527215f11dd88a0efb9007fb40cdeaf3808ee4ed4c3db1dbb2deb7d9e180d83beb7345e68012b70d65b2f92399f5c2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 5.0.5 (2023-12-07)
2
+
3
+ - Updated Chart.js to 4.4.1
4
+
5
+ ## 5.0.4 (2023-08-27)
6
+
7
+ - Updated Chart.js to 4.4.0
8
+
1
9
  ## 5.0.3 (2023-07-24)
2
10
 
3
11
  - Updated Chart.js to 4.3.1
data/README.md CHANGED
@@ -4,13 +4,11 @@ Create beautiful JavaScript charts with one line of Ruby. No more fighting with
4
4
 
5
5
  [See it in action](https://chartkick.com)
6
6
 
7
- **Chartkick 5.0 was recently released** - see [how to upgrade](#upgrading)
8
-
9
7
  :fire: For admin charts and dashboards, check out [Blazer](https://github.com/ankane/blazer/), and for advanced visualizations, check out [Vega](https://github.com/ankane/vega)
10
8
 
11
9
  :two_hearts: A perfect companion to [Groupdate](https://github.com/ankane/groupdate), [Hightop](https://github.com/ankane/hightop), and [ActiveMedian](https://github.com/ankane/active_median)
12
10
 
13
- [![Build Status](https://github.com/ankane/chartkick/workflows/build/badge.svg?branch=master)](https://github.com/ankane/chartkick/actions)
11
+ [![Build Status](https://github.com/ankane/chartkick/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/chartkick/actions)
14
12
 
15
13
  ## Quick Start
16
14
 
@@ -347,7 +345,7 @@ You can pass options directly to the charting library with:
347
345
  <%= line_chart data, library: {backgroundColor: "#eee"} %>
348
346
  ```
349
347
 
350
- See the documentation for [Chart.js](https://www.chartjs.org/docs/), [Google Charts](https://developers.google.com/chart/interactive/docs/gallery), and [Highcharts](https://api.highcharts.com/highcharts) for more info.
348
+ See the documentation for [Chart.js](https://www.chartjs.org/docs/), [Google Charts](https://developers.google.com/chart/interactive/docs/gallery), and [Highcharts](https://api.highcharts.com/highcharts) for more info. For Chart.js plugins, check out [this guide](guides/Chartjs-Plugins.md).
351
349
 
352
350
  To customize datasets in Chart.js, use:
353
351
 
@@ -1,3 +1,3 @@
1
1
  module Chartkick
2
- VERSION = "5.0.3"
2
+ VERSION = "5.0.5"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Chart.js v4.3.1
2
+ * Chart.js v4.4.1
3
3
  * https://www.chartjs.org
4
4
  * (c) 2023 Chart.js Contributors
5
5
  * Released under the MIT License
@@ -26,62 +26,62 @@
26
26
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Chart = factory());
27
27
  })(this, (function () { 'use strict';
28
28
 
29
- function _iterableToArrayLimit(arr, i) {
30
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
31
- if (null != _i) {
32
- var _s,
33
- _e,
34
- _x,
35
- _r,
36
- _arr = [],
37
- _n = !0,
38
- _d = !1;
29
+ function _iterableToArrayLimit(r, l) {
30
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
31
+ if (null != t) {
32
+ var e,
33
+ n,
34
+ i,
35
+ u,
36
+ a = [],
37
+ f = !0,
38
+ o = !1;
39
39
  try {
40
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
41
- if (Object(_i) !== _i) return;
42
- _n = !1;
43
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
44
- } catch (err) {
45
- _d = !0, _e = err;
40
+ if (i = (t = t.call(r)).next, 0 === l) {
41
+ if (Object(t) !== t) return;
42
+ f = !1;
43
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
44
+ } catch (r) {
45
+ o = !0, n = r;
46
46
  } finally {
47
47
  try {
48
- if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
48
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
49
49
  } finally {
50
- if (_d) throw _e;
50
+ if (o) throw n;
51
51
  }
52
52
  }
53
- return _arr;
53
+ return a;
54
54
  }
55
55
  }
56
- function ownKeys(object, enumerableOnly) {
57
- var keys = Object.keys(object);
56
+ function ownKeys(e, r) {
57
+ var t = Object.keys(e);
58
58
  if (Object.getOwnPropertySymbols) {
59
- var symbols = Object.getOwnPropertySymbols(object);
60
- enumerableOnly && (symbols = symbols.filter(function (sym) {
61
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
62
- })), keys.push.apply(keys, symbols);
63
- }
64
- return keys;
65
- }
66
- function _objectSpread2(target) {
67
- for (var i = 1; i < arguments.length; i++) {
68
- var source = null != arguments[i] ? arguments[i] : {};
69
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
70
- _defineProperty$1(target, key, source[key]);
71
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
72
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
59
+ var o = Object.getOwnPropertySymbols(e);
60
+ r && (o = o.filter(function (r) {
61
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
62
+ })), t.push.apply(t, o);
63
+ }
64
+ return t;
65
+ }
66
+ function _objectSpread2(e) {
67
+ for (var r = 1; r < arguments.length; r++) {
68
+ var t = null != arguments[r] ? arguments[r] : {};
69
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
70
+ _defineProperty$1(e, r, t[r]);
71
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
72
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
73
73
  });
74
74
  }
75
- return target;
75
+ return e;
76
76
  }
77
- function _typeof$1(obj) {
77
+ function _typeof$1(o) {
78
78
  "@babel/helpers - typeof";
79
79
 
80
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
81
- return typeof obj;
82
- } : function (obj) {
83
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
84
- }, _typeof$1(obj);
80
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
81
+ return typeof o;
82
+ } : function (o) {
83
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
84
+ }, _typeof$1(o);
85
85
  }
86
86
  function _classCallCheck$1(instance, Constructor) {
87
87
  if (!(instance instanceof Constructor)) {
@@ -1403,7 +1403,6 @@
1403
1403
  if (angle < -0.5 * PI) {
1404
1404
  angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]
1405
1405
  }
1406
-
1407
1406
  return {
1408
1407
  angle: angle,
1409
1408
  distance: radialDistanceFromCenter
@@ -2027,6 +2026,7 @@
2027
2026
  reverse: false,
2028
2027
  beginAtZero: false,
2029
2028
  bounds: 'ticks',
2029
+ clip: true,
2030
2030
  grace: 0,
2031
2031
  grid: {
2032
2032
  display: true,
@@ -2193,14 +2193,13 @@
2193
2193
  }, {
2194
2194
  key: "route",
2195
2195
  value: function route(scope, name, targetScope, targetName) {
2196
- var _Object$definePropert;
2197
2196
  var scopeObject = getScope$1(this, scope);
2198
2197
  var targetScopeObject = getScope$1(this, targetScope);
2199
2198
  var privateName = '_' + name;
2200
- Object.defineProperties(scopeObject, (_Object$definePropert = {}, _defineProperty$1(_Object$definePropert, privateName, {
2199
+ Object.defineProperties(scopeObject, _defineProperty$1(_defineProperty$1({}, privateName, {
2201
2200
  value: scopeObject[name],
2202
2201
  writable: true
2203
- }), _defineProperty$1(_Object$definePropert, name, {
2202
+ }), name, {
2204
2203
  enumerable: true,
2205
2204
  get: function get() {
2206
2205
  var local = this[privateName];
@@ -2213,7 +2212,7 @@
2213
2212
  set: function set(value) {
2214
2213
  this[privateName] = value;
2215
2214
  }
2216
- }), _Object$definePropert));
2215
+ }));
2217
2216
  }
2218
2217
  }, {
2219
2218
  key: "apply",
@@ -2609,7 +2608,7 @@
2609
2608
  h = rect.h,
2610
2609
  radius = rect.radius;
2611
2610
  // top left arc
2612
- ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, -HALF_PI, PI, true);
2611
+ ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);
2613
2612
  // line from top left to bottom left
2614
2613
  ctx.lineTo(x, y + h - radius.bottomLeft);
2615
2614
  // bottom left arc
@@ -2819,7 +2818,6 @@
2819
2818
  * @private
2820
2819
  */
2821
2820
  function _createResolver(scopes) {
2822
- var _cache;
2823
2821
  var prefixes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [''];
2824
2822
  var rootScopes = arguments.length > 2 ? arguments[2] : undefined;
2825
2823
  var fallback = arguments.length > 3 ? arguments[3] : undefined;
@@ -2830,9 +2828,9 @@
2830
2828
  if (typeof fallback === 'undefined') {
2831
2829
  fallback = _resolve('_fallback', scopes);
2832
2830
  }
2833
- var cache = (_cache = {}, _defineProperty$1(_cache, Symbol.toStringTag, 'Object'), _defineProperty$1(_cache, "_cacheable", true), _defineProperty$1(_cache, "_scopes", scopes), _defineProperty$1(_cache, "_rootScopes", finalRootScopes), _defineProperty$1(_cache, "_fallback", fallback), _defineProperty$1(_cache, "_getTarget", getTarget), _defineProperty$1(_cache, "override", function override(scope) {
2831
+ var cache = _defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1({}, Symbol.toStringTag, 'Object'), "_cacheable", true), "_scopes", scopes), "_rootScopes", finalRootScopes), "_fallback", fallback), "_getTarget", getTarget), "override", function override(scope) {
2834
2832
  return _createResolver([scope].concat(_toConsumableArray(scopes)), prefixes, finalRootScopes, fallback);
2835
- }), _cache);
2833
+ });
2836
2834
  return new Proxy(cache, {
2837
2835
  /**
2838
2836
  * A trap for the delete operator.
@@ -3633,8 +3631,10 @@
3633
3631
  return false;
3634
3632
  }
3635
3633
  };
3636
- window.addEventListener('test', null, options);
3637
- window.removeEventListener('test', null, options);
3634
+ if (_isDomSupported()) {
3635
+ window.addEventListener('test', null, options);
3636
+ window.removeEventListener('test', null, options);
3637
+ }
3638
3638
  } catch (e) {
3639
3639
  // continue regardless of error
3640
3640
  }
@@ -4921,9 +4921,8 @@
4921
4921
  var parsed = new Array(count);
4922
4922
  var i, ilen, index;
4923
4923
  for (i = 0, ilen = count; i < ilen; ++i) {
4924
- var _parsed$i;
4925
4924
  index = i + start;
4926
- parsed[i] = (_parsed$i = {}, _defineProperty$1(_parsed$i, iAxis, singleScale || iScale.parse(labels[index], index)), _defineProperty$1(_parsed$i, vAxis, vScale.parse(data[index], index)), _parsed$i);
4925
+ parsed[i] = _defineProperty$1(_defineProperty$1({}, iAxis, singleScale || iScale.parse(labels[index], index)), vAxis, vScale.parse(data[index], index));
4927
4926
  }
4928
4927
  return parsed;
4929
4928
  }
@@ -6476,7 +6475,7 @@
6476
6475
  line._chart = this.chart;
6477
6476
  line._datasetIndex = this.index;
6478
6477
  line._decimated = !!_dataset._decimated;
6479
- line.points = points.slice(Math.max(this._drawStart - 1, 0), this._drawStart + this._drawCount);
6478
+ line.points = points;
6480
6479
  var options = this.resolveDatasetElementOptions(mode);
6481
6480
  if (!this.options.showLine) {
6482
6481
  options.borderWidth = 0;
@@ -9275,6 +9274,13 @@
9275
9274
  case 'right':
9276
9275
  left -= width;
9277
9276
  break;
9277
+ case 'inner':
9278
+ if (i === ilen - 1) {
9279
+ left -= width;
9280
+ } else if (i > 0) {
9281
+ left -= width / 2;
9282
+ }
9283
+ break;
9278
9284
  }
9279
9285
  backdrop = {
9280
9286
  left: left,
@@ -10432,9 +10438,9 @@
10432
10438
  return cached;
10433
10439
  }
10434
10440
  var hasFunction = function hasFunction(value) {
10435
- return isObject(value) && Object.getOwnPropertyNames(value).reduce(function (acc, key) {
10436
- return acc || isFunction(value[key]);
10437
- }, false);
10441
+ return isObject(value) && Object.getOwnPropertyNames(value).some(function (key) {
10442
+ return isFunction(value[key]);
10443
+ });
10438
10444
  };
10439
10445
  function needContext(proxy, names) {
10440
10446
  var _descriptors2 = _descriptors(proxy),
@@ -10459,7 +10465,7 @@
10459
10465
  }
10460
10466
  return false;
10461
10467
  }
10462
- var version = "4.3.1";
10468
+ var version = "4.4.1";
10463
10469
  var KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];
10464
10470
  function positionIsHorizontal(position, axis) {
10465
10471
  return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';
@@ -10521,17 +10527,21 @@
10521
10527
  }
10522
10528
  return e;
10523
10529
  }
10524
- function getDatasetArea(meta) {
10530
+ function getSizeForArea(scale, chartArea, field) {
10531
+ return scale.options.clip ? scale[field] : chartArea[field];
10532
+ }
10533
+ function getDatasetArea(meta, chartArea) {
10525
10534
  var xScale = meta.xScale,
10526
10535
  yScale = meta.yScale;
10527
10536
  if (xScale && yScale) {
10528
10537
  return {
10529
- left: xScale.left,
10530
- right: xScale.right,
10531
- top: yScale.top,
10532
- bottom: yScale.bottom
10538
+ left: getSizeForArea(xScale, chartArea, 'left'),
10539
+ right: getSizeForArea(xScale, chartArea, 'right'),
10540
+ top: getSizeForArea(yScale, chartArea, 'top'),
10541
+ bottom: getSizeForArea(yScale, chartArea, 'bottom')
10533
10542
  };
10534
10543
  }
10544
+ return chartArea;
10535
10545
  }
10536
10546
  var Chart = /*#__PURE__*/function () {
10537
10547
  function Chart(item, userConfig) {
@@ -11124,7 +11134,7 @@
11124
11134
  var ctx = this.ctx;
11125
11135
  var clip = meta._clip;
11126
11136
  var useClip = !clip.disabled;
11127
- var area = getDatasetArea(meta) || this.chartArea;
11137
+ var area = getDatasetArea(meta, this.chartArea);
11128
11138
  var args = {
11129
11139
  meta: meta,
11130
11140
  index: meta.index,
@@ -15280,12 +15290,15 @@
15280
15290
  }, {
15281
15291
  key: "_getActiveElements",
15282
15292
  value: function _getActiveElements(e, lastActive, replay, inChartArea) {
15293
+ var _this35 = this;
15283
15294
  var options = this.options;
15284
15295
  if (e.type === 'mouseout') {
15285
15296
  return [];
15286
15297
  }
15287
15298
  if (!inChartArea) {
15288
- return lastActive;
15299
+ return lastActive.filter(function (i) {
15300
+ return _this35.chart.data.datasets[i.datasetIndex] && _this35.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== undefined;
15301
+ });
15289
15302
  }
15290
15303
  var active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);
15291
15304
  if (options.reverse) {
@@ -15472,13 +15485,13 @@
15472
15485
  _inherits$1(CategoryScale, _Scale);
15473
15486
  var _super19 = _createSuper$1(CategoryScale);
15474
15487
  function CategoryScale(cfg) {
15475
- var _this35;
15488
+ var _this36;
15476
15489
  _classCallCheck$1(this, CategoryScale);
15477
- _this35 = _super19.call(this, cfg);
15478
- _this35._startValue = undefined;
15479
- _this35._valueRange = 0;
15480
- _this35._addedLabels = [];
15481
- return _this35;
15490
+ _this36 = _super19.call(this, cfg);
15491
+ _this36._startValue = undefined;
15492
+ _this36._valueRange = 0;
15493
+ _this36._addedLabels = [];
15494
+ return _this36;
15482
15495
  }
15483
15496
  _createClass$1(CategoryScale, [{
15484
15497
  key: "init",
@@ -15721,15 +15734,15 @@
15721
15734
  _inherits$1(LinearScaleBase, _Scale2);
15722
15735
  var _super20 = _createSuper$1(LinearScaleBase);
15723
15736
  function LinearScaleBase(cfg) {
15724
- var _this36;
15737
+ var _this37;
15725
15738
  _classCallCheck$1(this, LinearScaleBase);
15726
- _this36 = _super20.call(this, cfg);
15727
- _this36.start = undefined;
15728
- _this36.end = undefined;
15729
- _this36._startValue = undefined;
15730
- _this36._endValue = undefined;
15731
- _this36._valueRange = 0;
15732
- return _this36;
15739
+ _this37 = _super20.call(this, cfg);
15740
+ _this37.start = undefined;
15741
+ _this37.end = undefined;
15742
+ _this37._startValue = undefined;
15743
+ _this37._endValue = undefined;
15744
+ _this37._valueRange = 0;
15745
+ return _this37;
15733
15746
  }
15734
15747
  _createClass$1(LinearScaleBase, [{
15735
15748
  key: "parse",
@@ -15979,14 +15992,14 @@
15979
15992
  _inherits$1(LogarithmicScale, _Scale3);
15980
15993
  var _super22 = _createSuper$1(LogarithmicScale);
15981
15994
  function LogarithmicScale(cfg) {
15982
- var _this37;
15995
+ var _this38;
15983
15996
  _classCallCheck$1(this, LogarithmicScale);
15984
- _this37 = _super22.call(this, cfg);
15985
- _this37.start = undefined;
15986
- _this37.end = undefined;
15987
- _this37._startValue = undefined;
15988
- _this37._valueRange = 0;
15989
- return _this37;
15997
+ _this38 = _super22.call(this, cfg);
15998
+ _this38.start = undefined;
15999
+ _this38.end = undefined;
16000
+ _this38._startValue = undefined;
16001
+ _this38._valueRange = 0;
16002
+ return _this38;
15990
16003
  }
15991
16004
  _createClass$1(LogarithmicScale, [{
15992
16005
  key: "parse",
@@ -16381,15 +16394,15 @@
16381
16394
  _inherits$1(RadialLinearScale, _LinearScaleBase2);
16382
16395
  var _super23 = _createSuper$1(RadialLinearScale);
16383
16396
  function RadialLinearScale(cfg) {
16384
- var _this38;
16397
+ var _this39;
16385
16398
  _classCallCheck$1(this, RadialLinearScale);
16386
- _this38 = _super23.call(this, cfg);
16387
- _this38.xCenter = undefined;
16388
- _this38.yCenter = undefined;
16389
- _this38.drawingArea = undefined;
16390
- _this38._pointLabels = [];
16391
- _this38._pointLabelItems = [];
16392
- return _this38;
16399
+ _this39 = _super23.call(this, cfg);
16400
+ _this39.xCenter = undefined;
16401
+ _this39.yCenter = undefined;
16402
+ _this39.drawingArea = undefined;
16403
+ _this39._pointLabels = [];
16404
+ _this39._pointLabelItems = [];
16405
+ return _this39;
16393
16406
  }
16394
16407
  _createClass$1(RadialLinearScale, [{
16395
16408
  key: "setDimensions",
@@ -16419,13 +16432,13 @@
16419
16432
  }, {
16420
16433
  key: "generateTickLabels",
16421
16434
  value: function generateTickLabels(ticks) {
16422
- var _this39 = this;
16435
+ var _this40 = this;
16423
16436
  LinearScaleBase.prototype.generateTickLabels.call(this, ticks);
16424
16437
  this._pointLabels = this.getLabels().map(function (value, index) {
16425
- var label = callback(_this39.options.pointLabels.callback, [value, index], _this39);
16438
+ var label = callback(_this40.options.pointLabels.callback, [value, index], _this40);
16426
16439
  return label || label === 0 ? label : '';
16427
16440
  }).filter(function (v, i) {
16428
- return _this39.chart.getDataVisibility(i);
16441
+ return _this40.chart.getDataVisibility(i);
16429
16442
  });
16430
16443
  }
16431
16444
  }, {
@@ -16538,7 +16551,7 @@
16538
16551
  }, {
16539
16552
  key: "drawGrid",
16540
16553
  value: function drawGrid() {
16541
- var _this40 = this;
16554
+ var _this41 = this;
16542
16555
  var ctx = this.ctx;
16543
16556
  var opts = this.options;
16544
16557
  var angleLines = opts.angleLines,
@@ -16552,11 +16565,11 @@
16552
16565
  if (grid.display) {
16553
16566
  this.ticks.forEach(function (tick, index) {
16554
16567
  if (index !== 0) {
16555
- offset = _this40.getDistanceFromCenterForValue(tick.value);
16556
- var context = _this40.getContext(index);
16568
+ offset = _this41.getDistanceFromCenterForValue(tick.value);
16569
+ var context = _this41.getContext(index);
16557
16570
  var optsAtIndex = grid.setContext(context);
16558
16571
  var optsAtIndexBorder = border.setContext(context);
16559
- drawRadiusLine(_this40, optsAtIndex, offset, labelCount, optsAtIndexBorder);
16572
+ drawRadiusLine(_this41, optsAtIndex, offset, labelCount, optsAtIndexBorder);
16560
16573
  }
16561
16574
  });
16562
16575
  }
@@ -16589,7 +16602,7 @@
16589
16602
  }, {
16590
16603
  key: "drawLabels",
16591
16604
  value: function drawLabels() {
16592
- var _this41 = this;
16605
+ var _this42 = this;
16593
16606
  var ctx = this.ctx;
16594
16607
  var opts = this.options;
16595
16608
  var tickOpts = opts.ticks;
@@ -16607,9 +16620,9 @@
16607
16620
  if (index === 0 && !opts.reverse) {
16608
16621
  return;
16609
16622
  }
16610
- var optsAtIndex = tickOpts.setContext(_this41.getContext(index));
16623
+ var optsAtIndex = tickOpts.setContext(_this42.getContext(index));
16611
16624
  var tickFont = toFont(optsAtIndex.font);
16612
- offset = _this41.getDistanceFromCenterForValue(_this41.ticks[index].value);
16625
+ offset = _this42.getDistanceFromCenterForValue(_this42.ticks[index].value);
16613
16626
  if (optsAtIndex.showLabelBackdrop) {
16614
16627
  ctx.font = tickFont.string;
16615
16628
  width = ctx.measureText(tick.label).width;
@@ -16818,20 +16831,20 @@
16818
16831
  _inherits$1(TimeScale, _Scale4);
16819
16832
  var _super24 = _createSuper$1(TimeScale);
16820
16833
  function TimeScale(props) {
16821
- var _this42;
16834
+ var _this43;
16822
16835
  _classCallCheck$1(this, TimeScale);
16823
- _this42 = _super24.call(this, props);
16824
- _this42._cache = {
16836
+ _this43 = _super24.call(this, props);
16837
+ _this43._cache = {
16825
16838
  data: [],
16826
16839
  labels: [],
16827
16840
  all: []
16828
16841
  };
16829
- _this42._unit = 'day';
16830
- _this42._majorUnit = undefined;
16831
- _this42._offsets = {};
16832
- _this42._normalized = false;
16833
- _this42._parseOpts = undefined;
16834
- return _this42;
16842
+ _this43._unit = 'day';
16843
+ _this43._majorUnit = undefined;
16844
+ _this43._offsets = {};
16845
+ _this43._normalized = false;
16846
+ _this43._parseOpts = undefined;
16847
+ return _this43;
16835
16848
  }
16836
16849
  _createClass$1(TimeScale, [{
16837
16850
  key: "init",
@@ -17190,13 +17203,13 @@
17190
17203
  _inherits$1(TimeSeriesScale, _TimeScale);
17191
17204
  var _super25 = _createSuper$1(TimeSeriesScale);
17192
17205
  function TimeSeriesScale(props) {
17193
- var _this43;
17206
+ var _this44;
17194
17207
  _classCallCheck$1(this, TimeSeriesScale);
17195
- _this43 = _super25.call(this, props);
17196
- _this43._table = [];
17197
- _this43._minPos = undefined;
17198
- _this43._tableRange = undefined;
17199
- return _this43;
17208
+ _this44 = _super25.call(this, props);
17209
+ _this44._table = [];
17210
+ _this44._minPos = undefined;
17211
+ _this44._tableRange = undefined;
17212
+ return _this44;
17200
17213
  }
17201
17214
  _createClass$1(TimeSeriesScale, [{
17202
17215
  key: "initOffsets",
@@ -17431,14 +17444,14 @@
17431
17444
  valueOrDefault: valueOrDefault
17432
17445
  });
17433
17446
 
17434
- function _typeof(obj) {
17447
+ function _typeof(o) {
17435
17448
  "@babel/helpers - typeof";
17436
17449
 
17437
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
17438
- return typeof obj;
17439
- } : function (obj) {
17440
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
17441
- }, _typeof(obj);
17450
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
17451
+ return typeof o;
17452
+ } : function (o) {
17453
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
17454
+ }, _typeof(o);
17442
17455
  }
17443
17456
 
17444
17457
  function toInteger(dirtyNumber) {
@@ -18249,7 +18262,6 @@
18249
18262
  return value < 0 ? Math.ceil(value) : Math.floor(value);
18250
18263
  } // Math.trunc is not supported by IE
18251
18264
  };
18252
-
18253
18265
  var defaultRoundingMethod = 'trunc';
18254
18266
  function getRoundingMethod(method) {
18255
18267
  return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
@@ -21270,7 +21282,6 @@
21270
21282
  // 0 to 999, -0 to -999
21271
21283
  fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999
21272
21284
  };
21273
-
21274
21285
  var timezonePatterns = {
21275
21286
  basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
21276
21287
  basic: /^([+-])(\d{2})(\d{2})|Z/,
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.3
4
+ version: 5.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-24 00:00:00.000000000 Z
11
+ date: 2023-12-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: andrew@ankane.org