Skip to content

Commit b5a5fa5

Browse files
committed
feat: update changelog and version
1 parent 945355a commit b5a5fa5

File tree

8 files changed

+35
-35
lines changed

8 files changed

+35
-35
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.2.0] - Unreleased
8+
## [0.2.0] - 2026-02-09
99

1010
### Added
1111
- **Accessibility (ARIA + keyboard)**: `title:` and `description:` options on charts, `role="img"` and `aria-label` on SVG elements, `aria-hidden` on decorative elements (grid, crosshair, reference lines), `aria-label` on data points
@@ -22,7 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
- **Heatmap chart type**: `c.heatmap(x_key: :day, y_key: :hour, value_key: :count)` for density/intensity visualization
2323
- **Treemap chart type**: `c.treemap(value_key: :size, label_key: :name)` for hierarchical data with optional `parent_key` grouping
2424

25-
## [0.1.0] - 2025-01-01
25+
## [0.1.0] - 2026-02-08
2626

2727
### Added
2828
- Initial release with 10 chart types: Line, Bar, Area (with stacking), Scatter, Pie/Donut, Radar, Horizontal Bar, Candlestick, Funnel

lib/generators/trackplot/install_generator.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def print_post_install
3737
say "Quick start — add this to any ERB view:"
3838
say ""
3939
say ' <%= trackplot_chart([{month: "Jan", revenue: 100}, {month: "Feb", revenue: 200}]) do |c| %>'
40-
say ' <% c.axis :x, data_key: :month %>'
41-
say ' <% c.axis :y, format: :currency %>'
42-
say ' <% c.line :revenue, curve: true %>'
43-
say ' <% c.tooltip format: :currency %>'
44-
say ' <% c.legend %>'
40+
say " <% c.axis :x, data_key: :month %>"
41+
say " <% c.axis :y, format: :currency %>"
42+
say " <% c.line :revenue, curve: true %>"
43+
say " <% c.tooltip format: :currency %>"
44+
say " <% c.legend %>"
4545
say " <% end %>"
4646
say ""
4747
end
@@ -69,10 +69,10 @@ def install_jsbundling
6969
say "Using #{pm} to install packages...", :cyan
7070

7171
install_cmd = case pm
72-
when "yarn" then "yarn add d3 trackplot"
73-
when "pnpm" then "pnpm add d3 trackplot"
74-
else "npm install d3 trackplot"
75-
end
72+
when "yarn" then "yarn add d3 trackplot"
73+
when "pnpm" then "pnpm add d3 trackplot"
74+
else "npm install d3 trackplot"
75+
end
7676

7777
run install_cmd
7878
ensure_import_in_application_js

lib/trackplot/color_scale.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def diverging(hex1, hex2, count: 8)
3737
h = lerp_hue(h1, h2, t)
3838
s = lerp(s1, s2, t)
3939
# Parabolic curve: l = 0.95 at t=0.5, dropping to ~0.35 at edges
40-
l = 0.95 - 2.4 * (t - 0.5) ** 2
40+
l = 0.95 - 2.4 * (t - 0.5)**2
4141
hsl_to_hex(h, s, l)
4242
end
4343
end
@@ -85,27 +85,27 @@ def rgb_to_hsl(r, g, b)
8585
h = s = 0.0
8686
else
8787
d = max - min
88-
s = l > 0.5 ? d / (2.0 - max - min) : d / (max + min)
88+
s = (l > 0.5) ? d / (2.0 - max - min) : d / (max + min)
8989

9090
h = case max
91-
when r then ((g - b) / d + (g < b ? 6 : 0)) / 6.0
92-
when g then ((b - r) / d + 2) / 6.0
93-
when b then ((r - g) / d + 4) / 6.0
94-
end
91+
when r then ((g - b) / d + ((g < b) ? 6 : 0)) / 6.0
92+
when g then ((b - r) / d + 2) / 6.0
93+
when b then ((r - g) / d + 4) / 6.0
94+
end
9595
end
9696

9797
[h * 360.0, s, l]
9898
end
9999

100100
def hsl_to_rgb(h, s, l)
101-
h = h / 360.0
101+
h /= 360.0
102102

103103
if s == 0
104104
val = (l * 255).round
105105
return [val, val, val]
106106
end
107107

108-
q = l < 0.5 ? l * (1 + s) : l + s - l * s
108+
q = (l < 0.5) ? l * (1 + s) : l + s - l * s
109109
p = 2 * l - q
110110

111111
r = hue_to_rgb(p, q, h + 1.0 / 3)
@@ -146,13 +146,13 @@ def lerp(a, b, t)
146146
def lerp_hue(h1, h2, t)
147147
diff = h2 - h1
148148
if diff.abs > 180
149-
diff += diff > 0 ? -360 : 360
149+
diff += (diff > 0) ? -360 : 360
150150
end
151151
(h1 + diff * t) % 360
152152
end
153153

154154
private_class_method :validate_hex!, :hex_to_rgb, :rgb_to_hsl, :hsl_to_rgb,
155-
:hue_to_rgb, :rgb_to_hex, :hex_to_hsl, :hsl_to_hex,
156-
:lerp, :lerp_hue
155+
:hue_to_rgb, :rgb_to_hex, :hex_to_hsl, :hsl_to_hex,
156+
:lerp, :lerp_hue
157157
end
158158
end

lib/trackplot/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Trackplot
2-
VERSION = "0.1.0"
2+
VERSION = "0.2.0"
33
end

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trackplot",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Beautiful D3.js charts for Rails with a Recharts-like DSL",
55
"module": "app/assets/javascripts/trackplot/index.js",
66
"main": "app/assets/javascripts/trackplot/index.js",

test/dummy/app/controllers/charts_controller.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ def index
156156
@drilldown_heatmap_data = %w[Q1 Q2 Q3 Q4].flat_map do |quarter|
157157
%w[Sales Marketing Engineering Support].map do |dept|
158158
months = case quarter
159-
when "Q1" then %w[Jan Feb Mar]
160-
when "Q2" then %w[Apr May Jun]
161-
when "Q3" then %w[Jul Aug Sep]
162-
when "Q4" then %w[Oct Nov Dec]
163-
end
159+
when "Q1" then %w[Jan Feb Mar]
160+
when "Q2" then %w[Apr May Jun]
161+
when "Q3" then %w[Jul Aug Sep]
162+
when "Q4" then %w[Oct Nov Dec]
163+
end
164164
{
165165
day: quarter, hour: dept,
166166
count: rand(50..200),

test/trackplot/color_scale_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ def hsl_hue(hex)
191191

192192
d = max - min
193193
h = case max
194-
when r then ((g - b) / d + (g < b ? 6 : 0)) / 6.0
195-
when g then ((b - r) / d + 2) / 6.0
196-
when b then ((r - g) / d + 4) / 6.0
197-
end
194+
when r then ((g - b) / d + ((g < b) ? 6 : 0)) / 6.0
195+
when g then ((b - r) / d + 2) / 6.0
196+
when b then ((r - g) / d + 4) / 6.0
197+
end
198198
h * 360.0
199199
end
200200
end

0 commit comments

Comments
 (0)