From 4cdfd61b45845efb1ca550e0abdac84fbc9b4fde Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Mon, 23 Feb 2026 22:29:07 +0100 Subject: [PATCH 1/8] =?UTF-8?q?update(arc-basic):=20pygal=20=E2=80=94=20co?= =?UTF-8?q?mprehensive=20quality=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comprehensive review and update of pygal implementation for arc-basic. --- plots/arc-basic/implementations/pygal.py | 42 +++++++++++------------- plots/arc-basic/metadata/pygal.yaml | 8 ++--- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/plots/arc-basic/implementations/pygal.py b/plots/arc-basic/implementations/pygal.py index 58689a03bf..e8f4a8ad58 100644 --- a/plots/arc-basic/implementations/pygal.py +++ b/plots/arc-basic/implementations/pygal.py @@ -1,7 +1,7 @@ -""" pyplots.ai +"""pyplots.ai arc-basic: Basic Arc Diagram -Library: pygal 3.1.0 | Python 3.13.11 -Quality: 94/100 | Created: 2025-12-17 +Library: pygal 3.1.0 | Python 3.14.3 +Quality: /100 | Updated: 2026-02-23 """ import math @@ -39,13 +39,16 @@ # Node positions along x-axis (1 to 10 range) x_positions = np.linspace(1, 10, n_nodes) -y_baseline = 1.0 +y_baseline = 0.5 -# Build color tuple: Python Blue for all arcs, Python Yellow for nodes +# Color palette: weight-based blue shades for arcs (lighter=weak, darker=strong) +arc_blues = {1: "#7BA7C9", 2: "#306998", 3: "#1B3F5C"} + +# Build colors tuple: one entry per edge series + node series n_edges = len(edges) -colors = tuple(["#306998"] * n_edges + ["#FFD43B"]) +colors = tuple([arc_blues[w] for _, _, w in edges] + ["#FFD43B"]) -# Custom style for the chart +# Custom style custom_style = Style( background="white", plot_background="white", @@ -59,7 +62,7 @@ legend_font_size=40, value_font_size=32, stroke_width=3, - opacity=0.65, + opacity=0.7, opacity_hover=1.0, ) @@ -79,16 +82,14 @@ stroke=True, dots_size=0, stroke_style={"width": 3, "linecap": "round"}, - range=(0, 6), + range=(0, 4.6), xrange=(0, 11), - x_labels=nodes, - x_labels_major_count=n_nodes, + x_labels=[{"value": float(x_positions[i]), "label": nodes[i]} for i in range(n_nodes)], truncate_label=-1, ) # Generate arc points for each edge -# Each arc is drawn as a series of points forming a semi-circle -arc_resolution = 30 # Number of points per arc +arc_resolution = 40 for start_idx, end_idx, weight in edges: x_start = x_positions[start_idx] @@ -98,19 +99,18 @@ x_center = (x_start + x_end) / 2 arc_radius = abs(x_end - x_start) / 2 - # Arc height proportional to the distance between nodes + # Arc height proportional to node distance distance = abs(end_idx - start_idx) height_scale = 0.4 * distance # Generate arc points (semi-circle above baseline) arc_points = [] for i in range(arc_resolution + 1): - theta = math.pi * i / arc_resolution # 0 to pi + theta = math.pi * i / arc_resolution x = x_center - arc_radius * math.cos(theta) y = y_baseline + height_scale * math.sin(theta) arc_points.append((x, y)) - # Line thickness based on weight chart.add( f"Arc {start_idx}-{end_idx}", arc_points, @@ -120,19 +120,15 @@ stroke_style={"width": 2 + weight * 2, "linecap": "round"}, ) -# Add nodes as a separate series (last, so uses Python Yellow) -node_points = [] -for i, name in enumerate(nodes): - x = x_positions[i] - node_points.append({"value": (x, y_baseline), "label": name}) - +# Add nodes as a separate series (last, uses Python Yellow) +node_points = [{"value": (float(x_positions[i]), y_baseline), "label": nodes[i]} for i in range(n_nodes)] chart.add("Characters", node_points, stroke=False, dots_size=35) # Save outputs chart.render_to_file("plot.svg") chart.render_to_png("plot.png") -# Also save HTML for interactive version +# Save HTML for interactive version with open("plot.html", "w") as f: f.write( """ diff --git a/plots/arc-basic/metadata/pygal.yaml b/plots/arc-basic/metadata/pygal.yaml index 835337c0f5..7fc03b61db 100644 --- a/plots/arc-basic/metadata/pygal.yaml +++ b/plots/arc-basic/metadata/pygal.yaml @@ -1,16 +1,16 @@ library: pygal specification_id: arc-basic created: 2025-12-17 10:58:08+00:00 -updated: 2025-12-17 10:58:08+00:00 -generated_by: claude-opus-4-5-20251101 +updated: '2026-02-23T12:00:00+00:00' +generated_by: claude-opus-4-6 workflow_run: 20300358253 issue: 991 -python_version: 3.13.11 +python_version: '3.14.3' library_version: 3.1.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot.html -quality_score: 94 +quality_score: null impl_tags: dependencies: [] techniques: From 0aba02928f0101c64d3506b64afd155ea5b81c66 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:34:25 +0000 Subject: [PATCH 2/8] chore(pygal): update quality score 79 and review feedback for arc-basic --- plots/arc-basic/implementations/pygal.py | 4 +- plots/arc-basic/metadata/pygal.yaml | 235 +++++++++++++++++++++-- 2 files changed, 217 insertions(+), 22 deletions(-) diff --git a/plots/arc-basic/implementations/pygal.py b/plots/arc-basic/implementations/pygal.py index e8f4a8ad58..2235b393f6 100644 --- a/plots/arc-basic/implementations/pygal.py +++ b/plots/arc-basic/implementations/pygal.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai arc-basic: Basic Arc Diagram Library: pygal 3.1.0 | Python 3.14.3 -Quality: /100 | Updated: 2026-02-23 +Quality: 79/100 | Created: 2026-02-23 """ import math diff --git a/plots/arc-basic/metadata/pygal.yaml b/plots/arc-basic/metadata/pygal.yaml index 7fc03b61db..2e72ecabe4 100644 --- a/plots/arc-basic/metadata/pygal.yaml +++ b/plots/arc-basic/metadata/pygal.yaml @@ -1,40 +1,235 @@ library: pygal specification_id: arc-basic created: 2025-12-17 10:58:08+00:00 -updated: '2026-02-23T12:00:00+00:00' +updated: '2026-02-23T21:34:25Z' generated_by: claude-opus-4-6 workflow_run: 20300358253 issue: 991 -python_version: '3.14.3' +python_version: 3.14.3 library_version: 3.1.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot.html -quality_score: null +quality_score: 79 impl_tags: dependencies: [] techniques: - html-export - - custom-legend patterns: - data-generation - iteration-over-groups - - matrix-construction dataprep: [] - styling: [] + styling: + - alpha-blending review: - strengths: [] - weaknesses: [] + strengths: + - Correct arc diagram implementation with all spec features (proportional height, + weight encoding, semi-transparency) + - Cohesive Python Blue/Yellow color palette with intentional weight-based color + hierarchy + - 'Perfect code quality: clean KISS structure, deterministic data, all imports used' + - Realistic neutral data context directly matching the spec suggested applications + - Multi-format output (SVG, PNG, HTML) leveraging pygal interactive capabilities + weaknesses: + - Visible y-axis spine artifact on the left edge of the plot area breaks the clean + design + - Arc weight differentiation is subtle — three blue shades too close and thickness + differences hard to distinguish + - No weight legend to help viewers understand arc color/thickness meaning + - Design lacks publication-level polish — needs more visual refinement and stronger + focal point improvements: [] - image_description: The plot displays an arc diagram with 10 character names (Alice, - Bob, Carol, David, Eve, Frank, Grace, Henry, Iris, Jack) arranged horizontally - along the bottom on a white background. Each character is represented by a yellow/gold - circular node (#FFD43B). The connections between characters are shown as blue - curved arcs (#306998) above the horizontal baseline. The arcs vary in height proportional - to the distance between connected nodes - longer-range connections (like Alice-Jack) - have higher arcs, while shorter-range connections (like Bob-Carol) have lower - arcs. Arc thickness varies based on connection weight, with stronger connections - appearing thicker. The title "Character Interactions · arc-basic · pygal · pyplots.ai" - is displayed at the top in blue. The arcs have semi-transparency allowing overlapping - arcs to be distinguishable. - verdict: APPROVED + image_description: 'The plot displays a basic arc diagram with 10 character nodes + (Alice, Bob, Carol, David, Eve, Frank, Grace, Henry, Iris, Jack) arranged as yellow + circular dots along a horizontal baseline. Curved arcs in varying shades of blue + connect pairs of nodes above the baseline, with arc height proportional to the + distance between connected nodes — the tallest arc spans from Alice to Jack (the + full width). Arc thickness and color darkness encode connection weight: heavier + connections (weight 3) are darker (#1B3F5C) and thicker, while lighter connections + (weight 1) are paler (#7BA7C9) and thinner. The title "Character Interactions + · arc-basic · pygal · pyplots.ai" appears at the top center. Node name labels + are positioned below the baseline. The background is white with no grid lines. + A subtle vertical line is visible along the left edge of the plot area (y-axis + spine artifact). No legend is shown.' + verdict: REJECTED + criteria_checklist: + visual_quality: + score: 25 + max: 30 + items: + - id: VQ-01 + name: Text Legibility + score: 8 + max: 8 + passed: true + comment: All font sizes explicitly set (title=72, labels=40, major_labels=40, + value=32), all clearly readable + - id: VQ-02 + name: No Overlap + score: 6 + max: 6 + passed: true + comment: No text collisions; node labels well-spaced; arc overlap handled + with semi-transparency + - id: VQ-03 + name: Element Visibility + score: 4 + max: 6 + passed: false + comment: Yellow nodes clearly visible; arc thickness differentiation between + weights is subtle (widths 4/6/8px), lighter arcs appear thin + - id: VQ-04 + name: Color Accessibility + score: 3 + max: 4 + passed: false + comment: Blue-yellow colorblind-safe; three blue shades close enough that + weight distinction is difficult + - id: VQ-05 + name: Layout & Canvas + score: 3 + max: 4 + passed: false + comment: Good horizontal distribution; visible y-axis spine artifact on left + edge detracts + - id: VQ-06 + name: Axis Labels & Title + score: 1 + max: 2 + passed: false + comment: Title format correct with descriptive prefix; no axis titles though + units not applicable for arc diagrams + design_excellence: + score: 11 + max: 20 + items: + - id: DE-01 + name: Aesthetic Sophistication + score: 5 + max: 8 + passed: false + comment: Cohesive Python Blue/Yellow palette with weight-based encoding; above + defaults but not publication-ready due to spine artifact and limited differentiation + - id: DE-02 + name: Visual Refinement + score: 3 + max: 6 + passed: false + comment: Grid removed, y-labels hidden, clean background; visible left border/spine + persists + - id: DE-03 + name: Data Storytelling + score: 3 + max: 6 + passed: false + comment: Weight-based thickness/color creates some hierarchy; Alice as hub + provides focal point; slightly above default + spec_compliance: + score: 14 + max: 15 + items: + - id: SC-01 + name: Plot Type + score: 5 + max: 5 + passed: true + comment: 'Correct arc diagram: nodes on horizontal line, curved arcs above + baseline' + - id: SC-02 + name: Required Features + score: 4 + max: 4 + passed: true + comment: 'All spec features present: proportional height, semi-transparency, + readable labels, weight encoding' + - id: SC-03 + name: Data Mapping + score: 3 + max: 3 + passed: true + comment: Nodes correctly positioned; arcs connect correct pairs; heights proportional + to distance + - id: SC-04 + name: Title & Legend + score: 2 + max: 3 + passed: false + comment: Title format correct; legend hidden (reasonable for 15 series) but + no weight legend + data_quality: + score: 14 + max: 15 + items: + - id: DQ-01 + name: Feature Coverage + score: 5 + max: 6 + passed: false + comment: Shows short/medium/long-range connections, three weight levels, varying + connectivity; could benefit from more extreme density contrast + - id: DQ-02 + name: Realistic Context + score: 5 + max: 5 + passed: true + comment: Character interactions in a story chapter — directly matches spec + application; neutral scenario + - id: DQ-03 + name: Appropriate Scale + score: 4 + max: 4 + passed: true + comment: 10 nodes within recommended range; 15 edges reasonable; weights 1-3 + sensible + code_quality: + score: 10 + max: 10 + items: + - id: CQ-01 + name: KISS Structure + score: 3 + max: 3 + passed: true + comment: Flat structure with appropriate loop for arc generation; no functions/classes + - id: CQ-02 + name: Reproducibility + score: 2 + max: 2 + passed: true + comment: np.random.seed(42) set; data is deterministic + - id: CQ-03 + name: Clean Imports + score: 2 + max: 2 + passed: true + comment: 'All imports used: math, numpy, pygal, Style' + - id: CQ-04 + name: Code Elegance + score: 2 + max: 2 + passed: true + comment: Clean, well-organized; no over-engineering or fake functionality + - id: CQ-05 + name: Output & API + score: 1 + max: 1 + passed: true + comment: Saves plot.png via render_to_png; also SVG and HTML; current API + library_mastery: + score: 5 + max: 10 + items: + - id: LM-01 + name: Idiomatic Usage + score: 3 + max: 5 + passed: false + comment: Uses pygal.XY() with Style, chart.add(), x_labels dicts — idiomatic; + arc diagram is workaround since no native arc chart + - id: LM-02 + name: Distinctive Features + score: 2 + max: 5 + passed: false + comment: Interactive SVG with opacity_hover, HTML export, multi-format output + — leverages pygal strengths but core viz not uniquely pygal From cfc6ef5fc4e22bbdd0ba7809b2c3817580a7cb1b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:42:04 +0000 Subject: [PATCH 3/8] fix(pygal): address review feedback for arc-basic Attempt 1/3 - fixes based on AI review --- plots/arc-basic/implementations/pygal.py | 82 +++++++++++++++++------- 1 file changed, 60 insertions(+), 22 deletions(-) diff --git a/plots/arc-basic/implementations/pygal.py b/plots/arc-basic/implementations/pygal.py index 2235b393f6..f9bc49b208 100644 --- a/plots/arc-basic/implementations/pygal.py +++ b/plots/arc-basic/implementations/pygal.py @@ -1,4 +1,4 @@ -""" pyplots.ai +"""pyplots.ai arc-basic: Basic Arc Diagram Library: pygal 3.1.0 | Python 3.14.3 Quality: 79/100 | Created: 2026-02-23 @@ -41,38 +41,51 @@ x_positions = np.linspace(1, 10, n_nodes) y_baseline = 0.5 -# Color palette: weight-based blue shades for arcs (lighter=weak, darker=strong) -arc_blues = {1: "#7BA7C9", 2: "#306998", 3: "#1B3F5C"} +# Color palette: wider range for clear weight differentiation +arc_colors = {1: "#A8D0E6", 2: "#306998", 3: "#0D2137"} -# Build colors tuple: one entry per edge series + node series -n_edges = len(edges) -colors = tuple([arc_blues[w] for _, _, w in edges] + ["#FFD43B"]) +# Thickness: wider range for immediate visual distinction +arc_widths = {1: 3, 2: 8, 3: 14} -# Custom style +# Weight labels for tooltip context +weight_labels = {1: "Weak", 2: "Moderate", 3: "Strong"} + +# Build colors tuple: one entry per edge + 3 legend entries + node series +colors = tuple( + [arc_colors[w] for _, _, w in edges] + + [arc_colors[3], arc_colors[2], arc_colors[1]] # Legend entries + + ["#FFD43B"] # Node color +) + +# Custom style — clean white background, no borders custom_style = Style( background="white", plot_background="white", foreground="#333333", foreground_strong="#306998", - foreground_subtle="#666666", + foreground_subtle="transparent", colors=colors, title_font_size=72, label_font_size=40, major_label_font_size=40, - legend_font_size=40, + legend_font_size=36, value_font_size=32, stroke_width=3, opacity=0.7, opacity_hover=1.0, ) -# Create XY chart +# Create XY chart — fill=False prevents area filling under arcs chart = pygal.XY( width=4800, height=2700, style=custom_style, + fill=False, title="Character Interactions · arc-basic · pygal · pyplots.ai", - show_legend=False, + show_legend=True, + legend_at_bottom=True, + legend_at_bottom_columns=3, + legend_box_size=24, x_title="", y_title="", show_x_guides=False, @@ -86,10 +99,21 @@ xrange=(0, 11), x_labels=[{"value": float(x_positions[i]), "label": nodes[i]} for i in range(n_nodes)], truncate_label=-1, + css=[ + "file://style.css", + "inline:.plot .background {fill: white; stroke: none !important;}", + "inline:.axis .line {stroke: none !important;}", + "inline:.axis .guides .line {stroke: none !important;}", + "inline:.plot .axis {stroke: none !important;}", + "inline:.series .line {fill: none !important;}", + # Hide edge series (1-15) and node series (19) from legend, keep weight legend (16-18) + "inline:.legends > g:nth-child(-n+15), .legends > g:nth-child(n+19) {display: none !important;}", + ], + js=[], ) -# Generate arc points for each edge -arc_resolution = 40 +# Generate arc points for each edge (empty title hides from legend) +arc_resolution = 50 for start_idx, end_idx, weight in edges: x_start = x_positions[start_idx] @@ -109,26 +133,40 @@ theta = math.pi * i / arc_resolution x = x_center - arc_radius * math.cos(theta) y = y_baseline + height_scale * math.sin(theta) - arc_points.append((x, y)) + arc_points.append( + {"value": (x, y), "label": f"{nodes[start_idx]} ↔ {nodes[end_idx]} ({weight_labels[weight]})"} + ) + # Empty title "" hides this series from the legend chart.add( - f"Arc {start_idx}-{end_idx}", - arc_points, + "", arc_points, stroke=True, show_dots=False, stroke_style={"width": arc_widths[weight], "linecap": "round"} + ) + +# Add weight legend entries (visible in legend, minimal data) +for w_val, w_label in [(3, "Strong"), (2, "Moderate"), (1, "Weak")]: + chart.add( + f"{w_label} connection", + [None], stroke=True, show_dots=False, - fill=False, - stroke_style={"width": 2 + weight * 2, "linecap": "round"}, + stroke_style={"width": arc_widths[w_val], "linecap": "round"}, ) -# Add nodes as a separate series (last, uses Python Yellow) -node_points = [{"value": (float(x_positions[i]), y_baseline), "label": nodes[i]} for i in range(n_nodes)] +# Add nodes as final series (Python Yellow dots) +node_points = [ + { + "value": (float(x_positions[i]), y_baseline), + "label": f"{nodes[i]} ({sum(1 for s, t, _ in edges if s == i or t == i)} connections)", + } + for i in range(n_nodes) +] chart.add("Characters", node_points, stroke=False, dots_size=35) # Save outputs chart.render_to_file("plot.svg") chart.render_to_png("plot.png") -# Save HTML for interactive version +# Save HTML for interactive version with hover tooltips with open("plot.html", "w") as f: f.write( """ @@ -136,7 +174,7 @@ Character Interactions · arc-basic · pygal · pyplots.ai From 351a2c9fc7796bf7eb25020ec5d9abc9fd41a753 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:48:34 +0000 Subject: [PATCH 4/8] chore(pygal): update quality score 84 and review feedback for arc-basic --- plots/arc-basic/implementations/pygal.py | 4 +- plots/arc-basic/metadata/pygal.yaml | 175 ++++++++++++----------- 2 files changed, 90 insertions(+), 89 deletions(-) diff --git a/plots/arc-basic/implementations/pygal.py b/plots/arc-basic/implementations/pygal.py index f9bc49b208..22ecd053b9 100644 --- a/plots/arc-basic/implementations/pygal.py +++ b/plots/arc-basic/implementations/pygal.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai arc-basic: Basic Arc Diagram Library: pygal 3.1.0 | Python 3.14.3 -Quality: 79/100 | Created: 2026-02-23 +Quality: 84/100 | Created: 2026-02-23 """ import math diff --git a/plots/arc-basic/metadata/pygal.yaml b/plots/arc-basic/metadata/pygal.yaml index 2e72ecabe4..30598de1f5 100644 --- a/plots/arc-basic/metadata/pygal.yaml +++ b/plots/arc-basic/metadata/pygal.yaml @@ -1,7 +1,7 @@ library: pygal specification_id: arc-basic created: 2025-12-17 10:58:08+00:00 -updated: '2026-02-23T21:34:25Z' +updated: '2026-02-23T21:48:33Z' generated_by: claude-opus-4-6 workflow_run: 20300358253 issue: 991 @@ -10,47 +10,49 @@ library_version: 3.1.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot.html -quality_score: 79 +quality_score: 84 impl_tags: dependencies: [] techniques: + - custom-legend - html-export patterns: - data-generation - iteration-over-groups dataprep: [] styling: + - minimal-chrome - alpha-blending review: strengths: - - Correct arc diagram implementation with all spec features (proportional height, - weight encoding, semi-transparency) - - Cohesive Python Blue/Yellow color palette with intentional weight-based color - hierarchy - - 'Perfect code quality: clean KISS structure, deterministic data, all imports used' - - Realistic neutral data context directly matching the spec suggested applications - - Multi-format output (SVG, PNG, HTML) leveraging pygal interactive capabilities + - 'Perfect spec compliance: all required arc diagram features implemented correctly' + - Clean, well-structured code with excellent KISS adherence and full 10/10 code + quality + - Effective dual-encoding of weight through both color intensity and line width + - Clever use of pygal CSS inline styling to create clean, minimal chrome + - Good data storytelling through visual hierarchy with strong connections standing + out weaknesses: - - Visible y-axis spine artifact on the left edge of the plot area breaks the clean - design - - Arc weight differentiation is subtle — three blue shades too close and thickness - differences hard to distinguish - - No weight legend to help viewers understand arc color/thickness meaning - - Design lacks publication-level polish — needs more visual refinement and stronger - focal point + - Weak connections (#A8D0E6 at 3px width, 0.7 opacity) nearly invisible against + white background + - Lightest blue shade provides insufficient contrast for effective color differentiation + - Title right-aligned by pygal default rather than centered or left-aligned + - Design polish good but not yet publication-quality sophistication improvements: [] - image_description: 'The plot displays a basic arc diagram with 10 character nodes - (Alice, Bob, Carol, David, Eve, Frank, Grace, Henry, Iris, Jack) arranged as yellow - circular dots along a horizontal baseline. Curved arcs in varying shades of blue - connect pairs of nodes above the baseline, with arc height proportional to the - distance between connected nodes — the tallest arc spans from Alice to Jack (the - full width). Arc thickness and color darkness encode connection weight: heavier - connections (weight 3) are darker (#1B3F5C) and thicker, while lighter connections - (weight 1) are paler (#7BA7C9) and thinner. The title "Character Interactions - · arc-basic · pygal · pyplots.ai" appears at the top center. Node name labels - are positioned below the baseline. The background is white with no grid lines. - A subtle vertical line is visible along the left edge of the plot area (y-axis - spine artifact). No legend is shown.' + image_description: 'The plot displays an arc diagram with 10 character nodes (Alice, + Bob, Carol, David, Eve, Frank, Grace, Henry, Iris, Jack) arranged as yellow/gold + dots along a horizontal baseline. Curved arcs above the baseline connect pairs + of characters. Arc height is proportional to the distance between connected nodes + — the Alice-Jack arc spans the full width and reaches the top of the plot, while + adjacent-node arcs (e.g., Alice-Bob) form small, tight curves near the baseline. + Three weight levels are encoded via both color intensity and line width: Strong + connections appear as thick, dark navy arcs; Moderate connections as medium-blue, + mid-weight arcs; Weak connections as thin, very light blue arcs. The title "Character + Interactions · arc-basic · pygal · pyplots.ai" appears at the top right in a monospace + font. Node labels are positioned below the baseline. A three-item legend at the + bottom shows "Strong connection", "Moderate connection", and "Weak connection" + with corresponding color squares. The background is clean white with no grid lines + or axis borders visible.' verdict: REJECTED criteria_checklist: visual_quality: @@ -59,73 +61,72 @@ review: items: - id: VQ-01 name: Text Legibility - score: 8 + score: 7 max: 8 passed: true - comment: All font sizes explicitly set (title=72, labels=40, major_labels=40, - value=32), all clearly readable + comment: Font sizes explicitly set (title=72, label=40, legend=36, value=32); + all text readable; legend text slightly small relative to canvas - id: VQ-02 name: No Overlap score: 6 max: 6 passed: true - comment: No text collisions; node labels well-spaced; arc overlap handled - with semi-transparency + comment: No text collisions; node labels well-spaced; arcs overlap naturally + as expected - id: VQ-03 name: Element Visibility score: 4 max: 6 passed: false - comment: Yellow nodes clearly visible; arc thickness differentiation between - weights is subtle (widths 4/6/8px), lighter arcs appear thin + comment: Weak connections (#A8D0E6 at 0.7 opacity with 3px stroke) very faint + against white background - id: VQ-04 name: Color Accessibility score: 3 max: 4 - passed: false - comment: Blue-yellow colorblind-safe; three blue shades close enough that - weight distinction is difficult + passed: true + comment: Blue monochromatic palette is colorblind-safe; lightest shade too + close to white - id: VQ-05 name: Layout & Canvas score: 3 max: 4 - passed: false - comment: Good horizontal distribution; visible y-axis spine artifact on left - edge detracts + passed: true + comment: Good layout; title right-aligned (pygal default); some unused space + below legend - id: VQ-06 name: Axis Labels & Title - score: 1 + score: 2 max: 2 - passed: false - comment: Title format correct with descriptive prefix; no axis titles though - units not applicable for arc diagrams + passed: true + comment: Descriptive title with context; node labels appropriate for arc diagram design_excellence: - score: 11 + score: 13 max: 20 items: - id: DE-01 name: Aesthetic Sophistication score: 5 max: 8 - passed: false - comment: Cohesive Python Blue/Yellow palette with weight-based encoding; above - defaults but not publication-ready due to spine artifact and limited differentiation + passed: true + comment: Custom three-tone blue palette with yellow node contrast; clean CSS-driven + minimal chrome; above defaults but not publication-level - id: DE-02 name: Visual Refinement - score: 3 + score: 4 max: 6 - passed: false - comment: Grid removed, y-labels hidden, clean background; visible left border/spine - persists + passed: true + comment: Grid/axes/borders hidden via CSS; clean white background; good whitespace; + effective chrome removal - id: DE-03 name: Data Storytelling - score: 3 + score: 4 max: 6 - passed: false - comment: Weight-based thickness/color creates some hierarchy; Alice as hub - provides focal point; slightly above default + passed: true + comment: Weight dual-encoded via color+width creates visual hierarchy; arc + height shows distance; hub characters identifiable spec_compliance: - score: 14 + score: 15 max: 15 items: - id: SC-01 @@ -133,29 +134,28 @@ review: score: 5 max: 5 passed: true - comment: 'Correct arc diagram: nodes on horizontal line, curved arcs above - baseline' + comment: 'Correct arc diagram: nodes on horizontal line, curved arcs above' - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: 'All spec features present: proportional height, semi-transparency, - readable labels, weight encoding' + comment: 'All spec features present: arcs above axis, height proportional, + semi-transparent, color-coded, readable labels' - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: Nodes correctly positioned; arcs connect correct pairs; heights proportional - to distance + comment: 10 nodes correctly positioned; 15 edges correctly rendered; weights + mapped to color and width - id: SC-04 name: Title & Legend - score: 2 + score: 3 max: 3 - passed: false - comment: Title format correct; legend hidden (reasonable for 15 series) but - no weight legend + passed: true + comment: Title follows format with descriptive prefix; legend shows three + weight categories data_quality: score: 14 max: 15 @@ -164,22 +164,21 @@ review: name: Feature Coverage score: 5 max: 6 - passed: false - comment: Shows short/medium/long-range connections, three weight levels, varying - connectivity; could benefit from more extreme density contrast + passed: true + comment: Shows short/long range connections, three weight levels, hub nodes; + could include isolated node - id: DQ-02 name: Realistic Context score: 5 max: 5 passed: true - comment: Character interactions in a story chapter — directly matches spec - application; neutral scenario + comment: Character interactions in a story chapter — realistic, neutral, comprehensible - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: 10 nodes within recommended range; 15 edges reasonable; weights 1-3 + comment: 10 nodes within spec range; 15 edges good density; 3 weight levels sensible code_quality: score: 10 @@ -190,13 +189,14 @@ review: score: 3 max: 3 passed: true - comment: Flat structure with appropriate loop for arc generation; no functions/classes + comment: 'Linear flow: imports, data, style, chart config, arc loop, legend, + nodes, save' - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: np.random.seed(42) set; data is deterministic + comment: np.random.seed(42) set; data is fully deterministic - id: CQ-03 name: Clean Imports score: 2 @@ -208,28 +208,29 @@ review: score: 2 max: 2 passed: true - comment: Clean, well-organized; no over-engineering or fake functionality + comment: Clean arc generation loop; CSS-based chrome removal; no fake functionality - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Saves plot.png via render_to_png; also SVG and HTML; current API + comment: Saves plot.png via render_to_png(); also outputs SVG and HTML; current + API library_mastery: - score: 5 + score: 7 max: 10 items: - id: LM-01 name: Idiomatic Usage - score: 3 + score: 4 max: 5 - passed: false - comment: Uses pygal.XY() with Style, chart.add(), x_labels dicts — idiomatic; - arc diagram is workaround since no native arc chart + passed: true + comment: Good use of pygal.XY, Style(), CSS customization, x_labels with value/label + dicts - id: LM-02 name: Distinctive Features - score: 2 + score: 3 max: 5 - passed: false - comment: Interactive SVG with opacity_hover, HTML export, multi-format output - — leverages pygal strengths but core viz not uniquely pygal + passed: true + comment: CSS inline styling and selective legend hiding via nth-child are + pygal-distinctive features From 9de1d9a9279bb3e2ac7de9057e9b942a1df37e01 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:53:48 +0000 Subject: [PATCH 5/8] fix(pygal): address review feedback for arc-basic Attempt 2/3 - fixes based on AI review --- plots/arc-basic/implementations/pygal.py | 32 +++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/plots/arc-basic/implementations/pygal.py b/plots/arc-basic/implementations/pygal.py index 22ecd053b9..32601bf514 100644 --- a/plots/arc-basic/implementations/pygal.py +++ b/plots/arc-basic/implementations/pygal.py @@ -1,4 +1,4 @@ -""" pyplots.ai +"""pyplots.ai arc-basic: Basic Arc Diagram Library: pygal 3.1.0 | Python 3.14.3 Quality: 84/100 | Created: 2026-02-23 @@ -41,20 +41,21 @@ x_positions = np.linspace(1, 10, n_nodes) y_baseline = 0.5 -# Color palette: wider range for clear weight differentiation -arc_colors = {1: "#A8D0E6", 2: "#306998", 3: "#0D2137"} +# Color palette: all three levels clearly distinguishable against white +arc_colors = {1: "#4292C6", 2: "#2171B5", 3: "#08306B"} # Thickness: wider range for immediate visual distinction -arc_widths = {1: 3, 2: 8, 3: 14} +arc_widths = {1: 6, 2: 10, 3: 16} # Weight labels for tooltip context weight_labels = {1: "Weak", 2: "Moderate", 3: "Strong"} -# Build colors tuple: one entry per edge + 3 legend entries + node series +# Build colors tuple: one entry per edge + 3 legend entries + node outline + node fill colors = tuple( [arc_colors[w] for _, _, w in edges] + [arc_colors[3], arc_colors[2], arc_colors[1]] # Legend entries - + ["#FFD43B"] # Node color + + ["#B8860B"] # Node outline (dark goldenrod) + + ["#FFD43B"] # Node fill (Python Yellow) ) # Custom style — clean white background, no borders @@ -62,16 +63,16 @@ background="white", plot_background="white", foreground="#333333", - foreground_strong="#306998", + foreground_strong="#08306B", foreground_subtle="transparent", colors=colors, title_font_size=72, label_font_size=40, major_label_font_size=40, - legend_font_size=36, + legend_font_size=40, value_font_size=32, stroke_width=3, - opacity=0.7, + opacity=0.85, opacity_hover=1.0, ) @@ -85,7 +86,7 @@ show_legend=True, legend_at_bottom=True, legend_at_bottom_columns=3, - legend_box_size=24, + legend_box_size=30, x_title="", y_title="", show_x_guides=False, @@ -94,7 +95,7 @@ show_y_labels=False, stroke=True, dots_size=0, - stroke_style={"width": 3, "linecap": "round"}, + stroke_style={"width": 6, "linecap": "round"}, range=(0, 4.6), xrange=(0, 11), x_labels=[{"value": float(x_positions[i]), "label": nodes[i]} for i in range(n_nodes)], @@ -106,7 +107,7 @@ "inline:.axis .guides .line {stroke: none !important;}", "inline:.plot .axis {stroke: none !important;}", "inline:.series .line {fill: none !important;}", - # Hide edge series (1-15) and node series (19) from legend, keep weight legend (16-18) + # Hide edge series (1-15) and node series (19-20) from legend, keep weight legend (16-18) "inline:.legends > g:nth-child(-n+15), .legends > g:nth-child(n+19) {display: none !important;}", ], js=[], @@ -152,7 +153,7 @@ stroke_style={"width": arc_widths[w_val], "linecap": "round"}, ) -# Add nodes as final series (Python Yellow dots) +# Add node outline ring (dark goldenrod border effect) node_points = [ { "value": (float(x_positions[i]), y_baseline), @@ -160,7 +161,10 @@ } for i in range(n_nodes) ] -chart.add("Characters", node_points, stroke=False, dots_size=35) +chart.add("", node_points, stroke=False, dots_size=42) + +# Add node fill on top (Python Yellow) +chart.add("Characters", node_points, stroke=False, dots_size=32) # Save outputs chart.render_to_file("plot.svg") From 4c05ab4c3012b415bda47dcdb27149c7b8b01b7a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 22:00:01 +0000 Subject: [PATCH 6/8] chore(pygal): update quality score 80 and review feedback for arc-basic --- plots/arc-basic/implementations/pygal.py | 4 +- plots/arc-basic/metadata/pygal.yaml | 160 ++++++++++++----------- 2 files changed, 83 insertions(+), 81 deletions(-) diff --git a/plots/arc-basic/implementations/pygal.py b/plots/arc-basic/implementations/pygal.py index 32601bf514..0997155c5a 100644 --- a/plots/arc-basic/implementations/pygal.py +++ b/plots/arc-basic/implementations/pygal.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai arc-basic: Basic Arc Diagram Library: pygal 3.1.0 | Python 3.14.3 -Quality: 84/100 | Created: 2026-02-23 +Quality: 80/100 | Created: 2026-02-23 """ import math diff --git a/plots/arc-basic/metadata/pygal.yaml b/plots/arc-basic/metadata/pygal.yaml index 30598de1f5..74d162c250 100644 --- a/plots/arc-basic/metadata/pygal.yaml +++ b/plots/arc-basic/metadata/pygal.yaml @@ -1,7 +1,7 @@ library: pygal specification_id: arc-basic created: 2025-12-17 10:58:08+00:00 -updated: '2026-02-23T21:48:33Z' +updated: '2026-02-23T22:00:01Z' generated_by: claude-opus-4-6 workflow_run: 20300358253 issue: 991 @@ -10,7 +10,7 @@ library_version: 3.1.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot.html -quality_score: 84 +quality_score: 80 impl_tags: dependencies: [] techniques: @@ -23,40 +23,41 @@ impl_tags: styling: - minimal-chrome - alpha-blending + - edge-highlighting review: strengths: - - 'Perfect spec compliance: all required arc diagram features implemented correctly' - - Clean, well-structured code with excellent KISS adherence and full 10/10 code - quality - - Effective dual-encoding of weight through both color intensity and line width - - Clever use of pygal CSS inline styling to create clean, minimal chrome - - Good data storytelling through visual hierarchy with strong connections standing - out + - Full spec compliance with all required features implemented (arc height proportional + to distance, weight encoding, semi-transparency) + - Clean visual design with removed axes/grid via CSS, white background, and good + canvas utilization + - Creative use of pygal.XY chart type for custom arc diagram rendering + - Thoughtful node design with dual-layer yellow fill and goldenrod outline + - Interactive HTML export leveraging pygal native SVG capabilities + - Proper legend with weight category labels weaknesses: - - Weak connections (#A8D0E6 at 3px width, 0.7 opacity) nearly invisible against - white background - - Lightest blue shade provides insufficient contrast for effective color differentiation - - Title right-aligned by pygal default rather than centered or left-aligned - - Design polish good but not yet publication-quality sophistication + - Arc weight differentiation (thickness and color shade) remains subtle in the rendered + output — the three levels do not create strong immediate visual distinction + - Blue monochromatic palette does not maximize contrast between weight categories + - Title right-aligned by pygal default rather than centered + - Complex CSS nth-child selectors for legend visibility control add code complexity improvements: [] - image_description: 'The plot displays an arc diagram with 10 character nodes (Alice, - Bob, Carol, David, Eve, Frank, Grace, Henry, Iris, Jack) arranged as yellow/gold - dots along a horizontal baseline. Curved arcs above the baseline connect pairs - of characters. Arc height is proportional to the distance between connected nodes - — the Alice-Jack arc spans the full width and reaches the top of the plot, while - adjacent-node arcs (e.g., Alice-Bob) form small, tight curves near the baseline. - Three weight levels are encoded via both color intensity and line width: Strong - connections appear as thick, dark navy arcs; Moderate connections as medium-blue, - mid-weight arcs; Weak connections as thin, very light blue arcs. The title "Character - Interactions · arc-basic · pygal · pyplots.ai" appears at the top right in a monospace - font. Node labels are positioned below the baseline. A three-item legend at the - bottom shows "Strong connection", "Moderate connection", and "Weak connection" - with corresponding color squares. The background is clean white with no grid lines - or axis borders visible.' - verdict: REJECTED + image_description: 'The plot displays a basic arc diagram with 10 character nodes + (Alice through Jack) arranged along a horizontal baseline near the bottom of the + canvas. Each node is rendered as a yellow circle with a dark goldenrod outline. + Curved blue arcs connect pairs of nodes above the baseline, with arc height proportional + to the distance between connected nodes — the tallest arc spans Alice to Jack + (the full width). Arcs use a blue monochromatic palette with three shades: dark + navy (#08306B) for strong connections, medium blue (#2171B5) for moderate, and + lighter blue (#4292C6) for weak, with corresponding thickness variation (thickest + for strong). The title "Character Interactions · arc-basic · pygal · pyplots.ai" + appears at the top right in dark navy text. Node labels appear below the baseline. + A bottom legend shows "Strong connection", "Moderate connection", and "Weak connection" + with colored squares. The background is clean white with no grid lines or axis + borders.' + verdict: APPROVED criteria_checklist: visual_quality: - score: 25 + score: 24 max: 30 items: - id: VQ-01 @@ -64,44 +65,44 @@ review: score: 7 max: 8 passed: true - comment: Font sizes explicitly set (title=72, label=40, legend=36, value=32); - all text readable; legend text slightly small relative to canvas + comment: Font sizes explicitly set (title=72, labels=40, legend=40, value=32). + All text clearly readable. - id: VQ-02 name: No Overlap score: 6 max: 6 passed: true - comment: No text collisions; node labels well-spaced; arcs overlap naturally - as expected + comment: No text overlap anywhere. Node labels well-spaced. - id: VQ-03 name: Element Visibility score: 4 max: 6 passed: false - comment: Weak connections (#A8D0E6 at 0.7 opacity with 3px stroke) very faint - against white background + comment: Arcs and nodes visible, but three weight levels (thickness 6/10/16 + and three blue shades) not strongly differentiated in rendered output. - id: VQ-04 name: Color Accessibility score: 3 max: 4 passed: true - comment: Blue monochromatic palette is colorblind-safe; lightest shade too - close to white + comment: Blue monochromatic palette is colorblind-safe. Yellow nodes good + contrast. Three blue shades lack sufficient mutual contrast. - id: VQ-05 name: Layout & Canvas score: 3 max: 4 passed: true - comment: Good layout; title right-aligned (pygal default); some unused space - below legend + comment: Good canvas utilization. Title right-aligned creating slight imbalance + with empty top-left. - id: VQ-06 name: Axis Labels & Title - score: 2 + score: 1 max: 2 passed: true - comment: Descriptive title with context; node labels appropriate for arc diagram + comment: Descriptive title with correct format. No axis titles, appropriate + for arc diagram. design_excellence: - score: 13 + score: 12 max: 20 items: - id: DE-01 @@ -109,22 +110,22 @@ review: score: 5 max: 8 passed: true - comment: Custom three-tone blue palette with yellow node contrast; clean CSS-driven - minimal chrome; above defaults but not publication-level + comment: Custom blue palette, yellow node accents with goldenrod outlines, + clean white background. Above defaults but not publication-level. - id: DE-02 name: Visual Refinement score: 4 max: 6 passed: true - comment: Grid/axes/borders hidden via CSS; clean white background; good whitespace; - effective chrome removal + comment: Axes, grid, borders removed via CSS. Clean background with generous + whitespace. Node outlines add polish. - id: DE-03 name: Data Storytelling - score: 4 + score: 3 max: 6 - passed: true - comment: Weight dual-encoded via color+width creates visual hierarchy; arc - height shows distance; hub characters identifiable + passed: false + comment: Weight encoding provides some hierarchy. Alice emerges as hub. Subtle + differences don't create immediately obvious narrative. spec_compliance: score: 15 max: 15 @@ -134,30 +135,30 @@ review: score: 5 max: 5 passed: true - comment: 'Correct arc diagram: nodes on horizontal line, curved arcs above' + comment: 'Correct arc diagram: nodes along horizontal line, curved arcs above.' - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: 'All spec features present: arcs above axis, height proportional, - semi-transparent, color-coded, readable labels' + comment: 'All spec features present: nodes, arcs, height proportional to distance, + semi-transparency, color coding, thickness by weight.' - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: 10 nodes correctly positioned; 15 edges correctly rendered; weights - mapped to color and width + comment: Nodes correctly positioned, arcs connect correct pairs, heights proportional + to distance. - id: SC-04 name: Title & Legend score: 3 max: 3 passed: true - comment: Title follows format with descriptive prefix; legend shows three - weight categories + comment: Title format correct. Legend labels (Strong/Moderate/Weak connection) + match data encoding. data_quality: - score: 14 + score: 13 max: 15 items: - id: DQ-01 @@ -165,23 +166,24 @@ review: score: 5 max: 6 passed: true - comment: Shows short/long range connections, three weight levels, hub nodes; - could include isolated node + comment: 'Good variety: short and long-range connections, three weight levels, + varying node connectivity, crossing arcs.' - id: DQ-02 name: Realistic Context - score: 5 + score: 4 max: 5 passed: true - comment: Character interactions in a story chapter — realistic, neutral, comprehensible + comment: Character interactions in a story chapter - plausible real-world + scenario matching spec applications. - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: 10 nodes within spec range; 15 edges good density; 3 weight levels - sensible + comment: 10 nodes within recommended range, 15 edges good density, weights + 1-3 appropriate. code_quality: - score: 10 + score: 9 max: 10 items: - id: CQ-01 @@ -189,33 +191,33 @@ review: score: 3 max: 3 passed: true - comment: 'Linear flow: imports, data, style, chart config, arc loop, legend, - nodes, save' + comment: 'Linear flow: imports, data, style, chart, arcs, nodes, save. No + functions or classes.' - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: np.random.seed(42) set; data is fully deterministic + comment: np.random.seed(42) set, data is deterministic. - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: 'All imports used: math, numpy, pygal, Style' + comment: 'All imports used: math, numpy, pygal, Style.' - id: CQ-04 name: Code Elegance - score: 2 + score: 1 max: 2 - passed: true - comment: Clean arc generation loop; CSS-based chrome removal; no fake functionality + passed: false + comment: Complex CSS nth-child selectors for legend management. Intricate + colors tuple construction. - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Saves plot.png via render_to_png(); also outputs SVG and HTML; current - API + comment: Saves plot.png, plot.svg, plot.html. Current pygal API. library_mastery: score: 7 max: 10 @@ -225,12 +227,12 @@ review: score: 4 max: 5 passed: true - comment: Good use of pygal.XY, Style(), CSS customization, x_labels with value/label - dicts + comment: Creative use of pygal.XY for custom coordinate plotting. Proper use + of Style, chart.add, render methods. - id: LM-02 name: Distinctive Features score: 3 max: 5 passed: true - comment: CSS inline styling and selective legend hiding via nth-child are - pygal-distinctive features + comment: Uses pygal CSS injection, custom x_labels with dicts, SVG-native + rendering, interactive HTML export. From 8c7f20f9497209dcd5769cf74de8e840feb647ef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 22:04:48 +0000 Subject: [PATCH 7/8] fix(pygal): address review feedback for arc-basic Attempt 3/3 - fixes based on AI review --- plots/arc-basic/implementations/pygal.py | 48 ++++++++++++------------ 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/plots/arc-basic/implementations/pygal.py b/plots/arc-basic/implementations/pygal.py index 0997155c5a..ad03c48867 100644 --- a/plots/arc-basic/implementations/pygal.py +++ b/plots/arc-basic/implementations/pygal.py @@ -1,4 +1,4 @@ -""" pyplots.ai +"""pyplots.ai arc-basic: Basic Arc Diagram Library: pygal 3.1.0 | Python 3.14.3 Quality: 80/100 | Created: 2026-02-23 @@ -41,21 +41,20 @@ x_positions = np.linspace(1, 10, n_nodes) y_baseline = 0.5 -# Color palette: all three levels clearly distinguishable against white -arc_colors = {1: "#4292C6", 2: "#2171B5", 3: "#08306B"} +# Color palette: distinct hues for immediate weight differentiation (colorblind-safe) +arc_colors = {1: "#93C5E8", 2: "#D4770B", 3: "#08306B"} -# Thickness: wider range for immediate visual distinction -arc_widths = {1: 6, 2: 10, 3: 16} +# Thickness: wide range for immediate visual distinction +arc_widths = {1: 4, 2: 12, 3: 22} # Weight labels for tooltip context weight_labels = {1: "Weak", 2: "Moderate", 3: "Strong"} -# Build colors tuple: one entry per edge + 3 legend entries + node outline + node fill +# Build colors tuple: legend entries first, then edges, then nodes colors = tuple( - [arc_colors[w] for _, _, w in edges] - + [arc_colors[3], arc_colors[2], arc_colors[1]] # Legend entries - + ["#B8860B"] # Node outline (dark goldenrod) - + ["#FFD43B"] # Node fill (Python Yellow) + [arc_colors[3], arc_colors[2], arc_colors[1]] # Legend (series 1-3) + + [arc_colors[w] for _, _, w in edges] # Edges (series 4-18) + + ["#B8860B", "#FFD43B"] # Node outline + fill ) # Custom style — clean white background, no borders @@ -107,13 +106,23 @@ "inline:.axis .guides .line {stroke: none !important;}", "inline:.plot .axis {stroke: none !important;}", "inline:.series .line {fill: none !important;}", - # Hide edge series (1-15) and node series (19-20) from legend, keep weight legend (16-18) - "inline:.legends > g:nth-child(-n+15), .legends > g:nth-child(n+19) {display: none !important;}", + # Hide all legend entries after the 3 weight categories + "inline:.legends > g:nth-child(n+4) {display: none !important;}", ], js=[], ) -# Generate arc points for each edge (empty title hides from legend) +# Add weight legend entries first (series 1-3, visible in legend) +for w_val, w_label in [(3, "Strong"), (2, "Moderate"), (1, "Weak")]: + chart.add( + f"{w_label} connection", + [None], + stroke=True, + show_dots=False, + stroke_style={"width": arc_widths[w_val], "linecap": "round"}, + ) + +# Generate arc points for each edge arc_resolution = 50 for start_idx, end_idx, weight in edges: @@ -138,21 +147,10 @@ {"value": (x, y), "label": f"{nodes[start_idx]} ↔ {nodes[end_idx]} ({weight_labels[weight]})"} ) - # Empty title "" hides this series from the legend chart.add( "", arc_points, stroke=True, show_dots=False, stroke_style={"width": arc_widths[weight], "linecap": "round"} ) -# Add weight legend entries (visible in legend, minimal data) -for w_val, w_label in [(3, "Strong"), (2, "Moderate"), (1, "Weak")]: - chart.add( - f"{w_label} connection", - [None], - stroke=True, - show_dots=False, - stroke_style={"width": arc_widths[w_val], "linecap": "round"}, - ) - # Add node outline ring (dark goldenrod border effect) node_points = [ { @@ -164,7 +162,7 @@ chart.add("", node_points, stroke=False, dots_size=42) # Add node fill on top (Python Yellow) -chart.add("Characters", node_points, stroke=False, dots_size=32) +chart.add("", node_points, stroke=False, dots_size=32) # Save outputs chart.render_to_file("plot.svg") From d5a69c980bdadebf670e1bc64f200d4477a88d0d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 22:12:02 +0000 Subject: [PATCH 8/8] chore(pygal): update quality score 90 and review feedback for arc-basic --- plots/arc-basic/implementations/pygal.py | 4 +- plots/arc-basic/metadata/pygal.yaml | 170 ++++++++++++----------- 2 files changed, 89 insertions(+), 85 deletions(-) diff --git a/plots/arc-basic/implementations/pygal.py b/plots/arc-basic/implementations/pygal.py index ad03c48867..49913ec31a 100644 --- a/plots/arc-basic/implementations/pygal.py +++ b/plots/arc-basic/implementations/pygal.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai arc-basic: Basic Arc Diagram Library: pygal 3.1.0 | Python 3.14.3 -Quality: 80/100 | Created: 2026-02-23 +Quality: 90/100 | Created: 2026-02-23 """ import math diff --git a/plots/arc-basic/metadata/pygal.yaml b/plots/arc-basic/metadata/pygal.yaml index 74d162c250..a17460fc30 100644 --- a/plots/arc-basic/metadata/pygal.yaml +++ b/plots/arc-basic/metadata/pygal.yaml @@ -1,7 +1,7 @@ library: pygal specification_id: arc-basic created: 2025-12-17 10:58:08+00:00 -updated: '2026-02-23T22:00:01Z' +updated: '2026-02-23T22:12:02Z' generated_by: claude-opus-4-6 workflow_run: 20300358253 issue: 991 @@ -10,7 +10,7 @@ library_version: 3.1.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/pygal/plot.html -quality_score: 80 +quality_score: 90 impl_tags: dependencies: [] techniques: @@ -26,106 +26,108 @@ impl_tags: - edge-highlighting review: strengths: - - Full spec compliance with all required features implemented (arc height proportional - to distance, weight encoding, semi-transparency) - - Clean visual design with removed axes/grid via CSS, white background, and good - canvas utilization - - Creative use of pygal.XY chart type for custom arc diagram rendering - - Thoughtful node design with dual-layer yellow fill and goldenrod outline - - Interactive HTML export leveraging pygal native SVG capabilities - - Proper legend with weight category labels + - Multi-hue palette (navy, orange, light blue) provides immediate weight differentiation + — major improvement over monochromatic blue + - Perfect spec compliance with all required arc diagram features implemented correctly + - Clean professional design with all visual clutter removed via CSS and two-layer + polished node rendering + - 'Excellent code quality: KISS structure, deterministic data, elegant arc generation' + - 'Strong pygal mastery: CSS-based chrome removal, nth-child legend hack, interactive + SVG tooltips' weaknesses: - - Arc weight differentiation (thickness and color shade) remains subtle in the rendered - output — the three levels do not create strong immediate visual distinction - - Blue monochromatic palette does not maximize contrast between weight categories + - Weak connection arcs (thin light blue) somewhat subtle against white background - Title right-aligned by pygal default rather than centered - - Complex CSS nth-child selectors for legend visibility control add code complexity + - No isolated or single-connection node to demonstrate full range of connectivity + patterns improvements: [] image_description: 'The plot displays a basic arc diagram with 10 character nodes - (Alice through Jack) arranged along a horizontal baseline near the bottom of the - canvas. Each node is rendered as a yellow circle with a dark goldenrod outline. - Curved blue arcs connect pairs of nodes above the baseline, with arc height proportional - to the distance between connected nodes — the tallest arc spans Alice to Jack - (the full width). Arcs use a blue monochromatic palette with three shades: dark - navy (#08306B) for strong connections, medium blue (#2171B5) for moderate, and - lighter blue (#4292C6) for weak, with corresponding thickness variation (thickest - for strong). The title "Character Interactions · arc-basic · pygal · pyplots.ai" - appears at the top right in dark navy text. Node labels appear below the baseline. - A bottom legend shows "Strong connection", "Moderate connection", and "Weak connection" - with colored squares. The background is clean white with no grid lines or axis - borders.' + (Alice, Bob, Carol, David, Eve, Frank, Grace, Henry, Iris, Jack) arranged as yellow + circles with dark goldenrod outlines along a horizontal baseline near the bottom + of the canvas. Curved arcs connect pairs of nodes above the baseline, with arc + height proportional to the distance between connected nodes — the tallest arcs + (Alice-Jack, Alice-Henry) span most of the canvas width and reach the top of the + plot. Three distinct colors encode connection weight: dark navy (#08306B) thick + arcs for strong connections, orange (#D4770B) medium arcs for moderate connections, + and light blue (#93C5E8) thin arcs for weak connections. The title "Character + Interactions · arc-basic · pygal · pyplots.ai" appears at the top right. Node + labels are positioned below the baseline. A three-item legend at the bottom shows + "Strong connection", "Moderate connection", and "Weak connection" with colored + squares in the respective hues. The background is clean white with no grid lines, + axis borders, or visual clutter.' verdict: APPROVED criteria_checklist: visual_quality: - score: 24 + score: 28 max: 30 items: - id: VQ-01 name: Text Legibility - score: 7 + score: 8 max: 8 passed: true - comment: Font sizes explicitly set (title=72, labels=40, legend=40, value=32). - All text clearly readable. + comment: All font sizes explicitly set (title=72, labels=40, major_labels=40, + legend=40, value=32). All text clearly readable at full resolution. - id: VQ-02 name: No Overlap score: 6 max: 6 passed: true - comment: No text overlap anywhere. Node labels well-spaced. + comment: No text collisions. Node labels well-spaced, arcs overlap naturally + and semi-transparency handles it well. - id: VQ-03 name: Element Visibility - score: 4 + score: 5 max: 6 - passed: false - comment: Arcs and nodes visible, but three weight levels (thickness 6/10/16 - and three blue shades) not strongly differentiated in rendered output. + passed: true + comment: Strong and moderate arcs immediately visible. Weak arcs (thin light + blue) visible but could be slightly more prominent. - id: VQ-04 name: Color Accessibility - score: 3 + score: 4 max: 4 passed: true - comment: Blue monochromatic palette is colorblind-safe. Yellow nodes good - contrast. Three blue shades lack sufficient mutual contrast. + comment: Multi-hue palette (navy, orange, light blue) is fully colorblind-safe. + All three weight levels distinguishable by both hue and luminance. - id: VQ-05 name: Layout & Canvas score: 3 max: 4 passed: true - comment: Good canvas utilization. Title right-aligned creating slight imbalance - with empty top-left. + comment: Good horizontal distribution. Arcs fill upper 60% well. Some unused + space below legend. Title right-aligned creates slight imbalance. - id: VQ-06 name: Axis Labels & Title - score: 1 + score: 2 max: 2 passed: true - comment: Descriptive title with correct format. No axis titles, appropriate + comment: Descriptive title with correct format. Node labels clear and appropriate for arc diagram. design_excellence: - score: 12 + score: 15 max: 20 items: - id: DE-01 name: Aesthetic Sophistication - score: 5 + score: 6 max: 8 passed: true - comment: Custom blue palette, yellow node accents with goldenrod outlines, - clean white background. Above defaults but not publication-level. + comment: Multi-hue palette with intentional weight hierarchy. Yellow nodes + with goldenrod outlines. Clean white canvas. Clearly above configured defaults. - id: DE-02 name: Visual Refinement - score: 4 + score: 5 max: 6 passed: true - comment: Axes, grid, borders removed via CSS. Clean background with generous - whitespace. Node outlines add polish. + comment: All chrome removed via inline CSS. Clean white background. Round + linecaps. Polished two-layer node rendering. - id: DE-03 name: Data Storytelling - score: 3 + score: 4 max: 6 - passed: false - comment: Weight encoding provides some hierarchy. Alice emerges as hub. Subtle - differences don't create immediately obvious narrative. + passed: true + comment: Three-level weight encoding via color and thickness creates immediate + visual hierarchy. Alice emerges as central hub. Arc height reveals connection + distance. spec_compliance: score: 15 max: 15 @@ -135,30 +137,32 @@ review: score: 5 max: 5 passed: true - comment: 'Correct arc diagram: nodes along horizontal line, curved arcs above.' + comment: 'Correct arc diagram: nodes on horizontal line, curved arcs above + baseline.' - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: 'All spec features present: nodes, arcs, height proportional to distance, - semi-transparency, color coding, thickness by weight.' + comment: 'All spec features present: arcs above axis, height proportional + to distance, semi-transparency, color coding, thickness by weight, readable + labels.' - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: Nodes correctly positioned, arcs connect correct pairs, heights proportional - to distance. + comment: Nodes correctly positioned along x-axis. 15 edges correctly rendered + as arcs. Heights proportional to index distance. - id: SC-04 name: Title & Legend score: 3 max: 3 passed: true - comment: Title format correct. Legend labels (Strong/Moderate/Weak connection) - match data encoding. + comment: Title format correct. Legend shows three weight categories with matching + colors. data_quality: - score: 13 + score: 14 max: 15 items: - id: DQ-01 @@ -166,24 +170,24 @@ review: score: 5 max: 6 passed: true - comment: 'Good variety: short and long-range connections, three weight levels, - varying node connectivity, crossing arcs.' + comment: Shows short-range, medium-range, and long-range connections. Three + weight levels. Varying node connectivity. Could include an isolated node. - id: DQ-02 name: Realistic Context - score: 4 + score: 5 max: 5 passed: true - comment: Character interactions in a story chapter - plausible real-world - scenario matching spec applications. + comment: Character interactions in a story chapter. Realistic, neutral, comprehensible + scenario. - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: 10 nodes within recommended range, 15 edges good density, weights - 1-3 appropriate. + comment: 10 nodes within spec range. 15 edges provide good density. Weights + 1-3 sensible. code_quality: - score: 9 + score: 10 max: 10 items: - id: CQ-01 @@ -191,14 +195,14 @@ review: score: 3 max: 3 passed: true - comment: 'Linear flow: imports, data, style, chart, arcs, nodes, save. No - functions or classes.' + comment: 'Linear flow: imports, data, style, chart config, legend, arc loop, + nodes, save. No functions or classes.' - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: np.random.seed(42) set, data is deterministic. + comment: np.random.seed(42) set. All data deterministic. - id: CQ-03 name: Clean Imports score: 2 @@ -207,19 +211,19 @@ review: comment: 'All imports used: math, numpy, pygal, Style.' - id: CQ-04 name: Code Elegance - score: 1 + score: 2 max: 2 - passed: false - comment: Complex CSS nth-child selectors for legend management. Intricate - colors tuple construction. + passed: true + comment: Clean arc generation loop. CSS-based chrome removal. Two-layer node + rendering. No over-engineering. - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Saves plot.png, plot.svg, plot.html. Current pygal API. + comment: Saves plot.png via render_to_png(). Current pygal 3.1.0 API. library_mastery: - score: 7 + score: 8 max: 10 items: - id: LM-01 @@ -227,12 +231,12 @@ review: score: 4 max: 5 passed: true - comment: Creative use of pygal.XY for custom coordinate plotting. Proper use - of Style, chart.add, render methods. + comment: Good use of pygal.XY, Style class, chart.add() with stroke_style + per-series, x_labels with value/label dicts. - id: LM-02 name: Distinctive Features - score: 3 + score: 4 max: 5 passed: true - comment: Uses pygal CSS injection, custom x_labels with dicts, SVG-native - rendering, interactive HTML export. + comment: Inline CSS customization, nth-child legend hiding, label dicts for + tooltips, multi-format output, truncate_label=-1.