chartkick 4.1.2 → 4.2.1

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: fc72b4105d5e863040aec42ff49f32623f8fa3c74488b8ecdf5bb80d465653b3
4
- data.tar.gz: 1e17d23367ad1ab3dd619d654e36f3f7cf179ed67f16164c22262460720627d7
3
+ metadata.gz: 360203297ee43cced5a6adbdeef339d635ed4792c06aea02071aaa1a7c2d93dd
4
+ data.tar.gz: 19261b37a5a18daa6b5a7d46887aa5e4b6d6c7e8cae45b763c6ff4246dfaae00
5
5
  SHA512:
6
- metadata.gz: cadb32e90ef25fa335d00410e753d28770f9ad245be0cd7d6b42e8de3fb984f8cb821f75d8cf61f0521fe25134110b6e3d5ff21c22fe8a54d441bb00b82ada54
7
- data.tar.gz: 1a10102ebd8b97a6b4b27572c9efd825f75cdcb8353ab75505924c72e3424481f1220a0a7960dacba29b997e48af8f1d812c1a9d5cd5672d8faad8d6465fa401
6
+ metadata.gz: fcfaffd5359b8f0bfd62d70bdc33964d0849fbbc28704b2f143280e8f0938c0b3328b7c0bfabae39be6d9d9b518d57b42d74d6d6b2471dc297a26a4a791fa028
7
+ data.tar.gz: bf2cbfb80736502bc50a24d18e38f739d65e75374081fbd187694e5196eb9a73a2012ce765e8c02a3eadbfd2acf12ae1a6fd856cda6af2ac98109baedafa1d98
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## 4.2.1 (2022-08-02)
2
+
3
+ - Updated Chart.js to 3.9.0
4
+
5
+ ## 4.2.0 (2022-06-12)
6
+
7
+ - Updated Chartkick.js to 4.2.0
8
+ - Updated Chart.js to 3.8.0
9
+
10
+ ## 4.1.3 (2022-01-15)
11
+
12
+ - Support for `importmap-rails` is no longer experimental
13
+ - Updated Chart.js to 3.7.0
14
+ - Fixed asset precompilation error with `importmap-rails`
15
+
1
16
  ## 4.1.2 (2021-11-06)
2
17
 
3
18
  - Removed automatic pinning for `importmap-rails` (still experimental)
data/README.md CHANGED
@@ -4,8 +4,6 @@ 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 4.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)
@@ -20,41 +18,68 @@ Add this line to your application’s Gemfile:
20
18
  gem "chartkick"
21
19
  ```
22
20
 
23
- For Rails 6 / Webpacker, run:
21
+ Then follow the instructions for your framework:
22
+
23
+ - [Rails 7 / Importmap](#rails-7--importmap)
24
+ - [Rails 7 / esbuild or Webpack](#rails-7--esbuild-or-webpack)
25
+ - [Rails 6 / Webpacker](#rails-6--webpacker)
26
+ - [Rails 5 / Sprockets](#rails-5--sprockets)
27
+
28
+ This sets up Chartkick with [Chart.js](https://www.chartjs.org/). For other charting libraries and frameworks, see [detailed instructions](#installation).
29
+
30
+ ### Rails 7 / Importmap
31
+
32
+ In `config/importmap.rb`, add:
33
+
34
+ ```ruby
35
+ pin "chartkick", to: "chartkick.js"
36
+ pin "Chart.bundle", to: "Chart.bundle.js"
37
+ ```
38
+
39
+ And in `app/javascript/application.js`, add:
40
+
41
+ ```js
42
+ import "chartkick"
43
+ import "Chart.bundle"
44
+ ```
45
+
46
+ ### Rails 7 / esbuild or Webpack
47
+
48
+ Run:
24
49
 
25
50
  ```sh
26
51
  yarn add chartkick chart.js
27
52
  ```
28
53
 
29
- And in `app/javascript/packs/application.js`, add:
54
+ And in `app/javascript/application.js`, add:
30
55
 
31
56
  ```js
32
57
  import "chartkick/chart.js"
33
58
  ```
34
59
 
35
- For Rails 5 / Sprockets, in `app/assets/javascripts/application.js`, add:
60
+ ### Rails 6 / Webpacker
36
61
 
37
- ```js
38
- //= require chartkick
39
- //= require Chart.bundle
62
+ Run:
63
+
64
+ ```sh
65
+ yarn add chartkick chart.js
40
66
  ```
41
67
 
42
- For Rails 7 / Importmap (experimental), in `config/importmap.rb`, add:
68
+ And in `app/javascript/packs/application.js`, add:
43
69
 
44
- ```ruby
45
- pin "chartkick", to: "chartkick.js"
46
- pin "Chart.bundle", to: "Chart.bundle.js"
70
+ ```js
71
+ import "chartkick/chart.js"
47
72
  ```
48
73
 
49
- And in `app/javascript/application.js`, add:
74
+ ### Rails 5 / Sprockets
75
+
76
+ In `app/assets/javascripts/application.js`, add:
50
77
 
51
78
  ```js
