chartkick 5.0.4 → 5.0.6
Sign up to get free protection for your applications and to get access to all the features.
- 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 +143 -130
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3990dc8d7dcc12779a0fa7e69be8cc56c36268181a7120cec044a1c6cd78599f
|
4
|
+
data.tar.gz: fec488a8e79f43e10e572239aaf19b0886cbd03e4d6931dca4155ebb6ef5be45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d926ace8a238d9a41f901a9f626c93678c66e7a8e2087178b06db8a253cc160c8bc74b18580049d58619730b0893b21e2f6ebfc922933b336d9a472eb71cf456
|
7
|
+
data.tar.gz: 8012187958af8bb1070d7c9e645f6b20252ede8a3341e23b8d7a0eacf6b9afd342db9c1e8951bfdecf2b9ddcf5dae90948df06ff792e94a3859be253dc885029
|
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
|
-
[![Build Status](https://github.com/ankane/chartkick/workflows/build/badge.svg
|
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
|
|
data/lib/chartkick/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* Chart.js v4.4.
|
2
|
+
* Chart.js v4.4.2
|
3
3
|
* https://www.chartjs.org
|
4
|
-
* (c)
|
4
|
+
* (c) 2024 Chart.js Contributors
|
5
5
|
* Released under the MIT License
|
6
6
|
*
|
7
7
|
* @kurkle/color v0.3.2
|
@@ -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
|
@@ -2194,14 +2193,13 @@
|
|
2194
2193
|
}, {
|
2195
2194
|
key: "route",
|
2196
2195
|
value: function route(scope, name, targetScope, targetName) {
|
2197
|
-
var _Object$definePropert;
|
2198
2196
|
var scopeObject = getScope$1(this, scope);
|
2199
2197
|
var targetScopeObject = getScope$1(this, targetScope);
|
2200
2198
|
var privateName = '_' + name;
|
2201
|
-
Object.defineProperties(scopeObject, (
|
2199
|
+
Object.defineProperties(scopeObject, _defineProperty$1(_defineProperty$1({}, privateName, {
|
2202
2200
|
value: scopeObject[name],
|
2203
2201
|
writable: true
|
2204
|
-
}),
|
2202
|
+
}), name, {
|
2205
2203
|
enumerable: true,
|
2206
2204
|
get: function get() {
|
2207
2205
|
var local = this[privateName];
|
@@ -2214,7 +2212,7 @@
|
|
2214
2212
|
set: function set(value) {
|
2215
2213
|
this[privateName] = value;
|
2216
2214
|
}
|
2217
|
-
})
|
2215
|
+
}));
|
2218
2216
|
}
|
2219
2217
|
}, {
|
2220
2218
|
key: "apply",
|
@@ -2820,7 +2818,6 @@
|
|
2820
2818
|
* @private
|
2821
2819
|
*/
|
2822
2820
|
function _createResolver(scopes) {
|
2823
|
-
var _cache;
|
2824
2821
|
var prefixes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [''];
|
2825
2822
|
var rootScopes = arguments.length > 2 ? arguments[2] : undefined;
|
2826
2823
|
var fallback = arguments.length > 3 ? arguments[3] : undefined;
|
@@ -2831,9 +2828,9 @@
|
|
2831
2828
|
if (typeof fallback === 'undefined') {
|
2832
2829
|
fallback = _resolve('_fallback', scopes);
|
2833
2830
|
}
|
2834
|
-
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) {
|
2835
2832
|
return _createResolver([scope].concat(_toConsumableArray(scopes)), prefixes, finalRootScopes, fallback);
|
2836
|
-
})
|
2833
|
+
});
|
2837
2834
|
return new Proxy(cache, {
|
2838
2835
|
/**
|
2839
2836
|
* A trap for the delete operator.
|
@@ -3634,8 +3631,10 @@
|
|
3634
3631
|
return false;
|
3635
3632
|
}
|
3636
3633
|
};
|
3637
|
-
|
3638
|
-
|
3634
|
+
if (_isDomSupported()) {
|
3635
|
+
window.addEventListener('test', null, options);
|
3636
|
+
window.removeEventListener('test', null, options);
|
3637
|
+
}
|
3639
3638
|
} catch (e) {
|
3640
3639
|
// continue regardless of error
|
3641
3640
|
}
|
@@ -4922,9 +4921,8 @@
|
|
4922
4921
|
var parsed = new Array(count);
|
4923
4922
|
var i, ilen, index;
|
4924
4923
|
for (i = 0, ilen = count; i < ilen; ++i) {
|
4925
|
-
var _parsed$i;
|
4926
4924
|
index = i + start;
|
4927
|
-
parsed[i] = (
|
4925
|
+
parsed[i] = _defineProperty$1(_defineProperty$1({}, iAxis, singleScale || iScale.parse(labels[index], index)), vAxis, vScale.parse(data[index], index));
|
4928
4926
|
}
|
4929
4927
|
return parsed;
|
4930
4928
|
}
|
@@ -7827,10 +7825,14 @@
|
|
7827
7825
|
passive: true
|
7828
7826
|
} : false;
|
7829
7827
|
function addListener(node, type, listener) {
|
7830
|
-
node
|
7828
|
+
if (node) {
|
7829
|
+
node.addEventListener(type, listener, eventListenerOptions);
|
7830
|
+
}
|
7831
7831
|
}
|
7832
7832
|
function removeListener(chart, type, listener) {
|
7833
|
-
chart.canvas
|
7833
|
+
if (chart && chart.canvas) {
|
7834
|
+
chart.canvas.removeEventListener(type, listener, eventListenerOptions);
|
7835
|
+
}
|
7834
7836
|
}
|
7835
7837
|
function fromNativeEvent(event, chart) {
|
7836
7838
|
var type = EVENT_TYPES[event.type] || event.type;
|
@@ -9276,6 +9278,13 @@
|
|
9276
9278
|
case 'right':
|
9277
9279
|
left -= width;
|
9278
9280
|
break;
|
9281
|
+
case 'inner':
|
9282
|
+
if (i === ilen - 1) {
|
9283
|
+
left -= width;
|
9284
|
+
} else if (i > 0) {
|
9285
|
+
left -= width / 2;
|
9286
|
+
}
|
9287
|
+
break;
|
9279
9288
|
}
|
9280
9289
|
backdrop = {
|
9281
9290
|
left: left,
|
@@ -10433,9 +10442,9 @@
|
|
10433
10442
|
return cached;
|
10434
10443
|
}
|
10435
10444
|
var hasFunction = function hasFunction(value) {
|
10436
|
-
return isObject(value) && Object.getOwnPropertyNames(value).
|
10437
|
-
return
|
10438
|
-
}
|
10445
|
+
return isObject(value) && Object.getOwnPropertyNames(value).some(function (key) {
|
10446
|
+
return isFunction(value[key]);
|
10447
|
+
});
|
10439
10448
|
};
|
10440
10449
|
function needContext(proxy, names) {
|
10441
10450
|
var _descriptors2 = _descriptors(proxy),
|
@@ -10460,7 +10469,7 @@
|
|
10460
10469
|
}
|
10461
10470
|
return false;
|
10462
10471
|
}
|
10463
|
-
var version = "4.4.
|
10472
|
+
var version = "4.4.2";
|
10464
10473
|
var KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];
|
10465
10474
|
function positionIsHorizontal(position, axis) {
|
10466
10475
|
return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';
|
@@ -14352,20 +14361,23 @@
|
|
14352
14361
|
return false;
|
14353
14362
|
}
|
14354
14363
|
var i, len;
|
14355
|
-
var
|
14364
|
+
var xSet = new Set();
|
14356
14365
|
var y = 0;
|
14357
14366
|
var count = 0;
|
14358
14367
|
for (i = 0, len = items.length; i < len; ++i) {
|
14359
14368
|
var el = items[i].element;
|
14360
14369
|
if (el && el.hasValue()) {
|
14361
14370
|
var pos = el.tooltipPosition();
|
14362
|
-
|
14371
|
+
xSet.add(pos.x);
|
14363
14372
|
y += pos.y;
|
14364
14373
|
++count;
|
14365
14374
|
}
|
14366
14375
|
}
|
14376
|
+
var xAverage = _toConsumableArray(xSet).reduce(function (a, b) {
|
14377
|
+
return a + b;
|
14378
|
+
}) / xSet.size;
|
14367
14379
|
return {
|
14368
|
-
x:
|
14380
|
+
x: xAverage,
|
14369
14381
|
y: y / count
|
14370
14382
|
};
|
14371
14383
|
},
|
@@ -15285,12 +15297,15 @@
|
|
15285
15297
|
}, {
|
15286
15298
|
key: "_getActiveElements",
|
15287
15299
|
value: function _getActiveElements(e, lastActive, replay, inChartArea) {
|
15300
|
+
var _this35 = this;
|
15288
15301
|
var options = this.options;
|
15289
15302
|
if (e.type === 'mouseout') {
|
15290
15303
|
return [];
|
15291
15304
|
}
|
15292
15305
|
if (!inChartArea) {
|
15293
|
-
return lastActive
|
15306
|
+
return lastActive.filter(function (i) {
|
15307
|
+
return _this35.chart.data.datasets[i.datasetIndex] && _this35.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== undefined;
|
15308
|
+
});
|
15294
15309
|
}
|
15295
15310
|
var active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);
|
15296
15311
|
if (options.reverse) {
|
@@ -15477,13 +15492,13 @@
|
|
15477
15492
|
_inherits$1(CategoryScale, _Scale);
|
15478
15493
|
var _super19 = _createSuper$1(CategoryScale);
|
15479
15494
|
function CategoryScale(cfg) {
|
15480
|
-
var
|
15495
|
+
var _this36;
|
15481
15496
|
_classCallCheck$1(this, CategoryScale);
|
15482
|
-
|
15483
|
-
|
15484
|
-
|
15485
|
-
|
15486
|
-
return
|
15497
|
+
_this36 = _super19.call(this, cfg);
|
15498
|
+
_this36._startValue = undefined;
|
15499
|
+
_this36._valueRange = 0;
|
15500
|
+
_this36._addedLabels = [];
|
15501
|
+
return _this36;
|
15487
15502
|
}
|
15488
15503
|
_createClass$1(CategoryScale, [{
|
15489
15504
|
key: "init",
|
@@ -15726,15 +15741,15 @@
|
|
15726
15741
|
_inherits$1(LinearScaleBase, _Scale2);
|
15727
15742
|
var _super20 = _createSuper$1(LinearScaleBase);
|
15728
15743
|
function LinearScaleBase(cfg) {
|
15729
|
-
var
|
15744
|
+
var _this37;
|
15730
15745
|
_classCallCheck$1(this, LinearScaleBase);
|
15731
|
-
|
15732
|
-
|
15733
|
-
|
15734
|
-
|
15735
|
-
|
15736
|
-
|
15737
|
-
return
|
15746
|
+
_this37 = _super20.call(this, cfg);
|
15747
|
+
_this37.start = undefined;
|
15748
|
+
_this37.end = undefined;
|
15749
|
+
_this37._startValue = undefined;
|
15750
|
+
_this37._endValue = undefined;
|
15751
|
+
_this37._valueRange = 0;
|
15752
|
+
return _this37;
|
15738
15753
|
}
|
15739
15754
|
_createClass$1(LinearScaleBase, [{
|
15740
15755
|
key: "parse",
|
@@ -15984,14 +15999,14 @@
|
|
15984
15999
|
_inherits$1(LogarithmicScale, _Scale3);
|
15985
16000
|
var _super22 = _createSuper$1(LogarithmicScale);
|
15986
16001
|
function LogarithmicScale(cfg) {
|
15987
|
-
var
|
16002
|
+
var _this38;
|
15988
16003
|
_classCallCheck$1(this, LogarithmicScale);
|
15989
|
-
|
15990
|
-
|
15991
|
-
|
15992
|
-
|
15993
|
-
|
15994
|
-
return
|
16004
|
+
_this38 = _super22.call(this, cfg);
|
16005
|
+
_this38.start = undefined;
|
16006
|
+
_this38.end = undefined;
|
16007
|
+
_this38._startValue = undefined;
|
16008
|
+
_this38._valueRange = 0;
|
16009
|
+
return _this38;
|
15995
16010
|
}
|
15996
16011
|
_createClass$1(LogarithmicScale, [{
|
15997
16012
|
key: "parse",
|
@@ -16386,15 +16401,15 @@
|
|
16386
16401
|
_inherits$1(RadialLinearScale, _LinearScaleBase2);
|
16387
16402
|
var _super23 = _createSuper$1(RadialLinearScale);
|
16388
16403
|
function RadialLinearScale(cfg) {
|
16389
|
-
var
|
16404
|
+
var _this39;
|
16390
16405
|
_classCallCheck$1(this, RadialLinearScale);
|
16391
|
-
|
16392
|
-
|
16393
|
-
|
16394
|
-
|
16395
|
-
|
16396
|
-
|
16397
|
-
return
|
16406
|
+
_this39 = _super23.call(this, cfg);
|
16407
|
+
_this39.xCenter = undefined;
|
16408
|
+
_this39.yCenter = undefined;
|
16409
|
+
_this39.drawingArea = undefined;
|
16410
|
+
_this39._pointLabels = [];
|
16411
|
+
_this39._pointLabelItems = [];
|
16412
|
+
return _this39;
|
16398
16413
|
}
|
16399
16414
|
_createClass$1(RadialLinearScale, [{
|
16400
16415
|
key: "setDimensions",
|
@@ -16424,13 +16439,13 @@
|
|
16424
16439
|
}, {
|
16425
16440
|
key: "generateTickLabels",
|
16426
16441
|
value: function generateTickLabels(ticks) {
|
16427
|
-
var
|
16442
|
+
var _this40 = this;
|
16428
16443
|
LinearScaleBase.prototype.generateTickLabels.call(this, ticks);
|
16429
16444
|
this._pointLabels = this.getLabels().map(function (value, index) {
|
16430
|
-
var label = callback(
|
16445
|
+
var label = callback(_this40.options.pointLabels.callback, [value, index], _this40);
|
16431
16446
|
return label || label === 0 ? label : '';
|
16432
16447
|
}).filter(function (v, i) {
|
16433
|
-
return
|
16448
|
+
return _this40.chart.getDataVisibility(i);
|
16434
16449
|
});
|
16435
16450
|
}
|
16436
16451
|
}, {
|
@@ -16543,7 +16558,7 @@
|
|
16543
16558
|
}, {
|
16544
16559
|
key: "drawGrid",
|
16545
16560
|
value: function drawGrid() {
|
16546
|
-
var
|
16561
|
+
var _this41 = this;
|
16547
16562
|
var ctx = this.ctx;
|
16548
16563
|
var opts = this.options;
|
16549
16564
|
var angleLines = opts.angleLines,
|
@@ -16556,12 +16571,12 @@
|
|
16556
16571
|
}
|
16557
16572
|
if (grid.display) {
|
16558
16573
|
this.ticks.forEach(function (tick, index) {
|
16559
|
-
if (index !== 0) {
|
16560
|
-
offset =
|
16561
|
-
var context =
|
16574
|
+
if (index !== 0 || index === 0 && _this41.min < 0) {
|
16575
|
+
offset = _this41.getDistanceFromCenterForValue(tick.value);
|
16576
|
+
var context = _this41.getContext(index);
|
16562
16577
|
var optsAtIndex = grid.setContext(context);
|
16563
16578
|
var optsAtIndexBorder = border.setContext(context);
|
16564
|
-
drawRadiusLine(
|
16579
|
+
drawRadiusLine(_this41, optsAtIndex, offset, labelCount, optsAtIndexBorder);
|
16565
16580
|
}
|
16566
16581
|
});
|
16567
16582
|
}
|
@@ -16594,7 +16609,7 @@
|
|
16594
16609
|
}, {
|
16595
16610
|
key: "drawLabels",
|
16596
16611
|
value: function drawLabels() {
|
16597
|
-
var
|
16612
|
+
var _this42 = this;
|
16598
16613
|
var ctx = this.ctx;
|
16599
16614
|
var opts = this.options;
|
16600
16615
|
var tickOpts = opts.ticks;
|
@@ -16609,12 +16624,12 @@
|
|
16609
16624
|
ctx.textAlign = 'center';
|
16610
16625
|
ctx.textBaseline = 'middle';
|
16611
16626
|
this.ticks.forEach(function (tick, index) {
|
16612
|
-
if (index === 0 && !opts.reverse) {
|
16627
|
+
if (index === 0 && _this42.min >= 0 && !opts.reverse) {
|
16613
16628
|
return;
|
16614
16629
|
}
|
16615
|
-
var optsAtIndex = tickOpts.setContext(
|
16630
|
+
var optsAtIndex = tickOpts.setContext(_this42.getContext(index));
|
16616
16631
|
var tickFont = toFont(optsAtIndex.font);
|
16617
|
-
offset =
|
16632
|
+
offset = _this42.getDistanceFromCenterForValue(_this42.ticks[index].value);
|
16618
16633
|
if (optsAtIndex.showLabelBackdrop) {
|
16619
16634
|
ctx.font = tickFont.string;
|
16620
16635
|
width = ctx.measureText(tick.label).width;
|
@@ -16823,20 +16838,20 @@
|
|
16823
16838
|
_inherits$1(TimeScale, _Scale4);
|
16824
16839
|
var _super24 = _createSuper$1(TimeScale);
|
16825
16840
|
function TimeScale(props) {
|
16826
|
-
var
|
16841
|
+
var _this43;
|
16827
16842
|
_classCallCheck$1(this, TimeScale);
|
16828
|
-
|
16829
|
-
|
16843
|
+
_this43 = _super24.call(this, props);
|
16844
|
+
_this43._cache = {
|
16830
16845
|
data: [],
|
16831
16846
|
labels: [],
|
16832
16847
|
all: []
|
16833
16848
|
};
|
16834
|
-
|
16835
|
-
|
16836
|
-
|
16837
|
-
|
16838
|
-
|
16839
|
-
return
|
16849
|
+
_this43._unit = 'day';
|
16850
|
+
_this43._majorUnit = undefined;
|
16851
|
+
_this43._offsets = {};
|
16852
|
+
_this43._normalized = false;
|
16853
|
+
_this43._parseOpts = undefined;
|
16854
|
+
return _this43;
|
16840
16855
|
}
|
16841
16856
|
_createClass$1(TimeScale, [{
|
16842
16857
|
key: "init",
|
@@ -17195,13 +17210,13 @@
|
|
17195
17210
|
_inherits$1(TimeSeriesScale, _TimeScale);
|
17196
17211
|
var _super25 = _createSuper$1(TimeSeriesScale);
|
17197
17212
|
function TimeSeriesScale(props) {
|
17198
|
-
var
|
17213
|
+
var _this44;
|
17199
17214
|
_classCallCheck$1(this, TimeSeriesScale);
|
17200
|
-
|
17201
|
-
|
17202
|
-
|
17203
|
-
|
17204
|
-
return
|
17215
|
+
_this44 = _super25.call(this, props);
|
17216
|
+
_this44._table = [];
|
17217
|
+
_this44._minPos = undefined;
|
17218
|
+
_this44._tableRange = undefined;
|
17219
|
+
return _this44;
|
17205
17220
|
}
|
17206
17221
|
_createClass$1(TimeSeriesScale, [{
|
17207
17222
|
key: "initOffsets",
|
@@ -17436,14 +17451,14 @@
|
|
17436
17451
|
valueOrDefault: valueOrDefault
|
17437
17452
|
});
|
17438
17453
|
|
17439
|
-
function _typeof(
|
17454
|
+
function _typeof(o) {
|
17440
17455
|
"@babel/helpers - typeof";
|
17441
17456
|
|
17442
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
17443
|
-
return typeof
|
17444
|
-
} : function (
|
17445
|
-
return
|
17446
|
-
}, _typeof(
|
17457
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
17458
|
+
return typeof o;
|
17459
|
+
} : function (o) {
|
17460
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
17461
|
+
}, _typeof(o);
|
17447
17462
|
}
|
17448
17463
|
|
17449
17464
|
function toInteger(dirtyNumber) {
|
@@ -18254,7 +18269,6 @@
|
|
18254
18269
|
return value < 0 ? Math.ceil(value) : Math.floor(value);
|
18255
18270
|
} // Math.trunc is not supported by IE
|
18256
18271
|
};
|
18257
|
-
|
18258
18272
|
var defaultRoundingMethod = 'trunc';
|
18259
18273
|
function getRoundingMethod(method) {
|
18260
18274
|
return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
|
@@ -21275,7 +21289,6 @@
|
|
21275
21289
|
// 0 to 999, -0 to -999
|
21276
21290
|
fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999
|
21277
21291
|
};
|
21278
|
-
|
21279
21292
|
var timezonePatterns = {
|
21280
21293
|
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
21281
21294
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: andrew@ankane.org
|
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
|
-
rubygems_version: 3.
|
55
|
+
rubygems_version: 3.5.3
|
56
56
|
signing_key:
|
57
57
|
specification_version: 4
|
58
58
|
summary: Create beautiful JavaScript charts with one line of Ruby
|