active_analytics 0.2.1 → 0.3.0

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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +88 -15
  3. data/app/controllers/active_analytics/application_controller.rb +23 -5
  4. data/app/controllers/active_analytics/assets_controller.rb +29 -0
  5. data/app/controllers/active_analytics/pages_controller.rb +9 -10
  6. data/app/controllers/active_analytics/referrers_controller.rb +9 -5
  7. data/app/controllers/active_analytics/sites_controller.rb +4 -4
  8. data/app/models/active_analytics/views_per_day.rb +22 -3
  9. data/app/views/active_analytics/assets/_charts.css +249 -0
  10. data/app/{assets/stylesheets/active_analytics/style.css → views/active_analytics/assets/_style.css} +36 -26
  11. data/app/views/active_analytics/assets/application.css.erb +2 -0
  12. data/app/{assets/javascripts/active_analytics → views/active_analytics/assets}/application.js +1 -3
  13. data/app/{assets/stylesheets/active_analytics → views/active_analytics/assets}/ariato.css +237 -234
  14. data/app/views/active_analytics/pages/_table.html.erb +6 -17
  15. data/app/views/active_analytics/pages/index.html.erb +1 -1
  16. data/app/views/active_analytics/pages/show.html.erb +7 -4
  17. data/app/views/active_analytics/referrers/_table.html.erb +9 -2
  18. data/app/views/active_analytics/referrers/index.html.erb +2 -2
  19. data/app/views/active_analytics/referrers/show.html.erb +6 -3
  20. data/app/views/active_analytics/sites/_histogram.html.erb +9 -2
  21. data/app/views/active_analytics/sites/_histogram_header.html.erb +10 -0
  22. data/app/views/active_analytics/sites/show.html.erb +2 -2
  23. data/app/views/layouts/active_analytics/_footer.html.erb +3 -3
  24. data/app/views/layouts/active_analytics/_header.html.erb +1 -3
  25. data/app/views/layouts/active_analytics/application.html.erb +5 -3
  26. data/config/routes.rb +2 -1
  27. data/lib/active_analytics/engine.rb +0 -4
  28. data/lib/active_analytics/version.rb +1 -1
  29. data/lib/active_analytics.rb +41 -3
  30. metadata +11 -9
  31. data/app/assets/stylesheets/active_analytics/application.css +0 -15
  32. data/app/assets/stylesheets/active_analytics/charts.css +0 -296
  33. /data/app/{assets/javascripts/active_analytics → views/active_analytics/assets}/ariato.js +0 -0
@@ -1,296 +0,0 @@
1
- /*
2
- * Charts.css v0.9.0 (https://ChartsCSS.org/)
3
- * Copyright 2020 Rami Yushuvaev
4
- * Licensed under MIT
5
- */
6
- .charts-css {
7
- --chart-bg-color: transparent;
8
- --heading-size: 0px;
9
- --primary-axis-color: rgba(var(--color-grey-100), 1);
10
- --primary-axis-style: solid;
11
- --primary-axis-width: 1px;
12
- --secondary-axes-color: rgba(var(--color-grey-50), 1);
13
- --secondary-axes-style: solid;
14
- --secondary-axes-width: 1px;
15
- --data-axes-color: rgba(var(--color-grey-200), 1);
16
- --data-axes-style: solid;
17
- --data-axes-width: 1px;
18
- --legend-border-color: rgba(var(--color-grey-200), 1);
19
- position: relative;
20
- display: block;
21
- margin: 0;
22
- padding: 0;
23
- border: 0;
24
- }
25
-
26
- /*
27
- * Chart wrapper element
28
- */
29
-
30
- .charts-css, .charts-css::after, .charts-css::before,
31
- .charts-css *,
32
- .charts-css *::after,
33
- .charts-css *::before {
34
- -webkit-box-sizing: border-box;
35
- box-sizing: border-box;
36
- }
37
-
38
- /*
39
- * Reset table element
40
- */
41
- table.charts-css {
42
- border-collapse: collapse;
43
- border-spacing: 0;
44
- empty-cells: show;
45
- overflow: initial;
46
- background-color: transparent;
47
- }
48
-
49
- table.charts-css caption,
50
- table.charts-css colgroup,
51
- table.charts-css thead,
52
- table.charts-css tbody,
53
- table.charts-css tr,
54
- table.charts-css th,
55
- table.charts-css td {
56
- display: block;
57
- margin: 0;
58
- padding: 0;
59
- border: 0;
60
- background-color: transparent;
61
- }
62
-
63
- table.charts-css colgroup,
64
- table.charts-css thead,
65
- table.charts-css tfoot {
66
- display: none;
67
- }
68
-
69
-
70
- /*
71
- * Chart colors
72
- */
73
-
74
- .charts-css.column tbody tr td {
75
- background: rgba(var(--color-grey-100), 1);
76
- padding: 0;
77
- }
78
-
79
- /*
80
- * Chart data
81
- */
82
- .charts-css.hide-data .data {
83
- opacity: 0;
84
- }
85
-
86
- .charts-css.show-data-on-hover .data {
87
- -webkit-transition-duration: .3s;
88
- transition-duration: .3s;
89
- opacity: 0;
90
- }
91
-
92
- .charts-css.show-data-on-hover tr:hover .data {
93
- -webkit-transition-duration: .3s;
94
- transition-duration: .3s;
95
- opacity: 1;
96
- }
97
-
98
- /*
99
- * Chart labels
100
- */
101
-
102
- .charts-css.column:not(.show-labels) {
103
- --labels-size: 0;
104
- }
105
-
106
- .charts-css.column:not(.show-labels) tbody tr th {
107
- display: none;
108
- }
109
-
110
- .charts-css.column.show-labels {
111
- --labels-size: 1.5rem;
112
- }
113
-
114
- .charts-css.column.show-labels tbody tr th {
115
- display: -webkit-box;
116
- display: -ms-flexbox;
117
- display: flex;
118
- -webkit-box-pack: var(--labels-align, center);
119
- -ms-flex-pack: var(--labels-align, center);
120
- justify-content: var(--labels-align, center);
121
- -webkit-box-align: center;
122
- -ms-flex-align: center;
123
- align-items: center;
124
- -webkit-box-orient: vertical;
125
- -webkit-box-direction: normal;
126
- -ms-flex-direction: column;
127
- flex-direction: column;
128
- }
129
-
130
- @media (max-width: 600px) {
131
- .charts-css.column.show-labels {
132
- --labels-size: 0;
133
- }
134
-
135
- .charts-css.column.show-labels tbody tr th {
136
- display: none;
137
- }
138
- }
139
-
140
- /*
141
- * Chart axes
142
- */
143
- .charts-css.column.show-primary-axis:not(.reverse) tbody tr {
144
- -webkit-border-after: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
145
- border-block-end: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
146
- }
147
-
148
- .charts-css.column.show-primary-axis.reverse tbody tr {
149
- -webkit-border-before: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
150
- border-block-start: var(--primary-axis-width) var(--primary-axis-style) var(--primary-axis-color);
151
- }
152
-
153
- .charts-css.column.show-5-secondary-axes:not(.reverse) tbody tr {
154
- background-size: 100% 20%;
155
- background-image: -webkit-gradient(linear, left top, left bottom, from(var(--secondary-axes-color)), to(transparent));
156
- background-image: linear-gradient(var(--secondary-axes-color) var(--secondary-axes-width), transparent var(--secondary-axes-width));
157
- }
158
-
159
- .charts-css.column.show-5-secondary-axes.reverse tbody tr {
160
- background-size: 100% 20%;
161
- background-image: -webkit-gradient(linear, left bottom, left top, from(var(--secondary-axes-color)), to(transparent));
162
- background-image: linear-gradient(0deg, var(--secondary-axes-color) var(--secondary-axes-width), transparent var(--secondary-axes-width));
163
- }
164
-
165
- /*
166
- * Chart tooltips
167
- */
168
- .charts-css .tooltip {
169
- position: absolute;
170
- z-index: 1;
171
- bottom: 50%;
172
- left: 50%;
173
- -webkit-transform: translateX(-50%);
174
- transform: translateX(-50%);
175
- width: -webkit-max-content;
176
- width: -moz-max-content;
177
- width: max-content;
178
- padding: 5px 10px;
179
- border-radius: 6px;
180
- visibility: hidden;
181
- opacity: 0;
182
- -webkit-transition: opacity .3s;
183
- transition: opacity .3s;
184
- background-color: rgba(var(--color-grey-500), 1);
185
- color: rgba(var(--color-grey-00), 1);
186
- text-align: center;
187
- font-size: .9rem;
188
- }
189
-
190
- .charts-css .tooltip::after {
191
- content: "";
192
- position: absolute;
193
- top: 100%;
194
- left: 50%;
195
- margin-left: -5px;
196
- border-width: 5px;
197
- border-style: solid;
198
- border-color: rgba(var(--color-grey-500), 1) transparent transparent;
199
- }
200
-
201
- .charts-css tr:hover .tooltip {
202
- visibility: visible;
203
- opacity: 1;
204
- }
205
-
206
- /*
207
- * Column Chart
208
- */
209
- .charts-css.column tbody {
210
- display: -webkit-box;
211
- display: -ms-flexbox;
212
- display: flex;
213
- -webkit-box-pack: justify;
214
- -ms-flex-pack: justify;
215
- justify-content: space-between;
216
- -webkit-box-align: stretch;
217
- -ms-flex-align: stretch;
218
- align-items: stretch;
219
- width: 100%;
220
- height: calc(100% - var(--heading-size));
221
- }
222
-
223
- .charts-css.column tbody tr {
224
- position: relative;
225
- -webkit-box-flex: 1;
226
- -ms-flex-positive: 1;
227
- flex-grow: 1;
228
- -ms-flex-negative: 1;
229
- flex-shrink: 1;
230
- -ms-flex-preferred-size: 0;
231
- flex-basis: 0;
232
- overflow-wrap: anywhere;
233
- display: -webkit-box;
234
- display: -ms-flexbox;
235
- display: flex;
236
- -webkit-box-pack: start;
237
- -ms-flex-pack: start;
238
- justify-content: flex-start;
239
- min-width: 0;
240
- }
241
-
242
- .charts-css.column tbody tr th {
243
- position: absolute;
244
- right: 0;
245
- left: 0;
246
- }
247
-
248
- .charts-css.column tbody tr td {
249
- display: -webkit-box;
250
- display: -ms-flexbox;
251
- display: flex;
252
- -webkit-box-pack: center;
253
- -ms-flex-pack: center;
254
- justify-content: center;
255
- width: 100%;
256
- height: calc(100% * var(--size, 1));
257
- position: relative;
258
- }
259
-
260
- .charts-css.column:not(.reverse) tbody tr {
261
- -webkit-box-align: end;
262
- -ms-flex-align: end;
263
- align-items: flex-end;
264
- -webkit-margin-after: var(--labels-size);
265
- margin-block-end: var(--labels-size);
266
- }
267
-
268
- .charts-css.column:not(.reverse) tbody tr th {
269
- bottom: calc(-1 * var(--labels-size) - var(--primary-axis-width));
270
- height: var(--labels-size);
271
- color: rgba(var(--color-grey-400), 1);
272
- font-weight: 400;
273
- }
274
-
275
- .charts-css.column:not(.reverse) tbody tr td {
276
- -webkit-box-align: start;
277
- -ms-flex-align: start;
278
- align-items: flex-start;
279
- }
280
-
281
- .charts-css.column:not(.stacked) tbody tr td {
282
- -webkit-box-flex: 1;
283
- -ms-flex-positive: 1;
284
- flex-grow: 1;
285
- -ms-flex-negative: 1;
286
- flex-shrink: 1;
287
- -ms-flex-preferred-size: 0;
288
- flex-basis: 0;
289
- }
290
-
291
- .charts-css.column:not(.reverse-data) tbody {
292
- -webkit-box-orient: horizontal;
293
- -webkit-box-direction: normal;
294
- -ms-flex-direction: row;
295
- flex-direction: row;
296
- }