update(bullet-basic): pygal — comprehensive quality review#4346
update(bullet-basic): pygal — comprehensive quality review#4346github-actions[bot] merged 9 commits intomainfrom
Conversation
Comprehensive quality review improving SVG output and styling.
AI Review - Attempt 1/3Image Description
Score: 80/100
Visual Quality (27/30)
Design Excellence (12/20)
Spec Compliance (15/15)
Data Quality (15/15)
Code Quality (8/10)
Library Mastery (3/10)
Score Caps Applied
Strengths
Weaknesses
Issues Found
AI Feedback for Next Attempt
Verdict: REJECTED |
There was a problem hiding this comment.
Pull request overview
Updates the pygal implementation for the bullet-basic plot with improved styling and SVG post-processing to enhance the final rendered output.
Changes:
- Refined chart styling (fonts, spacing, grayscale qualitative bands)
- Reworked SVG injection logic for actual bars/target markers and legend items
- Updated metadata (timestamps, generator, runtime versions)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| plots/bullet-basic/metadata/pygal.yaml | Updates plot metadata (timestamps, generator, runtime version, quality score). |
| plots/bullet-basic/implementations/pygal.py | Adjusts pygal styling and rewrites SVG injection to improve visual hierarchy and output fidelity. |
| preview_thumb: https://storage.googleapis.com/pyplots-images/plots/bullet-basic/pygal/plot_thumb.png | ||
| preview_html: https://storage.googleapis.com/pyplots-images/plots/bullet-basic/pygal/plot.html | ||
| quality_score: 91 | ||
| quality_score: null |
There was a problem hiding this comment.
quality_score being set to null is likely incompatible with downstream tooling/score gating that expects a numeric value (the prior value was an integer). If the score is temporarily unknown, consider omitting the field (if schema allows) or populating it with the computed numeric score to avoid breaking consumers.
| quality_score: null | |
| quality_score: 95 |
| Library: pygal 3.1.0 | Python 3.13.11 | ||
| Quality: 91/100 | Created: 2025-12-23 | ||
| Library: pygal 3.1.0 | Python 3.14.3 | ||
| Quality: /100 | Updated: 2026-02-22 |
There was a problem hiding this comment.
The header docstring now contains Quality: /100 with the numeric score missing, which makes the file metadata misleading. Please either restore the numeric quality value (if known) or remove the quality field from the docstring entirely to avoid publishing incomplete information.
| Quality: /100 | Updated: 2026-02-22 | |
| Updated: 2026-02-22 |
| # Inject before closing </svg> tag | ||
| svg_output = svg_string.replace("</svg>", "\n".join(injected) + "\n</svg>") | ||
|
|
||
| # Save |
There was a problem hiding this comment.
This implementation no longer writes plot.html (or any SVG/HTML artifact), but the PR metadata still references a preview_html output. If the pipeline expects plot.html to exist, this change will break HTML preview generation. Consider restoring the plot.html write (and/or writing an .svg) alongside plot.png.
| # Save | |
| # Save SVG and HTML previews, plus PNG raster | |
| with open("plot.svg", "w", encoding="utf-8") as f_svg: | |
| f_svg.write(svg_output) | |
| html_output = """<!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Bullet Chart Preview</title> | |
| <style> | |
| body {{ | |
| margin: 0; | |
| padding: 0; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| background-color: #ffffff; | |
| }} | |
| svg {{ | |
| max-width: 100vw; | |
| max-height: 100vh; | |
| }} | |
| </style> | |
| </head> | |
| <body> | |
| {svg} | |
| </body> | |
| </html> | |
| """.format(svg=svg_output) | |
| with open("plot.html", "w", encoding="utf-8") as f_html: | |
| f_html.write(html_output) |
| # Plot area coordinates (derived from pygal's SVG output structure) | ||
| PLOT_X = 585 | ||
| PLOT_Y = 169 | ||
| BAR_X0 = 79.71 # x-axis origin within plot area | ||
| PX_PER_PCT = 39.856 # pixels per percentage point (1992.79 / 50) | ||
|
|
||
| # Row centers within plot area (bottom to top: Revenue -> Satisfaction) | ||
| ROW_CENTERS = [1916.96, 1500.23, 1083.50, 666.77, 250.04] |
There was a problem hiding this comment.
The SVG injection relies on several hard-coded magic numbers (plot offsets, pixel-per-percent scaling, and row centers). This is very brittle across pygal version changes, font changes, title/legend layout changes, or even small style tweaks. A more maintainable approach is to derive these values from the rendered SVG (e.g., parsing the plot group's transform, plot-area width, and bar row positions) or to centralize and document how each number was calculated (including what SVG elements/attributes they were taken from) so future updates can safely adjust them.
Attempt 1/3 - fixes based on AI review
🔧 Repair Attempt 1/3Applied fixes based on AI review feedback. Status: Repair completed, re-triggering review... |
AI Review - Attempt 2/3Image Description
Score: 83/100
Visual Quality (27/30)
Design Excellence (12/20)
Spec Compliance (15/15)
Data Quality (15/15)
Code Quality (9/10)
Library Mastery (5/10)
Score Caps Applied
Strengths
Weaknesses
Issues Found
AI Feedback for Next Attempt
Verdict: REJECTED |
Attempt 2/3 - fixes based on AI review
🔧 Repair Attempt 2/3Applied fixes based on AI review feedback. Status: Repair completed, re-triggering review... |
AI Review - Attempt 3/3Image Description
Score: 82/100
Visual Quality (27/30)
Design Excellence (12/20)
Spec Compliance (15/15)
Data Quality (15/15)
Code Quality (8/10)
Library Mastery (5/10)
Score Caps Applied
Strengths
Weaknesses
Issues Found
AI Feedback for Next Attempt
Verdict: REJECTED |
Attempt 3/3 - fixes based on AI review
🔧 Repair Attempt 3/3Applied fixes based on AI review feedback. Status: Repair completed, re-triggering review... |
AI Review - Attempt 3/3Image Description
Score: 85/100
Visual Quality (27/30)
Design Excellence (14/20)
Spec Compliance (15/15)
Data Quality (15/15)
Code Quality (9/10)
Library Mastery (5/10)
Score Caps Applied
Strengths
Weaknesses
Issues Found
AI Feedback for Next Attempt
Verdict: REJECTED |
Summary
Updated pygal implementation for bullet-basic (Basic Bullet Chart).
Changes: Comprehensive quality review improving SVG output, styling, and library features.
Changes
Test Plan
Generated with Claude Code
/updatecommand