Skip to content

Commit b12921e

Browse files
chore(plotly): update quality score 90 and review feedback for sankey-basic
1 parent fcdf14e commit b12921e

2 files changed

Lines changed: 245 additions & 10 deletions

File tree

plots/sankey-basic/implementations/python/plotly.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: plotly | Python 3.13
4-
Quality: pending | Updated: 2026-04-30
3+
Library: plotly 6.7.0 | Python 3.13.13
4+
Quality: 90/100 | Updated: 2026-04-30
55
"""
66

77
import os
Lines changed: 242 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
# Per-library metadata for plotly implementation of sankey-basic
2-
# Auto-generated by impl-generate.yml
3-
41
library: plotly
52
language: python
63
specification_id: sankey-basic
74
created: '2025-12-23T19:43:26Z'
8-
updated: '2026-04-30T08:55:02Z'
5+
updated: '2026-04-30T09:02:05Z'
96
generated_by: claude-sonnet
107
workflow_run: 25156267074
118
issue: 810
@@ -15,7 +12,245 @@ 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/plotly/plot-dark.png
1613
preview_html_light: https://storage.googleapis.com/anyplot-images/plots/sankey-basic/python/plotly/plot-light.html
1714
preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/sankey-basic/python/plotly/plot-dark.html
18-
quality_score: null
15+
quality_score: 90
1916
review:
20-
strengths: []
21-
weaknesses: []
17+
strengths:
18+
- 'Correct Okabe-Ito color assignment: Coal=#009E73 (first source = first palette
19+
position), then Natural Gas=#D55E00, Nuclear=#0072B2, Renewables=#CC79A7 in canonical
20+
order'
21+
- 'Theme-adaptive chrome fully wired: INK for title/node labels flips correctly
22+
between light (#1A1A17) and dark (#F0EFE8); target nodes use INK_SOFT which also
23+
adapts; PAGE_BG backgrounds are correct (#FAF8F1 / #1A1A17)'
24+
- RGBA link colors (0.4 opacity) keyed to source node — flows are traceable while
25+
overlapping links remain distinguishable
26+
- 'Expert go.Sankey API usage: pad=25, thickness=35, line border color = PAGE_BG
27+
for clean separation, all parameters well-chosen'
28+
- Both PNG and HTML outputs generated; deterministic hardcoded data; KISS code structure
29+
throughout
30+
- 'Energy flow data is realistic and neutral: varied flow magnitudes across 4 sources
31+
and 4 targets, with selectively absent flows (Coal and Nuclear skip Transportation)
32+
adding plausibility'
33+
weaknesses:
34+
- 'Design Excellence is moderate (13/20): target nodes using INK_SOFT creates some
35+
visual distinction but the overall aesthetic is above-defaults rather than publication-ready;
36+
consider adding a subtle subtitle or unit annotation (TWh) to elevate storytelling'
37+
- 'DQ-03 minor deduction: coal-to-residential (5 TWh) and coal-to-commercial (8
38+
TWh) flows are somewhat high relative to modern energy realities where coal primarily
39+
feeds industrial and power-generation sectors; values are plausible but not factually
40+
tight'
41+
- 'DQ-01 minor deduction: all four sources have broadly similar distribution patterns
42+
(mostly Residential, Commercial, Industrial); introducing one source with a starkly
43+
different profile would increase feature coverage contrast'
44+
image_description: |-
45+
Light render (plot-light.png):
46+
Background: Warm off-white #FAF8F1 — correct, not pure white.
47+
Chrome: Title "Energy Distribution · sankey-basic · plotly · anyplot.ai" in dark #1A1A17 ink, 28px, clearly readable. Node labels (Natural Gas, Nuclear, Renewables, Coal on the left; Residential, Commercial, Transportation, Industrial on the right) rendered in #1A1A17 via global font=22px — all clearly legible against the warm background.
48+
Data: Four source nodes stacked on the left — Natural Gas (largest, orange #D55E00), Nuclear (blue #0072B2), Renewables (pink #CC79A7), Coal (green #009E73, bottom). Four target nodes on the right in dark gray (#4A4A44 INK_SOFT). Semi-transparent RGBA links (0.4 opacity) flow left-to-right, each colored after its source node. Natural Gas dominates as the widest band. Node border lines use PAGE_BG creating clean separation between stacked nodes.
49+
Legibility verdict: PASS — all text, including small node labels, clearly readable on the off-white surface.
50+
51+
Dark render (plot-dark.png):
52+
Background: Near-black #1A1A17 — correct, not pure black.
53+
Chrome: Title in light cream #F0EFE8 — clearly readable against the dark background. Node labels also flip to #F0EFE8 via the global font color token (INK = #F0EFE8 in dark mode). No dark-on-dark text detected anywhere.
54+
Data: Source node colors are identical to the light render — Natural Gas orange, Nuclear blue, Renewables pink, Coal green — Okabe-Ito positions 1–4 unchanged. Target nodes flip to light gray (#B8B7B0 INK_SOFT dark), visible against dark background. Semi-transparent link bands are slightly more muted on the dark surface but remain distinguishable by source color. No data color has changed between themes — only chrome elements adapted.
55+
Legibility verdict: PASS — all text is light-on-dark with no dark-on-dark failures.
56+
criteria_checklist:
57+
visual_quality:
58+
score: 30
59+
max: 30
60+
items:
61+
- id: VQ-01
62+
name: Text Legibility
63+
score: 8
64+
max: 8
65+
passed: true
66+
comment: Title explicitly 28px, global font explicitly 22px covering all node
67+
labels; all text readable in both themes
68+
- id: VQ-02
69+
name: No Overlap
70+
score: 6
71+
max: 6
72+
passed: true
73+
comment: No overlapping text or visual elements; node labels positioned cleanly
74+
inside/beside nodes
75+
- id: VQ-03
76+
name: Element Visibility
77+
score: 6
78+
max: 6
79+
passed: true
80+
comment: Nodes (thickness=35) and links clearly visible; semi-transparent
81+
links readable without obscuring each other
82+
- id: VQ-04
83+
name: Color Accessibility
84+
score: 2
85+
max: 2
86+
passed: true
87+
comment: Okabe-Ito palette is CVD-safe; 0.4 alpha on links provides adequate
88+
distinguishability
89+
- id: VQ-05
90+
name: Layout & Canvas
91+
score: 4
92+
max: 4
93+
passed: true
94+
comment: Sankey fills canvas well with balanced margins (l:80, r:80, t:120,
95+
b:60); no wasted space
96+
- id: VQ-06
97+
name: Axis Labels & Title
98+
score: 2
99+
max: 2
100+
passed: true
101+
comment: Descriptive title present; Sankey has no axes — node labels serve
102+
as data identifiers
103+
- id: VQ-07
104+
name: Palette Compliance
105+
score: 2
106+
max: 2
107+
passed: true
108+
comment: 'Coal=#009E73 first, then #D55E00, #0072B2, #CC79A7 in canonical
109+
order; backgrounds #FAF8F1/#1A1A17 correct'
110+
design_excellence:
111+
score: 13
112+
max: 20
113+
items:
114+
- id: DE-01
115+
name: Aesthetic Sophistication
116+
score: 5
117+
max: 8
118+
passed: true
119+
comment: 'Thoughtful: Okabe-Ito for sources, adaptive INK_SOFT for targets,
120+
PAGE_BG node borders for clean separation. Above defaults but not publication-ready'
121+
- id: DE-02
122+
name: Visual Refinement
123+
score: 4
124+
max: 6
125+
passed: true
126+
comment: pad=25 and thickness=35 are well-considered; clean layout with no
127+
extraneous elements; good refinement for Sankey type
128+
- id: DE-03
129+
name: Data Storytelling
130+
score: 4
131+
max: 6
132+
passed: true
133+
comment: Energy flow story readable through proportional node sizing — Natural
134+
Gas dominance clear; color coding enables flow tracing
135+
spec_compliance:
136+
score: 15
137+
max: 15
138+
items:
139+
- id: SC-01
140+
name: Plot Type
141+
score: 5
142+
max: 5
143+
passed: true
144+
comment: Correct Sankey diagram with nodes and proportional-width links
145+
- id: SC-02
146+
name: Required Features
147+
score: 4
148+
max: 4
149+
passed: true
150+
comment: Source→target flows, distinct colors per source category, link opacity,
151+
no circular flows, readable node labels
152+
- id: SC-03
153+
name: Data Mapping
154+
score: 3
155+
max: 3
156+
passed: true
157+
comment: Source and target indices correctly mapped; flow values drive link
158+
widths proportionally
159+
- id: SC-04
160+
name: Title & Legend
161+
score: 3
162+
max: 3
163+
passed: true
164+
comment: Title 'Energy Distribution · sankey-basic · plotly · anyplot.ai'
165+
includes spec-id, library, anyplot.ai in correct order
166+
data_quality:
167+
score: 13
168+
max: 15
169+
items:
170+
- id: DQ-01
171+
name: Feature Coverage
172+
score: 5
173+
max: 6
174+
passed: true
175+
comment: 4 sources × 4 targets with varied magnitudes (3–25 TWh); selective
176+
absence of flows (Coal/Nuclear skip Transportation) adds variety; distributions
177+
are somewhat similar across sources
178+
- id: DQ-02
179+
name: Realistic Context
180+
score: 5
181+
max: 5
182+
passed: true
183+
comment: 'Realistic neutral energy distribution domain: coal, natural gas,
184+
nuclear, renewables → residential, commercial, industrial, transportation'
185+
- id: DQ-03
186+
name: Appropriate Scale
187+
score: 3
188+
max: 4
189+
passed: true
190+
comment: Values plausible but coal-to-residential (5 TWh) and coal-to-commercial
191+
(8 TWh) are somewhat generous given coal's declining residential use
192+
code_quality:
193+
score: 10
194+
max: 10
195+
items:
196+
- id: CQ-01
197+
name: KISS Structure
198+
score: 3
199+
max: 3
200+
passed: true
201+
comment: 'Clean linear structure: imports → theme tokens → data → figure →
202+
save; no functions or classes'
203+
- id: CQ-02
204+
name: Reproducibility
205+
score: 2
206+
max: 2
207+
passed: true
208+
comment: Fully deterministic hardcoded data; no random generation needed
209+
- id: CQ-03
210+
name: Clean Imports
211+
score: 2
212+
max: 2
213+
passed: true
214+
comment: Only os and plotly.graph_objects imported, both used
215+
- id: CQ-04
216+
name: Code Elegance
217+
score: 2
218+
max: 2
219+
passed: true
220+
comment: List comprehensions for source/target/value extraction; RGBA link
221+
colors derived from source index cleanly
222+
- id: CQ-05
223+
name: Output & API
224+
score: 1
225+
max: 1
226+
passed: true
227+
comment: Saves plot-{THEME}.png and plot-{THEME}.html; current Plotly API
228+
used
229+
library_mastery:
230+
score: 9
231+
max: 10
232+
items:
233+
- id: LM-01
234+
name: Idiomatic Usage
235+
score: 5
236+
max: 5
237+
passed: true
238+
comment: 'Expert go.Sankey usage with all key parameters properly configured:
239+
pad, thickness, line, label, color for both node and link'
240+
- id: LM-02
241+
name: Distinctive Features
242+
score: 4
243+
max: 5
244+
passed: true
245+
comment: RGBA source-matched link coloring and interactive HTML export (with
246+
built-in hover/zoom) are Plotly-distinctive; static PNG alone wouldn't demonstrate
247+
interactivity
248+
verdict: APPROVED
249+
impl_tags:
250+
dependencies: []
251+
techniques:
252+
- html-export
253+
patterns: []
254+
dataprep: []
255+
styling:
256+
- alpha-blending

0 commit comments

Comments
 (0)