chartkick 2.3.1 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of chartkick might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/stale.yml +16 -0
- data/CHANGELOG.md +4 -0
- data/lib/chartkick/version.rb +1 -1
- data/vendor/assets/javascripts/chartkick.js +187 -124
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25800bdc22d121e4772de93a683abccb0dbd17ad
|
4
|
+
data.tar.gz: 0c6a84c170980a66c0478624813c15b0e3edcb6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbad3147ef4f3c568077291e3a2a191ba2ff7b290f80c9d895c8b824b64593b2ec07c9cb4941a821a568e1054ffc4b554457da638ed26ceb59aec652e218636f
|
7
|
+
data.tar.gz: 29909c761946dcdc2fb803f04a79f07bf6e570e9d07e96639fc78d7c93214c0866fc7cbec918120cc77a4376be1940e77da85830bcbb9fb24b8a40d36bba8564
|
data/.github/stale.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# Number of days of inactivity before an issue becomes stale
|
2
|
+
daysUntilStale: 7
|
3
|
+
# Number of days of inactivity before a stale issue is closed
|
4
|
+
daysUntilClose: 7
|
5
|
+
# Issues with these labels will never be considered stale
|
6
|
+
exemptLabels:
|
7
|
+
- enhancement
|
8
|
+
# Label to use when marking an issue as stale
|
9
|
+
staleLabel: stale
|
10
|
+
# Comment to post when marking an issue as stale. Set to `false` to disable
|
11
|
+
markComment: >
|
12
|
+
This issue has been automatically marked as stale because it has not had
|
13
|
+
recent activity. It will be closed if no further activity occurs. Thank you
|
14
|
+
for your contributions.
|
15
|
+
# Comment to post when closing a stale issue. Set to `false` to disable
|
16
|
+
closeComment: true
|
data/CHANGELOG.md
CHANGED
data/lib/chartkick/version.rb
CHANGED
@@ -1,76 +1,76 @@
|
|
1
1
|
(function webpackUniversalModuleDefinition(root, factory) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
3
|
+
module.exports = factory();
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
5
|
+
define([], factory);
|
6
|
+
else if(typeof exports === 'object')
|
7
|
+
exports["Chartkick"] = factory();
|
8
|
+
else
|
9
|
+
root["Chartkick"] = factory();
|
10
10
|
})(typeof self !== 'undefined' ? self : this, function() {
|
11
11
|
return /******/ (function(modules) { // webpackBootstrap
|
12
|
-
/******/
|
13
|
-
/******/
|
12
|
+
/******/ // The module cache
|
13
|
+
/******/ var installedModules = {};
|
14
14
|
/******/
|
15
|
-
/******/
|
16
|
-
/******/
|
15
|
+
/******/ // The require function
|
16
|
+
/******/ function __webpack_require__(moduleId) {
|
17
17
|
/******/
|
18
|
-
/******/
|
19
|
-
/******/
|
20
|
-
/******/
|
21
|
-
/******/
|
22
|
-
/******/
|
23
|
-
/******/
|
24
|
-
/******/
|
25
|
-
/******/
|
26
|
-
/******/
|
27
|
-
/******/
|
18
|
+
/******/ // Check if module is in cache
|
19
|
+
/******/ if(installedModules[moduleId]) {
|
20
|
+
/******/ return installedModules[moduleId].exports;
|
21
|
+
/******/ }
|
22
|
+
/******/ // Create a new module (and put it into the cache)
|
23
|
+
/******/ var module = installedModules[moduleId] = {
|
24
|
+
/******/ i: moduleId,
|
25
|
+
/******/ l: false,
|
26
|
+
/******/ exports: {}
|
27
|
+
/******/ };
|
28
28
|
/******/
|
29
|
-
/******/
|
30
|
-
/******/
|
29
|
+
/******/ // Execute the module function
|
30
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31
31
|
/******/
|
32
|
-
/******/
|
33
|
-
/******/
|
32
|
+
/******/ // Flag the module as loaded
|
33
|
+
/******/ module.l = true;
|
34
34
|
/******/
|
35
|
-
/******/
|
36
|
-
/******/
|
37
|
-
/******/
|
35
|
+
/******/ // Return the exports of the module
|
36
|
+
/******/ return module.exports;
|
37
|
+
/******/ }
|
38
38
|
/******/
|
39
39
|
/******/
|
40
|
-
/******/
|
41
|
-
/******/
|
40
|
+
/******/ // expose the modules object (__webpack_modules__)
|
41
|
+
/******/ __webpack_require__.m = modules;
|
42
42
|
/******/
|
43
|
-
/******/
|
44
|
-
/******/
|
43
|
+
/******/ // expose the module cache
|
44
|
+
/******/ __webpack_require__.c = installedModules;
|
45
45
|
/******/
|
46
|
-
/******/
|
47
|
-
/******/
|
48
|
-
/******/
|
49
|
-
/******/
|
50
|
-
/******/
|
51
|
-
/******/
|
52
|
-
/******/
|
53
|
-
/******/
|
54
|
-
/******/
|
55
|
-
/******/
|
46
|
+
/******/ // define getter function for harmony exports
|
47
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
48
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
49
|
+
/******/ Object.defineProperty(exports, name, {
|
50
|
+
/******/ configurable: false,
|
51
|
+
/******/ enumerable: true,
|
52
|
+
/******/ get: getter
|
53
|
+
/******/ });
|
54
|
+
/******/ }
|
55
|
+
/******/ };
|
56
56
|
/******/
|
57
|
-
/******/
|
58
|
-
/******/
|
59
|
-
/******/
|
60
|
-
/******/
|
61
|
-
/******/
|
62
|
-
/******/
|
63
|
-
/******/
|
64
|
-
/******/
|
57
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
58
|
+
/******/ __webpack_require__.n = function(module) {
|
59
|
+
/******/ var getter = module && module.__esModule ?
|
60
|
+
/******/ function getDefault() { return module['default']; } :
|
61
|
+
/******/ function getModuleExports() { return module; };
|
62
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
63
|
+
/******/ return getter;
|
64
|
+
/******/ };
|
65
65
|
/******/
|
66
|
-
/******/
|
67
|
-
/******/
|
66
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
67
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
68
68
|
/******/
|
69
|
-
/******/
|
70
|
-
/******/
|
69
|
+
/******/ // __webpack_public_path__
|
70
|
+
/******/ __webpack_require__.p = "";
|
71
71
|
/******/
|
72
|
-
/******/
|
73
|
-
/******/
|
72
|
+
/******/ // Load entry module and return exports
|
73
|
+
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
74
74
|
/******/ })
|
75
75
|
/************************************************************************/
|
76
76
|
/******/ ([
|
@@ -379,7 +379,6 @@ exports.isDate = isDate;
|
|
379
379
|
Object.defineProperty(exports, "__esModule", {
|
380
380
|
value: true
|
381
381
|
});
|
382
|
-
exports.Chartkick = undefined;
|
383
382
|
|
384
383
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
385
384
|
|
@@ -387,7 +386,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
387
386
|
* Chartkick.js
|
388
387
|
* Create beautiful charts with one line of JavaScript
|
389
388
|
* https://github.com/ankane/chartkick.js
|
390
|
-
* v2.3.
|
389
|
+
* v2.3.3
|
391
390
|
* MIT License
|
392
391
|
*/
|
393
392
|
|
@@ -405,6 +404,8 @@ var _google2 = _interopRequireDefault(_google);
|
|
405
404
|
|
406
405
|
var _helpers = __webpack_require__(0);
|
407
406
|
|
407
|
+
var _request_queue = __webpack_require__(5);
|
408
|
+
|
408
409
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
409
410
|
|
410
411
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
@@ -415,9 +416,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
415
416
|
|
416
417
|
var config = window.Chartkick || {};
|
417
418
|
var adapters = [];
|
418
|
-
var pendingRequests = [],
|
419
|
-
runningRequests = 0,
|
420
|
-
maxRequests = 4;
|
421
419
|
|
422
420
|
// helpers
|
423
421
|
|
@@ -434,61 +432,6 @@ function chartError(element, message) {
|
|
434
432
|
element.style.color = "#ff0000";
|
435
433
|
}
|
436
434
|
|
437
|
-
function pushRequest(element, url, success) {
|
438
|
-
pendingRequests.push([element, url, success]);
|
439
|
-
runNext();
|
440
|
-
}
|
441
|
-
|
442
|
-
function runNext() {
|
443
|
-
if (runningRequests < maxRequests) {
|
444
|
-
var request = pendingRequests.shift();
|
445
|
-
if (request) {
|
446
|
-
runningRequests++;
|
447
|
-
getJSON(request[0], request[1], request[2]);
|
448
|
-
runNext();
|
449
|
-
}
|
450
|
-
}
|
451
|
-
}
|
452
|
-
|
453
|
-
function requestComplete() {
|
454
|
-
runningRequests--;
|
455
|
-
runNext();
|
456
|
-
}
|
457
|
-
|
458
|
-
function getJSON(element, url, success) {
|
459
|
-
ajaxCall(url, success, function (jqXHR, textStatus, errorThrown) {
|
460
|
-
var message = typeof errorThrown === "string" ? errorThrown : errorThrown.message;
|
461
|
-
chartError(element, message);
|
462
|
-
});
|
463
|
-
}
|
464
|
-
|
465
|
-
function ajaxCall(url, success, error) {
|
466
|
-
var $ = window.jQuery || window.Zepto || window.$;
|
467
|
-
|
468
|
-
if ($) {
|
469
|
-
$.ajax({
|
470
|
-
dataType: "json",
|
471
|
-
url: url,
|
472
|
-
success: success,
|
473
|
-
error: error,
|
474
|
-
complete: requestComplete
|
475
|
-
});
|
476
|
-
} else {
|
477
|
-
var xhr = new XMLHttpRequest();
|
478
|
-
xhr.open("GET", url, true);
|
479
|
-
xhr.setRequestHeader("Content-Type", "application/json");
|
480
|
-
xhr.onload = function () {
|
481
|
-
requestComplete();
|
482
|
-
if (xhr.status === 200) {
|
483
|
-
success(JSON.parse(xhr.responseText), xhr.statusText, xhr);
|
484
|
-
} else {
|
485
|
-
error(xhr, "error", xhr.statusText);
|
486
|
-
}
|
487
|
-
};
|
488
|
-
xhr.send();
|
489
|
-
}
|
490
|
-
}
|
491
|
-
|
492
435
|
function errorCatcher(chart) {
|
493
436
|
try {
|
494
437
|
chart.__render();
|
@@ -500,9 +443,11 @@ function errorCatcher(chart) {
|
|
500
443
|
|
501
444
|
function fetchDataSource(chart, dataSource) {
|
502
445
|
if (typeof dataSource === "string") {
|
503
|
-
|
446
|
+
(0, _request_queue.pushRequest)(dataSource, function (data) {
|
504
447
|
chart.rawData = data;
|
505
448
|
errorCatcher(chart);
|
449
|
+
}, function (message) {
|
450
|
+
chartError(chart.element, message);
|
506
451
|
});
|
507
452
|
} else {
|
508
453
|
chart.rawData = dataSource;
|
@@ -887,7 +832,7 @@ var Chart = function () {
|
|
887
832
|
key: "__render",
|
888
833
|
value: function __render() {
|
889
834
|
this.data = this.__processData();
|
890
|
-
renderChart(this.
|
835
|
+
renderChart(this.__chartName(), this);
|
891
836
|
}
|
892
837
|
}]);
|
893
838
|
|
@@ -908,6 +853,11 @@ var LineChart = function (_Chart) {
|
|
908
853
|
value: function __processData() {
|
909
854
|
return processSeries(this, "datetime");
|
910
855
|
}
|
856
|
+
}, {
|
857
|
+
key: "__chartName",
|
858
|
+
value: function __chartName() {
|
859
|
+
return "LineChart";
|
860
|
+
}
|
911
861
|
}]);
|
912
862
|
|
913
863
|
return LineChart;
|
@@ -927,6 +877,11 @@ var PieChart = function (_Chart2) {
|
|
927
877
|
value: function __processData() {
|
928
878
|
return processSimple(this);
|
929
879
|
}
|
880
|
+
}, {
|
881
|
+
key: "__chartName",
|
882
|
+
value: function __chartName() {
|
883
|
+
return "PieChart";
|
884
|
+
}
|
930
885
|
}]);
|
931
886
|
|
932
887
|
return PieChart;
|
@@ -946,6 +901,11 @@ var ColumnChart = function (_Chart3) {
|
|
946
901
|
value: function __processData() {
|
947
902
|
return processSeries(this, "string");
|
948
903
|
}
|
904
|
+
}, {
|
905
|
+
key: "__chartName",
|
906
|
+
value: function __chartName() {
|
907
|
+
return "ColumnChart";
|
908
|
+
}
|
949
909
|
}]);
|
950
910
|
|
951
911
|
return ColumnChart;
|
@@ -965,6 +925,11 @@ var BarChart = function (_Chart4) {
|
|
965
925
|
value: function __processData() {
|
966
926
|
return processSeries(this, "string");
|
967
927
|
}
|
928
|
+
}, {
|
929
|
+
key: "__chartName",
|
930
|
+
value: function __chartName() {
|
931
|
+
return "BarChart";
|
932
|
+
}
|
968
933
|
}]);
|
969
934
|
|
970
935
|
return BarChart;
|
@@ -984,6 +949,11 @@ var AreaChart = function (_Chart5) {
|
|
984
949
|
value: function __processData() {
|
985
950
|
return processSeries(this, "datetime");
|
986
951
|
}
|
952
|
+
}, {
|
953
|
+
key: "__chartName",
|
954
|
+
value: function __chartName() {
|
955
|
+
return "AreaChart";
|
956
|
+
}
|
987
957
|
}]);
|
988
958
|
|
989
959
|
return AreaChart;
|
@@ -1003,6 +973,11 @@ var GeoChart = function (_Chart6) {
|
|
1003
973
|
value: function __processData() {
|
1004
974
|
return processSimple(this);
|
1005
975
|
}
|
976
|
+
}, {
|
977
|
+
key: "__chartName",
|
978
|
+
value: function __chartName() {
|
979
|
+
return "GeoChart";
|
980
|
+
}
|
1006
981
|
}]);
|
1007
982
|
|
1008
983
|
return GeoChart;
|
@@ -1022,6 +997,11 @@ var ScatterChart = function (_Chart7) {
|
|
1022
997
|
value: function __processData() {
|
1023
998
|
return processSeries(this, "number");
|
1024
999
|
}
|
1000
|
+
}, {
|
1001
|
+
key: "__chartName",
|
1002
|
+
value: function __chartName() {
|
1003
|
+
return "ScatterChart";
|
1004
|
+
}
|
1025
1005
|
}]);
|
1026
1006
|
|
1027
1007
|
return ScatterChart;
|
@@ -1041,6 +1021,11 @@ var BubbleChart = function (_Chart8) {
|
|
1041
1021
|
value: function __processData() {
|
1042
1022
|
return processSeries(this, "bubble");
|
1043
1023
|
}
|
1024
|
+
}, {
|
1025
|
+
key: "__chartName",
|
1026
|
+
value: function __chartName() {
|
1027
|
+
return "BubbleChart";
|
1028
|
+
}
|
1044
1029
|
}]);
|
1045
1030
|
|
1046
1031
|
return BubbleChart;
|
@@ -1066,12 +1051,17 @@ var Timeline = function (_Chart9) {
|
|
1066
1051
|
}
|
1067
1052
|
return data;
|
1068
1053
|
}
|
1054
|
+
}, {
|
1055
|
+
key: "__chartName",
|
1056
|
+
value: function __chartName() {
|
1057
|
+
return "Timeline";
|
1058
|
+
}
|
1069
1059
|
}]);
|
1070
1060
|
|
1071
1061
|
return Timeline;
|
1072
1062
|
}(Chart);
|
1073
1063
|
|
1074
|
-
var Chartkick =
|
1064
|
+
var Chartkick = {
|
1075
1065
|
LineChart: LineChart,
|
1076
1066
|
PieChart: PieChart,
|
1077
1067
|
ColumnChart: ColumnChart,
|
@@ -1101,6 +1091,8 @@ var Chartkick = exports.Chartkick = {
|
|
1101
1091
|
adapters: adapters
|
1102
1092
|
};
|
1103
1093
|
|
1094
|
+
exports.default = Chartkick;
|
1095
|
+
|
1104
1096
|
/***/ }),
|
1105
1097
|
/* 2 */
|
1106
1098
|
/***/ (function(module, exports, __webpack_require__) {
|
@@ -1723,7 +1715,7 @@ var setMax = function setMax(options, max) {
|
|
1723
1715
|
};
|
1724
1716
|
|
1725
1717
|
var setStacked = function setStacked(options, stacked) {
|
1726
|
-
options.plotOptions.series.stacking = stacked ? "normal" : null;
|
1718
|
+
options.plotOptions.series.stacking = stacked ? stacked === true ? "normal" : stacked : null;
|
1727
1719
|
};
|
1728
1720
|
|
1729
1721
|
var setXtitle = function setXtitle(options, title) {
|
@@ -2077,7 +2069,7 @@ var setBarMax = function setBarMax(options, max) {
|
|
2077
2069
|
};
|
2078
2070
|
|
2079
2071
|
var setStacked = function setStacked(options, stacked) {
|
2080
|
-
options.isStacked =
|
2072
|
+
options.isStacked = stacked ? stacked : false;
|
2081
2073
|
};
|
2082
2074
|
|
2083
2075
|
var setXtitle = function setXtitle(options, title) {
|
@@ -2361,6 +2353,77 @@ exports.default = {
|
|
2361
2353
|
renderTimeline: renderTimeline
|
2362
2354
|
};
|
2363
2355
|
|
2356
|
+
/***/ }),
|
2357
|
+
/* 5 */
|
2358
|
+
/***/ (function(module, exports, __webpack_require__) {
|
2359
|
+
|
2360
|
+
"use strict";
|
2361
|
+
|
2362
|
+
|
2363
|
+
Object.defineProperty(exports, "__esModule", {
|
2364
|
+
value: true
|
2365
|
+
});
|
2366
|
+
var pendingRequests = [],
|
2367
|
+
runningRequests = 0,
|
2368
|
+
maxRequests = 4;
|
2369
|
+
|
2370
|
+
function pushRequest(url, success, error) {
|
2371
|
+
pendingRequests.push([url, success, error]);
|
2372
|
+
runNext();
|
2373
|
+
}
|
2374
|
+
|
2375
|
+
function runNext() {
|
2376
|
+
if (runningRequests < maxRequests) {
|
2377
|
+
var request = pendingRequests.shift();
|
2378
|
+
if (request) {
|
2379
|
+
runningRequests++;
|
2380
|
+
getJSON(request[0], request[1], request[2]);
|
2381
|
+
runNext();
|
2382
|
+
}
|
2383
|
+
}
|
2384
|
+
}
|
2385
|
+
|
2386
|
+
function requestComplete() {
|
2387
|
+
runningRequests--;
|
2388
|
+
runNext();
|
2389
|
+
}
|
2390
|
+
|
2391
|
+
function getJSON(url, success, error) {
|
2392
|
+
ajaxCall(url, success, function (jqXHR, textStatus, errorThrown) {
|
2393
|
+
var message = typeof errorThrown === "string" ? errorThrown : errorThrown.message;
|
2394
|
+
error(message);
|
2395
|
+
});
|
2396
|
+
}
|
2397
|
+
|
2398
|
+
function ajaxCall(url, success, error) {
|
2399
|
+
var $ = window.jQuery || window.Zepto || window.$;
|
2400
|
+
|
2401
|
+
if ($) {
|
2402
|
+
$.ajax({
|
2403
|
+
dataType: "json",
|
2404
|
+
url: url,
|
2405
|
+
success: success,
|
2406
|
+
error: error,
|
2407
|
+
complete: requestComplete
|
2408
|
+
});
|
2409
|
+
} else {
|
2410
|
+
var xhr = new XMLHttpRequest();
|
2411
|
+
xhr.open("GET", url, true);
|
2412
|
+
xhr.setRequestHeader("Content-Type", "application/json");
|
2413
|
+
xhr.onload = function () {
|
2414
|
+
requestComplete();
|
2415
|
+
if (xhr.status === 200) {
|
2416
|
+
success(JSON.parse(xhr.responseText), xhr.statusText, xhr);
|
2417
|
+
} else {
|
2418
|
+
error(xhr, "error", xhr.statusText);
|
2419
|
+
}
|
2420
|
+
};
|
2421
|
+
xhr.send();
|
2422
|
+
}
|
2423
|
+
}
|
2424
|
+
|
2425
|
+
exports.pushRequest = pushRequest;
|
2426
|
+
|
2364
2427
|
/***/ })
|
2365
|
-
/******/ ]);
|
2366
|
-
});
|
2428
|
+
/******/ ])["default"];
|
2429
|
+
});
|
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: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,6 +60,7 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".github/ISSUE_TEMPLATE.md"
|
63
|
+
- ".github/stale.yml"
|
63
64
|
- ".gitignore"
|
64
65
|
- CHANGELOG.md
|
65
66
|
- CONTRIBUTING.md
|