52
- import "chartkick"
53
- import "Chart.bundle"
79
+ //= require chartkick
80
+ //= require Chart.bundle
54
81
  ```
55
82
 
56
- This sets up Chartkick with [Chart.js](https://www.chartjs.org/). For other charting libraries, see [detailed instructions](#installation).
57
-
58
83
  ## Charts
59
84
 
60
85
  Line chart
@@ -428,6 +453,20 @@ Next, choose your charting library.
428
453
 
429
454
  ### Chart.js
430
455
 
456
+ For Rails 7 / Importmap, in `config/importmap.rb`, add:
457
+
458
+ ```ruby
459
+ pin "chartkick", to: "chartkick.js"
460
+ pin "Chart.bundle", to: "Chart.bundle.js"
461
+ ```
462
+
463
+ And in `app/javascript/application.js`, add:
464
+
465
+ ```js
466
+ import "chartkick"
467
+ import "Chart.bundle"
468
+ ```
469
+
431
470
  For Rails 6 / Webpacker, run:
432
471
 
433
472
  ```sh
@@ -447,26 +486,24 @@ For Rails 5 / Sprockets, in `app/assets/javascripts/application.js`, add:
447
486
  //= require Chart.bundle
448
487
  ```
449
488
 
450
- For Rails 7 / Importmap (experimental), in `config/importmap.rb`, add:
489
+ ### Google Charts
490
+
491
+ In your layout or views, add:
492
+
493
+ ```erb
494
+ <%= javascript_include_tag "https://www.gstatic.com/charts/loader.js" %>
495
+ ```
496
+
497
+ For Rails 7 / Importmap, in `config/importmap.rb`, add:
451
498
 
452
499
  ```ruby
453
500
  pin "chartkick", to: "chartkick.js"
454
- pin "Chart.bundle", to: "Chart.bundle.js"
455
501
  ```
456
502
 
457
503
  And in `app/javascript/application.js`, add:
458
504
 
459
505
  ```js
460
506
  import "chartkick"
461
- import "Chart.bundle"
462
- ```
463
-
464
- ### Google Charts
465
-
466
- In your layout or views, add:
467
-
468
- ```erb
469
- <%= javascript_include_tag "https://www.gstatic.com/charts/loader.js" %>
470
507
  ```
471
508
 
472
509
  For Rails 6 / Webpacker, run:
@@ -487,18 +524,6 @@ For Rails 5 / Sprockets, in `app/assets/javascripts/application.js`, add:
487
524
  //= require chartkick
488
525
  ```
489
526
 
490
- For Rails 7 / Importmap (experimental), in `config/importmap.rb`, add:
491
-
492
- ```ruby
493
- pin "chartkick", to: "chartkick.js"
494
- ```
495
-
496
- And in `app/javascript/application.js`, add:
497
-
498
- ```js
499
- import "chartkick"
500
- ```
501
-
502
527
  To specify a language or Google Maps API key, use:
503
528
 
504
529
  ```js
@@ -509,44 +534,44 @@ before your charts.
509
534
 
510
535
  ### Highcharts
511
536
 
512
- For Rails 6 / Webpacker, run:
537
+ For Rails 7 / Importmap, run:
513
538
 
514
539
  ```sh
515
- yarn add chartkick highcharts
540
+ bin/importmap pin highcharts --download
516
541
  ```
517
542
 
518
- And in `app/javascript/packs/application.js`, add:
543
+ And in `config/importmap.rb`, add:
519
544
 
520
- ```js
521
- import "chartkick/highcharts"
545
+ ```ruby
546
+ pin "chartkick", to: "chartkick.js"
522
547
  ```
523
548
 
524
- For Rails 5 / Sprockets, download [highcharts.js](https://code.highcharts.com/highcharts.js) into `vendor/assets/javascripts` (or use `yarn add highcharts` in Rails 5.1+), and in `app/assets/javascripts/application.js`, add:
549
+ And in `app/javascript/application.js`, add:
525
550
 
526
551
  ```js
527
- //= require chartkick
528
- //= require highcharts
529
- ```
530
-
531
- For Rails 7 / Importmap (experimental), in `config/importmap.rb`, add:
552
+ import "chartkick"
553
+ import Highcharts from "highcharts"
532
554
 
533
- ```ruby
534
- pin "chartkick", to: "chartkick.js"
555
+ window.Highcharts = Highcharts
535
556
  ```
536
557
 
537
- And run:
558
+ For Rails 6 / Webpacker, run:
538
559
 
539
560
  ```sh
540
- bin/importmap pin highcharts --download
561
+ yarn add chartkick highcharts
541
562
  ```
542
563
 
543
- And in `app/javascript/application.js`, add:
564
+ And in `app/javascript/packs/application.js`, add:
544
565
 
545
566
  ```js
546
- import "chartkick"
547
- import Highcharts from "highcharts"
567
+ import "chartkick/highcharts"
568
+ ```
548
569
 
549
- window.Highcharts = Highcharts
570
+ For Rails 5 / Sprockets, download [highcharts.js](https://code.highcharts.com/highcharts.js) into `vendor/assets/javascripts` (or use `yarn add highcharts` in Rails 5.1+), and in `app/assets/javascripts/application.js`, add:
571
+
572
+ ```js
573
+ //= require chartkick
574
+ //= require highcharts
550
575
  ```
551
576
 
552
577
  ### Sinatra and Padrino
@@ -3,8 +3,8 @@ module Chartkick
3
3
  # for assets
4
4
 
5
5
  # for importmap
6
- if defined?(Importmap)
7
- initializer "chartkick.importmap", after: "importmap" do |app|
6
+ initializer "chartkick.importmap" do |app|
7
+ if defined?(Importmap)
8
8
  app.config.assets.precompile << "chartkick.js"
9
9
  app.config.assets.precompile << "Chart.bundle.js"
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module Chartkick
2
- VERSION = "4.1.2"
2
+ VERSION = "4.2.1"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014-2021 Chart.js Contributors
3
+ Copyright (c) 2014-2022 Chart.js Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6