chartkick 4.1.2 → 4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc72b4105d5e863040aec42ff49f32623f8fa3c74488b8ecdf5bb80d465653b3
4
- data.tar.gz: 1e17d23367ad1ab3dd619d654e36f3f7cf179ed67f16164c22262460720627d7
3
+ metadata.gz: 89ed1824ceea10158a8321a32e75daeb96dcb1eaeea839dc6f4eddd1de97cd88
4
+ data.tar.gz: 8c4a6ff2477b7314cec55237fbcfafe7e0b95efb4890a50925edb4eb095bb468
5
5
  SHA512:
6
- metadata.gz: cadb32e90ef25fa335d00410e753d28770f9ad245be0cd7d6b42e8de3fb984f8cb821f75d8cf61f0521fe25134110b6e3d5ff21c22fe8a54d441bb00b82ada54
7
- data.tar.gz: 1a10102ebd8b97a6b4b27572c9efd825f75cdcb8353ab75505924c72e3424481f1220a0a7960dacba29b997e48af8f1d812c1a9d5cd5672d8faad8d6465fa401
6
+ metadata.gz: 5f6bedf2f1e49a194cdede42c1fb80d7dbf02a0d26955f0c0248b625736efc52269c966b3c8a50a0f3ba8bc5782bc7ad6843195a123fe6e9211026255305c825
7
+ data.tar.gz: 341942cf99eaf9a262d13b0abc8ca00898d88a2ac688a269bf932e6d0e365592a1ccca0f46bbc9e4ebca9fffcb9991853a8c4ea82448e73fe04b1847f12d5bd4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 4.1.3 (2022-01-15)
2
+
3
+ - Support for `importmap-rails` is no longer experimental
4
+ - Updated Chart.js to 3.7.0
5
+ - Fixed asset precompilation error with `importmap-rails`
6
+
1
7
  ## 4.1.2 (2021-11-06)
2
8
 
3
9
  - Removed automatic pinning for `importmap-rails` (still experimental)
data/README.md CHANGED
@@ -20,26 +20,17 @@ Add this line to your application’s Gemfile:
20
20
  gem "chartkick"
21
21
  ```
22
22
 
23
- For Rails 6 / Webpacker, run:
24
-
25
- ```sh
26
- yarn add chartkick chart.js
27
- ```
28
-
29
- And in `app/javascript/packs/application.js`, add:
23
+ Then follow the instructions for your framework:
30
24
 
31
- ```js
32
- import "chartkick/chart.js"
33
- ```
25
+ - [Rails 7 / Importmap](#rails-7--importmap)
26
+ - [Rails 6 / Webpacker](#rails-6--webpacker)
27
+ - [Rails 5 / Sprockets](#rails-5--sprockets)
34
28
 
35
- For Rails 5 / Sprockets, in `app/assets/javascripts/application.js`, add:
29
+ This sets up Chartkick with [Chart.js](https://www.chartjs.org/). For other charting libraries and frameworks, see [detailed instructions](#installation).
36
30
 
37
- ```js
38
- //= require chartkick
39
- //= require Chart.bundle
40
- ```
31
+ ### Rails 7 / Importmap
41
32
 
42
- For Rails 7 / Importmap (experimental), in `config/importmap.rb`, add:
33
+ In `config/importmap.rb`, add:
43
34
 
44
35
  ```ruby
45
36
  pin "chartkick", to: "chartkick.js"
@@ -53,7 +44,28 @@ import "chartkick"
53
44
  import "Chart.bundle"
