Skip to content

feat(pygal): implement maze-circular#7493

Merged
MarkusNeusinger merged 6 commits into
mainfrom
implementation/maze-circular/pygal
May 20, 2026
Merged

feat(pygal): implement maze-circular#7493
MarkusNeusinger merged 6 commits into
mainfrom
implementation/maze-circular/pygal

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: maze-circular - python/pygal

Implements the python/pygal version of maze-circular.

File: plots/maze-circular/implementations/python/pygal.py

Parent Issue: #3804


🤖 impl-generate workflow

github-actions Bot added 2 commits May 20, 2026 07:56
Regen from quality 52. Addressed:
- jagged arcs: 32 sample points per sector for smooth circular walls
- no theme support: added ANYPLOT_THEME env var with theme-adaptive chrome
- wrong output filename: plot.png → plot-{THEME}.png
- missing HTML output: added plot-{THEME}.html for interactive pygal
- functions violated KISS: inlined find/union/arc_pts
- wrong title: fixed to maze-circular · python · pygal · anyplot.ai
- sys.path fix to prevent pygal.py shadowing installed pygal package
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 20, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): Circular maze on a warm off-white #FAF8F1 background. Seven concentric rings divided into 14 sectors, drawn with near-black wall strokes. Entry gap is on the right side of the outer boundary (~12–13° from horizontal), with a Y-shaped arrow indicator (coded #009E73) extending outward. A 5-pointed star sits at the center (coded #D55E00). Title "maze-circular · python · pygal · anyplot.ai" appears in dark ink at the top, spanning ~72% of canvas width. All text is clearly readable against the light background. Wall strokes are visible; colored accent markers are present but subtle relative to canvas size.

Dark render (plot-dark.png): Same maze on a near-black #1A1A17 background. Walls render in light cream (#E8E8E0), providing strong contrast and an elegant "technical blueprint" aesthetic. Title appears in light cream text — clearly readable, no dark-on-dark failures. Entry arrow and goal star present at identical positions as the light render. Data accent colors (#009E73, #D55E00) are theme-independent and correctly coded; only the wall chrome color and title text flip between themes.

Both paragraphs are required. A review that only describes one render is invalid.

Score: 86/100

Category Score Max
Visual Quality 28 30
Design Excellence 13 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 5 10
Total 86 100

Visual Quality (28/30)

  • VQ-01: Text Legibility (8/8) — Title font size explicitly set (66), spans ~72% of canvas, readable in both themes
  • VQ-02: No Overlap (6/6) — No text or element overlap; maze walls non-overlapping by construction
  • VQ-03: Element Visibility (5/6) — Maze walls clearly visible; entry arrow (width:14) and goal star present but proportionally small — need to be scaled up to be unambiguous markers
  • VQ-04: Color Accessibility (2/2) — Single-color walls with Okabe-Ito accent points; CVD-safe
  • VQ-05: Layout & Canvas (3/4) — Square 2400×2400 appropriate; slight excess whitespace at bottom
  • VQ-06: Axis Labels & Title (2/2) — Title correct; axis labels N/A for maze visualization
  • VQ-07: Palette Compliance (2/2) — Light #FAF8F1, dark #1A1A17; wall color theme-adaptive; accents use Okabe-Ito #009E73 / #D55E00

