From 6af62a328c81b0e6767dd47892bfd428aa00cc0e Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Mon, 23 Feb 2026 22:28:59 +0100 Subject: [PATCH 1/4] =?UTF-8?q?update(arc-basic):=20altair=20=E2=80=94=20c?= =?UTF-8?q?omprehensive=20quality=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comprehensive review and update of altair implementation for arc-basic. --- plots/arc-basic/implementations/altair.py | 83 +++++++++++++++-------- plots/arc-basic/metadata/altair.yaml | 8 +-- 2 files changed, 60 insertions(+), 31 deletions(-) diff --git a/plots/arc-basic/implementations/altair.py b/plots/arc-basic/implementations/altair.py index ae83096a36..d62d9fe00a 100644 --- a/plots/arc-basic/implementations/altair.py +++ b/plots/arc-basic/implementations/altair.py @@ -1,7 +1,7 @@ -""" pyplots.ai +"""pyplots.ai arc-basic: Basic Arc Diagram -Library: altair 6.0.0 | Python 3.13.11 -Quality: 91/100 | Created: 2025-12-23 +Library: altair 6.0.0 | Python 3.14.3 +Quality: /100 | Updated: 2026-02-23 """ import altair as alt @@ -15,9 +15,8 @@ nodes = ["Alice", "Bob", "Carol", "David", "Eve", "Frank", "Grace", "Henry", "Iris", "Jack"] n_nodes = len(nodes) -# Edges: pairs of connected nodes with weights edges = [ - (0, 1, 3), # Alice-Bob (strong connection) + (0, 1, 3), # Alice-Bob (strong) (0, 3, 2), # Alice-David (1, 2, 2), # Bob-Carol (2, 4, 1), # Carol-Eve @@ -36,30 +35,33 @@ # Node positions along x-axis x_positions = np.linspace(0, 100, n_nodes) -y_baseline = 10 +y_baseline = 0 -# Create node dataframe -nodes_df = pd.DataFrame({"x": x_positions, "y": [y_baseline] * n_nodes, "name": nodes}) +# Node dataframe with connection count for sizing +connection_count = [0] * n_nodes +for s, e, w in edges: + connection_count[s] += w + connection_count[e] += w -# Create arc paths - each arc as a series of points following a semicircle +nodes_df = pd.DataFrame({"x": x_positions, "y": [y_baseline] * n_nodes, "name": nodes, "connections": connection_count}) + +# Build arc paths as semicircular curves arc_data = [] points_per_arc = 50 +max_span = max(abs(e - s) for s, e, _ in edges) for edge_id, (start, end, weight) in enumerate(edges): x_start = x_positions[start] x_end = x_positions[end] + span = abs(end - start) + height = 7 * span - # Arc height proportional to distance between nodes - distance = abs(end - start) - height = 8 * distance - - # Generate points along a semicircle arc angles = np.linspace(0, np.pi, points_per_arc) - x_center = (x_start + x_end) / 2 radius_x = abs(x_end - x_start) / 2 radius_y = height / 2 + pair = f"{nodes[start]}–{nodes[end]}" for i, angle in enumerate(angles): arc_data.append( { @@ -67,37 +69,61 @@ "x": x_center - radius_x * np.cos(angle), "y": y_baseline + radius_y * np.sin(angle), "weight": weight, + "pair": pair, "order": i, } ) arcs_df = pd.DataFrame(arc_data) -# Create arc chart with lines +# Y-domain: tight around data for better canvas use +max_arc_height = 7 * max_span / 2 +y_domain = [-4, max_arc_height + 4] + +# Arcs: weight drives both thickness and opacity for visual hierarchy arcs = ( alt.Chart(arcs_df) - .mark_line(strokeWidth=2, opacity=0.6) + .mark_line() .encode( x=alt.X("x:Q", axis=None), - y=alt.Y("y:Q", axis=None), + y=alt.Y("y:Q", axis=None, scale=alt.Scale(domain=y_domain)), detail="edge_id:N", - strokeWidth=alt.StrokeWidth("weight:Q", scale=alt.Scale(domain=[1, 3], range=[2, 6]), legend=None), + strokeWidth=alt.StrokeWidth( + "weight:Q", + scale=alt.Scale(domain=[1, 3], range=[1.5, 5]), + legend=alt.Legend( + title="Interaction Strength", + titleFontSize=16, + labelFontSize=14, + orient="top-right", + offset=10, + values=[1, 2, 3], + symbolStrokeWidth=3, + labelExpr="datum.value == 1 ? 'Weak' : datum.value == 2 ? 'Moderate' : 'Strong'", + ), + ), + strokeOpacity=alt.StrokeOpacity("weight:Q", scale=alt.Scale(domain=[1, 3], range=[0.35, 0.7]), legend=None), color=alt.value("#306998"), + tooltip=[alt.Tooltip("pair:N", title="Connection"), alt.Tooltip("weight:Q", title="Strength")], ) - .properties(width=1600, height=900) ) -# Create node points +# Nodes: size proportional to total connection weight node_points = ( alt.Chart(nodes_df) - .mark_circle(size=600, color="#FFD43B", stroke="#306998", strokeWidth=3) - .encode(x=alt.X("x:Q", axis=None), y=alt.Y("y:Q", axis=None)) + .mark_circle(color="#FFD43B", stroke="#306998", strokeWidth=2.5) + .encode( + x=alt.X("x:Q", axis=None), + y=alt.Y("y:Q", axis=None, scale=alt.Scale(domain=y_domain)), + size=alt.Size("connections:Q", scale=alt.Scale(domain=[2, 11], range=[300, 800]), legend=None), + tooltip=[alt.Tooltip("name:N", title="Character"), alt.Tooltip("connections:Q", title="Total Weight")], + ) ) -# Create node labels +# Node labels below baseline node_labels = ( alt.Chart(nodes_df) - .mark_text(dy=30, fontSize=18, fontWeight="bold", color="#306998") + .mark_text(dy=26, fontSize=18, fontWeight="bold", color="#306998") .encode(x=alt.X("x:Q"), y=alt.Y("y:Q"), text="name:N") ) @@ -107,11 +133,14 @@ .properties( width=1600, height=900, - title=alt.Title("Character Interactions · arc-basic · altair · pyplots.ai", fontSize=28, anchor="middle"), + title=alt.Title( + "Character Interactions · arc-basic · altair · pyplots.ai", fontSize=28, anchor="middle", offset=15 + ), ) .configure_view(strokeWidth=0) + .configure_legend(strokeColor="transparent", padding=12) ) -# Save outputs +# Save chart.save("plot.png", scale_factor=3.0) chart.save("plot.html") diff --git a/plots/arc-basic/metadata/altair.yaml b/plots/arc-basic/metadata/altair.yaml index 7b6caabae5..29290465e6 100644 --- a/plots/arc-basic/metadata/altair.yaml +++ b/plots/arc-basic/metadata/altair.yaml @@ -1,16 +1,16 @@ library: altair specification_id: arc-basic created: '2025-12-23T08:49:37Z' -updated: '2025-12-23T09:04:22Z' -generated_by: claude-opus-4-5-20251101 +updated: '2026-02-23T12:00:00+00:00' +generated_by: claude-opus-4-6 workflow_run: 20455963635 issue: 0 -python_version: 3.13.11 +python_version: '3.14.3' library_version: 6.0.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/altair/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/altair/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/altair/plot.html -quality_score: 91 +quality_score: null impl_tags: dependencies: [] techniques: From f26e3bc0e991652dac1c7effdf6dbc0f682339c9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:34:10 +0000 Subject: [PATCH 2/4] chore(altair): update quality score 86 and review feedback for arc-basic --- plots/arc-basic/implementations/altair.py | 4 +- plots/arc-basic/metadata/altair.yaml | 267 ++++++++++++---------- 2 files changed, 152 insertions(+), 119 deletions(-) diff --git a/plots/arc-basic/implementations/altair.py b/plots/arc-basic/implementations/altair.py index d62d9fe00a..0513f73fb8 100644 --- a/plots/arc-basic/implementations/altair.py +++ b/plots/arc-basic/implementations/altair.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai arc-basic: Basic Arc Diagram Library: altair 6.0.0 | Python 3.14.3 -Quality: /100 | Updated: 2026-02-23 +Quality: 86/100 | Updated: 2026-02-23 """ import altair as alt diff --git a/plots/arc-basic/metadata/altair.yaml b/plots/arc-basic/metadata/altair.yaml index 29290465e6..2ab9599f0d 100644 --- a/plots/arc-basic/metadata/altair.yaml +++ b/plots/arc-basic/metadata/altair.yaml @@ -1,166 +1,192 @@ library: altair specification_id: arc-basic created: '2025-12-23T08:49:37Z' -updated: '2026-02-23T12:00:00+00:00' +updated: '2026-02-23T21:34:10Z' generated_by: claude-opus-4-6 workflow_run: 20455963635 issue: 0 -python_version: '3.14.3' +python_version: 3.14.3 library_version: 6.0.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/altair/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/altair/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/altair/plot.html -quality_score: null +quality_score: 86 impl_tags: dependencies: [] techniques: - - layer-composition - - html-export + - layer-composition + - hover-tooltips + - custom-legend + - html-export patterns: - - data-generation - - iteration-over-groups - - matrix-construction + - data-generation + - iteration-over-groups dataprep: [] styling: - - alpha-blending + - minimal-chrome + - alpha-blending + - edge-highlighting review: strengths: - - Excellent implementation of arc diagram using Altairs declarative grammar with - custom path generation - - Beautiful color scheme using Python blue (#306998) and yellow (#FFD43B) brand - colors - - Arc height correctly proportional to node distance as specified - - Semi-transparency (0.6) handles overlapping arcs well - - Edge weight encoding via strokeWidth provides visual differentiation - - Clean code structure with clear data preparation and chart layering - - 'Appropriate data context: character interactions in a story chapter' + - Excellent data quality with realistic character interaction scenario covering + all arc diagram features + - Thoughtful visual hierarchy through weight-based thickness AND opacity encoding + plus node sizing + - Clean idiomatic Altair code with proper declarative grammar and layer composition + - Colorblind-safe blue/yellow palette with good color harmony + - Good use of Altair-specific features (labelExpr, tooltips, HTML export) weaknesses: - - Layout has excessive whitespace below the baseline; nodes are positioned at y=10 - in a 900px height canvas - - Missing legend for edge weight interpretation (strokeWidth encoding has legend=None) - image_description: The plot displays an arc diagram showing character interactions. - Ten nodes (Alice, Bob, Carol, David, Eve, Frank, Grace, Henry, Iris, Jack) are - arranged horizontally along the bottom of the chart, represented as yellow circles - with blue outlines. The character names appear below each node in bold blue text. - Curved blue arcs connect pairs of nodes above the horizontal line, with arc height - proportional to the distance between connected nodes. The longest arcs span from - Alice to Jack and Alice to Henry, reaching nearly to the top of the plot. Shorter - arcs connect adjacent or nearby characters. The arcs use semi-transparent blue - (#306998) with varying thicknesses based on edge weights. The title "Character - Interactions · arc-basic · altair · pyplots.ai" appears at the top center. + - Legend label font size at 14pt is below the 16pt minimum guideline + - Nodes appear somewhat small relative to the arc canvas area + - Right canvas edge is tight near Jack node — risk of clipping + - Title format prepends Character Interactions beyond standard spec-id format + - Design could be further elevated with more refined palette and stronger focal + emphasis + image_description: 'The plot displays a basic arc diagram with 10 character nodes + (Alice, Bob, Carol, David, Eve, Frank, Grace, Henry, Iris, Jack) arranged along + a horizontal baseline at the bottom. Curved semicircular arcs connect nodes above + the baseline, with arc height proportional to the distance between connected nodes + — the tallest arc spans from Alice to Jack across the entire width. Arcs are rendered + in steel blue (#306998) with varying thickness and opacity based on interaction + strength: thicker, more opaque arcs indicate stronger connections (weight 3), + while thinner, more transparent arcs indicate weaker ones (weight 1). Nodes are + yellow circles (#FFD43B) with blue borders, sized proportionally to total connection + weight — Alice and David appear largest as the most connected characters. Bold + blue labels appear below each node. The title "Character Interactions · arc-basic + · altair · pyplots.ai" is centered at the top. A legend in the top-right corner + shows "Interaction Strength" with Weak, Moderate, and Strong categories distinguished + by line thickness. The background is clean white with no axes or grid lines.' criteria_checklist: visual_quality: - score: 36 - max: 40 + score: 27 + max: 30 items: - id: VQ-01 name: Text Legibility - score: 10 - max: 10 + score: 7 + max: 8 passed: true - comment: Title is large (28pt), node labels are 18pt bold, all clearly readable + comment: All font sizes explicitly set (title 28pt, labels 18pt bold, legend + title 16pt). Legend label fontSize at 14pt slightly below 16pt guideline. - id: VQ-02 name: No Overlap - score: 8 - max: 8 + score: 6 + max: 6 passed: true - comment: No overlapping text or elements + comment: No text overlaps. Node labels well-spaced. Arc overlaps handled with + semi-transparency. - id: VQ-03 name: Element Visibility - score: 8 - max: 8 + score: 5 + max: 6 passed: true - comment: Nodes are appropriately sized (600), arcs visible with opacity 0.6 + comment: Arcs clearly visible with weight-based differentiation. Nodes somewhat + small relative to arc canvas. - id: VQ-04 name: Color Accessibility - score: 5 - max: 5 + score: 4 + max: 4 passed: true - comment: Blue/yellow color scheme is colorblind-safe + comment: Colorblind-safe blue/yellow scheme. Weight uses thickness and opacity, + not color alone. - id: VQ-05 - name: Layout Balance + name: Layout & Canvas score: 3 - max: 5 + max: 4 passed: true - comment: Good overall, but nodes positioned low with much empty space below - baseline + comment: Good utilization overall. Jack node tight against right edge. Some + unused space near legend. - id: VQ-06 - name: Axis Labels - score: 0 - max: 2 - passed: false - comment: No axes present (appropriate for this chart type, but no units shown) - - id: VQ-07 - name: Grid & Legend + name: Axis Labels & Title score: 2 max: 2 passed: true - comment: Clean design, no unnecessary grid, strokeWidth encoding is self-explanatory + comment: Descriptive title with context. Axes appropriately hidden for arc + diagram. + design_excellence: + score: 13 + max: 20 + items: + - id: DE-01 + name: Aesthetic Sophistication + score: 5 + max: 8 + passed: true + comment: Intentional Python blue/yellow palette. Weight-based opacity+thickness + hierarchy. Above defaults but not publication-level. + - id: DE-02 + name: Visual Refinement + score: 4 + max: 6 + passed: true + comment: Axes hidden, view border removed, legend styled with transparent + stroke. Clean minimal chrome. + - id: DE-03 + name: Data Storytelling + score: 4 + max: 6 + passed: true + comment: Weight encoding and node sizing create visual hierarchy. Central + characters identifiable. Arc height reveals range. spec_compliance: - score: 23 - max: 25 + score: 14 + max: 15 items: - id: SC-01 name: Plot Type - score: 8 - max: 8 - passed: true - comment: Correct arc diagram type - - id: SC-02 - name: Data Mapping score: 5 max: 5 passed: true - comment: Nodes correctly arranged horizontally, arcs connect pairs - - id: SC-03 + comment: Correct arc diagram with nodes along horizontal line and curved arcs + above. + - id: SC-02 name: Required Features - score: 5 - max: 5 + score: 4 + max: 4 passed: true - comment: Arc heights proportional to distance, semi-transparency, stroke width - for weights - - id: SC-04 - name: Data Range + comment: 'All spec features present: proportional arc height, semi-transparency, + readable labels, weight-based thickness.' + - id: SC-03 + name: Data Mapping score: 3 max: 3 passed: true - comment: All nodes and connections visible - - id: SC-05 - name: Legend Accuracy - score: 0 - max: 2 - passed: true - comment: No legend for edge weights (strokeWidth legend is disabled) - - id: SC-06 - name: Title Format + comment: Nodes correctly positioned. Arcs connect correct nodes. Height proportional + to span. + - id: SC-04 + name: Title & Legend score: 2 - max: 2 + max: 3 passed: true - comment: 'Correct format: "Character Interactions · arc-basic · altair · pyplots.ai"' + comment: Title includes required elements but has extra 'Character Interactions' + prefix. Legend well-labeled. data_quality: - score: 20 - max: 20 + score: 15 + max: 15 items: - id: DQ-01 name: Feature Coverage - score: 8 - max: 8 + score: 6 + max: 6 passed: true - comment: Shows short-range and long-range connections, varying weights (1-3) + comment: Shows short-range and long-range connections. All three weight levels. + Varying node importance. - id: DQ-02 name: Realistic Context - score: 7 - max: 7 + score: 5 + max: 5 passed: true - comment: Character interactions in a story is a perfect real-world scenario + comment: Character interactions in a story chapter — real, comprehensible, + neutral scenario. - id: DQ-03 name: Appropriate Scale - score: 5 - max: 5 + score: 4 + max: 4 passed: true - comment: 10 nodes with 15 edges is ideal for readability + comment: 10 nodes within recommended range. 15 edges good density. Weight + values 1-3 sensible. code_quality: - score: 9 + score: 10 max: 10 items: - id: CQ-01 @@ -168,40 +194,47 @@ review: score: 3 max: 3 passed: true - comment: 'Simple linear structure: imports → data → plot → save' + comment: Clean imports to data to plot to save flow. No functions or classes. - id: CQ-02 name: Reproducibility - score: 3 - max: 3 + score: 2 + max: 2 passed: true - comment: np.random.seed(42) set + comment: np.random.seed(42) set. Data is deterministic. - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: Only necessary imports (altair, numpy, pandas) + comment: 'All imports used: altair, numpy, pandas.' - id: CQ-04 - name: No Deprecated API - score: 1 - max: 1 + name: Code Elegance + score: 2 + max: 2 passed: true - comment: Uses current Altair API + comment: Appropriate complexity for manual arc generation. Clean computation. - id: CQ-05 - name: Output Correct - score: 0 + name: Output & API + score: 1 max: 1 - passed: false - comment: Saves both plot.png and plot.html (correct) - library_features: - score: 3 - max: 5 + passed: true + comment: Saves plot.png with scale_factor=3.0. Also saves plot.html. Current + Altair API. + library_mastery: + score: 7 + max: 10 items: - - id: LF-01 - name: Uses distinctive library features + - id: LM-01 + name: Idiomatic Usage + score: 4 + max: 5 + passed: true + comment: Good declarative grammar usage. Proper encoding types and scales. + Arc path generation necessarily manual. + - id: LM-02 + name: Distinctive Features score: 3 max: 5 passed: true - comment: Uses declarative layering, encoding system, but arc diagrams are - not native to Altair so required manual path generation - verdict: APPROVED + comment: Uses labelExpr, tooltips, layer composition, configure_view/configure_legend. + verdict: REJECTED From b04b997d8946f25b2301b5ab68da9604fd33af8c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:44:30 +0000 Subject: [PATCH 3/4] fix(altair): address review feedback for arc-basic Attempt 1/3 - fixes based on AI review --- plots/arc-basic/implementations/altair.py | 41 ++++++++++++++--------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/plots/arc-basic/implementations/altair.py b/plots/arc-basic/implementations/altair.py index 0513f73fb8..d6b1d927e6 100644 --- a/plots/arc-basic/implementations/altair.py +++ b/plots/arc-basic/implementations/altair.py @@ -1,4 +1,4 @@ -""" pyplots.ai +"""pyplots.ai arc-basic: Basic Arc Diagram Library: altair 6.0.0 | Python 3.14.3 Quality: 86/100 | Updated: 2026-02-23 @@ -78,23 +78,27 @@ # Y-domain: tight around data for better canvas use max_arc_height = 7 * max_span / 2 -y_domain = [-4, max_arc_height + 4] +y_domain = [-5, max_arc_height + 4] +x_domain = [-4, 104] -# Arcs: weight drives both thickness and opacity for visual hierarchy +# Hover selection for interactive arc highlighting (HTML export) +hover = alt.selection_point(on="pointerover", empty=False, fields=["edge_id"]) + +# Arcs: weight drives color, thickness, and opacity for visual hierarchy arcs = ( alt.Chart(arcs_df) .mark_line() .encode( - x=alt.X("x:Q", axis=None), + x=alt.X("x:Q", axis=None, scale=alt.Scale(domain=x_domain)), y=alt.Y("y:Q", axis=None, scale=alt.Scale(domain=y_domain)), detail="edge_id:N", strokeWidth=alt.StrokeWidth( "weight:Q", - scale=alt.Scale(domain=[1, 3], range=[1.5, 5]), + scale=alt.Scale(domain=[1, 3], range=[1.5, 6]), legend=alt.Legend( title="Interaction Strength", titleFontSize=16, - labelFontSize=14, + labelFontSize=16, orient="top-right", offset=10, values=[1, 2, 3], @@ -102,20 +106,27 @@ labelExpr="datum.value == 1 ? 'Weak' : datum.value == 2 ? 'Moderate' : 'Strong'", ), ), - strokeOpacity=alt.StrokeOpacity("weight:Q", scale=alt.Scale(domain=[1, 3], range=[0.35, 0.7]), legend=None), - color=alt.value("#306998"), + strokeOpacity=alt.condition( + hover, + alt.value(0.95), + alt.StrokeOpacity("weight:Q", scale=alt.Scale(domain=[1, 3], range=[0.3, 0.8]), legend=None), + ), + color=alt.Color( + "weight:Q", scale=alt.Scale(domain=[1, 2, 3], range=["#7daed4", "#306998", "#152d4a"]), legend=None + ), tooltip=[alt.Tooltip("pair:N", title="Connection"), alt.Tooltip("weight:Q", title="Strength")], ) + .add_params(hover) ) # Nodes: size proportional to total connection weight node_points = ( alt.Chart(nodes_df) - .mark_circle(color="#FFD43B", stroke="#306998", strokeWidth=2.5) + .mark_circle(color="#FFD43B", stroke="#152d4a", strokeWidth=2.5) .encode( - x=alt.X("x:Q", axis=None), + x=alt.X("x:Q", axis=None, scale=alt.Scale(domain=x_domain)), y=alt.Y("y:Q", axis=None, scale=alt.Scale(domain=y_domain)), - size=alt.Size("connections:Q", scale=alt.Scale(domain=[2, 11], range=[300, 800]), legend=None), + size=alt.Size("connections:Q", scale=alt.Scale(domain=[2, 11], range=[500, 1200]), legend=None), tooltip=[alt.Tooltip("name:N", title="Character"), alt.Tooltip("connections:Q", title="Total Weight")], ) ) @@ -123,7 +134,7 @@ # Node labels below baseline node_labels = ( alt.Chart(nodes_df) - .mark_text(dy=26, fontSize=18, fontWeight="bold", color="#306998") + .mark_text(dy=30, fontSize=18, fontWeight="bold", color="#152d4a") .encode(x=alt.X("x:Q"), y=alt.Y("y:Q"), text="name:N") ) @@ -133,12 +144,10 @@ .properties( width=1600, height=900, - title=alt.Title( - "Character Interactions · arc-basic · altair · pyplots.ai", fontSize=28, anchor="middle", offset=15 - ), + title=alt.Title("arc-basic · altair · pyplots.ai", fontSize=28, anchor="middle", offset=15), ) .configure_view(strokeWidth=0) - .configure_legend(strokeColor="transparent", padding=12) + .configure_legend(strokeColor="transparent", padding=12, titleColor="#152d4a", labelColor="#333333") ) # Save From 12ae80273ec1488d4ed222be3c6f7e99a66a0178 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:51:16 +0000 Subject: [PATCH 4/4] chore(altair): update quality score 90 and review feedback for arc-basic --- plots/arc-basic/implementations/altair.py | 4 +- plots/arc-basic/metadata/altair.yaml | 159 +++++++++++----------- 2 files changed, 83 insertions(+), 80 deletions(-) diff --git a/plots/arc-basic/implementations/altair.py b/plots/arc-basic/implementations/altair.py index d6b1d927e6..c236602ae3 100644 --- a/plots/arc-basic/implementations/altair.py +++ b/plots/arc-basic/implementations/altair.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai arc-basic: Basic Arc Diagram Library: altair 6.0.0 | Python 3.14.3 -Quality: 86/100 | Updated: 2026-02-23 +Quality: 90/100 | Updated: 2026-02-23 """ import altair as alt diff --git a/plots/arc-basic/metadata/altair.yaml b/plots/arc-basic/metadata/altair.yaml index 2ab9599f0d..a2bef69db0 100644 --- a/plots/arc-basic/metadata/altair.yaml +++ b/plots/arc-basic/metadata/altair.yaml @@ -1,7 +1,7 @@ library: altair specification_id: arc-basic created: '2025-12-23T08:49:37Z' -updated: '2026-02-23T21:34:10Z' +updated: '2026-02-23T21:51:16Z' generated_by: claude-opus-4-6 workflow_run: 20455963635 issue: 0 @@ -10,7 +10,7 @@ library_version: 6.0.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/altair/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/altair/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/altair/plot.html -quality_score: 86 +quality_score: 90 impl_tags: dependencies: [] techniques: @@ -28,37 +28,38 @@ impl_tags: - edge-highlighting review: strengths: - - Excellent data quality with realistic character interaction scenario covering - all arc diagram features - - Thoughtful visual hierarchy through weight-based thickness AND opacity encoding - plus node sizing - - Clean idiomatic Altair code with proper declarative grammar and layer composition - - Colorblind-safe blue/yellow palette with good color harmony - - Good use of Altair-specific features (labelExpr, tooltips, HTML export) + - Effective triple encoding of edge weight through color, thickness, and opacity + creates clear visual hierarchy + - Cohesive Python-themed color palette (blue gradient arcs + yellow nodes) with + strong contrast + - Full spec compliance with all required features including proportional arc height, + semi-transparency, and color coding + - Excellent use of Altair declarative grammar with interactive hover selection and + conditional encoding + - Node sizing by connection weight adds an extra data dimension that aids storytelling weaknesses: - - Legend label font size at 14pt is below the 16pt minimum guideline - - Nodes appear somewhat small relative to the arc canvas area - - Right canvas edge is tight near Jack node — risk of clipping - - Title format prepends Character Interactions beyond standard spec-id format - - Design could be further elevated with more refined palette and stronger focal - emphasis + - Node label font size (18pt) is slightly below the 20pt guideline for labels + - Weakest arcs (weight=1, opacity 0.3) are quite faint and could benefit from a + higher minimum opacity + - Legend positioned somewhat far from the main data area with empty space in the + upper-left image_description: 'The plot displays a basic arc diagram with 10 character nodes (Alice, Bob, Carol, David, Eve, Frank, Grace, Henry, Iris, Jack) arranged along - a horizontal baseline at the bottom. Curved semicircular arcs connect nodes above - the baseline, with arc height proportional to the distance between connected nodes - — the tallest arc spans from Alice to Jack across the entire width. Arcs are rendered - in steel blue (#306998) with varying thickness and opacity based on interaction - strength: thicker, more opaque arcs indicate stronger connections (weight 3), - while thinner, more transparent arcs indicate weaker ones (weight 1). Nodes are - yellow circles (#FFD43B) with blue borders, sized proportionally to total connection - weight — Alice and David appear largest as the most connected characters. Bold - blue labels appear below each node. The title "Character Interactions · arc-basic - · altair · pyplots.ai" is centered at the top. A legend in the top-right corner - shows "Interaction Strength" with Weak, Moderate, and Strong categories distinguished - by line thickness. The background is clean white with no axes or grid lines.' + a horizontal baseline near the bottom. Nodes are rendered as yellow (#FFD43B) + circles with dark blue (#152d4a) strokes, with sizes proportional to each character''s + total connection weight — Alice and David are visibly the largest. Curved semicircular + arcs connect pairs of nodes above the baseline, with arc height proportional to + the distance between connected nodes. Arc thickness ranges from thin (~1.5px) + for weight-1 connections to thick (~6px) for weight-3 connections. Arc color uses + a blue gradient: light steel blue (#7daed4) for weak connections, medium blue + (#306998) for moderate, and dark navy (#152d4a) for strong. Arc opacity also varies + (0.3–0.8) by weight. A legend in the top-right labeled "Interaction Strength" + shows Weak, Moderate, and Strong categories. The title "arc-basic · altair · pyplots.ai" + is centered at the top in bold 28pt font. The background is clean white with no + axes, grid, or chart border.' criteria_checklist: visual_quality: - score: 27 + score: 26 max: 30 items: - id: VQ-01 @@ -66,70 +67,71 @@ review: score: 7 max: 8 passed: true - comment: All font sizes explicitly set (title 28pt, labels 18pt bold, legend - title 16pt). Legend label fontSize at 14pt slightly below 16pt guideline. + comment: Title 28pt, node labels 18pt bold (slightly below 20pt guideline), + legend title/labels 16pt. All text readable and explicitly sized. - id: VQ-02 name: No Overlap score: 6 max: 6 passed: true - comment: No text overlaps. Node labels well-spaced. Arc overlaps handled with - semi-transparency. + comment: No text collisions. Node labels well-spaced. Arc overlaps mitigated + by transparency. - id: VQ-03 name: Element Visibility score: 5 max: 6 passed: true - comment: Arcs clearly visible with weight-based differentiation. Nodes somewhat - small relative to arc canvas. + comment: Nodes clearly visible. Strong/moderate arcs prominent. Weakest arcs + (opacity 0.3) somewhat faint but distinguishable by shape. - id: VQ-04 name: Color Accessibility score: 4 max: 4 passed: true - comment: Colorblind-safe blue/yellow scheme. Weight uses thickness and opacity, - not color alone. + comment: Monochromatic blue palette is colorblind-safe. Yellow nodes contrast + well. Weight uses thickness and opacity in addition to color. - id: VQ-05 name: Layout & Canvas score: 3 max: 4 passed: true - comment: Good utilization overall. Jack node tight against right edge. Some - unused space near legend. + comment: Plot fills ~60-65% of canvas. Some empty space in upper-left. Legend + slightly separated from data area. - id: VQ-06 name: Axis Labels & Title - score: 2 + score: 1 max: 2 passed: true - comment: Descriptive title with context. Axes appropriately hidden for arc - diagram. + comment: Title correctly formatted. Arc diagrams don't use traditional axes; + node labels serve as positional identifiers. design_excellence: - score: 13 + score: 15 max: 20 items: - id: DE-01 name: Aesthetic Sophistication - score: 5 + score: 6 max: 8 passed: true - comment: Intentional Python blue/yellow palette. Weight-based opacity+thickness - hierarchy. Above defaults but not publication-level. + comment: Custom blue gradient palette with contrasting yellow nodes. Python-themed + color scheme. Bold typography with intentional visual hierarchy. - id: DE-02 name: Visual Refinement - score: 4 + score: 5 max: 6 passed: true - comment: Axes hidden, view border removed, legend styled with transparent - stroke. Clean minimal chrome. + comment: View stroke removed, axes hidden, legend styled with transparent + stroke and custom colors, clean background. Every detail deliberately configured. - id: DE-03 name: Data Storytelling score: 4 max: 6 passed: true - comment: Weight encoding and node sizing create visual hierarchy. Central - characters identifiable. Arc height reveals range. + comment: Triple encoding of weight creates effective visual hierarchy. Node + sizing identifies central characters. Long-range vs short-range connections + visible by arc height. spec_compliance: - score: 14 + score: 15 max: 15 items: - id: SC-01 @@ -137,29 +139,29 @@ review: score: 5 max: 5 passed: true - comment: Correct arc diagram with nodes along horizontal line and curved arcs - above. + comment: 'Correct arc diagram: nodes on horizontal line, semicircular arcs + above.' - id: SC-02 name: Required Features score: 4 max: 4 passed: true comment: 'All spec features present: proportional arc height, semi-transparency, - readable labels, weight-based thickness.' + readable labels, color coding, weight-based thickness.' - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: Nodes correctly positioned. Arcs connect correct nodes. Height proportional - to span. + comment: Nodes correctly positioned. Arcs connect specified pairs. Heights + scale with span distance. - id: SC-04 name: Title & Legend - score: 2 + score: 3 max: 3 passed: true - comment: Title includes required elements but has extra 'Character Interactions' - prefix. Legend well-labeled. + comment: Title 'arc-basic · altair · pyplots.ai' correct. Legend 'Interaction + Strength' with Weak/Moderate/Strong labels. data_quality: score: 15 max: 15 @@ -169,22 +171,21 @@ review: score: 6 max: 6 passed: true - comment: Shows short-range and long-range connections. All three weight levels. - Varying node importance. + comment: Short-range, medium-range, and long-range connections. All three + weight levels. Varying node connectivity. - id: DQ-02 name: Realistic Context score: 5 max: 5 passed: true - comment: Character interactions in a story chapter — real, comprehensible, - neutral scenario. + comment: Character interactions in a story chapter. Plausible neutral scenario + from spec applications. - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: 10 nodes within recommended range. 15 edges good density. Weight - values 1-3 sensible. + comment: 10 nodes within recommended 10-50 range. 15 edges with weights 1-3. code_quality: score: 10 max: 10 @@ -194,47 +195,49 @@ review: score: 3 max: 3 passed: true - comment: Clean imports to data to plot to save flow. No functions or classes. + comment: 'Linear flow: imports, data, arc computation, chart layers, 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. Edge data is hardcoded and deterministic. - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: 'All imports used: altair, numpy, pandas.' + comment: All three imports (altair, numpy, pandas) are used. - id: CQ-04 name: Code Elegance score: 2 max: 2 passed: true - comment: Appropriate complexity for manual arc generation. Clean computation. + comment: Appropriate complexity for arc path generation. No fake UI or over-engineering. - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Saves plot.png with scale_factor=3.0. Also saves plot.html. Current - Altair API. + comment: Saves plot.png with scale_factor=3.0 and plot.html. Current Altair + 6.x API. library_mastery: - score: 7 + score: 9 max: 10 items: - id: LM-01 name: Idiomatic Usage - score: 4 + score: 5 max: 5 passed: true - comment: Good declarative grammar usage. Proper encoding types and scales. - Arc path generation necessarily manual. + comment: Declarative grammar with Chart.mark_*.encode(). Layer composition, + proper encoding types, Scale/Legend/Title/condition/configure usage. - id: LM-02 name: Distinctive Features - score: 3 + score: 4 max: 5 passed: true - comment: Uses labelExpr, tooltips, layer composition, configure_view/configure_legend. - verdict: REJECTED + comment: Interactive hover selection, conditional encoding, native tooltips, + labelExpr for legend labels, HTML export via Vega-Lite. + verdict: APPROVED