54
45
  ```
55
46
 
56
- This sets up Chartkick with [Chart.js](https://www.chartjs.org/). For other charting libraries, see [detailed instructions](#installation).
47
+ ### Rails 6 / Webpacker
48
+
49
+ Run:
50
+
51
+ ```sh
52
+ yarn add chartkick chart.js
53
+ ```
54
+
55
+ And in `app/javascript/packs/application.js`, add:
56
+
57
+ ```js
58
+ import "chartkick/chart.js"
59
+ ```
60
+
61
+ ### Rails 5 / Sprockets
62
+
63
+ In `app/assets/javascripts/application.js`, add:
64
+
65
+ ```js
66
+ //= require chartkick
67
+ //= require Chart.bundle
68
+ ```
57
69
 
58
70
  ## Charts
59
71
 
@@ -428,6 +440,20 @@ Next, choose your charting library.
428
440
 
429
441
  ### Chart.js
430
442
 
443
+ For Rails 7 / Importmap, in `config/importmap.rb`, add:
444
+
445
+ ```ruby
446
+ pin "chartkick", to: "chartkick.js"
447
+ pin "Chart.bundle", to: "Chart.bundle.js"
448
+ ```
449
+
450
+ And in `app/javascript/application.js`, add:
451
+
452
+ ```js
453
+ import "chartkick"
454
+ import "Chart.bundle"
455
+ ```
456
+
431
457
  For Rails 6 / Webpacker, run:
432
458
 
433
459
  ```sh
@@ -447,26 +473,24 @@ For Rails 5 / Sprockets, in `app/assets/javascripts/application.js`, add:
447
473
  //= require Chart.bundle
448
474
  ```
449
475
 
450
- For Rails 7 / Importmap (experimental), in `config/importmap.rb`, add:
476
+ ### Google Charts
477
+
478
+ In your layout or views, add:
479
+
480
+ ```erb
481
+ <%= javascript_include_tag "https://www.gstatic.com/charts/loader.js" %>
482
+ ```
483
+
484
+ For Rails 7 / Importmap, in `config/importmap.rb`, add:
451
485
 
452
486
  ```ruby
453
487
  pin "chartkick", to: "chartkick.js"
454
- pin "Chart.bundle", to: "Chart.bundle.js"
455
488
  ```
456
489
 
457
490
  And in `app/javascript/application.js`, add:
458
491
 
459
492
  ```js
460
493
  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
494
  ```
471
495
 
472
496
  For Rails 6 / Webpacker, run:
@@ -487,18 +511,6 @@ For Rails 5 / Sprockets, in `app/assets/javascripts/application.js`, add:
487
511
  //= require chartkick
488
512
  ```
489
513
 
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
514
  To specify a language or Google Maps API key, use:
503
515
 
504
516
  ```js
@@ -509,44 +521,44 @@ before your charts.
509
521
 
510
522
  ### Highcharts
511
523
 
512
- For Rails 6 / Webpacker, run:
524
+ For Rails 7 / Importmap, run:
513
525
 
514
526
  ```sh
515
- yarn add chartkick highcharts
527
+ bin/importmap pin highcharts --download
516
528
  ```
517
529
 
518
- And in `app/javascript/packs/application.js`, add:
530
+ And in `config/importmap.rb`, add:
519
531
 
520
- ```js
521
- import "chartkick/highcharts"
532
+ ```ruby
533
+ pin "chartkick", to: "chartkick.js"
522
534
  ```
523
535
 
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:
536
+ And in `app/javascript/application.js`, add:
525
537
 
526
538
  ```js
527
- //= require chartkick
528
- //= require highcharts
529
- ```
530
-
531
- For Rails 7 / Importmap (experimental), in `config/importmap.rb`, add:
539
+ import "chartkick"
540
+ import Highcharts from "highcharts"
532
541
 
533
- ```ruby
534
- pin "chartkick", to: "chartkick.js"
542
+ window.Highcharts = Highcharts
535
543
  ```
536
544
 
537
- And run:
545
+ For Rails 6 / Webpacker, run:
538
546
 
539
547
  ```sh
540
- bin/importmap pin highcharts --download
548
+ yarn add chartkick highcharts
541
549
  ```
542
550
 
543
- And in `app/javascript/application.js`, add:
551
+ And in `app/javascript/packs/application.js`, add:
544
552
 
545
553
  ```js
546
- import "chartkick"
547
- import Highcharts from "highcharts"
554
+ import "chartkick/highcharts"
555
+ ```
548
556
 
549
- window.Highcharts = Highcharts
557
+ 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:
558
+
559
+ ```js
560
+ //= require chartkick
561
+ //= require highcharts
550
562
  ```
551
563
 
552
564
  ### 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.1.3"
3
3
  end