Design Excellence (13/20)

  • DE-01: Aesthetic Sophistication (5/8) — Above defaults: algorithmic generation, intentional accent colors, clean minimalism; dark mode has compelling blueprint aesthetic. Not yet publication-ready — maze corridors lack visual weight.
  • DE-02: Visual Refinement (4/6) — No grid/spines, correct backgrounds, explicit line weights. Walls slightly thin for stated print-friendly use case.
  • DE-03: Data Storytelling (4/6) — Entry arrow and goal star create clear visual hierarchy guiding the eye from outer entry to center goal; color accents establish puzzle narrative effectively.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct circular maze with concentric rings and radial passages
  • SC-02: Required Features (4/4) — Concentric rings, radial walls, ring passages, outer entry gap with arrow, center goal star, Kruskal's algorithm guaranteeing one solution
  • SC-03: Data Mapping (3/3) — Correct coordinate mapping; all elements within canvas bounds
  • SC-04: Title & Legend (3/3) — Title maze-circular · python · pygal · anyplot.ai correct; no legend (appropriate)

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Shows all spec aspects: 7 rings, 14 sectors, entry on outer edge, goal at center, solvable passages
  • DQ-02: Realistic Context (5/5) — Maze puzzle is neutral, real-world (printable puzzles, game design, spatial education)
  • DQ-03: Appropriate Scale (4/4) — 7 rings in recommended 5–10 range; np.random.seed(42) for reproducibility

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Linear flow: imports → theme → maze generation → plot → save; no functions/classes
  • CQ-02: Reproducibility (2/2) — np.random.seed(42) set
  • CQ-03: Clean Imports (2/2) — All imports used; sys/os needed for path fix and theme env var
  • CQ-04: Code Elegance (2/2) — Clean Pythonic code; inline union-find is compact and appropriate; no fake UI
  • CQ-05: Output & API (1/1) — Saves plot-{THEME}.png + plot-{THEME}.html; current pygal API

Library Mastery (5/10)

  • LM-01: Idiomatic Usage (3/5) — Uses pygal.XY with Style and stroke_style per series; correct approach but XY is used as a raw coordinate canvas rather than leveraging pygal's higher-level chart features
  • LM-02: Distinctive Features (2/5) — Produces HTML output (pygal-distinctive) and uses per-series stroke_style color overrides, but pygal's interactive naming (labeled series, visible in HTML tooltip/legend) is unused

Score Caps Applied

  • None

Strengths

  • Algorithmically correct maze via Kruskal's union-find — guaranteed single solution path
  • Full spec compliance: 7 rings, 14 sectors, entry gap on outer boundary, center goal
  • Theme-adaptive chrome: #FAF8F1 / #1A1A17 backgrounds with correctly flipping wall and text colors
  • Entry arrow and goal star use Okabe-Ito #009E73 / #D55E00 — correct palette signal
  • Perfect code quality: KISS structure, seed set, clean imports, both PNG + HTML output

