Skip to content

Commit d5c8b8f

Browse files
chore(altair): update quality score 91 and review feedback for lollipop-basic
1 parent ee8995c commit d5c8b8f

2 files changed

Lines changed: 104 additions & 80 deletions

File tree

plots/lollipop-basic/implementations/python/altair.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
"""anyplot.ai
1+
""" anyplot.ai
22
lollipop-basic: Basic Lollipop Chart
33
Library: altair 6.2.2 | Python 3.13.14
4-
Quality: 87/100 | Updated: 2026-07-01
4+
Quality: 91/100 | Updated: 2026-07-01
55
"""
66

77
import sys as _sys

plots/lollipop-basic/metadata/python/altair.yaml

Lines changed: 102 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ library: altair
22
language: python
33
specification_id: lollipop-basic
44
created: '2025-12-23T15:13:50Z'
5-
updated: '2026-07-01T06:06:39Z'
5+
updated: '2026-07-01T06:16:56Z'
66
generated_by: claude-sonnet
77
workflow_run: 28496613795
88
issue: 934
@@ -12,40 +12,51 @@ preview_url_light: https://storage.googleapis.com/anyplot-images/plots/lollipop-
1212
preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/lollipop-basic/python/altair/plot-dark.png
1313
preview_html_light: https://storage.googleapis.com/anyplot-images/plots/lollipop-basic/python/altair/plot-light.html
1414
preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/lollipop-basic/python/altair/plot-dark.html
15-
quality_score: 87
15+
quality_score: 91
1616
review:
1717
strengths:
18-
- 'Perfect spec compliance: correct lollipop type with stems and dots, sorted data,
19-
all required features present'
20-
- 'Strong theme adaptation: both renders pass legibility with correct background
21-
and text color tokens throughout'
22-
- 'Intentional focal emphasis: Electronics dot sized at 2x others using alt.condition
23-
— evidence of design thinking beyond defaults'
24-
- Interactive hover with selection_point and opacity dim/highlight showcases Altair
25-
distinctive declarative interactivity
26-
- 'Clean KISS code: deterministic data, all imports used, elegant layer composition
27-
with + operator'
28-
- 'Correct canvas handling: pad-to-3200x1800 logic with fail-loud on overshoot'
18+
- Correct lollipop chart with proper mark_rule stems and mark_circle dots — all
19+
spec requirements satisfied
20+
- 'Focal emphasis: Electronics dot rendered at size=950 vs size=480 for others,
21+
creating clear visual hierarchy'
22+
- Annotated top performer with bold '$425,000' value label guiding viewer to key
23+
insight
24+
- Interactive hover selection (alt.selection_point) with opacity dimming — Altair-native
25+
feature active in HTML output
26+
- 'Perfect theme-adaptive chrome: all text, grid, and legend tokens correctly flip
27+
between #FAF8F1 and #1A1A17 surfaces'
28+
- Idiomatic Altair layer composition (stems + dots + annotation) using alt.datum
29+
expressions and alt.condition
30+
- Sales data sorted descending — reinforces ranking narrative immediately
31+
- 'Both renders fully legible: no dark-on-dark or light-on-light text failures'
2932
weaknesses:
30-
- 'DE-03: No value annotation or reference line to anchor the viewer story — add
31-
a text label on the Electronics dot showing $425K or a horizontal mean reference
32-
line'
33-
- 'DE-02: Axis domain lines still visible (domainColor=INK_SOFT) — add domainOpacity=0
34-
to configure_axis for a cleaner minimal aesthetic'
35-
- 'VQ-01 minor: 10 rotated x-axis labels at -35 deg are readable but slightly dense
36-
— labelAngle=-45 with labelFontSize=9 would improve spacing'
33+
- 'DE-01 (5/8): Design is intentional and above defaults but not yet at publication-quality
34+
polish — typography hierarchy could be tighter and marker stroke effect could
35+
be more refined'
36+
- 'DE-02 (4/6): Tick marks still visible on both axes; removing or reducing them
37+
would sharpen the minimalist look; domain opacity=0 hides axis line cleanly but
38+
tick color remains'
39+
- 'DE-03 (4/6): Storytelling is good but could be elevated — consider color-fading
40+
all bars below top-3 slightly to deepen the ranking story beyond size variation'
41+
- 'VQ-01 (7/8): Annotation font at fontSize=10 is the smallest element; at mobile
42+
width (~400 px) it scales to ~5 px — slightly below comfortable threshold; consider
43+
fontSize=11-12 for the annotation'
44+
- 'LM-02 (4/5): Interactive selection and alt.datum expressions are Altair-distinctive,
45+
but the HTML-rendered interactivity is invisible in the static PNG — consider
46+
adding a text annotation or legend note referencing interactivity, or showcase
47+
another Altair-unique static visual encoding'
3748
image_description: |-
3849
Light render (plot-light.png):
39-
Background: Warm off-white #FAF8F1 — correct theme background.
40-
Chrome: Title "Product Sales by Category · lollipop-basic · python · altair · anyplot.ai" in bold dark ink, ~70% width — readable. Y-axis label "Sales (USD)" and X-axis label "Category" in dark INK tone — readable. Y-axis tick labels ($0–$450,000) and X-axis category labels (rotated -35°) in muted INK_SOFT tone — all readable.
41-
Data: Brand green #009E73 stems (strokeWidth=4 vertical rules) and circular dots. Electronics dot is noticeably larger (size=950) as a focal emphasis. All 10 categories visible with lollipop from $0 baseline to value. No overlapping elements.
42-
Legibility verdict: PASS
50+
Background: Warm off-white (#FAF8F1) — correct, not pure white
51+
Chrome: Bold title "Product Sales by Category · lollipop-basic · python · altair · anyplot.ai" in dark ink, clearly readable; "Category" X-axis label and "Sales (USD)" Y-axis label both readable dark text; Y-axis tick labels ($0–$450,000 in dollar format) and X-axis category tick labels (rotated -45°) all legible against the light surface; subtle horizontal grid lines in INK at 12% opacity
52+
Data: 10 lollipop stems in brand green #009E73 (mark_rule, strokeWidth=4); circular markers in same #009E73 with PAGE_BG stroke ring for separation; Electronics marker is distinctly larger (size=950) creating focal emphasis; "$425,000" annotation in dark ink above Electronics dot
53+
Legibility verdict: PASS — all text clearly readable, no light-on-light failures
4354
4455
Dark render (plot-dark.png):
45-
Background: Warm near-black #1A1A17 — correct theme background.
46-
Chrome: Title in bold light text (#F0EFE8 tone) — readable. Axis labels and tick labels in light muted tone (#B8B7B0 tone) — readable. No dark-on-dark failures. Tick label text is clearly distinguishable from the dark background.
47-
Data: Data colors (brand green #009E73) are IDENTICAL to the light render — only chrome has flipped. Stems and dots carry identical color. Electronics larger dot is preserved. Grid lines appear as subtle light lines on dark background.
48-
Legibility verdict: PASS
56+
Background: Warm near-black (#1A1A17) — correct, not pure black
57+
Chrome: Title and axis labels in light off-white (INK=#F0EFE8) — fully readable against dark surface; Y-axis and X-axis tick labels in INK_SOFT (#B8B7B0) — clearly visible; grid lines subtle against dark surface; "$425,000" annotation in light text, legible
58+
Data: Stems and dots in identical #009E73 brand green — matches light render exactly; Electronics dot still distinctly larger; no hue shift between themes (data colors theme-invariant, only chrome flips)
59+
Legibility verdict: PASS — no dark-on-dark failures; all chrome tokens correctly adapted to dark theme; brand green #009E73 remains visible and distinguishable on dark surface
4960
criteria_checklist:
5061
visual_quality:
5162
score: 29
@@ -56,74 +67,80 @@ review:
5667
score: 7
5768
max: 8
5869
passed: true
59-
comment: Font sizes explicitly set (title 15px, axis 10/12px), readable in
60-
both themes. 10 rotated labels at -35deg are slightly dense but readable.
70+
comment: All font sizes explicitly set (title=15, axis=12, ticks=10, annotation=10);
71+
readable in both themes; annotation at fontSize=10 is the smallest element
72+
and slightly tight at mobile scale
6173
- id: VQ-02
6274
name: No Overlap
6375
score: 6
6476
max: 6
6577
passed: true
66-
comment: No text or element collisions in either render.
78+
comment: No overlapping elements; X-axis labels rotated -45° with sufficient
79+
spacing for 10 categories
6780
- id: VQ-03
6881
name: Element Visibility
6982
score: 6
7083
max: 6
7184
passed: true
72-
comment: Stems at strokeWidth=4 clearly visible; dot sizes 480-950 well-sized;
73-
Electronics focal dot stands out.
85+
comment: Stems at strokeWidth=4 clearly visible; dots at size=480950 well-proportioned
86+
for 10 data points; size variation adds information encoding
7487
- id: VQ-04
7588
name: Color Accessibility
7689
score: 2
7790
max: 2
7891
passed: true
79-
comment: Single series brand green is CVD-safe, no red-green-only signal.
92+
comment: 'Single #009E73 series with high contrast on both surfaces; no CVD
93+
concerns with single-hue chart'
8094
- id: VQ-05
8195
name: Layout & Canvas
8296
score: 4
8397
max: 4
8498
passed: true
85-
comment: Canvas gate passed. No overflow or clipping. Title proportional,
86-
balanced axis labels.
99+
comment: Chart occupies healthy portion of 3200x1800 canvas; balanced margins;
100+
vl-convert padding + PIL centering produces clean layout
87101
- id: VQ-06
88102
name: Axis Labels & Title
89103
score: 2
90104
max: 2
91105
passed: true
92-
comment: Y-axis Sales (USD) includes units; X-axis Category descriptive; title
93-
in correct format with descriptive prefix.
106+
comment: 'X: ''Category'', Y: ''Sales (USD)'' — descriptive with units; title
107+
includes descriptive prefix per spec'
94108
- id: VQ-07
95109
name: Palette Compliance
96110
score: 2
97111
max: 2
98112
passed: true
99-
comment: 'First series is #009E73. Backgrounds #FAF8F1 / #1A1A17. Both renders
100-
theme-correct.'
113+
comment: 'First (only) series = #009E73 brand green; background #FAF8F1 (light)
114+
/ #1A1A17 (dark); chrome tokens (INK, INK_SOFT, ELEVATED_BG) correctly theme-adaptive;
115+
data colors identical across both renders'
101116
design_excellence:
102-
score: 11
117+
score: 13
103118
max: 20
104119
items:
105120
- id: DE-01
106121
name: Aesthetic Sophistication
107122
score: 5
108123
max: 8
109124
passed: true
110-
comment: 'Above default: conditional dot sizing highlights top performer,
111-
hover selection with opacity dim/highlight adds interactivity. Professional
112-
but not exceptional.'
125+
comment: 'Above a well-configured default: intentional focal emphasis via
126+
size variation, dot stroke ring for definition, annotation on top performer,
127+
interactive hover selection. Not yet at FiveThirtyEight publication level.'
113128
- id: DE-02
114129
name: Visual Refinement
115-
score: 3
130+
score: 4
116131
max: 6
117132
passed: true
118-
comment: Y-only grid, very low gridOpacity=0.12, dot stroke outline creates
119-
clean outlined marker effect. Axis domain lines still present.
133+
comment: Y-grid only with 12% opacity (subtle), domain opacity=0 removes axis
134+
line, X-grid disabled. Tick marks still visible on both axes; further minimization
135+
would sharpen the look.
120136
- id: DE-03
121137
name: Data Storytelling
122-
score: 3
138+
score: 4
123139
max: 6
124140
passed: true
125-
comment: Data sorted descending, larger Electronics dot focal emphasis. No
126-
annotation or reference line to anchor the narrative further.
141+
comment: 'Clear storytelling: descending sort creates ranking narrative, size-encoded
142+
focal point on Electronics (the winner), value annotation anchors the story.
143+
Visual hierarchy guides viewer. Good but not exceptional storytelling depth.'
127144
spec_compliance:
128145
score: 15
129146
max: 15
@@ -133,28 +150,31 @@ review:
133150
score: 5
134151
max: 5
135152
passed: true
136-
comment: 'Correct lollipop chart: rule stems + circle markers, vertical orientation.'
153+
comment: 'Correct lollipop chart: mark_rule stems from baseline, mark_circle
154+
dots at values, vertical orientation, categories on X-axis'
137155
- id: SC-02
138156
name: Required Features
139157
score: 4
140158
max: 4
141159
passed: true
142-
comment: Stems from baseline to value, circular dots at data values, vertical
143-
orientation, data sorted by value descending.
160+
comment: 'Stems: thin lines (mark_rule strokeWidth=4); dots: circular markers;
161+
vertical orientation; sorted by value (sort=''-y''); 10 categories in optimal
162+
range'
144163
- id: SC-03
145164
name: Data Mapping
146165
score: 3
147166
max: 3
148167
passed: true
149-
comment: X=category (N), Y=value in USD (Q). All 10 categories shown, full
150-
value range displayed.
168+
comment: Category on X-axis, Sales value on Y-axis; all 10 categories visible;
169+
baseline at $0
151170
- id: SC-04
152171
name: Title & Legend
153172
score: 3
154173
max: 3
155174
passed: true
156-
comment: Title matches required format with descriptive prefix. Single series
157-
— no legend needed.
175+
comment: 'Title: ''Product Sales by Category · lollipop-basic · python · altair
176+
· anyplot.ai'' — correct {Descriptive Title} · {spec-id} · {lang} · {lib}
177+
· anyplot.ai format; no legend (single-series, appropriate)'
158178
data_quality:
159179
score: 15
160180
max: 15
@@ -164,22 +184,22 @@ review:
164184
score: 6
165185
max: 6
166186
passed: true
167-
comment: 'Full lollipop structure: stems, dots, sorted ranking, focal emphasis,
168-
10 categories.'
187+
comment: 'Full lollipop feature set demonstrated: stems, dots, baseline, sorted
188+
ranking, value annotation; 10 categories provides good variation'
169189
- id: DQ-02
170190
name: Realistic Context
171191
score: 5
172192
max: 5
173193
passed: true
174-
comment: E-commerce product sales by category — plausible, neutral, real-world
175-
scenario.
194+
comment: Product sales by e-commerce category — recognizable, neutral, real-world
195+
business scenario; Electronics as top seller is realistic
176196
- id: DQ-03
177197
name: Appropriate Scale
178198
score: 4
179199
max: 4
180200
passed: true
181-
comment: USD $95k-$425k range realistic for product category sales; Y-axis
182-
starts at $0; 10 categories within spec's 5-20 range.
201+
comment: Sales values $95K–$425K are plausible for a medium retailer; Electronics:Pet
202+
Supplies ratio (~4.5:1) is realistic; descending values have natural distribution
183203
code_quality:
184204
score: 10
185205
max: 10
@@ -189,61 +209,65 @@ review:
189209
score: 3
190210
max: 3
191211
passed: true
192-
comment: No functions/classes. Linear flow. Clean variable naming.
212+
comment: 'Flat structure: sys.path fix → imports → tokens → data → chart layers
213+
→ compose → save; no functions or classes'
193214
- id: CQ-02
194215
name: Reproducibility
195216
score: 2
196217
max: 2
197218
passed: true
198-
comment: Static hardcoded data, fully deterministic output.
219+
comment: Deterministic hardcoded data; no random elements
199220
- id: CQ-03
200221
name: Clean Imports
201222
score: 2
202223
max: 2
203224
passed: true
204-
comment: 'All imports used: sys, os, altair, pandas, PIL.'
225+
comment: All 5 imports (sys, os, altair, pandas, PIL.Image) are actively used
205226
- id: CQ-04
206227
name: Code Elegance
207228
score: 2
208229
max: 2
209230
passed: true
210-
comment: Layer composition with + operator idiomatic. alt.condition used cleanly
211-
for size and opacity.
231+
comment: Clean Altair layer composition; alt.condition and alt.datum expressions
232+
used appropriately; no fake interactivity (hover is real Altair feature)
212233
- id: CQ-05
213234
name: Output & API
214235
score: 1
215236
max: 1
216237
passed: true
217-
comment: Saves plot-{THEME}.png and plot-{THEME}.html. Current Altair 6 API.
218-
Correct scale_factor=4.0 with pad-to-target logic.
238+
comment: Saves plot-{THEME}.png and plot-{THEME}.html; current Altair 6.x
239+
API; PIL padding block present
219240
library_mastery:
220-
score: 7
241+
score: 9
221242
max: 10
222243
items:
223244
- id: LM-01
224245
name: Idiomatic Usage
225-
score: 4
246+
score: 5
226247
max: 5
227248
passed: true
228-
comment: mark_rule for stems, mark_circle for dots, layer composition with
229-
+, configure_* for global styling — all idiomatic Altair.
249+
comment: 'Expert Altair usage: declarative layer composition (stems+dots+annotation),
250+
alt.selection_point with pointerover, alt.condition for conditional encodings,
251+
configure_* for theme-adaptive chrome'
230252
- id: LM-02
231253
name: Distinctive Features
232-
score: 3
254+
score: 4
233255
max: 5
234256
passed: true
235-
comment: alt.selection_point interactive hover with opacity dim/highlight,
236-
alt.condition for conditional size and opacity, tooltips with format strings.
257+
comment: 'Altair-distinctive: selection_point with pointerover for real hover,
258+
alt.condition for opacity/size based on selection/datum, alt.datum.category
259+
expression, layer composition with + operator, dual HTML+PNG output. Hover
260+
interactivity is invisible in static PNG.'
237261
verdict: APPROVED
238262
impl_tags:
239263
dependencies:
240264
- pillow
241265
techniques:
242266
- layer-composition
243267
- hover-tooltips
268+
- annotations
244269
- html-export
245270
patterns: []
246271
dataprep: []
247272
styling:
248273
- edge-highlighting
249-
- alpha-blending

0 commit comments

Comments
 (0)