rails_charts 0.0.3 → 0.0.4

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: 460115967715c86a598bf125d23580fc781154445e4a7752623579868009c409
4
- data.tar.gz: 63f5815f0c51083b58fc1036c668b51b7a770f47b09f2734ec90b0e6a31fce94
3
+ metadata.gz: f624c9ad155015b47d5bb2f4e7ede4253c9c56cbcc872cb03279f5be9210b427
4
+ data.tar.gz: e1bca3b0812cadf060220514186764188742e6f6d8d87b2ac9db07325c32eb10
5
5
  SHA512:
6
- metadata.gz: af2ddf1ae9553126c82522db0f37d81da9856d029b1fb8f4be8afeaa609a250a15cb2aebd4e7b8fe7a3f66ccfbbff95d6b02476caed0a898fa887450d6a00074
7
- data.tar.gz: b0336548ae63cfd514029cd8bc186208981865369c6a68ea99c4aab062a5bfa8743ca7ed33e4590a916e049bbbb8a3bf4719e7221621e171cf60b6e277865f51
6
+ metadata.gz: c0e5933e814a589621025f45d169417a8aeaa8da44cb2c00bbcde2175f5c24ff38ebc15f5fc464b203c3c13ca0e52e724ca8e7264e26cdc8bc5784981d01d557
7
+ data.tar.gz: 18e131a0526afc482ec562a5f283f2b6f81fa93ed6b59320594f7ac6094fd862ca22be2bdb29d0f7f466ba6c9a1581c3bd2b238d9609d8abb08aa709dc089ed6
data/README.md CHANGED
@@ -6,27 +6,27 @@
6
6
 
7
7
  One more gem to build nice charts for your Ruby on Rails application.
8
8
 
