chartkick 5.0.3 → 5.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +2 -4
- data/lib/chartkick/version.rb +1 -1
- data/vendor/assets/javascripts/Chart.bundle.js +141 -130
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4c12b23eada9f3616245b3db795ebe98d71f7edc9cc3a325ff5359c8998ccf7
|
|
4
|
+
data.tar.gz: 1af2f8289b768f28847bf6c75e61f3803ed43a3850d7e52d990381f43440a95d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: efb010cad8e5501514b25debf313ea6e9ed4facc5d6d1feae5c914d3e0ebc72485a64659bca83cdc772709e96eea6b70773e80dd98187c0c66a4aecf984b0e65
|
|
7
|
+
data.tar.gz: ca7305dbb9765f35c1e085e11d40d3ab95527215f11dd88a0efb9007fb40cdeaf3808ee4ed4c3db1dbb2deb7d9e180d83beb7345e68012b70d65b2f92399f5c2
|
data/CHANGELOG.md
CHANGED
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
|
-
[](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
|
|
data/lib/chartkick/version.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Chart.js v4.
|
|
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(
|
|
30
|
-
var
|
|
31
|
-
if (null !=
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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 (
|
|
41
|
-
if (Object(
|
|
42
|
-
|
|
43
|
-
} else for (; !(
|
|
44
|
-
} catch (
|
|
45
|
-
|
|
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 (!
|
|
48
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
49
49
|
} finally {
|
|
50
|
-
if (
|
|
50
|
+
if (o) throw n;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return a;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
function ownKeys(
|
|
57
|
-
var
|
|
56
|
+
function ownKeys(e, r) {
|
|
57
|
+
var t = Object.keys(e);
|
|
58
58
|
if (Object.getOwnPropertySymbols) {
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
return Object.getOwnPropertyDescriptor(
|
|
62
|
-
})),
|
|
63
|
-
}
|
|
64
|
-
return
|
|
65
|
-
}
|
|
66
|
-
function _objectSpread2(
|
|
67
|
-
for (var
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
_defineProperty$1(
|
|
71
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
72
|
-
Object.defineProperty(
|
|
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
|
|
75
|
+
return e;
|
|
76
76
|
}
|
|
77
|
-
function _typeof$1(
|
|
77
|
+
function _typeof$1(o) {
|
|
78
78
|
"@babel/helpers - typeof";
|
|
79
79
|
|
|
80
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
81
|
-
return typeof
|
|
82
|
-
} : function (
|
|
83
|
-
return
|
|
84
|
-
}, _typeof$1(
|
|
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, (
|
|
2199
|
+
Object.defineProperties(scopeObject, _defineProperty$1(_defineProperty$1({}, privateName, {
|
|
2201
2200
|
value: scopeObject[name],
|
|
2202
2201
|
writable: true
|
|
2203
|
-
}),
|
|
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
|
-
})
|
|
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,
|
|
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 = (
|
|
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
|
-
})
|
|
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
|
-
|
|
3637
|
-
|
|
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] = (
|
|
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
|
|
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).
|
|
10436
|
-
return
|
|
10437
|
-
}
|
|
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.
|
|
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
|
|
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
|
|
10530
|
-
right: xScale
|
|
10531
|
-
top: yScale
|
|
10532
|
-
bottom: yScale
|
|
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
|
|
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
|
|
15488
|
+
var _this36;
|
|
15476
15489
|
_classCallCheck$1(this, CategoryScale);
|
|
15477
|
-
|
|
15478
|
-
|
|
15479
|
-
|
|
15480
|
-
|
|
15481
|
-
return
|
|
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
|
|
15737
|
+
var _this37;
|
|
15725
15738
|
_classCallCheck$1(this, LinearScaleBase);
|
|
15726
|
-
|
|
15727
|
-
|
|
15728
|
-
|
|
15729
|
-
|
|
15730
|
-
|
|
15731
|
-
|
|
15732
|
-
return
|
|
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
|
|
15995
|
+
var _this38;
|
|
15983
15996
|
_classCallCheck$1(this, LogarithmicScale);
|
|
15984
|
-
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
return
|
|
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
|
|
16397
|
+
var _this39;
|
|
16385
16398
|
_classCallCheck$1(this, RadialLinearScale);
|
|
16386
|
-
|
|
16387
|
-
|
|
16388
|
-
|
|
16389
|
-
|
|
16390
|
-
|
|
16391
|
-
|
|
16392
|
-
return
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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 =
|
|
16556
|
-
var context =
|
|
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(
|
|
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
|
|
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(
|
|
16623
|
+
var optsAtIndex = tickOpts.setContext(_this42.getContext(index));
|
|
16611
16624
|
var tickFont = toFont(optsAtIndex.font);
|
|
16612
|
-
offset =
|
|
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
|
|
16834
|
+
var _this43;
|
|
16822
16835
|
_classCallCheck$1(this, TimeScale);
|
|
16823
|
-
|
|
16824
|
-
|
|
16836
|
+
_this43 = _super24.call(this, props);
|
|
16837
|
+
_this43._cache = {
|
|
16825
16838
|
data: [],
|
|
16826
16839
|
labels: [],
|
|
16827
16840
|
all: []
|
|
16828
16841
|
};
|
|
16829
|
-
|
|
16830
|
-
|
|
16831
|
-
|
|
16832
|
-
|
|
16833
|
-
|
|
16834
|
-
return
|
|
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
|
|
17206
|
+
var _this44;
|
|
17194
17207
|
_classCallCheck$1(this, TimeSeriesScale);
|
|
17195
|
-
|
|
17196
|
-
|
|
17197
|
-
|
|
17198
|
-
|
|
17199
|
-
return
|
|
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(
|
|
17447
|
+
function _typeof(o) {
|
|
17435
17448
|
"@babel/helpers - typeof";
|
|
17436
17449
|
|
|
17437
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
17438
|
-
return typeof
|
|
17439
|
-
} : function (
|
|
17440
|
-
return
|
|
17441
|
-
}, _typeof(
|
|
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.
|
|
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
|
|
11
|
+
date: 2023-12-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email: andrew@ankane.org
|