From ebd76759d77402522034ce307781a7e669351e2c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 6 May 2026 03:32:47 +0000 Subject: [PATCH 1/4] chore(pygal): add metadata for ternary-basic --- .../implementations/python/pygal.py | 117 +++++++----------- .../ternary-basic/metadata/python/pygal.yaml | 51 +++----- 2 files changed, 62 insertions(+), 106 deletions(-) diff --git a/plots/ternary-basic/implementations/python/pygal.py b/plots/ternary-basic/implementations/python/pygal.py index 8c3b87200c..37653a98e1 100644 --- a/plots/ternary-basic/implementations/python/pygal.py +++ b/plots/ternary-basic/implementations/python/pygal.py @@ -1,10 +1,11 @@ -""" pyplots.ai +"""anyplot.ai ternary-basic: Basic Ternary Plot -Library: pygal 3.1.0 | Python 3.13.11 -Quality: 78/100 | Created: 2025-12-24 +Library: pygal 3.1.0 | Python 3.13 +Quality: pending | Created: 2025-12-24 """ import math +import os import cairosvg import numpy as np @@ -12,87 +13,79 @@ from pygal.style import Style +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" +INK_MUTED = "#6B6A63" if THEME == "light" else "#A8A79F" +BRAND = "#009E73" + np.random.seed(42) -# Triangle height for equilateral triangle with base = 1 H = math.sqrt(3) / 2 -# Sample soil composition data (Sand%, Silt%, Clay%) - all sum to 100 -# Ternary coordinates: Top=Sand, Bottom-right=Silt, Bottom-left=Clay compositions = [ - (65, 25, 10), # Sandy Loam - (10, 45, 45), # Silty Clay - (30, 35, 35), # Clay Loam - (40, 40, 20), # Loam - (50, 10, 40), # Sandy Clay - (20, 65, 15), # Silt Loam - (90, 5, 5), # Pure Sand - (5, 90, 5), # Pure Silt - (5, 5, 90), # Pure Clay - (33, 34, 33), # Balanced - (45, 45, 10), # Sandy Silt - (55, 35, 10), # Silty Sand - (15, 20, 65), # Clay - (10, 15, 75), # Heavy Clay - (50, 30, 20), # Light Loam + (65, 25, 10), + (10, 45, 45), + (30, 35, 35), + (40, 40, 20), + (50, 10, 40), + (20, 65, 15), + (90, 5, 5), + (5, 90, 5), + (5, 5, 90), + (33, 34, 33), + (45, 45, 10), + (55, 35, 10), + (15, 20, 65), + (10, 15, 75), + (50, 30, 20), ] -# Convert ternary (sand, silt, clay) to cartesian (x, y) -# Formula: x = 0.5 * (2 * silt/100 + sand/100), y = H * sand/100 data_points = [(0.5 * (2 * s[1] + s[0]) / 100, H * s[0] / 100) for s in compositions] -# Triangle vertices -vertex_sand = (0.5, H) # Top - 100% Sand -vertex_silt = (1.0, 0.0) # Bottom-right - 100% Silt -vertex_clay = (0.0, 0.0) # Bottom-left - 100% Clay +vertex_sand = (0.5, H) +vertex_silt = (1.0, 0.0) +vertex_clay = (0.0, 0.0) -# Grid lines at 20%, 40%, 60%, 80% intervals -# Each line connects two edges of the triangle grid_lines = [] for pct in [0.2, 0.4, 0.6, 0.8]: - # Parallel to base (constant Sand %) - from left edge to right edge p1 = (0.5 * (2 * (1 - pct) + pct), H * pct) p2 = (0.5 * pct, H * pct) grid_lines.extend([p1, p2, (None, None)]) - # Parallel to left side (constant Silt %) - from base to right edge p1 = (0.5 * (2 * pct + (1 - pct)), H * (1 - pct)) p2 = (pct, 0.0) grid_lines.extend([p1, p2, (None, None)]) - # Parallel to right side (constant Clay %) - from base to left edge p1 = (0.5 * (1 - pct), H * (1 - pct)) p2 = (0.5 * (2 * (1 - pct)), 0.0) grid_lines.extend([p1, p2, (None, None)]) -# Tick marks along each edge at 20% intervals tick_marks = [] -tick_len = 0.03 # Length of tick marks +tick_len = 0.03 for pct in [0.2, 0.4, 0.6, 0.8]: - # Ticks on left edge (Clay-Sand): perpendicular outward x_left = 0.5 * pct y_left = H * pct tick_marks.extend([(x_left, y_left), (x_left - tick_len, y_left), (None, None)]) - # Ticks on right edge (Sand-Silt): perpendicular outward x_right = 0.5 * (2 - pct) y_right = H * pct tick_marks.extend([(x_right, y_right), (x_right + tick_len, y_right), (None, None)]) - # Ticks on base (Clay-Silt): perpendicular downward x_base = pct y_base = 0.0 tick_marks.extend([(x_base, y_base), (x_base, y_base - tick_len), (None, None)]) -# Custom style for 3600x3600 px canvas custom_style = Style( - background="white", - plot_background="white", - foreground="#333333", - foreground_strong="#333333", - foreground_subtle="#666666", - colors=("#333333", "#AAAAAA", "#306998", "#333333"), # Boundary, Grid, Data, Ticks + background=PAGE_BG, + plot_background=PAGE_BG, + foreground=INK, + foreground_strong=INK, + foreground_subtle=INK_MUTED, + colors=(BRAND, INK_MUTED, INK_SOFT, INK), title_font_size=80, label_font_size=48, major_label_font_size=44, @@ -101,7 +94,6 @@ opacity=0.85, ) -# Create XY chart (square format for ternary plot) chart = pygal.XY( width=3600, height=3600, @@ -115,7 +107,7 @@ show_y_labels=False, x_title="", y_title="", - title="Soil Composition · ternary-basic · pygal · pyplots.ai", + title="Soil Composition · ternary-basic · pygal · anyplot.ai", dots_size=20, stroke=False, include_x_axis=False, @@ -126,26 +118,18 @@ margin_bottom=120, ) -# Triangle outline (no legend entry - structural element) chart.add( None, [vertex_clay, vertex_silt, vertex_sand, vertex_clay], stroke=True, show_dots=False, stroke_style={"width": 5} ) -# Grid lines at 20% intervals (no legend entry - structural element) chart.add(None, grid_lines, stroke=True, show_dots=False, stroke_style={"width": 2, "dasharray": "8,5"}) -# Data points (soil samples) - the only legend-worthy series chart.add("Soil Samples", data_points, stroke=False, dots_size=22) -# Tick marks along edges (no legend entry - structural element) chart.add(None, tick_marks, stroke=True, show_dots=False, stroke_style={"width": 3}) -# Render to SVG string first svg_content = chart.render().decode("utf-8") -# Calculate pixel positions for labels (inline conversion - KISS principle) -# The chart has xrange=(-0.15, 1.15) = 1.30 range and yrange=(-0.20, 1.05) = 1.25 range -# Approximate: plot area starts after margin and title plot_x_start = 150 plot_x_end = 3450 plot_y_start = 250 @@ -153,7 +137,6 @@ x_range = 1.30 y_range = 1.25 -# Vertex label positions (offset from triangle vertices) sand_px = plot_x_start + (0.5 + 0.15) / x_range * (plot_x_end - plot_x_start) sand_py = plot_y_start + (1.05 - (H + 0.06)) / y_range * (plot_y_end - plot_y_start) silt_px = plot_x_start + (1.07 + 0.15) / x_range * (plot_x_end - plot_x_start) @@ -161,48 +144,40 @@ clay_px = plot_x_start + (-0.07 + 0.15) / x_range * (plot_x_end - plot_x_start) clay_py = plot_y_start + (1.05 - (-0.03)) / y_range * (plot_y_end - plot_y_start) -# Build SVG text elements for vertex labels vertex_labels_svg = f""" - SAND - SILT - CLAY + SAND + SILT + CLAY """ -# Percentage labels along each edge at 20%, 40%, 60%, 80% pct_labels_svg = "" pct_font_size = 36 for pct in [20, 40, 60, 80]: frac = pct / 100.0 - # Left edge (Clay-Sand): Sand % increases going up, Clay % decreases left_x = 0.5 * frac left_y = H * frac left_px = plot_x_start + (left_x - 0.06 + 0.15) / x_range * (plot_x_end - plot_x_start) left_py = plot_y_start + (1.05 - left_y) / y_range * (plot_y_end - plot_y_start) - pct_labels_svg += f' {pct}\n' + pct_labels_svg += f' {pct}\n' - # Right edge (Sand-Silt): Sand % increases going up, Silt % increases going down-right right_x = 0.5 * (2 - frac) right_y = H * frac right_px = plot_x_start + (right_x + 0.04 + 0.15) / x_range * (plot_x_end - plot_x_start) right_py = plot_y_start + (1.05 - right_y) / y_range * (plot_y_end - plot_y_start) - pct_labels_svg += f' {pct}\n' + pct_labels_svg += f' {pct}\n' - # Bottom edge (Clay-Silt): Clay % decreases left-to-right, Silt % increases base_x = frac base_y = -0.05 base_px = plot_x_start + (base_x + 0.15) / x_range * (plot_x_end - plot_x_start) base_py = plot_y_start + (1.05 - base_y) / y_range * (plot_y_end - plot_y_start) - pct_labels_svg += f' {pct}\n' + pct_labels_svg += f' {pct}\n' -# Insert all labels before the closing tag all_labels_svg = vertex_labels_svg + pct_labels_svg svg_content = svg_content.replace("", all_labels_svg + "") -# Save as SVG for HTML output -with open("plot.html", "w") as f: +with open(f"plot-{THEME}.html", "w") as f: f.write(svg_content) -# Convert to PNG -cairosvg.svg2png(bytestring=svg_content.encode("utf-8"), write_to="plot.png") +cairosvg.svg2png(bytestring=svg_content.encode("utf-8"), write_to=f"plot-{THEME}.png") diff --git a/plots/ternary-basic/metadata/python/pygal.yaml b/plots/ternary-basic/metadata/python/pygal.yaml index 3cbe96e916..ccc4b28aa9 100644 --- a/plots/ternary-basic/metadata/python/pygal.yaml +++ b/plots/ternary-basic/metadata/python/pygal.yaml @@ -1,40 +1,21 @@ +# Per-library metadata for pygal implementation of ternary-basic +# Auto-generated by impl-generate.yml + library: pygal +language: python specification_id: ternary-basic created: '2025-12-24T09:54:54Z' -updated: '2025-12-24T10:23:09Z' -generated_by: claude-opus-4-5-20251101 -workflow_run: 20483448048 -issue: 0 -python_version: 3.13.11 +updated: '2026-05-06T03:32:47Z' +generated_by: claude-haiku +workflow_run: 25414898498 +issue: 1001 +python_version: 3.13.13 library_version: 3.1.0 -preview_url: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/pygal/plot.png -preview_html: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/pygal/plot.html -quality_score: 78 -impl_tags: - dependencies: - - cairosvg - techniques: - - manual-ticks - - annotations - - html-export - patterns: - - matrix-construction - - iteration-over-groups - dataprep: [] - styling: - - grid-styling +preview_url_light: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-light.png +preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-dark.png +preview_html_light: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-light.html +preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-dark.html +quality_score: null review: - strengths: - - Creative implementation of ternary plot using pygal XY chart type since pygal - lacks native ternary support - - Excellent use of SVG manipulation to add vertex and percentage labels that pygal - cannot natively produce - - Realistic soil composition data with meaningful variation across the ternary space - - Proper ternary coordinate transformation from compositional data to Cartesian - coordinates - - Clean grid lines at 20% intervals with appropriate styling - - Correct title format following the spec-id · library · pyplots.ai convention - weaknesses: - - Legend shows only Soil Samples which adds little value for a single-series plot - - Some whitespace below the plot area could be better utilized - - Percentage labels along edges are relatively small compared to vertex labels + strengths: [] + weaknesses: [] From 776ce86131781d7659a548449fde36438fc6849f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 6 May 2026 03:36:55 +0000 Subject: [PATCH 2/4] chore(pygal): update quality score 84 and review feedback for ternary-basic --- .../implementations/python/pygal.py | 6 +- .../ternary-basic/metadata/python/pygal.yaml | 236 +++++++++++++++++- 2 files changed, 232 insertions(+), 10 deletions(-) diff --git a/plots/ternary-basic/implementations/python/pygal.py b/plots/ternary-basic/implementations/python/pygal.py index 37653a98e1..e33446ecdd 100644 --- a/plots/ternary-basic/implementations/python/pygal.py +++ b/plots/ternary-basic/implementations/python/pygal.py @@ -1,7 +1,7 @@ -"""anyplot.ai +""" anyplot.ai ternary-basic: Basic Ternary Plot -Library: pygal 3.1.0 | Python 3.13 -Quality: pending | Created: 2025-12-24 +Library: pygal 3.1.0 | Python 3.13.13 +Quality: 84/100 | Updated: 2026-05-06 """ import math diff --git a/plots/ternary-basic/metadata/python/pygal.yaml b/plots/ternary-basic/metadata/python/pygal.yaml index ccc4b28aa9..908baf2a7f 100644 --- a/plots/ternary-basic/metadata/python/pygal.yaml +++ b/plots/ternary-basic/metadata/python/pygal.yaml @@ -1,11 +1,8 @@ -# Per-library metadata for pygal implementation of ternary-basic -# Auto-generated by impl-generate.yml - library: pygal language: python specification_id: ternary-basic created: '2025-12-24T09:54:54Z' -updated: '2026-05-06T03:32:47Z' +updated: '2026-05-06T03:36:54Z' generated_by: claude-haiku workflow_run: 25414898498 issue: 1001 @@ -15,7 +12,232 @@ preview_url_light: https://storage.googleapis.com/anyplot-images/plots/ternary-b preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-dark.png preview_html_light: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-light.html preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-dark.html -quality_score: null +quality_score: 84 review: - strengths: [] - weaknesses: [] + strengths: + - Perfect theme adaptation with light and dark renders fully readable + - Clean professional layout with generous margins and no overlapping elements + - Accurate ternary data representation with all 15 samples correctly positioned + - Strong code quality with explicit font sizing and reproducible seeding + - Complete spec implementation with all required features (grid, vertex labels, + tick marks) + weaknesses: + - 'CRITICAL: Data points render as monochrome (dark/light) instead of Okabe-Ito + #009E73 green — violates brand consistency rule despite correct Style configuration' + - Title includes context text before spec-id (should be 'ternary-basic · pygal · + anyplot.ai') + - Generic styling with no custom palette work or visual hierarchy to emphasize insights + image_description: |- + Light render (plot-light.png): + Background: Warm off-white #FAF8F1 (correct) + Chrome: Title, vertex labels (SAND/SILT/CLAY), percentage scales (20/40/60/80) all clearly readable in dark text. Grid lines subtle and dashed. Legend visible. + Data: 15 soil sample points plotted as dark circles, clearly visible and well-distributed across triangle + Colors: Data points appear monochrome (dark/black) instead of brand green #009E73 + Legibility verdict: PASS (but data color is FAIL per VQ-07) + + Dark render (plot-dark.png): + Background: Warm near-black #1A1A17 (correct) + Chrome: Title, vertex labels, percentage scales all clearly readable in light text. No dark-on-dark failures. Grid lines visible but subtle. + Data: 15 soil sample points plotted as light/white circles, clearly visible. Data colors identical to light render (monochrome, not green). + Colors: Data points appear monochrome (light/white) instead of brand green #009E73 + Legibility verdict: PASS (but data color is FAIL per VQ-07) + criteria_checklist: + visual_quality: + score: 28 + max: 30 + items: + - id: VQ-01 + name: Text Legibility + score: 8 + max: 8 + passed: true + comment: All font sizes explicitly set (title 80px, labels 48px, ticks 44px); + all perfectly readable in both themes + - id: VQ-02 + name: No Overlap + score: 6 + max: 6 + passed: true + comment: No text overlap; grid, labels, and data all cleanly separated + - id: VQ-03 + name: Element Visibility + score: 6 + max: 6 + passed: true + comment: Markers (dots_size=22) and grid lines optimally visible; all elements + adapted to data density + - id: VQ-04 + name: Color Accessibility + score: 2 + max: 2 + passed: true + comment: Good contrast between elements; not relying on red-green as sole + signal + - id: VQ-05 + name: Layout & Canvas + score: 4 + max: 4 + passed: true + comment: Perfect 3600×3600 square layout; plot uses 60-70% of canvas with + generous margins + - id: VQ-06 + name: Axis Labels & Title + score: 2 + max: 2 + passed: true + comment: Vertex labels descriptive (SAND/SILT/CLAY); percentage scales on + all axes; title descriptive + - id: VQ-07 + name: Palette Compliance + score: 0 + max: 2 + passed: false + comment: 'CRITICAL: Data points should be #009E73 (brand green) but render + as monochrome (dark/light by theme). Style defines colors=(BRAND,#009E73,...) + but output does not show green. Violates Okabe-Ito requirement: first series + ALWAYS #009E73' + design_excellence: + score: 10 + max: 20 + items: + - id: DE-01 + name: Aesthetic Sophistication + score: 4 + max: 8 + passed: false + comment: Well-configured defaults but monochrome data colors limit sophistication; + no custom palette work + - id: DE-02 + name: Visual Refinement + score: 4 + max: 6 + passed: true + comment: Subtle dashed grid, clean triangle frame, generous whitespace + - id: DE-03 + name: Data Storytelling + score: 2 + max: 6 + passed: false + comment: Data clearly displayed but no visual hierarchy or emphasis to guide + viewer through insights + spec_compliance: + score: 14 + max: 15 + items: + - id: SC-01 + name: Plot Type + score: 5 + max: 5 + passed: true + comment: Correct ternary plot with proper equilateral triangle and vertex + positioning + - id: SC-02 + name: Required Features + score: 4 + max: 4 + passed: true + comment: 'All features present: grid lines at 20/40/60/80%, vertex labels, + tick marks, data points' + - id: SC-03 + name: Data Mapping + score: 3 + max: 3 + passed: true + comment: All 15 soil samples correctly mapped to ternary coordinates; composition + constraint satisfied + - id: SC-04 + name: Title & Legend + score: 2 + max: 3 + passed: false + comment: Title format includes extra context ('Soil Composition' before spec-id); + should be 'ternary-basic · pygal · anyplot.ai'. Legend correct. + data_quality: + score: 15 + max: 15 + items: + - id: DQ-01 + name: Feature Coverage + score: 6 + max: 6 + passed: true + comment: 'Demonstrates all aspects of ternary plots: triangle frame, grid, + vertex labels, data points, tick marks' + - id: DQ-02 + name: Realistic Context + score: 5 + max: 5 + passed: true + comment: Soil classification (sand/silt/clay) is classical ternary plot use + case; neutral, scientific context + - id: DQ-03 + name: Appropriate Scale + score: 4 + max: 4 + passed: true + comment: All values 0-100%, compositions sum to 100%; factually correct for + soil types + code_quality: + score: 10 + max: 10 + items: + - id: CQ-01 + name: KISS Structure + score: 3 + max: 3 + passed: true + comment: 'Linear code: imports → constants → data → chart → render; no unnecessary + functions' + - id: CQ-02 + name: Reproducibility + score: 2 + max: 2 + passed: true + comment: np.random.seed(42) set; deterministic hardcoded compositions + - id: CQ-03 + name: Clean Imports + score: 2 + max: 2 + passed: true + comment: 'All imports used: math, os, cairosvg, numpy, pygal, Style' + - id: CQ-04 + name: Code Elegance + score: 2 + max: 2 + passed: true + comment: Clear, readable code with appropriate complexity for ternary transformation; + no fake functionality + - id: CQ-05 + name: Output & API + score: 1 + max: 1 + passed: true + comment: 'Correct output: plot-{THEME}.png and plot-{THEME}.html' + library_mastery: + score: 7 + max: 10 + items: + - id: LM-01 + name: Idiomatic Usage + score: 4 + max: 5 + passed: true + comment: Proper Style object creation with theme tokens; correct pygal.XY() + usage; standard rendering approach + - id: LM-02 + name: Distinctive Features + score: 3 + max: 5 + passed: false + comment: SVG label injection post-render demonstrates understanding of pygal's + SVG-based nature and coordinate transformation; somewhat distinctive but + limited + verdict: APPROVED +impl_tags: + dependencies: [] + techniques: + - manual-ticks + patterns: + - data-generation + dataprep: [] + styling: [] From 2dc823690a46f01a98c2d878dab5225cdb62598c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 6 May 2026 03:43:08 +0000 Subject: [PATCH 3/4] chore(pygal): update quality score 49 and review feedback for ternary-basic --- .../implementations/python/pygal.py | 2 +- .../ternary-basic/metadata/python/pygal.yaml | 158 +++++++++--------- 2 files changed, 81 insertions(+), 79 deletions(-) diff --git a/plots/ternary-basic/implementations/python/pygal.py b/plots/ternary-basic/implementations/python/pygal.py index e33446ecdd..130dc0691b 100644 --- a/plots/ternary-basic/implementations/python/pygal.py +++ b/plots/ternary-basic/implementations/python/pygal.py @@ -1,7 +1,7 @@ """ anyplot.ai ternary-basic: Basic Ternary Plot Library: pygal 3.1.0 | Python 3.13.13 -Quality: 84/100 | Updated: 2026-05-06 +Quality: 49/100 | Updated: 2026-05-06 """ import math diff --git a/plots/ternary-basic/metadata/python/pygal.yaml b/plots/ternary-basic/metadata/python/pygal.yaml index 908baf2a7f..e6df0be309 100644 --- a/plots/ternary-basic/metadata/python/pygal.yaml +++ b/plots/ternary-basic/metadata/python/pygal.yaml @@ -2,7 +2,7 @@ library: pygal language: python specification_id: ternary-basic created: '2025-12-24T09:54:54Z' -updated: '2026-05-06T03:36:54Z' +updated: '2026-05-06T03:43:07Z' generated_by: claude-haiku workflow_run: 25414898498 issue: 1001 @@ -12,35 +12,35 @@ preview_url_light: https://storage.googleapis.com/anyplot-images/plots/ternary-b preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-dark.png preview_html_light: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-light.html preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-dark.html -quality_score: 84 +quality_score: 49 review: strengths: - - Perfect theme adaptation with light and dark renders fully readable - - Clean professional layout with generous margins and no overlapping elements - - Accurate ternary data representation with all 15 samples correctly positioned - - Strong code quality with explicit font sizing and reproducible seeding - - Complete spec implementation with all required features (grid, vertex labels, - tick marks) + - Correct ternary plot structure with all required elements (triangle, grid, vertex + labels, tick marks) + - Both light and dark renders properly theme-adapted for text and background chrome + - Excellent spec compliance with comprehensive feature coverage (grid lines, tick + marks, percentage labels) + - Clean code structure with proper theme token usage and reasonable complexity + - Well-positioned labels and annotations without overlapping text elements weaknesses: - - 'CRITICAL: Data points render as monochrome (dark/light) instead of Okabe-Ito - #009E73 green — violates brand consistency rule despite correct Style configuration' - - Title includes context text before spec-id (should be 'ternary-basic · pygal · - anyplot.ai') - - Generic styling with no custom palette work or visual hierarchy to emphasize insights + - Data points rendered in dark gray/neutral color instead of Okabe-Ito brand green + (#009E73) — violates VQ-07 palette compliance + - Design lacks aesthetic sophistication and visual refinement — appears as configured + library defaults image_description: |- Light render (plot-light.png): - Background: Warm off-white #FAF8F1 (correct) - Chrome: Title, vertex labels (SAND/SILT/CLAY), percentage scales (20/40/60/80) all clearly readable in dark text. Grid lines subtle and dashed. Legend visible. - Data: 15 soil sample points plotted as dark circles, clearly visible and well-distributed across triangle - Colors: Data points appear monochrome (dark/black) instead of brand green #009E73 - Legibility verdict: PASS (but data color is FAIL per VQ-07) + Background: Warm off-white (#FAF8F1) ✓ + Chrome: Title "Soil Composition · ternary-basic · pygal · anyplot.ai" is bold and clearly readable in dark text. Vertex labels (SAND, SILT, CLAY) at 60px are properly positioned. Percentage labels (20, 40, 60, 80) at 36px are readable in muted tone. Tick marks visible along edges. + Data: 15 data points visible as DARK GRAY/BLACK dots — NOT the required brand green (#009E73). Grid lines are subtle dashed lines. Grid and axes appear in neutral tones. + Legibility verdict: PASS for text, but FAIL for data color compliance. All text is readable in light theme, but data color is non-compliant. Dark render (plot-dark.png): - Background: Warm near-black #1A1A17 (correct) - Chrome: Title, vertex labels, percentage scales all clearly readable in light text. No dark-on-dark failures. Grid lines visible but subtle. - Data: 15 soil sample points plotted as light/white circles, clearly visible. Data colors identical to light render (monochrome, not green). - Colors: Data points appear monochrome (light/white) instead of brand green #009E73 - Legibility verdict: PASS (but data color is FAIL per VQ-07) + Background: Warm near-black (#1A1A17) ✓ + Chrome: Title and vertex labels are light-colored and clearly visible against dark background. No "dark-on-dark" failures. Legend "Soil Samples" is readable. + Data: Data points appear as LIGHT GRAY/WHITE dots — confirming they are NOT the brand green since the color flipped between themes (data colors should stay identical across themes). Only chrome should adapt. + Legibility verdict: PASS for text readability, FAIL for palette compliance. The fact that data points changed color between renders proves they are using theme-adaptive tokens (INK/INK_SOFT) instead of the required brand color (#009E73 which should be identical in both renders). + + CRITICAL FINDING: VQ-07 failure. Data points should render in identical #009E73 across both light and dark themes; they instead show dark→light color flip, indicating incorrect use of theme-adaptive tokens instead of brand color. criteria_checklist: visual_quality: score: 28 @@ -51,51 +51,51 @@ review: score: 8 max: 8 passed: true - comment: All font sizes explicitly set (title 80px, labels 48px, ticks 44px); - all perfectly readable in both themes + comment: Font sizes explicitly set (title 80px, labels 60px, values 36px), + all readable in both themes - id: VQ-02 name: No Overlap score: 6 max: 6 passed: true - comment: No text overlap; grid, labels, and data all cleanly separated + comment: No overlapping text, vertex labels well-positioned, percentage labels + clear - id: VQ-03 name: Element Visibility score: 6 max: 6 passed: true - comment: Markers (dots_size=22) and grid lines optimally visible; all elements - adapted to data density + comment: 15 data points clearly visible with appropriate marker size for data + density - id: VQ-04 name: Color Accessibility score: 2 max: 2 passed: true - comment: Good contrast between elements; not relying on red-green as sole - signal + comment: Good contrast throughout, CVD-safe - id: VQ-05 name: Layout & Canvas score: 4 max: 4 passed: true - comment: Perfect 3600×3600 square layout; plot uses 60-70% of canvas with - generous margins + comment: 3600×3600 square format appropriate for ternary, plot fills ~60-70% + of canvas with balanced margins - id: VQ-06 name: Axis Labels & Title score: 2 max: 2 passed: true - comment: Vertex labels descriptive (SAND/SILT/CLAY); percentage scales on - all axes; title descriptive + comment: Title with context, vertex labels are component names (SAND, SILT, + CLAY) - id: VQ-07 name: Palette Compliance score: 0 max: 2 passed: false - comment: 'CRITICAL: Data points should be #009E73 (brand green) but render - as monochrome (dark/light by theme). Style defines colors=(BRAND,#009E73,...) - but output does not show green. Violates Okabe-Ito requirement: first series - ALWAYS #009E73' + comment: 'CRITICAL FAILURE: Data points should render in #009E73 (identical + across themes), but appear dark gray in light render and light gray in dark + render, proving incorrect use of theme-adaptive color instead of brand green. + Violates spec: ''first categorical series is ALWAYS #009E73''' design_excellence: score: 10 max: 20 @@ -105,23 +105,24 @@ review: score: 4 max: 8 passed: false - comment: Well-configured defaults but monochrome data colors limit sophistication; - no custom palette work + comment: Well-configured library defaults with custom Style object, but no + exceptional design flourishes — looks professional but generic - id: DE-02 name: Visual Refinement score: 4 max: 6 - passed: true - comment: Subtle dashed grid, clean triangle frame, generous whitespace + passed: false + comment: Dashed grid lines and tick marks show some customization, but overall + minimal visual polish beyond defaults - id: DE-03 name: Data Storytelling score: 2 max: 6 passed: false - comment: Data clearly displayed but no visual hierarchy or emphasis to guide - viewer through insights + comment: Data displayed with title context, but no visual hierarchy or emphasis + — viewer must find their own story spec_compliance: - score: 14 + score: 15 max: 15 items: - id: SC-01 @@ -129,29 +130,27 @@ review: score: 5 max: 5 passed: true - comment: Correct ternary plot with proper equilateral triangle and vertex - positioning + comment: Correct ternary plot with equilateral triangle structure - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: 'All features present: grid lines at 20/40/60/80%, vertex labels, - tick marks, data points' + comment: 'All features present: grid at 20%/40%/60%/80%, vertex labels, tick + marks, percentage labels' - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: All 15 soil samples correctly mapped to ternary coordinates; composition - constraint satisfied + comment: Coordinates correctly calculated from compositions, all 15 points + visible and distributed properly - id: SC-04 name: Title & Legend - score: 2 + score: 3 max: 3 - passed: false - comment: Title format includes extra context ('Soil Composition' before spec-id); - should be 'ternary-basic · pygal · anyplot.ai'. Legend correct. + passed: true + comment: Title format correct, legend label 'Soil Samples' matches spec data_quality: score: 15 max: 15 @@ -161,22 +160,21 @@ review: score: 6 max: 6 passed: true - comment: 'Demonstrates all aspects of ternary plots: triangle frame, grid, - vertex labels, data points, tick marks' + comment: 'Shows all aspects: pure components, mixed compositions, diverse + distribution across triangle' - id: DQ-02 name: Realistic Context score: 5 max: 5 passed: true - comment: Soil classification (sand/silt/clay) is classical ternary plot use - case; neutral, scientific context + comment: Soil composition is classic ternary application, data plausible for + sand/silt/clay classification - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: All values 0-100%, compositions sum to 100%; factually correct for - soil types + comment: All compositions sum to 100%, realistic soil classification values code_quality: score: 10 max: 10 @@ -186,58 +184,62 @@ review: score: 3 max: 3 passed: true - comment: 'Linear code: imports → constants → data → chart → render; no unnecessary - functions' + comment: 'Straightforward: imports → parameters → data → chart → export, no + unnecessary functions' - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: np.random.seed(42) set; deterministic hardcoded compositions + comment: np.random.seed(42) set, deterministic output - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: 'All imports used: math, os, cairosvg, numpy, pygal, Style' + comment: 'All imports used: math (sqrt), os (theme), cairosvg (PNG), numpy, + pygal' - id: CQ-04 name: Code Elegance score: 2 max: 2 passed: true - comment: Clear, readable code with appropriate complexity for ternary transformation; - no fake functionality + comment: Reasonably clean, manual SVG label injection is necessary for ternary + labels in pygal - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: 'Correct output: plot-{THEME}.png and plot-{THEME}.html' + comment: 'Correct: saves as plot-{THEME}.png and plot-{THEME}.html' library_mastery: - score: 7 + score: 6 max: 10 items: - id: LM-01 name: Idiomatic Usage - score: 4 + score: 3 max: 5 - passed: true - comment: Proper Style object creation with theme tokens; correct pygal.XY() - usage; standard rendering approach + passed: false + comment: Uses pygal.XY() and Style appropriately, but manual SVG manipulation + suggests fighting library limits - id: LM-02 name: Distinctive Features score: 3 max: 5 passed: false - comment: SVG label injection post-render demonstrates understanding of pygal's - SVG-based nature and coordinate transformation; somewhat distinctive but - limited - verdict: APPROVED + comment: Custom Style object and theme tokens show library understanding, + but mostly standard usage + verdict: REJECTED impl_tags: - dependencies: [] + dependencies: + - cairosvg techniques: + - annotations - manual-ticks + - html-export patterns: - data-generation + - matrix-construction dataprep: [] styling: [] From 1617ed1502fd9e9bff4e41f86b58f4e30cdeae0b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 6 May 2026 03:54:39 +0000 Subject: [PATCH 4/4] chore(pygal): update quality score 92 and review feedback for ternary-basic --- .../implementations/python/pygal.py | 4 +- .../ternary-basic/metadata/python/pygal.yaml | 116 +++++------------- 2 files changed, 34 insertions(+), 86 deletions(-) diff --git a/plots/ternary-basic/implementations/python/pygal.py b/plots/ternary-basic/implementations/python/pygal.py index 130dc0691b..da0e238739 100644 --- a/plots/ternary-basic/implementations/python/pygal.py +++ b/plots/ternary-basic/implementations/python/pygal.py @@ -1,7 +1,7 @@ """ anyplot.ai ternary-basic: Basic Ternary Plot Library: pygal 3.1.0 | Python 3.13.13 -Quality: 49/100 | Updated: 2026-05-06 +Quality: 92/100 | Updated: 2026-05-06 """ import math @@ -85,7 +85,7 @@ foreground=INK, foreground_strong=INK, foreground_subtle=INK_MUTED, - colors=(BRAND, INK_MUTED, INK_SOFT, INK), + colors=(INK, INK_MUTED, BRAND, INK), title_font_size=80, label_font_size=48, major_label_font_size=44, diff --git a/plots/ternary-basic/metadata/python/pygal.yaml b/plots/ternary-basic/metadata/python/pygal.yaml index e6df0be309..815bfbbc11 100644 --- a/plots/ternary-basic/metadata/python/pygal.yaml +++ b/plots/ternary-basic/metadata/python/pygal.yaml @@ -2,7 +2,7 @@ library: pygal language: python specification_id: ternary-basic created: '2025-12-24T09:54:54Z' -updated: '2026-05-06T03:43:07Z' +updated: '2026-05-06T03:54:39Z' generated_by: claude-haiku workflow_run: 25414898498 issue: 1001 @@ -12,38 +12,30 @@ preview_url_light: https://storage.googleapis.com/anyplot-images/plots/ternary-b preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-dark.png preview_html_light: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-light.html preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/ternary-basic/python/pygal/plot-dark.html -quality_score: 49 +quality_score: 92 review: strengths: - - Correct ternary plot structure with all required elements (triangle, grid, vertex - labels, tick marks) - - Both light and dark renders properly theme-adapted for text and background chrome - - Excellent spec compliance with comprehensive feature coverage (grid lines, tick - marks, percentage labels) - - Clean code structure with proper theme token usage and reasonable complexity - - Well-positioned labels and annotations without overlapping text elements - weaknesses: - - Data points rendered in dark gray/neutral color instead of Okabe-Ito brand green - (#009E73) — violates VQ-07 palette compliance - - Design lacks aesthetic sophistication and visual refinement — appears as configured - library defaults + - 'Palette compliance fixed: data points now correctly render as #009E73 brand green' + - Perfect theme adaptation with proper chrome switching + - Clean, professional layout with no text overlaps + - Complete specification implementation with all ternary features + - Strong code quality with proper reproducibility and structure + weaknesses: [] image_description: |- Light render (plot-light.png): - Background: Warm off-white (#FAF8F1) ✓ - Chrome: Title "Soil Composition · ternary-basic · pygal · anyplot.ai" is bold and clearly readable in dark text. Vertex labels (SAND, SILT, CLAY) at 60px are properly positioned. Percentage labels (20, 40, 60, 80) at 36px are readable in muted tone. Tick marks visible along edges. - Data: 15 data points visible as DARK GRAY/BLACK dots — NOT the required brand green (#009E73). Grid lines are subtle dashed lines. Grid and axes appear in neutral tones. - Legibility verdict: PASS for text, but FAIL for data color compliance. All text is readable in light theme, but data color is non-compliant. + Background: Warm off-white #FAF8F1 - correct + Chrome: Title in dark text #1A1A17, vertex labels bold and clear, percentage labels in muted ink #6B6A63, grid lines subtle dashed pattern + Data: 15 data points rendered as brand green circles #009E73, clearly visible and well-positioned + Legibility verdict: PASS Dark render (plot-dark.png): - Background: Warm near-black (#1A1A17) ✓ - Chrome: Title and vertex labels are light-colored and clearly visible against dark background. No "dark-on-dark" failures. Legend "Soil Samples" is readable. - Data: Data points appear as LIGHT GRAY/WHITE dots — confirming they are NOT the brand green since the color flipped between themes (data colors should stay identical across themes). Only chrome should adapt. - Legibility verdict: PASS for text readability, FAIL for palette compliance. The fact that data points changed color between renders proves they are using theme-adaptive tokens (INK/INK_SOFT) instead of the required brand color (#009E73 which should be identical in both renders). - - CRITICAL FINDING: VQ-07 failure. Data points should render in identical #009E73 across both light and dark themes; they instead show dark→light color flip, indicating incorrect use of theme-adaptive tokens instead of brand color. + Background: Warm near-black #1A1A17 - correct + Chrome: Title in light text #F0EFE8, vertex labels visible in light text, percentage labels in light muted #A8A79F, grid lines subtle + Data: 15 data points remain as brand green #009E73 - identical to light render (only chrome flipped) + Legibility verdict: PASS criteria_checklist: visual_quality: - score: 28 + score: 30 max: 30 items: - id: VQ-01 @@ -51,76 +43,55 @@ review: score: 8 max: 8 passed: true - comment: Font sizes explicitly set (title 80px, labels 60px, values 36px), - all readable in both themes - id: VQ-02 name: No Overlap score: 6 max: 6 passed: true - comment: No overlapping text, vertex labels well-positioned, percentage labels - clear - id: VQ-03 name: Element Visibility score: 6 max: 6 passed: true - comment: 15 data points clearly visible with appropriate marker size for data - density - id: VQ-04 name: Color Accessibility score: 2 max: 2 passed: true - comment: Good contrast throughout, CVD-safe - id: VQ-05 name: Layout & Canvas score: 4 max: 4 passed: true - comment: 3600×3600 square format appropriate for ternary, plot fills ~60-70% - of canvas with balanced margins - id: VQ-06 name: Axis Labels & Title score: 2 max: 2 passed: true - comment: Title with context, vertex labels are component names (SAND, SILT, - CLAY) - id: VQ-07 name: Palette Compliance - score: 0 + score: 2 max: 2 - passed: false - comment: 'CRITICAL FAILURE: Data points should render in #009E73 (identical - across themes), but appear dark gray in light render and light gray in dark - render, proving incorrect use of theme-adaptive color instead of brand green. - Violates spec: ''first categorical series is ALWAYS #009E73''' + passed: true design_excellence: - score: 10 + score: 14 max: 20 items: - id: DE-01 name: Aesthetic Sophistication - score: 4 + score: 6 max: 8 - passed: false - comment: Well-configured library defaults with custom Style object, but no - exceptional design flourishes — looks professional but generic + passed: true - id: DE-02 name: Visual Refinement score: 4 max: 6 - passed: false - comment: Dashed grid lines and tick marks show some customization, but overall - minimal visual polish beyond defaults + passed: true - id: DE-03 name: Data Storytelling - score: 2 + score: 4 max: 6 - passed: false - comment: Data displayed with title context, but no visual hierarchy or emphasis - — viewer must find their own story + passed: true spec_compliance: score: 15 max: 15 @@ -130,27 +101,21 @@ review: score: 5 max: 5 passed: true - comment: Correct ternary plot with equilateral triangle structure - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: 'All features present: grid at 20%/40%/60%/80%, vertex labels, tick - marks, percentage labels' - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: Coordinates correctly calculated from compositions, all 15 points - visible and distributed properly - id: SC-04 name: Title & Legend score: 3 max: 3 passed: true - comment: Title format correct, legend label 'Soil Samples' matches spec data_quality: score: 15 max: 15 @@ -160,21 +125,16 @@ review: score: 6 max: 6 passed: true - comment: 'Shows all aspects: pure components, mixed compositions, diverse - distribution across triangle' - id: DQ-02 name: Realistic Context score: 5 max: 5 passed: true - comment: Soil composition is classic ternary application, data plausible for - sand/silt/clay classification - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: All compositions sum to 100%, realistic soil classification values code_quality: score: 10 max: 10 @@ -184,62 +144,50 @@ review: score: 3 max: 3 passed: true - comment: 'Straightforward: imports → parameters → data → chart → export, no - unnecessary functions' - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: np.random.seed(42) set, deterministic output - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: 'All imports used: math (sqrt), os (theme), cairosvg (PNG), numpy, - pygal' - id: CQ-04 name: Code Elegance score: 2 max: 2 passed: true - comment: Reasonably clean, manual SVG label injection is necessary for ternary - labels in pygal - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: 'Correct: saves as plot-{THEME}.png and plot-{THEME}.html' library_mastery: - score: 6 + score: 8 max: 10 items: - id: LM-01 name: Idiomatic Usage - score: 3 + score: 5 max: 5 - passed: false - comment: Uses pygal.XY() and Style appropriately, but manual SVG manipulation - suggests fighting library limits + passed: true - id: LM-02 name: Distinctive Features score: 3 max: 5 - passed: false - comment: Custom Style object and theme tokens show library understanding, - but mostly standard usage - verdict: REJECTED + passed: true + verdict: APPROVED impl_tags: dependencies: - cairosvg techniques: - annotations - - manual-ticks - html-export patterns: - data-generation - matrix-construction dataprep: [] - styling: [] + styling: + - custom-colormap