9
- With it you can build various types of charts [Apache eCharts](https://echarts.apache.org/) library (v. 5.3.2). This gem simplifies interface and adding few helpers to start adding charts in your app with just a few lines of code.
9
+ With it you can build various types of charts [Apache eCharts](https://echarts.apache.org/) library (v. 5.4.0). This gem simplifies interface and adding few helpers to start adding charts in your app with just a few lines of code.
10
10
 
11
11
  What you can build with it:
12
12
 
13
- - line chart
14
- - area chart
15
- - bar chart
16
- - donut chart
17
- - pie chart
18
- - radar chart
19
- - calendar chart
20
- - candlestick chart
21
- - funnel chart
22
- - gauge chart
23
- - parallel chart
24
- - sankey chart
25
- - scatter chart
26
- - stacked bar chart
27
- - custom chart
28
-
29
- In most cases with one line of code you can have a nice chart. The idea of this gem was inspired by [Charkick](https://github.com/ankane/chartkick) gem which is great and allows you to build charts very quickly. It works best in cooperation with [groupdate](https://github.com/ankane/groupdate) gem. Unfortunatelly it's missing many needed types of charts or other customization options.
13
+ - [area chart](#area-chart)
14
+ - [line chart](#line-chart)
15
+ - [bar chart](#bar-chart)
16
+ - [donut chart](#donut-chart)
17
+ - [pie chart](#pie-chart)
18
+ - [radar chart](#radar-chart)
19
+ - [calendar chart](#calendar-chart)
20
+ - [candlestick chart](#candlestick-chart)
21
+ - [funnel chart](#funnel-chart)
22
+ - [gauge chart](#gauge-chart)
23
+ - [parallel chart](#parallel-chart)
24
+ - [sankey chart](#sankey-chart)
25
+ - [scatter chart](#scatter-chart)
26
+ - [stacked bar chart](#stacked-bar-chart)
27
+ - [custom chart](#custom-chart)
28
+
29
+ In most cases with one line of code you can have a nice chart. The idea of this gem was inspired by [Chartkick](https://github.com/ankane/chartkick) gem which is great and allows you to build charts very quickly. It works best in cooperation with [groupdate](https://github.com/ankane/groupdate) gem. Unfortunatelly it's missing many needed types of charts or other customization options.
30
30
 
31
31
  This implementation have more options and similar "interface" for building charts.
32
32
 
@@ -66,7 +66,7 @@ or do it manualy
66
66
  <%= line_chart User.group(:age).count %>
67
67
  ```
68
68
 
69
- 4) customize charts if needed. See available options or [official documentation](https://echarts.apache.org/examples/en/index.html).
69
+ 4) customize charts if needed. See available options or [official documentation](https://echarts.apache.org/examples/en/index.html).
70
70
 
71
71
 
72
72
  ### Webpack / esbuild
@@ -102,7 +102,7 @@ window.echarts = echarts;
102
102
  <%= line_chart User.group(:age).count %>
103
103
  ```
104
104
 
105
- 4) customize charts if needed. See available options or [official documentation](https://echarts.apache.org/examples/en/index.html).
105
+ 4) customize charts if needed. See available options or [official documentation](https://echarts.apache.org/examples/en/index.html).
106
106
 
107
107
  ### Importmaps
108
108
 
@@ -113,7 +113,7 @@ pin "echarts", to: "echarts.min.js"
113
113
  pin "echarts/theme/dark", to: "echarts/theme/dark.js"
114
114
  ```
115
115
 
116
- 2) add eCharts in main JS
116
+ 2) add eCharts in main JS
117
117
 
118
118
  ```javascript
119
119
  import "echarts"
@@ -125,7 +125,7 @@ import "echarts/theme/dark"
125
125
  <%= line_chart User.group(:age).count %>
126
126
  ```
127
127
 
128
- 4) customize charts if needed. See available options or [official documentation](https://echarts.apache.org/examples/en/index.html).
128
+ 4) customize charts if needed. See available options or [official documentation](https://echarts.apache.org/examples/en/index.html).
129
129
 
130
130
  ## Options
131
131
 
@@ -185,7 +185,7 @@ Every chart has a built in default configuration for tooltips, or other options
185
185
  ![Line Chart](docs/line_chart.png)
186
186
 
187
187
  ```ruby
188
- <%= line_chart User.group(:age).count, class: 'box',
188
+ <%= line_chart User.group(:age).count, class: 'box',
189
189
  options: {
190
190
  title: {
191
191
  text: "People count by age",
@@ -204,7 +204,7 @@ Every chart has a built in default configuration for tooltips, or other options
204
204
  class: 'box',
205
205
  theme: 'sakura',
206
206
  options: {
207
- series: {
207
+ series: {
208
208
  barWidth: '50%'
209
209
  },
210
210
  tooltip: {
@@ -322,18 +322,18 @@ Every chart has a built in default configuration for tooltips, or other options
322
322
  ![Donut Chart](docs/donut_chart.png)
323
323
 
324
324
  ```ruby
325
- <%= donut_chart User.group(:role).count,
325
+ <%= donut_chart User.group(:role).count,
326
326
  class: 'box',
327
327
  options: {
328
328
  legend: {
329
329
  bottom: '0'
330
330
  },
331
- emphasis: {
331
+ emphasis: {
332
332
  itemStyle: {
333
333
  shadowBlur: 10,
334
334
  shadowOffsetX: 0,
335
335
  shadowColor: 'rgba(0, 0, 0, 0.5)'
336
- }
336
+ }
337
337
  }
338
338
  }
339
339
  %>
@@ -344,7 +344,7 @@ Every chart has a built in default configuration for tooltips, or other options
344
344
  ![Pie Chart](docs/pie_chart.png)
345
345
 
346
346
  ```ruby
347
- <%= pie_chart User.group(:role).count,
347
+ <%= pie_chart User.group(:role).count,
348
348
  class: 'box',
349
349
  options: {
350
350
  legend: { orient: 'vertical', left: 'left' }
@@ -388,12 +388,12 @@ Every chart has a built in default configuration for tooltips, or other options
388
388
  source: 'HTML',
389
389
  target: 'Good',
390
390
  value: 1
391
- },
391
+ },
392
392
  {
393
393
  source: 'JS',
394
394
  target: 'Good',
395
395
  value: 1
396
- },
396
+ },
397
397
  {
398
398
  source: 'CSS',
399
399
  target: 'Good',
@@ -408,7 +408,7 @@ Every chart has a built in default configuration for tooltips, or other options
408
408
  source: 'Good',
409
409
  target: 'Backend',
410
410
  value: 1
411
- },
411
+ },
412
412
  {
413
413
  source: 'Good',
414
414
  target: 'Frontend',
@@ -418,7 +418,7 @@ Every chart has a built in default configuration for tooltips, or other options
418
418
  source: 'Bad',
419
419
  target: 'Backend',
420
420
  value: 1
421
- },
421
+ },
422
422
  ]
423
423
  }, {
424
424
  options: {
@@ -445,7 +445,7 @@ Every chart has a built in default configuration for tooltips, or other options
445
445
  },
446
446
  yAxis: {
447
447
  name: 'Sales'
448
- },
448
+ },
449
449
  legend: {
450
450
  data: [
451
451
  {name: 'John'},
@@ -516,3 +516,6 @@ You are welcome to contributes. Some open tasks:
516
516
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
517
517
 
518
518
  Gem is using https://echarts.apache.org/ to build charts.
519
+
520
+ [<img src="https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/more_gems.png?raw=true"
521
+ />](https://www.railsjazz.com/?utm_source=github&utm_medium=bottom&utm_campaign=rails_charts)
@@ -0,0 +1,174 @@
1
+
2
+
3
+ /*
4
+ * Licensed to the Apache Software Foundation (ASF) under one
5
+ * or more contributor license agreements. See the NOTICE file
6
+ * distributed with this work for additional information
7
+ * regarding copyright ownership. The ASF licenses this file
8
+ * to you under the Apache License, Version 2.0 (the
9
+ * "License"); you may not use this file except in compliance
10
+ * with the License. You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing,
15
+ * software distributed under the License is distributed on an
16
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ * KIND, either express or implied. See the License for the
18
+ * specific language governing permissions and limitations
19
+ * under the License.
20
+ */
21
+
22
+
23
+ /**
24
+ * AUTO-GENERATED FILE. DO NOT MODIFY.
25
+ */
26
+ (function(root, factory) {
27
+ if (typeof define === 'function' && define.amd) {
28
+ // AMD. Register as an anonymous module.
29
+ define(['exports'], factory);
30
+ } else if (
31
+ typeof exports === 'object' &&
32
+ typeof exports.nodeName !== 'string'
33
+ ) {
34
+ // CommonJS
35
+ factory(exports);
36
+ } else {
37
+ // Browser globals
38
+ factory({});
39
+ }
40
+ })(this, function(exports) {
41
+
42
+
43
+ /**
44
+ * Language: Ukrainian.
45
+ */
46
+
47
+ var localeObj = {
48
+ time: {
49
+ month: [
50
+ 'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень',
51
+ 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'
52
+ ],
53
+ monthAbbr: [
54
+ 'Січ', 'Лют', 'Бер', 'Кві', 'Тра', 'Чер',
55
+ 'Лип', 'Сер', 'Вер', 'Жов', 'Лис', 'Гру'
56
+ ],
57
+ dayOfWeek: [
58
+ 'Неділя', 'Понеділок', 'Вівторок', 'Середа', 'Четвер', 'П\'ятниця', 'Субота'
59
+ ],
60
+ dayOfWeekAbbr: [
61
+ 'нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'
62
+ ]
63
+ },
64
+ legend: {
65
+ selector: {
66
+ all: 'Все',
67
+ inverse: 'Обернути'
68
+ }
69
+ },
70
+ toolbox: {
71
+ brush: {
72
+ title: {
73
+ rect: 'Выділити область',
74
+ polygon: 'Інструмент «Ласо»',
75
+ lineX: 'Горизонтальне виділення',
76
+ lineY: 'Вертикальне виділення',
77
+ keep: 'Залишити обране',
78
+ clear: 'Очистити обране'
79
+ }
80
+ },
81
+ dataView: {
82
+ title: 'Дані',
83
+ lang: ['Дані', 'Закрити', 'Оновити']
84
+ },
85
+ dataZoom: {
86
+ title: {
87
+ zoom: 'Збільшити',
88
+ back: 'Скасувати збільшення'
89
+ }
90
+ },
91
+ magicType: {
92
+ title: {
93
+ line: 'Переключитися на лінійний графік',
94
+ bar: 'Переключитися на стовпчикову діаграму',
95
+ stack: 'Стопка',
96
+ tiled: 'Плитка'
97
+ }
98
+ },
99
+ restore: {
100
+ title: 'Відновити'
101
+ },
102
+ saveAsImage: {
103
+ title: 'Зберегти зображення',
104
+ lang: ['Правий клік, щоб зберегти зображення']
105
+ }
106
+ },
107
+ series: {
108
+ typeNames: {
109
+ pie: 'Кругова діаграма',
110
+ bar: 'Стовпчикова діаграма',
111
+ line: 'Лінійний графік',
112
+ scatter: 'Точкова діаграма',
113
+ effectScatter: 'Точкова діаграма з хвилями',
114
+ radar: 'Пелюсткова діаграма',
115
+ tree: 'Дерево',
116
+ treemap: 'Пласке дерево',
117
+ boxplot: 'Ящик з вусами',
118
+ candlestick: 'Свічний графік',
119
+ k: 'Графік К-ліній',
120
+ heatmap: 'Теплова мапа',
121
+ map: 'Мапа',
122
+ parallel: 'Діаграма паралельних координат',
123
+ lines: 'Лінійний граф',
124
+ graph: 'Граф отношений',
125
+ sankey: 'Діаграма Санкей',
126
+ funnel: 'Воронкообразна діаграма',
127
+ gauge: 'Шкала',
128
+ pictorialBar: 'Стовпчик-картинка',
129
+ themeRiver: 'Тематична ріка',
130
+ sunburst: 'Сонячне проміння'
131
+ }
132
+ },
133
+ aria: {
134
+ general: {
135
+ withTitle: 'Це графік, що відрображує "{title}"',
136
+ withoutTitle: 'Це графік'
137
+ },
138
+ series: {
139
+ single: {
140
+ prefix: '',
141
+ withName: ' з типом {seriesType} та іменем {seriesName}.',
142
+ withoutName: ' з типом {seriesType}.'
143
+ },
144
+ multiple: {
145
+ prefix: '. Він складається з {seriesCount} серій.',
146
+ withName:
147
+ ' Серія {seriesId} має тип {seriesType} та відображає {seriesName}.',
148
+ withoutName: ' Серія {seriesId} має тип {seriesType}.',
149
+ separator: {
150
+ middle: '',
151
+ end: ''
152
+ }
153
+ }
154
+ },
155
+ data: {
156
+ allData: 'Дані такі: ',
157
+ partialData: 'Перші {displayCnt} елементів: ',
158
+ withName: 'значення для {name} — {value}',
159
+ withoutName: '{value}',
160
+ separator: {
161
+ middle: ', ',
162
+ end: '. '
163
+ }
164
+ }
165
+ }
166
+ };
167
+
168
+ for (var key in localeObj) {
169
+ if (localeObj.hasOwnProperty(key)) {
170
+ exports[key] = localeObj[key];
171
+ }
172
+ }
173
+
174
+ });
@@ -0,0 +1,170 @@
1
+
2
+
3
+ /*
4
+ * Licensed to the Apache Software Foundation (ASF) under one
5
+ * or more contributor license agreements. See the NOTICE file
6
+ * distributed with this work for additional information
7
+ * regarding copyright ownership. The ASF licenses this file
8
+ * to you under the Apache License, Version 2.0 (the
9
+ * "License"); you may not use this file except in compliance
10
+ * with the License. You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing,
15
+ * software distributed under the License is distributed on an
16
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ * KIND, either express or implied. See the License for the
18
+ * specific language governing permissions and limitations
19
+ * under the License.
20
+ */
21
+
22
+
23
+ /**
24
+ * AUTO-GENERATED FILE. DO NOT MODIFY.
25
+ */
26
+ (function(root, factory) {
27
+ if (typeof define === 'function' && define.amd) {
28
+ // AMD. Register as an anonymous module.
29
+ define(['exports', 'echarts'], factory);
30
+ } else if (
31
+ typeof exports === 'object' &&
32
+ typeof exports.nodeName !== 'string'
33
+ ) {
34
+ // CommonJS
35
+ factory(exports, require('echarts/lib/echarts'));
36
+ } else {
37
+ // Browser globals
38
+ factory({}, root.echarts);
39
+ }
40
+ })(this, function(exports, echarts) {
41
+
42
+
43
+ /**
44
+ * Language: Ukrainian.
45
+ */
46
+
47
+ var localeObj = {
48
+ time: {
49
+ month: [
50
+ 'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень',
51
+ 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'
52
+ ],
53
+ monthAbbr: [
54
+ 'Січ', 'Лют', 'Бер', 'Кві', 'Тра', 'Чер',
55
+ 'Лип', 'Сер', 'Вер', 'Жов', 'Лис', 'Гру'
56
+ ],
57
+ dayOfWeek: [
58
+ 'Неділя', 'Понеділок', 'Вівторок', 'Середа', 'Четвер', 'П\'ятниця', 'Субота'
59
+ ],
60
+ dayOfWeekAbbr: [
61
+ 'нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'
62
+ ]
63
+ },
64
+ legend: {
65
+ selector: {
66
+ all: 'Все',
67
+ inverse: 'Обернути'
68
+ }
69
+ },
70
+ toolbox: {
71
+ brush: {
72
+ title: {
73
+ rect: 'Выділити область',
74
+ polygon: 'Інструмент «Ласо»',
75
+ lineX: 'Горизонтальне виділення',
76
+ lineY: 'Вертикальне виділення',
77
+ keep: 'Залишити обране',
78
+ clear: 'Очистити обране'
79
+ }
80
+ },
81
+ dataView: {
82
+ title: 'Дані',
83
+ lang: ['Дані', 'Закрити', 'Оновити']
84
+ },
85
+ dataZoom: {
86
+ title: {
87
+ zoom: 'Збільшити',
88
+ back: 'Скасувати збільшення'
89
+ }
90
+ },
91
+ magicType: {
92
+ title: {
93
+ line: 'Переключитися на лінійний графік',
94
+ bar: 'Переключитися на стовпчикову діаграму',
95
+ stack: 'Стопка',
96
+ tiled: 'Плитка'
97
+ }
98
+ },
99
+ restore: {
100
+ title: 'Відновити'
101
+ },
102
+ saveAsImage: {
103
+ title: 'Зберегти зображення',
104
+ lang: ['Правий клік, щоб зберегти зображення']
105
+ }
106
+ },
107
+ series: {
108
+ typeNames: {
109
+ pie: 'Кругова діаграма',
110
+ bar: 'Стовпчикова діаграма',
111
+ line: 'Лінійний графік',
112
+ scatter: 'Точкова діаграма',
113
+ effectScatter: 'Точкова діаграма з хвилями',
114
+ radar: 'Пелюсткова діаграма',
115
+ tree: 'Дерево',
116
+ treemap: 'Пласке дерево',
117
+ boxplot: 'Ящик з вусами',
118
+ candlestick: 'Свічний графік',
119
+ k: 'Графік К-ліній',
120
+ heatmap: 'Теплова мапа',
121
+ map: 'Мапа',
122
+ parallel: 'Діаграма паралельних координат',
123
+ lines: 'Лінійний граф',
124
+ graph: 'Граф отношений',
125
+ sankey: 'Діаграма Санкей',
126
+ funnel: 'Воронкообразна діаграма',
127
+ gauge: 'Шкала',
128
+ pictorialBar: 'Стовпчик-картинка',
129
+ themeRiver: 'Тематична ріка',
130
+ sunburst: 'Сонячне проміння'
131
+ }
132
+ },
133
+ aria: {
134
+ general: {
135
+ withTitle: 'Це графік, що відрображує "{title}"',
136
+ withoutTitle: 'Це графік'
137
+ },
138
+ series: {
139
+ single: {
140
+ prefix: '',
141
+ withName: ' з типом {seriesType} та іменем {seriesName}.',
142
+ withoutName: ' з типом {seriesType}.'
143
+ },
144
+ multiple: {
145
+ prefix: '. Він складається з {seriesCount} серій.',
146
+ withName:
147
+ ' Серія {seriesId} має тип {seriesType} та відображає {seriesName}.',
148
+ withoutName: ' Серія {seriesId} має тип {seriesType}.',
149
+ separator: {
150
+ middle: '',
151
+ end: ''
152
+ }
153
+ }
154
+ },
155
+ data: {
156
+ allData: 'Дані такі: ',
157
+ partialData: 'Перші {displayCnt} елементів: ',
158
+ withName: 'значення для {name} — {value}',
159
+ withoutName: '{value}',
160
+ separator: {
161
+ middle: ', ',
162
+ end: '. '
163
+ }
164
+ }
165
+ }
166
+ };
167
+
168
+ echarts.registerLocale('UA', localeObj);
169
+
170
+ });