Weaknesses

  • Entry arrow (width:14, #009E73) is proportionally too small — appears as a subtle Y-cluster; needs a longer body (~0.35 units) and wider wings (~0.15 units) to read clearly as a directional marker at canvas scale
  • Goal star (outer radius 0.07 units) is too small — increase to at least 0.12 units and consider adding a fill so it registers visually as the puzzle goal
  • LM-02 low: pygal's interactive HTML features are unused — name the entry and goal series with descriptive labels so they appear as interactive elements in the HTML render
  • Walls slightly thin for "print-friendly" use case stated in spec — increase wall stroke width from 8 to 12 for bolder, more playable appearance
  • Slight excess whitespace at bottom of canvas — reduce bottom margin or adjust range to better center the maze vertically

Issues Found

  1. LM-02 LOW: pygal produces interactive HTML charts, but all series are named "" — interactive features are wasted
    • Fix: Give entry arrow, goal star, and perhaps the maze wall series meaningful labels like "Entry", "Goal" so they show in the HTML interactive legend/tooltips
  2. VQ-03 / DE-01: Entry arrow and goal star accent markers are too small to provide strong visual impact
    • Fix: Increase entry arrow body to outer_r + 0.35 base distance, wings to 0.15 unit span; increase star outer radius to 0.12, and add a closed polygon fill using pygal's fill=True on that specific series

AI Feedback for Next Attempt

Improve two areas: (1) Make entry and goal markers visually prominent — the arrow should be large enough to unambiguously signal the entry point (body ~0.35 units outside the outer ring, wings ~0.15 units wide), and the star should have an outer radius of at least 0.12 units with a fill; (2) Leverage pygal's interactive HTML by naming the entry arrow series "Entry" and goal series "Goal" — this turns a key distinctive pygal feature from unused to active. Also increase wall stroke width to 12 for a bolder, more print-friendly maze.

Verdict: REJECTED

@github-actions github-actions Bot added quality:86 Quality score 86/100 ai-rejected Quality not OK, triggers update labels May 20, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels May 20, 2026
Attempt 1/3 - fixes based on AI review
@github-actions
Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 1/4

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 20, 2026

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): Warm off-white background (#FAF8F1) — correct for light theme. Title "maze-circular · python · pygal · anyplot.ai" renders as dark near-black text, clearly readable across the top. No axis labels or tick labels (appropriate for a maze). Seven concentric rings with radial dividers are rendered as dark (#1A1A17) stroked lines at 10px width with rounded linecaps, giving a clean, even aesthetic. At approximately the 1 o'clock position on the outer ring there is a visible entry gap, with outward lines forming a green (#009E73) arrowhead V-shape. A small 5-pointed star outline in vermillion (#D55E00) marks the goal at the center. All text is readable against the light background — no light-on-light failures.

Dark render (plot-dark.png): Near-black background (#1A1A17) — correct for dark theme. Title renders as light off-white text, clearly legible — no dark-on-dark failures. Maze walls flip to #E8E8E0 (near-white) on the dark surface, producing a high-contrast, striking result. Data colors (green entry arrow #009E73, vermillion goal star #D55E00) are identical to the light render — only chrome (background, wall color) flips as expected. All text is readable against the dark background.

Score: 86/100

Category Score Max
Visual Quality 28 30
Design Excellence 12 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 6 10
Total 86 100

Visual Quality (28/30)

  • VQ-01: Text Legibility (8/8) — All font sizes explicitly set (title 66, label 56, major-label 44, legend 44, value 36). Clearly readable in both themes.
  • VQ-02: No Overlap (6/6) — No overlapping text or maze elements.
  • VQ-03: Element Visibility (5/6) — Walls clearly visible at 10px stroke. Entry arrow (20px green) and goal star (10px vermillion) are visible but stroke-only without fill, making them slightly less prominent than ideal at canvas scale.
  • VQ-04: Color Accessibility (2/2) — Dark walls on light / light walls on dark both high-contrast. Okabe-Ito green and vermillion are CVD-safe.
  • VQ-05: Layout & Canvas (3/4) — Square 2400×2400 correct for circular plot. Maze centered; occupies ~55-60% of canvas width — minor dead space on left/right but not severe.
  • VQ-06: Axis Labels & Title (2/2) — Title matches mandated format. No axis labels needed for maze (N/A).
  • VQ-07: Palette Compliance (2/2) — Backgrounds correct (#FAF8F1 light / #1A1A17 dark). Entry arrow #009E73 (Okabe-Ito pos 1), goal star #D55E00 (pos 2). Wall color theme-adaptive. Both renders fully theme-correct.

Design Excellence (12/20)

  • DE-01: Aesthetic Sophistication (5/8) — Minimalist maze aesthetic is intentional and polished. Dark render is particularly striking (white walls on near-black). Clearly above configured defaults, but not FiveThirtyEight-level — no ring depth cues or color gradient to add visual interest.
  • DE-02: Visual Refinement (4/6) — No guides, no grid, no axis labels, no legend. Rounded linecap/linejoin adds polish to wall strokes. Clean margins.
  • DE-03: Data Storytelling (3/6) — Entry arrow and goal star establish a clear entry→navigate→goal visual hierarchy. However, these markers could be more dominant — the story is conceptually clear but visually understated.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Circular maze with concentric rings and radial passages.
  • SC-02: Required Features (4/4) — 7 rings, 14 sectors, Kruskal's algorithm (unique solution guaranteed), entry gap on outer ring, goal star at center, consistent wall thickness.
  • SC-03: Data Mapping (3/3) — XY coordinates correctly map ring/sector geometry. Passage absence = wall presence logic correct.
  • SC-04: Title & Legend (3/3) — Title is maze-circular · python · pygal · anyplot.ai. No legend needed (show_legend=False).

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Shows all maze features: rings, radial walls, open passages, entry gap, goal marker, guaranteed unique solution via union-find.
  • DQ-02: Realistic Context (5/5) — Maze puzzle is a real-world, neutral application. No controversial content.
  • DQ-03: Appropriate Scale (4/4) — 7 rings, 14 sectors, seed=42. inner_r=0.10, outer_r=0.88 give sensible proportions.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Linear: imports → data → maze generation → plot → save. No functions or classes.
  • CQ-02: Reproducibility (2/2) — np.random.seed(42) set.
  • CQ-03: Clean Imports (2/2) — All five imports used: os, sys, numpy, pygal, Style.
  • CQ-04: Code Elegance (2/2) — Inline union-find with path halving is clean and idiomatic for Kruskal's. sys.path manipulation is necessary and correctly placed.
  • CQ-05: Output & API (1/1) — Saves plot-{THEME}.png and plot-{THEME}.html. Current API.

Library Mastery (6/10)

  • LM-01: Idiomatic Usage (3/5) — Correct pygal patterns: custom Style, XY chart, stroke_style dict. Using XY as a drawing canvas is the right approach but doesn't leverage high-level chart-type APIs.
  • LM-02: Distinctive Features (3/5) — Named series ("Entry →", "Goal ★") for HTML tooltip exposure is a genuine pygal-specific feature. Also correctly saves interactive HTML. stroke_style with linecap/linejoin is pygal-specific. Solid but not exceptional.

Score Caps Applied

  • None

Strengths

  • Algorithmically correct Kruskal maze generation (inline union-find with path halving) guarantees exactly one solution
  • Clean minimalist aesthetic with theme-adaptive wall colors — dark render is striking and professional
  • Named series ("Entry →", "Goal ★") correctly exploit pygal's HTML tooltip feature for interactive output
  • Perfect spec compliance: entry gap, goal star, 7 rings, reproducible seed=42
  • All font sizes explicitly set; title readable in both light and dark renders

Weaknesses

  • Entry arrow and goal star are stroke-only (no fill) — they are visible but less prominent than ideal; goal star is particularly small relative to the maze size
  • Maze occupies ~55-60% of canvas width — minor dead space on left/right sides
  • Library mastery is limited: pygal.XY used as a raw drawing canvas rather than exploiting any high-level chart-type feature; LM-02 is partially compensated by named-series tooltips but scope is narrow

Issues Found

  1. VQ-03 / DE-03 LOW: Goal star and entry arrow are stroke-only outlines, reducing visual impact
    • Fix: Fill the goal star with #D55E00; consider a wider arrowhead or filled triangle tip for the entry arrow to make both landmarks clearly distinct from wall lines
  2. DE-01 / DE-03 MODERATE: No visual depth or ring-difficulty cues
    • Fix: Consider a subtle opacity gradient on ring arcs (outermost rings slightly lighter) to hint at depth; or use a very faint halo around the center goal area

AI Feedback for Next Attempt

The maze structure and palette are correct. To push DE scores higher: (1) fill the goal star polygon rather than just stroking it — a solid vermillion star at center will be unmistakable; (2) add an arrowhead fill to the entry marker; (3) consider a subtle visual cue (e.g., faint ring-arc tinting or slight opacity reduction on outer rings) to convey depth without cluttering the puzzle. These changes would lift DE-01 from 5→6 and DE-03 from 3→4.

Verdict: APPROVED

@github-actions github-actions Bot added the ai-approved Quality OK, ready for merge label May 20, 2026
@MarkusNeusinger MarkusNeusinger merged commit 7961ad5 into main May 20, 2026
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/maze-circular/pygal branch May 20, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-approved Quality OK, ready for merge ai-attempt-1 First repair attempt quality:86 Quality score 86/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant