supercharts-bullet_train 1.2.0 → 1.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e811c023b43cfac138f37ad0cab28985d10a22732cb31222d64ada7566f7e2f
|
4
|
+
data.tar.gz: 129ebeb5e7114f83260850f5575292ca36fa93c4b8ae12af58c088a4245fdf47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0e757aa845f016496c787282abfee6ae47792de9d6bbca3b3c4b1b4b6495228423215614e5596652589c752b1a7a8b976efa22f6257eb02ae175b81ff4ede2b
|
7
|
+
data.tar.gz: 3de0a84b61460b609434a1cca51016fc303943d4cefd0f49140e6b9fb225c473b45214d2f886823a33b1748a3195d2d58c8cc90a624d9faf99b2911be1c64b53
|
data/README.md
CHANGED
@@ -90,30 +90,35 @@ This will generated some new files and modify some files like inserting a `turbo
|
|
90
90
|
|
91
91
|
### Generate some test data
|
92
92
|
|
93
|
-
We'll use a
|
93
|
+
We'll use a new seed file create `click_throughs` with random-looking `created_at` properties (in this case creating a log normal spike and long-tail curve typical of a launch).
|
94
94
|
|
95
95
|
```ruby
|
96
|
-
#
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
96
|
+
# db/seeds/click_throughs.rb
|
97
|
+
team = Team.first
|
98
|
+
|
99
|
+
if team.present?
|
100
|
+
ClickThrough.delete_all # start fresh
|
101
|
+
|
102
|
+
# Rubystats::LognormalDistribution.new(1, 4.0)
|
103
|
+
sample_logn_days_since_launch = [0.374752478249304,2.573715367349214,8.205364533794372,0.018758139772852223,0.007503724554433451,9.795277947976652,8.920746829981699,0.10551189188869997,1.764721845714895,0.16013475895174034,0.09656162234229956,1.051545673721908,3.4605465909422444,0.5284662248320162,12.552059342378902,0.802742590175781,0.02109366834525422,0.02664778128443366,4.390318514353362,0.09774971155444112,1.2046433918447472,6.842861969154294,0.011979372791258703,0.064030764714403,0.254580889613002,0.8375254371675241,6.645595256049555,0.004578324225909655,7.645897327323974,3.8198662350854358,2.5433159804484093,12.23258356052949,8.590508575839966,0.36652090412334615,0.11151312341555021,0.17233489061676868,0.2146532779238352,0.14245752689762017,0.19342953572076568,0.1529907988439447,0.00750514011797885,0.4518938917044475,2.824609604776437,0.9950891711469877,1.0656326056125578,0.1261305417548888,0.009966388079746133,11.001041702449946,0.0013675811570916427,0.02367451456093704,0.01894224395588477,4.440315660471336,0.09493622122995193,0.07657312652331208,1.4874835063144172,0.13842079252030612,2.1017802510726815,4.196227775076141,0.054093691138304485,0.0051252791552137186,3.0245345093639773,0.00032997376067659843,0.006931535931463956,1.78040031800141,1.2156342429038396,1.7978965235819222,0.818322573101528,0.08369936871534746,0.16412718021762976,9.844260419603875,5.14537997872604,10.644277259959916,2.516432067417657,0.02670462498452867,0.009043612354757327,2.481241138462057,1.9882680498827123,0.11922535105626798,0.20284489863820995,0.1274031773301022,0.35779282006366203,1.0571276594384351,1.0249771657735456,0.6552185634235514,0.7524783523736271,0.2539575382334551,0.5439132099545871]
|
104
|
+
|
105
|
+
sample_logn_days_since_launch.each do |days_offset|
|
106
|
+
created_at = 2.weeks.ago + days_offset.days
|
107
|
+
|
108
|
+
team.click_throughs.create!(created_at: created_at)
|
104
109
|
end
|
105
110
|
end
|
106
111
|
```
|
107
112
|
|
108
|
-
Then
|
113
|
+
Then run:
|
109
114
|
|
110
|
-
```
|
111
|
-
|
115
|
+
```sh
|
116
|
+
bin/rails r db/seeds/click_throughs.rb
|
112
117
|
```
|
113
118
|
|
114
119
|
Visit your app in `localhost:3000` and you should see your new chart.
|
115
120
|
|
116
|
-

