Skip to content

Commit b62ed82

Browse files
chore(bokeh): update quality score 90 and review feedback for line-retention-cohort
1 parent bafef61 commit b62ed82

2 files changed

Lines changed: 73 additions & 65 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
"""pyplots.ai
1+
""" pyplots.ai
22
line-retention-cohort: User Retention Curve by Cohort
33
Library: bokeh 3.9.0 | Python 3.14.3
4-
Quality: 87/100 | Created: 2026-03-16
4+
Quality: 90/100 | Created: 2026-03-16
55
"""
66

77
import numpy as np
Lines changed: 71 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
library: bokeh
22
specification_id: line-retention-cohort
33
created: '2026-03-16T20:44:38Z'
4-
updated: '2026-03-16T20:56:18Z'
4+
updated: '2026-03-16T21:02:56Z'
55
generated_by: claude-opus-4-5-20251101
66
workflow_run: 23164943124
77
issue: 4572
@@ -10,100 +10,102 @@ library_version: 3.9.0
1010
preview_url: https://storage.googleapis.com/pyplots-images/plots/line-retention-cohort/bokeh/plot.png
1111
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/line-retention-cohort/bokeh/plot_thumb.png
1212
preview_html: https://storage.googleapis.com/pyplots-images/plots/line-retention-cohort/bokeh/plot.html
13-
quality_score: 87
13+
quality_score: 90
1414
review:
1515
strengths:
16-
- Perfect spec compliance - all required features including visual hierarchy and
17-
threshold line
18-
- Clean well-structured code with full reproducibility
19-
- Good data storytelling through graduated visual emphasis on newer cohorts
20-
- Dual output (PNG + HTML) leverages Bokeh strengths
16+
- Excellent spec compliance — every requirement from the specification is implemented
17+
- Strong visual hierarchy through progressive line width and opacity that emphasizes
18+
newer cohorts
19+
- Idiomatic Bokeh usage with ColumnDataSource, HoverTool, and dual PNG/HTML output
20+
- Custom colorblind-safe palette with warm-to-cool progression
21+
- Clean, well-structured code with good reproducibility
2122
weaknesses:
22-
- Monochromatic blue palette needs more hue variation for cohort differentiation
23-
and accessibility
24-
- Jan 2025 line at alpha 0.55 is slightly too faint against light background
25-
- HTML output missing HoverTool - Bokeh key distinctive feature
26-
- No annotation or label on the 20% threshold line
27-
image_description: 'The plot shows a line chart with 5 user retention curves for
28-
monthly signup cohorts (Jan-May 2025). All curves start at 100% at week 0 and
29-
decay over 12 weeks. The lines use a palette spanning warm amber (Jan 2025, lightest/thinnest)
30-
through teal and blue to dark navy (May 2025, thickest/most opaque), creating
31-
a clear visual hierarchy emphasizing newer cohorts. Circle markers sit on each
32-
data point with white borders. A horizontal dashed gray line marks the 20% retention
33-
threshold. The legend in the top-right shows cohort labels with sample sizes (e.g.,
34-
"Jan 2025 (n=1,245)"). Title reads "line-retention-cohort · bokeh · pyplots.ai".
35-
X-axis: "Weeks Since Signup", Y-axis: "Retention Rate (%)". Background is light
36-
gray (#fafafa) with subtle dashed y-gridlines and no x-gridlines. Toolbar is hidden.'
23+
- Legend and threshold label text could be slightly larger for better readability
24+
on the large canvas
25+
- Axis spines are still fully present — removing top/right spines would improve
26+
visual refinement
27+
- Cohort curves converge at later weeks, making individual lines harder to distinguish
28+
image_description: The plot displays 5 user retention cohort curves (Jan–May 2025)
29+
on a light gray background. All curves start at 100% retention at week 0 and decay
30+
over 12 weeks. Colors progress from warm gold/amber (Jan 2025) through teal (Feb),
31+
dark blue (Mar), purple (Apr), to dark navy (May 2025). Line widths increase and
32+
opacity grows from older to newer cohorts, visually emphasizing the most recent
33+
cohort. Each data point has a circular marker with a white edge. A horizontal
34+
dashed gray line at 20% marks a retention threshold, labeled "20% Threshold" near
35+
the right edge. The legend in the top-right corner lists all cohorts with sample
36+
sizes (e.g., "Jan 2025 (n=1,245)"). Y-axis runs from 0 to ~105% with subtle dashed
37+
gridlines; X-axis shows "Weeks Since Signup" from 0 to 12. Title reads "line-retention-cohort
38+
· bokeh · pyplots.ai" in dark text at top-left.
3739
criteria_checklist:
3840
visual_quality:
3941
score: 28
4042
max: 30
4143
items:
4244
- id: VQ-01
4345
name: Text Legibility
44-
score: 8
46+
score: 7
4547
max: 8
4648
passed: true
4749
comment: All font sizes explicitly set (title 42pt, labels 32pt, ticks 24pt,
48-
legend 20pt), all clearly readable
50+
legend 20pt). Legend and threshold label readable but slightly small for
51+
canvas size.
4952
- id: VQ-02
5053
name: No Overlap
5154
score: 6
5255
max: 6
5356
passed: true
54-
comment: No overlapping text; legend positioned in top-right without occluding
55-
data
57+
comment: No text overlaps. Legend positioned clear of data.
5658
- id: VQ-03
5759
name: Element Visibility
5860
score: 5
5961
max: 6
6062
passed: true
61-
comment: Lines and markers well-sized; Jan 2025 line at alpha=0.55 slightly
62-
faint
63+
comment: Lines and markers clearly visible. Curves converge at later weeks
64+
making distinction harder.
6365
- id: VQ-04
6466
name: Color Accessibility
65-
score: 3
67+
score: 4
6668
max: 4
6769
passed: true
68-
comment: Colors distinguishable but monochromatic blue palette relies on luminance
69-
differences
70+
comment: Gold, teal, blue, purple, navy palette avoids red-green confusion.
7071
- id: VQ-05
7172
name: Layout & Canvas
7273
score: 4
7374
max: 4
7475
passed: true
75-
comment: Plot fills canvas well with balanced margins
76+
comment: Plot fills canvas well with balanced margins.
7677
- id: VQ-06
7778
name: Axis Labels & Title
7879
score: 2
7980
max: 2
8081
passed: true
81-
comment: Descriptive labels with units
82+
comment: 'Descriptive labels with units: Weeks Since Signup, Retention Rate
83+
(%).'
8284
design_excellence:
83-
score: 13
85+
score: 14
8486
max: 20
8587
items:
8688
- id: DE-01
8789
name: Aesthetic Sophistication
88-
score: 5
90+
score: 6
8991
max: 8
9092
passed: true
91-
comment: Thoughtful hierarchy with graduated line widths, alphas, marker sizes;
92-
custom background; above defaults but not publication-quality
93+
comment: Custom palette with warm-to-cool progression. Intentional hierarchy
94+
through line width and opacity. Above defaults but not FiveThirtyEight-level.
9395
- id: DE-02
9496
name: Visual Refinement
9597
score: 4
9698
max: 6
9799
passed: true
98-
comment: X-grid removed, y-grid subtle dashed, custom background, toolbar
99-
removed, axis styling customized
100+
comment: Subtle y-grid (dashed, alpha 0.15), x-grid removed, light gray background.
101+
Axis spines still fully present.
100102
- id: DE-03
101103
name: Data Storytelling
102104
score: 4
103105
max: 6
104106
passed: true
105-
comment: Clear visual hierarchy through line width/opacity progression; 20%
106-
threshold adds benchmark context
107+
comment: Progressive line width/opacity emphasizes newer cohorts. 20% threshold
108+
adds business context. Data shows improving retention over time.
107109
spec_compliance:
108110
score: 15
109111
max: 15
@@ -113,26 +115,27 @@ review:
113115
score: 5
114116
max: 5
115117
passed: true
116-
comment: Correct line chart with retention curves
118+
comment: Correct line chart showing retention curves by cohort.
117119
- id: SC-02
118120
name: Required Features
119121
score: 4
120122
max: 4
121123
passed: true
122-
comment: All spec features present including visual hierarchy and threshold
123-
line
124+
comment: 'All spec requirements implemented: 100% start, distinct colors,
125+
legend with sizes, gridlines, reference line.'
124126
- id: SC-03
125127
name: Data Mapping
126128
score: 3
127129
max: 3
128130
passed: true
129-
comment: X=weeks since signup, Y=retention rate percentage
131+
comment: X=weeks since signup, Y=retention rate percentage. Correct mapping.
130132
- id: SC-04
131133
name: Title & Legend
132134
score: 3
133135
max: 3
134136
passed: true
135-
comment: Title format correct; legend labels match spec format
137+
comment: Title follows spec-id · library · pyplots.ai format. Legend labels
138+
use cohort (n=size) format.
136139
data_quality:
137140
score: 14
138141
max: 15
@@ -142,20 +145,22 @@ review:
142145
score: 5
143146
max: 6
144147
passed: true
145-
comment: 5 cohorts with different decay rates showing improving retention
146-
trend; could use more pattern variety
148+
comment: 5 cohorts with varying decay rates. Good spread but could show more
149+
variation in curve shapes.
147150
- id: DQ-02
148151
name: Realistic Context
149152
score: 5
150153
max: 5
151154
passed: true
152-
comment: Monthly SaaS signup cohorts with realistic user counts
155+
comment: Monthly signup cohorts for a product. Cohort sizes 1,245-1,680 are
156+
plausible for mid-size SaaS.
153157
- id: DQ-03
154158
name: Appropriate Scale
155159
score: 4
156160
max: 4
157161
passed: true
158-
comment: Cohort sizes and retention decay rates realistic for SaaS products
162+
comment: Retention decays realistically from 100%. Final values 12-32% at
163+
week 12 are consistent with typical retention curves.
159164
code_quality:
160165
score: 10
161166
max: 10
@@ -165,53 +170,56 @@ review:
165170
score: 3
166171
max: 3
167172
passed: true
168-
comment: Clean imports-data-plot-style-save flow
173+
comment: Clean Imports → Data → Plot → Save structure. No functions or classes.
169174
- id: CQ-02
170175
name: Reproducibility
171176
score: 2
172177
max: 2
173178
passed: true
174-
comment: np.random.seed(42) set
179+
comment: np.random.seed(42) set.
175180
- id: CQ-03
176181
name: Clean Imports
177182
score: 2
178183
max: 2
179184
passed: true
180-
comment: All imports used
185+
comment: All imports used including output_file/save for HTML export.
181186
- id: CQ-04
182187
name: Code Elegance
183188
score: 2
184189
max: 2
185190
passed: true
186-
comment: Clean, Pythonic, appropriate complexity
191+
comment: Clean, well-organized code with appropriate complexity.
187192
- id: CQ-05
188193
name: Output & API
189194
score: 1
190195
max: 1
191196
passed: true
192-
comment: Saves as plot.png via export_png, also saves HTML
197+
comment: Saves as plot.png via export_png. Also saves interactive HTML.
193198
library_mastery:
194-
score: 7
199+
score: 9
195200
max: 10
196201
items:
197202
- id: LM-01
198203
name: Idiomatic Usage
199-
score: 4
204+
score: 5
200205
max: 5
201206
passed: true
202-
comment: Good use of ColumnDataSource, figure, Legend, Span models
207+
comment: Excellent use of ColumnDataSource, figure API, Legend model, Span,
208+
Label, HoverTool.
203209
- id: LM-02
204210
name: Distinctive Features
205-
score: 3
211+
score: 4
206212
max: 5
207213
passed: true
208-
comment: Uses Span, manual Legend, HTML export; missing HoverTool for interactive
209-
version
210-
verdict: REJECTED
214+
comment: HoverTool with tooltips, dual PNG+HTML output, ColumnDataSource data
215+
binding, Span for reference lines.
216+
verdict: APPROVED
211217
impl_tags:
212218
dependencies: []
213219
techniques:
220+
- hover-tooltips
214221
- custom-legend
222+
- annotations
215223
- html-export
216224
patterns:
217225
- data-generation
@@ -220,5 +228,5 @@ impl_tags:
220228
dataprep: []
221229
styling:
222230
- alpha-blending
223-
- grid-styling
224231
- edge-highlighting
232+
- grid-styling

0 commit comments

Comments
 (0)