From e531f9b4ebdddfc82325df40dd3d4136d0d17c17 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 23 Apr 2026 19:20:38 +0000 Subject: [PATCH 1/4] feat(plotly): implement scatter-basic --- .../implementations/python/plotly.py | 155 ++++++------------ 1 file changed, 46 insertions(+), 109 deletions(-) diff --git a/plots/scatter-basic/implementations/python/plotly.py b/plots/scatter-basic/implementations/python/plotly.py index e3e96ec4b5..cb9f498ce5 100644 --- a/plots/scatter-basic/implementations/python/plotly.py +++ b/plots/scatter-basic/implementations/python/plotly.py @@ -1,146 +1,83 @@ -""" pyplots.ai +"""anyplot.ai scatter-basic: Basic Scatter Plot -Library: plotly 6.5.2 | Python 3.14 -Quality: 92/100 | Created: 2025-12-22 +Library: plotly | Python 3.14 +Quality: pending | Updated: 2026-04-23 """ +import os + import numpy as np import plotly.graph_objects as go -# Data: Study hours vs exam scores (realistic educational context) +# Theme tokens (see prompts/default-style-guide.md "Theme-adaptive Chrome") +THEME = os.getenv("ANYPLOT_THEME", "light") +PAGE_BG = "#FAF8F1" if THEME == "light" else "#1A1A17" +ELEVATED_BG = "#FFFDF6" if THEME == "light" else "#242420" +INK = "#1A1A17" if THEME == "light" else "#F0EFE8" +INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0" +GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)" +BRAND = "#009E73" # Okabe-Ito position 1 — always first series + +# Data: study hours vs exam scores, moderate positive correlation np.random.seed(42) -n_students = 120 +n_students = 160 study_hours = np.random.uniform(1, 10, n_students) -base_score = 45 + study_hours * 5 -exam_scores = base_score + np.random.randn(n_students) * 8 +exam_scores = 45 + study_hours * 5 + np.random.randn(n_students) * 8 exam_scores = np.clip(exam_scores, 0, 100) -# Inject outliers to show scatter plot's outlier-detection value -study_hours[0], exam_scores[0] = 8.5, 52.0 # High effort, low result -study_hours[1], exam_scores[1] = 2.0, 78.0 # Low effort, high result -study_hours[2], exam_scores[2] = 9.2, 55.0 # Another underperformer - -# Linear regression for trend line -coeffs = np.polyfit(study_hours, exam_scores, 1) -trend_x = np.array([0.5, 10.5]) -trend_y = np.polyval(coeffs, trend_x) -r_value = np.corrcoef(study_hours, exam_scores)[0, 1] - -# Color palette -python_blue = "#306998" -accent_orange = "#D4782F" - -fig = go.Figure() - -# Trend line (behind markers) -fig.add_trace( - go.Scatter( - x=trend_x, - y=trend_y, - mode="lines", - line={"color": "rgba(48, 105, 152, 0.4)", "width": 2.5, "dash": "dash"}, - showlegend=False, - hoverinfo="skip", - ) -) - -# Main scatter — size 11 avoids congestion in dense regions -fig.add_trace( +# Plot +fig = go.Figure( go.Scatter( x=study_hours, y=exam_scores, mode="markers", - marker={"size": 11, "color": python_blue, "opacity": 0.6, "line": {"width": 1.2, "color": "white"}}, + marker={"size": 13, "color": BRAND, "opacity": 0.7, "line": {"width": 1.2, "color": PAGE_BG}}, + hovertemplate="Study: %{x:.1f} h
Score: %{y:.1f}%", showlegend=False, - hovertemplate="Student
Study: %{x:.1f} h
Score: %{y:.1f}%", ) ) -# Outlier diamonds -fig.add_trace( - go.Scatter( - x=[8.5, 2.0, 9.2], - y=[52.0, 78.0, 55.0], - mode="markers", - marker={ - "size": 15, - "color": accent_orange, - "opacity": 0.9, - "line": {"width": 2, "color": "white"}, - "symbol": "diamond", - }, - showlegend=False, - hoverinfo="skip", - ) -) - -# Annotations — each outlier gets its own label for clarity -ann_base = { - "showarrow": True, - "arrowhead": 2, - "arrowsize": 1.2, - "arrowwidth": 2, - "arrowcolor": accent_orange, - "align": "center", - "font": {"size": 16, "color": accent_orange, "family": "Arial, sans-serif"}, - "bgcolor": "rgba(255,255,255,0.85)", - "bordercolor": accent_orange, - "borderwidth": 1.5, - "borderpad": 5, -} -annotations = [ - {**ann_base, "x": 2.0, "y": 78.0, "text": "Low effort,
high score", "ax": -75, "ay": -45}, - {**ann_base, "x": 8.5, "y": 52.0, "text": "High effort,
low score", "ax": 80, "ay": 40}, - {**ann_base, "x": 9.2, "y": 55.0, "text": "Underperformer", "ax": 75, "ay": -35}, - # Correlation coefficient near trend line - { - "x": 8.5, - "y": np.polyval(coeffs, 8.5) + 4, - "text": f"r = {r_value:.2f}", - "showarrow": False, - "bgcolor": "rgba(255,255,255,0.8)", - "borderpad": 4, - "font": {"size": 17, "color": python_blue, "family": "Arial, sans-serif"}, - }, -] - +# Style fig.update_layout( title={ - "text": "scatter-basic · plotly · pyplots.ai", - "font": {"size": 28, "color": "#2C3E50", "family": "Arial Black, Arial, sans-serif"}, + "text": "scatter-basic · plotly · anyplot.ai", + "font": {"size": 28, "color": INK}, "x": 0.5, "xanchor": "center", "y": 0.95, }, xaxis={ - "title": {"text": "Study Hours (h)", "font": {"size": 22, "family": "Arial, sans-serif"}, "standoff": 12}, - "tickfont": {"size": 18}, - "showgrid": True, + "title": {"text": "Study Hours per Day", "font": {"size": 22, "color": INK}, "standoff": 12}, + "tickfont": {"size": 18, "color": INK_SOFT}, + "gridcolor": GRID, "gridwidth": 1, - "gridcolor": "rgba(0,0,0,0.06)", - "range": [0, 11], + "linecolor": INK_SOFT, "zeroline": False, + "showline": True, + "mirror": False, + "range": [0, 11], "dtick": 2, }, yaxis={ - "title": {"text": "Exam Score (%)", "font": {"size": 22, "family": "Arial, sans-serif"}, "standoff": 12}, - "tickfont": {"size": 18}, - "showgrid": True, + "title": {"text": "Exam Score (%)", "font": {"size": 22, "color": INK}, "standoff": 12}, + "tickfont": {"size": 18, "color": INK_SOFT}, + "gridcolor": GRID, "gridwidth": 1, - "gridcolor": "rgba(0,0,0,0.06)", - "range": [35, 105], + "linecolor": INK_SOFT, "zeroline": False, + "showline": True, + "mirror": False, + "range": [35, 105], "dtick": 10, }, - template="plotly_white", - showlegend=False, - margin={"l": 80, "r": 40, "t": 90, "b": 70}, - annotations=annotations, - plot_bgcolor="white", - paper_bgcolor="#FAFBFC", - hoverlabel={"bgcolor": "white", "font_size": 14, "font_color": python_blue}, + paper_bgcolor=PAGE_BG, + plot_bgcolor=PAGE_BG, + font={"color": INK}, + margin={"l": 90, "r": 60, "t": 100, "b": 80}, + hoverlabel={"bgcolor": ELEVATED_BG, "bordercolor": INK_SOFT, "font": {"color": INK}}, ) -fig.write_image("plot.png", width=1600, height=900, scale=3) -fig.write_html("plot.html") +# Save +fig.write_image(f"plot-{THEME}.png", width=1600, height=900, scale=3) +fig.write_html(f"plot-{THEME}.html", include_plotlyjs="cdn") From a12b50440eb4d5efc63524f19b313136db1a78df Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 23 Apr 2026 19:20:56 +0000 Subject: [PATCH 2/4] chore(plotly): add metadata for scatter-basic --- .../scatter-basic/metadata/python/plotly.yaml | 241 ++---------------- 1 file changed, 18 insertions(+), 223 deletions(-) diff --git a/plots/scatter-basic/metadata/python/plotly.yaml b/plots/scatter-basic/metadata/python/plotly.yaml index 7c4410b254..9c9ea36cd8 100644 --- a/plots/scatter-basic/metadata/python/plotly.yaml +++ b/plots/scatter-basic/metadata/python/plotly.yaml @@ -1,226 +1,21 @@ +# Per-library metadata for plotly implementation of scatter-basic +# Auto-generated by impl-generate.yml + library: plotly +language: python specification_id: scatter-basic -created: '2025-12-22T23:36:07Z' -updated: '2026-02-14T14:47:56Z' -generated_by: claude-opus-4-6 -workflow_run: 20446831781 -issue: 0 -python_version: '3.14' -library_version: 6.5.2 -preview_url: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/plotly/plot.png -preview_html: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/plotly/plot.html -quality_score: 92 -impl_tags: - dependencies: [] - techniques: - - annotations - - hover-tooltips - - html-export - patterns: - - data-generation - dataprep: - - regression - styling: - - alpha-blending - - edge-highlighting - - grid-styling +created: '2026-04-23T19:20:55Z' +updated: '2026-04-23T19:20:55Z' +generated_by: claude-opus-4-5-20251101 +workflow_run: 24853790187 +issue: 611 +python_version: 3.14.4 +library_version: 6.7.0 +preview_url_light: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/plotly/plot-light.png +preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/plotly/plot-dark.png +preview_html_light: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/plotly/plot-light.html +preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/plotly/plot-dark.html +quality_score: null review: - strengths: - - Excellent data storytelling with three annotated outliers and correlation coefficient - — goes well beyond just plotting points - - 'Professional aesthetic: custom blue/orange palette, white marker edges, subtle - grid, off-white paper background' - - All font sizes explicitly set and well-calibrated for 4800×2700 output - - Plotly-distinctive features used effectively (hovertemplate, HTML export, hoverlabel - styling) - - Clean, well-structured code with elegant annotation dict-spread pattern - weaknesses: - - Minor annotation congestion in the bottom-right between 'High effort, low score' - (8.5, 52) and 'Underperformer' (9.2, 55) — arrows nearly overlap - - Layout margins asymmetric (L=80 vs R=40) leading to slightly unbalanced whitespace - distribution - image_description: 'The plot displays a scatter plot of "Study Hours (h)" (x-axis, - range 0–11) vs "Exam Score (%)" (y-axis, range ~35–105) with 120 blue circular - markers (#306998) at opacity 0.6 with white edge outlines on a white background - with very subtle gray grid lines. A dashed blue trend line shows the positive - correlation. Three orange (#D4782F) diamond markers highlight outliers: "Low effort, - high score" at (~2h, 78%), "High effort, low score" at (~8.5h, 52%), and "Underperformer" - at (~9.2h, 55%). Each outlier has a bordered orange annotation box with an arrow - pointing to the marker. The correlation coefficient "r = 0.79" is displayed in - blue near the upper portion of the trend line. The title "scatter-basic · plotly - · pyplots.ai" is centered at the top in dark bold text. The paper background is - a light off-white (#FAFBFC). Overall the plot has a clean, professional appearance - with clear data storytelling.' - criteria_checklist: - visual_quality: - score: 27 - max: 30 - items: - - id: VQ-01 - name: Text Legibility - score: 8 - max: 8 - passed: true - comment: 'All font sizes explicitly set: title 28pt, axis labels 22pt, ticks - 18pt, annotations 16-17pt' - - id: VQ-02 - name: No Overlap - score: 5 - max: 6 - passed: true - comment: Minor congestion between bottom-right annotations — arrows nearly - overlap - - id: VQ-03 - name: Element Visibility - score: 6 - max: 6 - passed: true - comment: 120 points at size 11 with opacity 0.6, outlier diamonds at size - 15 — well adapted to density - - id: VQ-04 - name: Color Accessibility - score: 4 - max: 4 - passed: true - comment: Blue/orange pair is colorblind-safe with good contrast - - id: VQ-05 - name: Layout Balance - score: 2 - max: 4 - passed: false - comment: Asymmetric margins (L=80, R=40); slightly unbalanced whitespace distribution - - id: VQ-06 - name: Axis Labels & Title - score: 2 - max: 2 - passed: true - comment: 'Descriptive labels with units: Study Hours (h), Exam Score (%)' - design_excellence: - score: 17 - max: 20 - items: - - id: DE-01 - name: Aesthetic Sophistication - score: 7 - max: 8 - passed: true - comment: Custom palette, intentional typography hierarchy, white marker edges, - subtle grid, off-white paper - - id: DE-02 - name: Visual Refinement - score: 5 - max: 6 - passed: true - comment: plotly_white template, 0.06 opacity grid, zeroline removed, generous - standoff - - id: DE-03 - name: Data Storytelling - score: 5 - max: 6 - passed: true - comment: Three annotated outliers with descriptive labels, trend line with - r=0.79 guides interpretation - spec_compliance: - score: 15 - max: 15 - items: - - id: SC-01 - name: Plot Type - score: 5 - max: 5 - passed: true - comment: Correct 2D scatter plot - - id: SC-02 - name: Required Features - score: 4 - max: 4 - passed: true - comment: Transparency, axis labels, title, grid lines, appropriate point size - all present - - id: SC-03 - name: Data Mapping - score: 3 - max: 3 - passed: true - comment: X=study hours, Y=exam scores correctly assigned - - id: SC-04 - name: Title Format - score: 3 - max: 3 - passed: true - comment: scatter-basic · plotly · pyplots.ai correct format - data_quality: - score: 15 - max: 15 - items: - - id: DQ-01 - name: Feature Coverage - score: 6 - max: 6 - passed: true - comment: Shows correlation, scatter distribution, outliers, and trend line - - id: DQ-02 - name: Realistic Context - score: 5 - max: 5 - passed: true - comment: Study hours vs exam scores — neutral educational scenario - - id: DQ-03 - name: Appropriate Scale - score: 4 - max: 4 - passed: true - comment: Hours 1-10, scores 0-100% — perfectly realistic ranges - code_quality: - score: 10 - max: 10 - items: - - id: CQ-01 - name: KISS Structure - score: 3 - max: 3 - passed: true - comment: Imports → Data → Plot → Save, no functions/classes - - id: CQ-02 - name: Reproducibility - score: 2 - max: 2 - passed: true - comment: np.random.seed(42) - - id: CQ-03 - name: Clean Imports - score: 2 - max: 2 - passed: true - comment: Only numpy and plotly.graph_objects - - id: CQ-04 - name: Code Elegance - score: 2 - max: 2 - passed: true - comment: Clean dict-spread pattern for annotations, appropriate complexity - - id: CQ-05 - name: Output & API - score: 1 - max: 1 - passed: true - comment: Saves plot.png at 4800×2700 via write_image - library_features: - score: 8 - max: 10 - items: - - id: LM-01 - name: Idiomatic Usage - score: 4 - max: 5 - passed: true - comment: Good Graph Objects API usage with proper modes, hovertemplate, and - update_layout - - id: LM-02 - name: Distinctive Features - score: 4 - max: 5 - passed: true - comment: hovertemplate, write_html, hoverlabel styling — Plotly-distinctive - features - verdict: APPROVED + strengths: [] + weaknesses: [] From c46807002f3ed46ba8061dc9672cc622eeef6da6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 23 Apr 2026 19:22:02 +0000 Subject: [PATCH 3/4] chore(plotly): update quality score 80 and review feedback for scatter-basic --- .../implementations/python/plotly.py | 6 +- .../scatter-basic/metadata/python/plotly.yaml | 229 +++++++++++++++++- 2 files changed, 225 insertions(+), 10 deletions(-) diff --git a/plots/scatter-basic/implementations/python/plotly.py b/plots/scatter-basic/implementations/python/plotly.py index cb9f498ce5..6f0e3fef74 100644 --- a/plots/scatter-basic/implementations/python/plotly.py +++ b/plots/scatter-basic/implementations/python/plotly.py @@ -1,7 +1,7 @@ -"""anyplot.ai +""" anyplot.ai scatter-basic: Basic Scatter Plot -Library: plotly | Python 3.14 -Quality: pending | Updated: 2026-04-23 +Library: plotly 6.7.0 | Python 3.14.4 +Quality: 80/100 | Created: 2026-04-23 """ import os diff --git a/plots/scatter-basic/metadata/python/plotly.yaml b/plots/scatter-basic/metadata/python/plotly.yaml index 9c9ea36cd8..f2c0acb06f 100644 --- a/plots/scatter-basic/metadata/python/plotly.yaml +++ b/plots/scatter-basic/metadata/python/plotly.yaml @@ -1,11 +1,8 @@ -# Per-library metadata for plotly implementation of scatter-basic -# Auto-generated by impl-generate.yml - library: plotly language: python specification_id: scatter-basic created: '2026-04-23T19:20:55Z' -updated: '2026-04-23T19:20:55Z' +updated: '2026-04-23T19:22:02Z' generated_by: claude-opus-4-5-20251101 workflow_run: 24853790187 issue: 611 @@ -15,7 +12,225 @@ preview_url_light: https://storage.googleapis.com/anyplot-images/plots/scatter-b preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/plotly/plot-dark.png preview_html_light: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/plotly/plot-light.html preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/plotly/plot-dark.html -quality_score: null +quality_score: 80 review: - strengths: [] - weaknesses: [] + strengths: + - 'Full dual-theme support: correct backgrounds (#FAF8F1 / #1A1A17) and theme-adaptive + chrome in both renders with no dark-on-dark or light-on-light failures' + - 'Correct Okabe-Ito palette compliance: brand green #009E73 used as the sole data + color throughout' + - Title format scatter-basic · plotly · anyplot.ai is exact; axis labels are descriptive + with units + - Both HTML and PNG outputs generated for both themes + weaknesses: + - No trend line or annotations — the spec example application (exploring correlations) + would benefit from a regression line and correlation coefficient display + - 'Design excellence is minimal: no visual emphasis or storytelling beyond raw points' + - Marker size could be slightly larger for better readability at 4800x2700 resolution + image_description: |- + Light render (plot-light.png): + Background: Warm off-white (~#FAF8F1), clearly distinct from pure white — PASS + Chrome: Title "scatter-basic · plotly · anyplot.ai" in dark charcoal, readable. Axis labels "Study Hours per Day" and "Exam Score (%)" in dark ink, readable. Tick labels in dark gray, readable. No light-on-light issues. + Data: All ~200 markers use #009E73 (Okabe-Ito position 1, brand green) with ~0.7 alpha. Markers clearly distinguishable from background. Subtle horizontal and vertical grid lines present. + Legibility verdict: PASS + + Dark render (plot-dark.png): + Background: Warm near-black (~#1A1A17), clearly distinct from pure black — PASS + Chrome: Title in light cream/off-white text, readable. Axis labels and tick labels in lighter tones, readable. No dark-on-dark failures detected. Grid lines subtle but visible. + Data: Same #009E73 green markers as light render — data colors identical, only chrome flipped. Brand green visible and readable on dark surface. + Legibility verdict: PASS + criteria_checklist: + visual_quality: + score: 27 + max: 30 + items: + - id: VQ-01 + name: Text Legibility + score: 7 + max: 8 + passed: true + comment: Title, axis labels, ticks readable in both renders; title slightly + smaller than ideal for 4800x2700 + - id: VQ-02 + name: No Overlap + score: 5 + max: 6 + passed: true + comment: Some marker overlap in dense 3-5 hour region; semi-transparency mitigates + but does not fully resolve + - id: VQ-03 + name: Element Visibility + score: 6 + max: 6 + passed: true + comment: All markers clearly visible in both themes; size and alpha appropriate + for ~200 points + - id: VQ-04 + name: Color Accessibility + score: 2 + max: 2 + passed: true + comment: 'Single brand green #009E73, CVD-safe' + - id: VQ-05 + name: Layout & Canvas + score: 3 + max: 4 + passed: true + comment: Good proportions, nothing cut off; margins functional but could be + more generous + - id: VQ-06 + name: Axis Labels & Title + score: 2 + max: 2 + passed: true + comment: Title format correct; Study Hours per Day and Exam Score (%) are + descriptive + - id: VQ-07 + name: Palette Compliance + score: 2 + max: 2 + passed: true + comment: 'First/only series is #009E73; backgrounds are #FAF8F1 (light) / + #1A1A17 (dark); chrome correctly flips' + design_excellence: + score: 9 + max: 20 + items: + - id: DE-01 + name: Aesthetic Sophistication + score: 4 + max: 8 + passed: false + comment: Correct brand color and theme-adaptive chrome, but no intentional + visual hierarchy or emphasis + - id: DE-02 + name: Visual Refinement + score: 3 + max: 6 + passed: true + comment: Subtle grid, clean L-shaped axis frame; refined but not distinctive + - id: DE-03 + name: Data Storytelling + score: 2 + max: 6 + passed: false + comment: No trend line, no outlier highlighting, no annotations; correlation + visible but not guided + spec_compliance: + score: 15 + max: 15 + items: + - id: SC-01 + name: Plot Type + score: 5 + max: 5 + passed: true + comment: Correct 2D scatter plot + - id: SC-02 + name: Required Features + score: 4 + max: 4 + passed: true + comment: Transparency, grid lines, axis labels, title, appropriate marker + size all present + - id: SC-03 + name: Data Mapping + score: 3 + max: 3 + passed: true + comment: X = Study Hours per Day, Y = Exam Score (%), ~200 points with clear + positive correlation + - id: SC-04 + name: Title & Legend + score: 3 + max: 3 + passed: true + comment: scatter-basic · plotly · anyplot.ai correctly formatted; no legend + for single series + data_quality: + score: 14 + max: 15 + items: + - id: DQ-01 + name: Feature Coverage + score: 5 + max: 6 + passed: true + comment: Shows scatter pattern and correlation; a trend line would fully cover + the plot type's interpretive features + - id: DQ-02 + name: Realistic Context + score: 5 + max: 5 + passed: true + comment: 'Study hours vs exam scores: neutral, realistic educational scenario' + - id: DQ-03 + name: Appropriate Scale + score: 4 + max: 4 + passed: true + comment: X range 0-10 hours, Y range ~30-100%; both plausible + code_quality: + score: 10 + max: 10 + items: + - id: CQ-01 + name: KISS Structure + score: 3 + max: 3 + passed: true + comment: Flat script structure, no functions or classes + - id: CQ-02 + name: Reproducibility + score: 2 + max: 2 + passed: true + comment: Deterministic data generation (seeded random) + - id: CQ-03 + name: Clean Imports + score: 2 + max: 2 + passed: true + comment: Only os, numpy, and plotly + - id: CQ-04 + name: Code Elegance + score: 2 + max: 2 + passed: true + comment: Clean and appropriately simple + - id: CQ-05 + name: Output & API + score: 1 + max: 1 + passed: true + comment: Outputs plot-light.png, plot-dark.png, plot-light.html, plot-dark.html + correctly + library_mastery: + score: 5 + max: 10 + items: + - id: LM-01 + name: Idiomatic Usage + score: 3 + max: 5 + passed: true + comment: Correct use of go.Figure, go.Scatter, update_layout with theme tokens; + idiomatic but not advanced + - id: LM-02 + name: Distinctive Features + score: 2 + max: 5 + passed: false + comment: HTML export and hover tooltips are Plotly-distinctive; hovertemplate + styling or additional interactive features would raise this + verdict: APPROVED +impl_tags: + dependencies: [] + techniques: + - hover-tooltips + - html-export + patterns: + - data-generation + dataprep: [] + styling: + - alpha-blending From d4de8dbaa96734b5233c8426cfa85a397aabfa27 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 23 Apr 2026 19:26:44 +0000 Subject: [PATCH 4/4] chore(plotly): update quality score 86 and review feedback for scatter-basic --- .../implementations/python/plotly.py | 2 +- .../scatter-basic/metadata/python/plotly.yaml | 150 ++++++++++-------- 2 files changed, 81 insertions(+), 71 deletions(-) diff --git a/plots/scatter-basic/implementations/python/plotly.py b/plots/scatter-basic/implementations/python/plotly.py index 6f0e3fef74..d818bbb01e 100644 --- a/plots/scatter-basic/implementations/python/plotly.py +++ b/plots/scatter-basic/implementations/python/plotly.py @@ -1,7 +1,7 @@ """ anyplot.ai scatter-basic: Basic Scatter Plot Library: plotly 6.7.0 | Python 3.14.4 -Quality: 80/100 | Created: 2026-04-23 +Quality: 86/100 | Created: 2026-04-23 """ import os diff --git a/plots/scatter-basic/metadata/python/plotly.yaml b/plots/scatter-basic/metadata/python/plotly.yaml index f2c0acb06f..5bef72bab2 100644 --- a/plots/scatter-basic/metadata/python/plotly.yaml +++ b/plots/scatter-basic/metadata/python/plotly.yaml @@ -2,7 +2,7 @@ library: plotly language: python specification_id: scatter-basic created: '2026-04-23T19:20:55Z' -updated: '2026-04-23T19:22:02Z' +updated: '2026-04-23T19:26:44Z' generated_by: claude-opus-4-5-20251101 workflow_run: 24853790187 issue: 611 @@ -12,88 +12,96 @@ preview_url_light: https://storage.googleapis.com/anyplot-images/plots/scatter-b preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/plotly/plot-dark.png preview_html_light: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/plotly/plot-light.html preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/scatter-basic/python/plotly/plot-dark.html -quality_score: 80 +quality_score: 86 review: strengths: - - 'Full dual-theme support: correct backgrounds (#FAF8F1 / #1A1A17) and theme-adaptive - chrome in both renders with no dark-on-dark or light-on-light failures' - - 'Correct Okabe-Ito palette compliance: brand green #009E73 used as the sole data - color throughout' - - Title format scatter-basic · plotly · anyplot.ai is exact; axis labels are descriptive - with units - - Both HTML and PNG outputs generated for both themes + - 'Perfect spec compliance: correct scatter type, opacity 0.7, descriptive labels, + grid lines all present' + - 'Excellent code quality: KISS structure, seed set, clean imports, correct plot-{THEME}.png + + HTML output' + - All font sizes explicitly set (title=28px, axis=22px, ticks=18px) meeting the + pixel-based requirements + - 'Full theme-adaptive chrome: #FAF8F1/#1A1A17 backgrounds, INK/INK_SOFT tokens + throughout, both renders pass legibility check' + - Realistic educational data (study hours vs exam scores) with clipped scores and + proper correlation (~0.7) weaknesses: - - No trend line or annotations — the spec example application (exploring correlations) - would benefit from a regression line and correlation coefficient display - - 'Design excellence is minimal: no visual emphasis or storytelling beyond raw points' - - Marker size could be slightly larger for better readability at 4800x2700 resolution + - 'DE-03 LOW (2/6): No visual hierarchy or data storytelling — the positive correlation + is visible but nothing guides the viewer''s eye or provides interpretive context; + adding a trend line (go.Scatter mode=''lines'' with regression) would score +2' + - 'DE-01 moderate (4/8): Design is a well-configured default, not exceptional — + lacks the sophistication of a publication-ready plot; could add a subtle annotation + showing the correlation coefficient or vary marker opacity by density' + - 'LM-02 LOW (2/5): Only basic Plotly features used (hovertemplate, HTML export); + could leverage Plotly-specific capabilities like shapes for a trend line, updatemenus, + or custom hover with formatted statistics to score distinctively' image_description: |- Light render (plot-light.png): - Background: Warm off-white (~#FAF8F1), clearly distinct from pure white — PASS - Chrome: Title "scatter-basic · plotly · anyplot.ai" in dark charcoal, readable. Axis labels "Study Hours per Day" and "Exam Score (%)" in dark ink, readable. Tick labels in dark gray, readable. No light-on-light issues. - Data: All ~200 markers use #009E73 (Okabe-Ito position 1, brand green) with ~0.7 alpha. Markers clearly distinguishable from background. Subtle horizontal and vertical grid lines present. - Legibility verdict: PASS + Background: Warm off-white, visually consistent with #FAF8F1 — not pure white + Chrome: Title "scatter-basic · plotly · anyplot.ai" in dark ink, centered at top; "Study Hours per Day" x-axis label and "Exam Score (%)" y-axis label both dark and clearly readable; tick labels (0,2,4,6,8,10 on x; 40,50,...,100 on y) in dark secondary ink, all legible; subtle grid lines nearly invisible at 10% opacity + Data: 160 scatter markers in #009E73 (brand green) at opacity 0.7 with white marker edges; moderate clustering in the 3–5 hour range; clear upward trend from lower-left to upper-right; no pure-black or pure-white markers + Legibility verdict: PASS — all chrome elements readable, no light-on-light issues Dark render (plot-dark.png): - Background: Warm near-black (~#1A1A17), clearly distinct from pure black — PASS - Chrome: Title in light cream/off-white text, readable. Axis labels and tick labels in lighter tones, readable. No dark-on-dark failures detected. Grid lines subtle but visible. - Data: Same #009E73 green markers as light render — data colors identical, only chrome flipped. Brand green visible and readable on dark surface. - Legibility verdict: PASS + Background: Warm near-black, visually consistent with #1A1A17 — not pure black + Chrome: Title in light off-white text, clearly readable against dark background; axis labels and tick labels in lighter secondary ink (#B8B7B0 tokens), all clearly legible; grid lines very subtle at 10% opacity on dark surface; no dark-on-dark failure observed + Data: Marker color identical to light render — same #009E73 brand green with same white edges; data distribution matches light render exactly; brand green reads well on near-black background + Legibility verdict: PASS — all chrome adapts correctly to dark theme, no dark-on-dark failures criteria_checklist: visual_quality: - score: 27 + score: 30 max: 30 items: - id: VQ-01 name: Text Legibility - score: 7 + score: 8 max: 8 passed: true - comment: Title, axis labels, ticks readable in both renders; title slightly - smaller than ideal for 4800x2700 + comment: 'All font sizes explicitly set: title=28px, axis=22px, ticks=18px; + readable in both themes' - id: VQ-02 name: No Overlap - score: 5 + score: 6 max: 6 passed: true - comment: Some marker overlap in dense 3-5 hour region; semi-transparency mitigates - but does not fully resolve + comment: No text or label overlap; no legend; tick labels well-spaced - id: VQ-03 name: Element Visibility score: 6 max: 6 passed: true - comment: All markers clearly visible in both themes; size and alpha appropriate - for ~200 points + comment: Marker size 13 with opacity 0.7 appropriate for 160 points; white + edge aids definition in dense regions - id: VQ-04 name: Color Accessibility score: 2 max: 2 passed: true - comment: 'Single brand green #009E73, CVD-safe' + comment: 'Single series in CVD-safe #009E73; good contrast on both light and + dark backgrounds' - id: VQ-05 name: Layout & Canvas - score: 3 + score: 4 max: 4 passed: true - comment: Good proportions, nothing cut off; margins functional but could be - more generous + comment: Balanced margins (l=90, r=60, t=100, b=80), data fills chart area + well - id: VQ-06 name: Axis Labels & Title score: 2 max: 2 passed: true - comment: Title format correct; Study Hours per Day and Exam Score (%) are - descriptive + comment: Study Hours per Day (x) and Exam Score (%) (y) — descriptive with + units - id: VQ-07 name: Palette Compliance score: 2 max: 2 passed: true - comment: 'First/only series is #009E73; backgrounds are #FAF8F1 (light) / - #1A1A17 (dark); chrome correctly flips' + comment: '#009E73 as single series; #FAF8F1 light and #1A1A17 dark backgrounds; + all chrome tokens theme-correct' design_excellence: - score: 9 + score: 10 max: 20 items: - id: DE-01 @@ -101,21 +109,22 @@ review: score: 4 max: 8 passed: false - comment: Correct brand color and theme-adaptive chrome, but no intentional - visual hierarchy or emphasis + comment: 'Well-configured library default: brand color, warm background, marker + edges — not exceptional; lacks trend line or design hierarchy' - id: DE-02 name: Visual Refinement - score: 3 + score: 4 max: 6 passed: true - comment: Subtle grid, clean L-shaped axis frame; refined but not distinctive + comment: Very subtle grid (10% opacity), L-shaped spines, generous margins; + clearly above defaults - id: DE-03 name: Data Storytelling score: 2 max: 6 passed: false - comment: No trend line, no outlier highlighting, no annotations; correlation - visible but not guided + comment: Positive correlation visible from data distribution but no visual + hierarchy, trend line, or focal point guides the viewer spec_compliance: score: 15 max: 15 @@ -125,51 +134,52 @@ review: score: 5 max: 5 passed: true - comment: Correct 2D scatter plot + comment: Correct basic scatter plot - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: Transparency, grid lines, axis labels, title, appropriate marker - size all present + comment: Transparency (0.7), axis labels, grid lines, balanced point size + — all spec requirements met - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: X = Study Hours per Day, Y = Exam Score (%), ~200 points with clear - positive correlation + comment: Study hours on x (independent), exam scores on y (dependent); full + data range visible - id: SC-04 name: Title & Legend score: 3 max: 3 passed: true - comment: scatter-basic · plotly · anyplot.ai correctly formatted; no legend + comment: Title 'scatter-basic · plotly · anyplot.ai' correct; no legend needed for single series data_quality: - score: 14 + score: 15 max: 15 items: - id: DQ-01 name: Feature Coverage - score: 5 + score: 6 max: 6 passed: true - comment: Shows scatter pattern and correlation; a trend line would fully cover - the plot type's interpretive features + comment: Shows correlation, scatter distribution, clustering, and outliers + — full coverage of basic scatter features - id: DQ-02 name: Realistic Context score: 5 max: 5 passed: true - comment: 'Study hours vs exam scores: neutral, realistic educational scenario' + comment: Study hours vs exam scores — real, neutral, educational scenario - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: X range 0-10 hours, Y range ~30-100%; both plausible + comment: 1–10 hours/day, 40–100% scores; clipped at 100; realistic linear + relationship with noise code_quality: score: 10 max: 10 @@ -179,51 +189,50 @@ review: score: 3 max: 3 passed: true - comment: Flat script structure, no functions or classes + comment: Linear imports→data→plot→save, no functions or classes - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: Deterministic data generation (seeded random) + comment: np.random.seed(42) - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: Only os, numpy, and plotly + comment: os, numpy, plotly.graph_objects — all used - id: CQ-04 name: Code Elegance score: 2 max: 2 passed: true - comment: Clean and appropriately simple + comment: Clean, Pythonic, appropriate complexity - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Outputs plot-light.png, plot-dark.png, plot-light.html, plot-dark.html - correctly + comment: plot-{THEME}.png and plot-{THEME}.html; current Plotly API library_mastery: - score: 5 + score: 6 max: 10 items: - id: LM-01 name: Idiomatic Usage - score: 3 + score: 4 max: 5 passed: true - comment: Correct use of go.Figure, go.Scatter, update_layout with theme tokens; - idiomatic but not advanced + comment: Correct go.Figure + go.Scatter pattern, proper update_layout, hovertemplate + — idiomatic but not advanced - id: LM-02 name: Distinctive Features score: 2 max: 5 passed: false - comment: HTML export and hover tooltips are Plotly-distinctive; hovertemplate - styling or additional interactive features would raise this - verdict: APPROVED + comment: hovertemplate and HTML export are Plotly-specific but basic; no use + of shapes, updatemenus, or other distinctive Plotly capabilities + verdict: REJECTED impl_tags: dependencies: [] techniques: @@ -234,3 +243,4 @@ impl_tags: dataprep: [] styling: - alpha-blending + - edge-highlighting