chartkick 5.1.2 → 5.1.3
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 +4 -0
- data/README.md +19 -48
- data/lib/chartkick/version.rb +1 -1
- data/vendor/assets/javascripts/Chart.bundle.js +6 -6
- metadata +3 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60765472a4a878439878da816efbb07ef13ef5e8d13fa05d1b5d17cc35a86fc1
|
|
4
|
+
data.tar.gz: 895e11561ff7bc42c3171d43f7c70ac680b68e213133210ddbadd35ddb6e847d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b887e7da63f59a7faa7c7746e685dddc936a349042b90873d53cb08db64b284b809e3a1c89943f5ec0068dbf0fc188ca96555a651b1863198673760f3b5808f
|
|
7
|
+
data.tar.gz: aba0da7151b351d6f4bf3ed6b7382d0bb0a2998f06230946a44c2f34d918028eecec0aadff454794565f6f125c113acf56022b081c61cbda4d18fe9528fee1bb
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -20,9 +20,8 @@ gem "chartkick"
|
|
|
20
20
|
|
|
21
21
|
Then follow the instructions for your JavaScript setup:
|
|
22
22
|
|
|
23
|
-
- [Importmap](#importmap) (Rails 7 default)
|
|
24
|
-
- [esbuild, rollup.js, or Webpack](#esbuild-rollupjs-or-webpack)
|
|
25
|
-
- [Webpacker](#webpacker) (Rails 6 default)
|
|
23
|
+
- [Importmap](#importmap) (Rails 7+ default)
|
|
24
|
+
- [Bun, esbuild, rollup.js, or Webpack](#bun-esbuild-rollupjs-or-webpack)
|
|
26
25
|
- [Sprockets](#sprockets)
|
|
27
26
|
|
|
28
27
|
This sets up Chartkick with [Chart.js](https://www.chartjs.org/). For other charting libraries and frameworks, see [these instructions](#additional-charting-libraries).
|
|
@@ -43,11 +42,13 @@ import "chartkick"
|
|
|
43
42
|
import "Chart.bundle"
|
|
44
43
|
```
|
|
45
44
|
|
|
46
|
-
### esbuild, rollup.js, or Webpack
|
|
45
|
+
### Bun, esbuild, rollup.js, or Webpack
|
|
47
46
|
|
|
48
47
|
Run:
|
|
49
48
|
|
|
50
49
|
```sh
|
|
50
|
+
bun add chartkick chart.js
|
|
51
|
+
# or
|
|
51
52
|
yarn add chartkick chart.js
|
|
52
53
|
```
|
|
53
54
|
|
|
@@ -57,22 +58,6 @@ And in `app/javascript/application.js`, add:
|
|
|
57
58
|
import "chartkick/chart.js"
|
|
58
59
|
```
|
|
59
60
|
|
|
60
|
-
Note: For rollup.js, this requires `format: "iife"` in `rollup.config.js`.
|
|
61
|
-
|
|
62
|
-
### Webpacker
|
|
63
|
-
|
|
64
|
-
Run:
|
|
65
|
-
|
|
66
|
-
```sh
|
|
67
|
-
yarn add chartkick chart.js
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
And in `app/javascript/packs/application.js`, add:
|
|
71
|
-
|
|
72
|
-
```js
|
|
73
|
-
import "chartkick/chart.js"
|
|
74
|
-
```
|
|
75
|
-
|
|
76
61
|
### Sprockets
|
|
77
62
|
|
|
78
63
|
In `app/assets/javascripts/application.js`, add:
|
|
@@ -140,8 +125,8 @@ Multiple series
|
|
|
140
125
|
|
|
141
126
|
```erb
|
|
142
127
|
<%= line_chart [
|
|
143
|
-
{name: "Workout", data: {"
|
|
144
|
-
{name: "Call parents", data: {"
|
|
128
|
+
{name: "Workout", data: {"2025-01-01" => 3, "2025-01-02" => 4}},
|
|
129
|
+
{name: "Call parents", data: {"2025-01-01" => 5, "2025-01-02" => 3}}
|
|
145
130
|
] %>
|
|
146
131
|
```
|
|
147
132
|
|
|
@@ -158,13 +143,13 @@ Data can be a hash, array, or URL.
|
|
|
158
143
|
#### Hash
|
|
159
144
|
|
|
160
145
|
```erb
|
|
161
|
-
<%= line_chart({"
|
|
146
|
+
<%= line_chart({"2025-01-01" => 2, "2025-01-02" => 3}) %>
|
|
162
147
|
```
|
|
163
148
|
|
|
164
149
|
#### Array
|
|
165
150
|
|
|
166
151
|
```erb
|
|
167
|
-
<%= line_chart [["
|
|
152
|
+
<%= line_chart [["2025-01-01", 2], ["2025-01-02", 3]] %>
|
|
168
153
|
```
|
|
169
154
|
|
|
170
155
|
#### URL
|
|
@@ -210,7 +195,7 @@ Min and max values
|
|
|
210
195
|
Min and max for x-axis - *Chart.js*
|
|
211
196
|
|
|
212
197
|
```erb
|
|
213
|
-
<%= line_chart data, xmin: "
|
|
198
|
+
<%= line_chart data, xmin: "2025-01-01", xmax: "2025-02-01" %>
|
|
214
199
|
```
|
|
215
200
|
|
|
216
201
|
Colors
|
|
@@ -452,7 +437,7 @@ In your layout or views, add:
|
|
|
452
437
|
<%= javascript_include_tag "https://www.gstatic.com/charts/loader.js" %>
|
|
453
438
|
```
|
|
454
439
|
|
|
455
|
-
For Importmap (Rails 7 default), in `config/importmap.rb`, add:
|
|
440
|
+
For Importmap (Rails 7+ default), in `config/importmap.rb`, add:
|
|
456
441
|
|
|
457
442
|
```ruby
|
|
458
443
|
pin "chartkick", to: "chartkick.js"
|
|
@@ -464,9 +449,11 @@ And in `app/javascript/application.js`, add:
|
|
|
464
449
|
import "chartkick"
|
|
465
450
|
```
|
|
466
451
|
|
|
467
|
-
For
|
|
452
|
+
For Bun, esbuild, rollup.js, or Webpack, run:
|
|
468
453
|
|
|
469
454
|
```sh
|
|
455
|
+
bun add chartkick
|
|
456
|
+
# or
|
|
470
457
|
yarn add chartkick
|
|
471
458
|
```
|
|
472
459
|
|
|
@@ -492,7 +479,7 @@ before your charts.
|
|
|
492
479
|
|
|
493
480
|
### Highcharts
|
|
494
481
|
|
|
495
|
-
For Importmap (Rails 7 default), run:
|
|
482
|
+
For Importmap (Rails 7+ default), run:
|
|
496
483
|
|
|
497
484
|
```sh
|
|
498
485
|
bin/importmap pin highcharts --download
|
|
@@ -513,9 +500,11 @@ import Highcharts from "highcharts"
|
|
|
513
500
|
window.Highcharts = Highcharts
|
|
514
501
|
```
|
|
515
502
|
|
|
516
|
-
For
|
|
503
|
+
For Bun, esbuild, rollup.js, or Webpack, run:
|
|
517
504
|
|
|
518
505
|
```sh
|
|
506
|
+
bun add chartkick highcharts
|
|
507
|
+
# or
|
|
519
508
|
yarn add chartkick highcharts
|
|
520
509
|
```
|
|
521
510
|
|
|
@@ -525,7 +514,7 @@ And in `app/javascript/packs/application.js`, add:
|
|
|
525
514
|
import "chartkick/highcharts"
|
|
526
515
|
```
|
|
527
516
|
|
|
528
|
-
For Sprockets, download [highcharts.js](https://code.highcharts.com/highcharts.js) into `vendor/assets/javascripts` (or use `yarn add highcharts`
|
|
517
|
+
For Sprockets, download [highcharts.js](https://code.highcharts.com/highcharts.js) into `vendor/assets/javascripts` (or use `yarn add highcharts`), and in `app/assets/javascripts/application.js`, add:
|
|
529
518
|
|
|
530
519
|
```js
|
|
531
520
|
//= require chartkick
|
|
@@ -643,24 +632,6 @@ Check out [how to configure CSP](https://github.com/ankane/chartkick/blob/master
|
|
|
643
632
|
- [Make Easy Graphs and Charts on Rails with Chartkick](https://www.sitepoint.com/make-easy-graphs-and-charts-on-rails-with-chartkick/)
|
|
644
633
|
- [Practical Graphs on Rails: Chartkick in Practice](https://www.sitepoint.com/graphs-on-rails-chartkick-in-practice/)
|
|
645
634
|
|
|
646
|
-
## Upgrading
|
|
647
|
-
|
|
648
|
-
### 5.0
|
|
649
|
-
|
|
650
|
-
If you use Importmap or Sprockets, update the gem and you’re good to go!
|
|
651
|
-
|
|
652
|
-
If you use esbuild, Webpack, or Webpacker, run:
|
|
653
|
-
|
|
654
|
-
```sh
|
|
655
|
-
yarn upgrade chartkick --latest
|
|
656
|
-
```
|
|
657
|
-
|
|
658
|
-
If you use Chart.js with esbuild, Webpack, or Webpacker, also run:
|
|
659
|
-
|
|
660
|
-
```sh
|
|
661
|
-
yarn upgrade chart.js --latest
|
|
662
|
-
```
|
|
663
|
-
|
|
664
635
|
## History
|
|
665
636
|
|
|
666
637
|
View the [changelog](https://github.com/ankane/chartkick/blob/master/CHANGELOG.md)
|
data/lib/chartkick/version.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Chart.js v4.4.
|
|
2
|
+
* Chart.js v4.4.7
|
|
3
3
|
* https://www.chartjs.org
|
|
4
4
|
* (c) 2024 Chart.js Contributors
|
|
5
5
|
* Released under the MIT License
|
|
@@ -222,10 +222,10 @@
|
|
|
222
222
|
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf$1(t)););
|
|
223
223
|
return t;
|
|
224
224
|
}
|
|
225
|
-
function _superPropGet(t,
|
|
226
|
-
var p = _get(_getPrototypeOf$1(1 & r ? t.prototype : t),
|
|
225
|
+
function _superPropGet(t, o, e, r) {
|
|
226
|
+
var p = _get(_getPrototypeOf$1(1 & r ? t.prototype : t), o, e);
|
|
227
227
|
return 2 & r && "function" == typeof p ? function (t) {
|
|
228
|
-
return p.apply(
|
|
228
|
+
return p.apply(e, t);
|
|
229
229
|
} : p;
|
|
230
230
|
}
|
|
231
231
|
function _toConsumableArray(r) {
|
|
@@ -944,7 +944,7 @@
|
|
|
944
944
|
* @since 2.7.0
|
|
945
945
|
*/
|
|
946
946
|
function isNullOrUndef(value) {
|
|
947
|
-
return value === null ||
|
|
947
|
+
return value === null || value === undefined;
|
|
948
948
|
}
|
|
949
949
|
/**
|
|
950
950
|
* Returns true if `value` is an array (including typed arrays), else returns false.
|
|
@@ -10402,7 +10402,7 @@
|
|
|
10402
10402
|
}
|
|
10403
10403
|
return false;
|
|
10404
10404
|
}
|
|
10405
|
-
var version = "4.4.
|
|
10405
|
+
var version = "4.4.7";
|
|
10406
10406
|
var KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];
|
|
10407
10407
|
function positionIsHorizontal(position, axis) {
|
|
10408
10408
|
return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';
|
metadata
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chartkick
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.1.
|
|
4
|
+
version: 5.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Kane
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2025-02-01 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
|
-
description:
|
|
14
12
|
email: andrew@ankane.org
|
|
15
13
|
executables: []
|
|
16
14
|
extensions: []
|
|
@@ -37,7 +35,6 @@ homepage: https://chartkick.com
|
|
|
37
35
|
licenses:
|
|
38
36
|
- MIT
|
|
39
37
|
metadata: {}
|
|
40
|
-
post_install_message:
|
|
41
38
|
rdoc_options: []
|
|
42
39
|
require_paths:
|
|
43
40
|
- lib
|
|
@@ -52,8 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
52
49
|
- !ruby/object:Gem::Version
|
|
53
50
|
version: '0'
|
|
54
51
|
requirements: []
|
|
55
|
-
rubygems_version: 3.
|
|
56
|
-
signing_key:
|
|
52
|
+
rubygems_version: 3.6.2
|
|
57
53
|
specification_version: 4
|
|
58
54
|
summary: Create beautiful JavaScript charts with one line of Ruby
|
|
59
55
|
test_files: []
|