Skip to content

Commit fc24c54

Browse files
fix(highcharts): address review feedback for line-retention-cohort
Attempt 2/3 - fixes based on AI review
1 parent 7f44744 commit fc24c54

1 file changed

Lines changed: 24 additions & 17 deletions

File tree

plots/line-retention-cohort/implementations/highcharts.py

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" pyplots.ai
1+
"""pyplots.ai
22
line-retention-cohort: User Retention Curve by Cohort
33
Library: highcharts unknown | Python 3.14.3
44
Quality: 84/100 | Created: 2026-03-16
@@ -47,52 +47,58 @@
4747
"type": "line",
4848
"width": 4800,
4949
"height": 2700,
50-
"backgroundColor": "#ffffff",
51-
"marginBottom": 200,
50+
"backgroundColor": "#fafafa",
51+
"marginBottom": 240,
5252
"marginLeft": 200,
5353
"marginRight": 180,
5454
"marginTop": 160,
55+
"style": {"fontFamily": "'Segoe UI', 'Helvetica Neue', Arial, sans-serif"},
5556
}
5657

5758
chart.options.title = {
5859
"text": "line-retention-cohort \u00b7 highcharts \u00b7 pyplots.ai",
59-
"style": {"fontSize": "48px", "fontWeight": "bold"},
60+
"style": {"fontSize": "48px", "fontWeight": "bold", "color": "#2a2a2a"},
6061
}
6162

6263
chart.options.subtitle = {
6364
"text": "User Retention by Monthly Signup Cohort",
64-
"style": {"fontSize": "32px", "color": "#666666"},
65+
"style": {"fontSize": "32px", "color": "#777777"},
6566
}
6667

6768
# X-axis
6869
chart.options.x_axis = {
6970
"categories": week_labels,
70-
"title": {"text": "Weeks Since Signup", "style": {"fontSize": "36px"}},
71-
"labels": {"style": {"fontSize": "28px"}},
71+
"title": {"text": "Weeks Since Signup", "style": {"fontSize": "36px", "color": "#444444"}},
72+
"labels": {"style": {"fontSize": "28px", "color": "#555555"}},
7273
"gridLineWidth": 0,
74+
"lineColor": "#cccccc",
75+
"lineWidth": 1,
76+
"tickWidth": 0,
7377
}
7478

7579
# Y-axis
7680
chart.options.y_axis = {
77-
"title": {"text": "Retained Users (%)", "style": {"fontSize": "36px"}},
78-
"labels": {"style": {"fontSize": "28px"}, "format": "{value}%"},
81+
"title": {"text": "Retained Users (%)", "style": {"fontSize": "36px", "color": "#444444"}},
82+
"labels": {"style": {"fontSize": "28px", "color": "#555555"}, "format": "{value}%"},
7983
"min": 0,
8084
"max": 100,
8185
"tickInterval": 20,
8286
"gridLineWidth": 1,
83-
"gridLineColor": "rgba(0, 0, 0, 0.08)",
87+
"gridLineColor": "rgba(0, 0, 0, 0.06)",
88+
"gridLineDashStyle": "Dot",
89+
"lineWidth": 0,
8490
"plotLines": [
8591
{
8692
"value": 20,
87-
"color": "#999999",
88-
"dashStyle": "Dash",
93+
"color": "#b0413e",
94+
"dashStyle": "LongDash",
8995
"width": 3,
9096
"label": {
9197
"text": "20% Retention Target",
9298
"align": "right",
93-
"style": {"fontSize": "24px", "color": "#999999", "fontStyle": "italic"},
99+
"style": {"fontSize": "24px", "color": "#b0413e", "fontWeight": "600"},
94100
"x": -20,
95-
"y": -12,
101+
"y": -14,
96102
},
97103
}
98104
],
@@ -101,7 +107,8 @@
101107
# Legend
102108
chart.options.legend = {
103109
"enabled": True,
104-
"itemStyle": {"fontSize": "30px"},
110+
"itemStyle": {"fontSize": "30px", "fontWeight": "normal", "color": "#444444"},
111+
"itemHoverStyle": {"color": "#222222"},
105112
"symbolWidth": 80,
106113
"symbolHeight": 20,
107114
"layout": "vertical",
@@ -128,8 +135,8 @@
128135
}
129136
}
130137

131-
# Colors - distinct, colorblind-safe palette starting with Python Blue
132-
colors = ["#306998", "#e07b39", "#2ca02c", "#d62728", "#8c564b"]
138+
# Colors - colorblind-safe palette starting with Python Blue
139+
colors = ["#306998", "#e07b39", "#8c564b", "#7b4f8a", "#d4a84b"]
133140

134141
# Add series - older cohorts first (thinner), newest last (thickest)
135142
for i, (cohort, rates) in enumerate(retention_data.items()):

0 commit comments

Comments
 (0)