Skip to content

Commit d431ecf

Browse files
chore(bokeh): update quality score 86 and review feedback for sankey-basic
1 parent ed6e31e commit d431ecf

2 files changed

Lines changed: 239 additions & 10 deletions

File tree

plots/sankey-basic/implementations/python/bokeh.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
"""anyplot.ai
1+
""" anyplot.ai
22
sankey-basic: Basic Sankey Diagram
3-
Library: bokeh | Python 3.13
4-
Quality: pending | Created: 2026-04-30
3+
Library: bokeh 3.9.0 | Python 3.13.13
4+
Quality: 86/100 | Updated: 2026-04-30
55
"""
66

77
import os
Lines changed: 236 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
# Per-library metadata for bokeh implementation of sankey-basic
2-
# Auto-generated by impl-generate.yml
3-
41
library: bokeh
52
language: python
63
specification_id: sankey-basic
74
created: '2025-12-23T19:43:20Z'
8-
updated: '2026-04-30T08:54:17Z'
5+
updated: '2026-04-30T09:01:04Z'
96
generated_by: claude-sonnet
107
workflow_run: 25156351219
118
issue: 810
@@ -15,7 +12,239 @@ preview_url_light: https://storage.googleapis.com/anyplot-images/plots/sankey-ba
1512
preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/sankey-basic/python/bokeh/plot-dark.png
1613
preview_html_light: https://storage.googleapis.com/anyplot-images/plots/sankey-basic/python/bokeh/plot-light.html
1714
preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/sankey-basic/python/bokeh/plot-dark.html
18-
quality_score: null
15+
quality_score: 86
1916
review:
20-
strengths: []
21-
weaknesses: []
17+
strengths:
18+
- 'Correct Sankey topology: proportional node sizing, stacked flow packing, Bezier
19+
curves all computed correctly'
20+
- 'Okabe-Ito canonical order strictly followed; first source (Coal) correctly gets
21+
#009E73'
22+
- Clean, flat code with clear layout arithmetic that is easy to follow
23+
- Thoughtful target-node color choice (muted neutrals) creates visual hierarchy
24+
between source and destination
25+
- Both PNG and HTML output generated correctly
26+
weaknesses:
27+
- Title format is "Energy Flow · sankey-basic · bokeh · anyplot.ai" — must be exactly
28+
"sankey-basic · bokeh · anyplot.ai" per spec
29+
- 'Bokeh HoverTool not used: the HTML output supports interactivity but no tooltips
30+
are added; hover showing source->target flow value is the most impactful Bokeh-specific
31+
feature for a Sankey'
32+
- 'Fixed fill_alpha=0.45 is not theme-adaptive: flows look appropriately translucent
33+
on light background but become murky/dark on dark background; use a higher alpha
34+
for dark theme'
35+
- 'Dark-mode target node colors (#5A6A7A, #7A6A8A, #6A7A5A) are near-black on a
36+
near-black background — low contrast in dark render'
37+
- Approximately 10% of canvas height is empty dead space between title and the first
38+
node; compress y_range or adjust layout
39+
- No ColumnDataSource used — bypasses Bokeh core data-binding pattern (less idiomatic)
40+
image_description: |-
41+
Light render (plot-light.png):
42+
Background: Warm off-white #FAF8F1 — correct, not pure white
43+
Chrome: Title "Energy Flow · sankey-basic · bokeh · anyplot.ai" at 32pt in dark INK — readable; node labels at 22pt in dark INK — all readable; no axis labels (correct for Sankey)
44+
Data: Five source nodes (Coal=#009E73, Gas=#D55E00, Nuclear=#0072B2, Hydro=#CC79A7, Solar=#E69F00) with Okabe-Ito canonical order; target nodes in muted neutrals (#5A6A7A, #7A6A8A, #6A7A5A); bezier flow ribbons carry source colors with fill_alpha=0.45; flows look vibrant and translucent on light surface
45+
Legibility verdict: PASS — all text clearly readable against light background
46+
47+
Dark render (plot-dark.png):
48+
Background: Near-black #1A1A17 — correct, not pure black
49+
Chrome: Title and node labels switch to light INK token (#F0EFE8) — all readable; no dark-on-dark text failures detected
50+
Data: Source/target node data colors are identical to light render (Okabe-Ito positions unchanged); however fixed fill_alpha=0.45 is not theme-adaptive — flows appear noticeably darker/murkier on dark background making crossing ribbons harder to distinguish; dark-mode target node colors (#5A6A7A, #7A6A8A, #6A7A5A) blend into the dark background reducing target node contrast
51+
Legibility verdict: PASS for text; PARTIAL for data elements — flow ribbons have reduced visual impact in dark theme due to non-adaptive alpha
52+
criteria_checklist:
53+
visual_quality:
54+
score: 28
55+
max: 30
56+
items:
57+
- id: VQ-01
58+
name: Text Legibility
59+
score: 8
60+
max: 8
61+
passed: true
62+
comment: Title at 32pt, node labels at 22pt; all text readable in both themes
63+
- id: VQ-02
64+
name: No Overlap
65+
score: 6
66+
max: 6
67+
passed: true
68+
comment: Source and target labels cleanly separated; no text collisions
69+
- id: VQ-03
70+
name: Element Visibility
71+
score: 5
72+
max: 6
73+
passed: true
74+
comment: Clear in light mode; dark mode flows reduced by non-adaptive fill_alpha=0.45
75+
- id: VQ-04
76+
name: Color Accessibility
77+
score: 2
78+
max: 2
79+
passed: true
80+
comment: Okabe-Ito palette, colorblind-safe
81+
- id: VQ-05
82+
name: Layout & Canvas
83+
score: 3
84+
max: 4
85+
passed: true
86+
comment: Good horizontal fill; ~10% empty vertical space between title and
87+
top node
88+
- id: VQ-06
89+
name: Axis Labels & Title
90+
score: 2
91+
max: 2
92+
passed: true
93+
comment: Axes hidden (correct for Sankey); node labels include TWh units
94+
- id: VQ-07
95+
name: Palette Compliance
96+
score: 2
97+
max: 2
98+
passed: true
99+
comment: 'First source (Coal) uses #009E73; Okabe-Ito canonical order; backgrounds
100+
#FAF8F1/#1A1A17; theme-adaptive chrome'
101+
design_excellence:
102+
score: 14
103+
max: 20
104+
items:
105+
- id: DE-01
106+
name: Aesthetic Sophistication
107+
score: 6
108+
max: 8
109+
passed: true
110+
comment: Source colors carried through bezier ribbons; muted neutral targets
111+
create hierarchy; proportional sizing; not quite publication-ready
112+
- id: DE-02
113+
name: Visual Refinement
114+
score: 4
115+
max: 6
116+
passed: true
117+
comment: Axes/spines/grid fully removed; clean; but vertical dead zone at
118+
top and dark render murkiness
119+
- id: DE-03
120+
name: Data Storytelling
121+
score: 4
122+
max: 6
123+
passed: true
124+
comment: Source-color-coded flows enable visual tracing; Gas dominance visible;
125+
no annotation on largest flow
126+
spec_compliance:
127+
score: 14
128+
max: 15
129+
items:
130+
- id: SC-01
131+
name: Plot Type
132+
score: 5
133+
max: 5
134+
passed: true
135+
comment: Correct Sankey diagram with Bezier ribbons and proportional node
136+
heights
137+
- id: SC-02
138+
name: Required Features
139+
score: 4
140+
max: 4
141+
passed: true
142+
comment: Sources/targets/values mapped; proportional flows; distinct source
143+
colors; link opacity; node labels; no circular flows
144+
- id: SC-03
145+
name: Data Mapping
146+
score: 3
147+
max: 3
148+
passed: true
149+
comment: Sources left, targets right; all 11 flows represented; proportional
150+
node heights
151+
- id: SC-04
152+
name: Title & Legend
153+
score: 2
154+
max: 3
155+
passed: false
156+
comment: Title 'Energy Flow · sankey-basic · bokeh · anyplot.ai' has extra
157+
prefix; required format is 'sankey-basic · bokeh · anyplot.ai'
158+
data_quality:
159+
score: 15
160+
max: 15
161+
items:
162+
- id: DQ-01
163+
name: Feature Coverage
164+
score: 6
165+
max: 6
166+
passed: true
167+
comment: 11 flows, 5 sources, 3 sectors; varied magnitudes (5-30 TWh); many-to-many
168+
connections
169+
- id: DQ-02
170+
name: Realistic Context
171+
score: 5
172+
max: 5
173+
passed: true
174+
comment: Energy flow domain (Coal/Gas/Nuclear/Hydro/Solar → Industrial/Residential/Commercial)
175+
is real-world and neutral
176+
- id: DQ-03
177+
name: Appropriate Scale
178+
score: 4
179+
max: 4
180+
passed: true
181+
comment: Relative magnitudes plausible; Gas as largest source, Industrial
182+
as largest consumer are realistic
183+
code_quality:
184+
score: 10
185+
max: 10
186+
items:
187+
- id: CQ-01
188+
name: KISS Structure
189+
score: 3
190+
max: 3
191+
passed: true
192+
comment: 'Flat script: imports → tokens → data → layout → plot → save; no
193+
functions/classes'
194+
- id: CQ-02
195+
name: Reproducibility
196+
score: 2
197+
max: 2
198+
passed: true
199+
comment: All data hardcoded; fully deterministic
200+
- id: CQ-03
201+
name: Clean Imports
202+
score: 2
203+
max: 2
204+
passed: true
205+
comment: 'All imports used: os, sys, numpy, bokeh.io, bokeh.models, bokeh.plotting'
206+
- id: CQ-04
207+
name: Code Elegance
208+
score: 2
209+
max: 2
210+
passed: true
211+
comment: Appropriate complexity for manual Sankey; Bezier math clear; no fake
212+
functionality
213+
- id: CQ-05
214+
name: Output & API
215+
score: 1
216+
max: 1
217+
passed: true
218+
comment: Saves plot-{THEME}.png and plot-{THEME}.html; current Bokeh API
219+
library_mastery:
220+
score: 5
221+
max: 10
222+
items:
223+
- id: LM-01
224+
name: Idiomatic Usage
225+
score: 3
226+
max: 5
227+
passed: true
228+
comment: Uses figure, quad, patch, Label, export_png correctly; bypasses ColumnDataSource
229+
(Bokeh's core data pattern)
230+
- id: LM-02
231+
name: Distinctive Features
232+
score: 2
233+
max: 5
234+
passed: false
235+
comment: Creative use of primitives for Sankey; but HoverTool completely absent
236+
from HTML output — Bokeh's signature interactive feature for flow value
237+
display
238+
verdict: REJECTED
239+
impl_tags:
240+
dependencies: []
241+
techniques:
242+
- bezier-curves
243+
- html-export
244+
- annotations
245+
patterns:
246+
- iteration-over-groups
247+
dataprep: []
248+
styling:
249+
- minimal-chrome
250+
- alpha-blending

0 commit comments

Comments
 (0)