|
117
122
|
|
118
123
|
## Modifying the chart
|
119
124
|
|
@@ -147,12 +152,12 @@ For the following types of changes, you'll need to create your own Stimulus cont
|
|
147
152
|
If you just want to make aesthetic changes, you can change the following css variables found at the top of your scaffolded `show.html.erb`. In this case, these are all TailwindCSS classes that set the appropriate custom CSS properties scoped to just that chart.
|
148
153
|
|
149
154
|
```html
|
150
|
-
[--axis-color:theme('colors.gray.300')] dark:[--axis-color:theme('colors.
|
151
|
-
[--grid-color:theme('colors.gray.100')] dark:[--grid-color:theme('colors.
|
155
|
+
[--axis-color:theme('colors.gray.300')] dark:[--axis-color:theme('colors.slate.500')]
|
156
|
+
[--grid-color:theme('colors.gray.100')] dark:[--grid-color:theme('colors.slate.800')]
|
152
157
|
[--line-color:#a86fe7]
|
153
158
|
[--point-color:theme('colors.gray.800')] dark:[--point-color:theme('colors.white')]
|
154
|
-
[--point-stroke-color:theme('colors.white')] dark:[--point-stroke-color:theme('colors.
|
155
|
-
[--point-stroke-color-hover:theme('colors.gray.100')] dark:[--point-stroke-color-hover:theme('colors.
|
159
|
+
[--point-stroke-color:theme('colors.white')] dark:[--point-stroke-color:theme('colors.slate.700')]
|
160
|
+
[--point-stroke-color-hover:theme('colors.gray.100')] dark:[--point-stroke-color-hover:theme('colors.slate.800')]
|
156
161
|
[--bar-fill-color:var(--line-color)]
|
157
162
|
[--bar-hover-fill-color:var(--point-color)]
|
158
163
|
[--point-radius:4] md:[--point-radius:6]
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<%= turbo_frame_tag :charts_tangible_things do %>
|
2
2
|
<div class="p-8 rounded-md shadow
|
3
|
-
bg-white dark:bg-
|
4
|
-
[--axis-color:theme('colors.gray.300')] dark:[--axis-color:theme('colors.
|
5
|
-
[--grid-color:theme('colors.gray.100')] dark:[--grid-color:theme('colors.
|
6
|
-
[--line-color
|
3
|
+
bg-white dark:bg-slate-900
|
4
|
+
[--axis-color:theme('colors.gray.300')] dark:[--axis-color:theme('colors.slate.500')]
|
5
|
+
[--grid-color:theme('colors.gray.100')] dark:[--grid-color:theme('colors.slate.800')]
|
6
|
+
[--line-color:theme('colors.primary.400')] dark:[--line-color:theme('colors.primary.600')]
|
7
7
|
[--point-color:theme('colors.gray.800')] dark:[--point-color:theme('colors.white')]
|
8
|
-
[--point-stroke-color:theme('colors.white')] dark:[--point-stroke-color:theme('colors.
|
9
|
-
[--point-stroke-color-hover:theme('colors.gray.100')] dark:[--point-stroke-color-hover:theme('colors.
|
8
|
+
[--point-stroke-color:theme('colors.white')] dark:[--point-stroke-color:theme('colors.slate.900')]
|
9
|
+
[--point-stroke-color-hover:theme('colors.gray.100')] dark:[--point-stroke-color-hover:theme('colors.slate.800')]
|
10
10
|
[--bar-fill-color:var(--line-color)]
|
11
11
|
[--bar-hover-fill-color:var(--point-color)]
|
12
12
|
[--point-radius:4] md:[--point-radius:6]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: supercharts-bullet_train
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pascal Laliberté
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|