From 62e7a1539c507deab7ada82bdc208fc173f5f88e Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Mon, 23 Feb 2026 22:29:16 +0100 Subject: [PATCH 1/8] =?UTF-8?q?update(arc-basic):=20letsplot=20=E2=80=94?= =?UTF-8?q?=20comprehensive=20quality=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comprehensive review and update of letsplot implementation for arc-basic. --- plots/arc-basic/implementations/letsplot.py | 107 +++++++++++++++----- plots/arc-basic/metadata/letsplot.yaml | 8 +- 2 files changed, 83 insertions(+), 32 deletions(-) diff --git a/plots/arc-basic/implementations/letsplot.py b/plots/arc-basic/implementations/letsplot.py index 168fe2f8f5..0cc7fd1dea 100644 --- a/plots/arc-basic/implementations/letsplot.py +++ b/plots/arc-basic/implementations/letsplot.py @@ -1,7 +1,7 @@ -""" pyplots.ai +"""pyplots.ai arc-basic: Basic Arc Diagram -Library: letsplot 4.8.2 | Python 3.13.11 -Quality: 92/100 | Created: 2025-12-23 +Library: letsplot 4.8.2 | Python 3.14.3 +Quality: /100 | Updated: 2026-02-23 """ import numpy as np @@ -10,13 +10,18 @@ LetsPlot, aes, element_blank, + element_rect, element_text, geom_path, geom_point, + geom_segment, geom_text, ggplot, ggsize, labs, + layer_tooltips, + scale_alpha_identity, + scale_color_identity, scale_size_identity, theme, xlim, @@ -28,14 +33,12 @@ LetsPlot.setup_html() # Data: Character interactions in a story chapter -np.random.seed(42) - nodes = ["Alice", "Bob", "Carol", "David", "Eve", "Frank", "Grace", "Henry", "Iris", "Jack"] n_nodes = len(nodes) # Edges: pairs of connected nodes with weights (source, target, weight) 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 @@ -54,7 +57,18 @@ # Node positions along x-axis x_positions = np.linspace(0, 1, n_nodes) -y_baseline = 0.1 +y_baseline = 0.08 + +# Count connections per node for visual hierarchy +connections = [0] * n_nodes +for s, t, w in edges: + connections[s] += w + connections[t] += w + +# Arc color intensity by weight +weight_colors = {1: "#93B8CC", 2: "#306998", 3: "#1A3A5C"} +weight_alphas = {1: 0.5, 2: 0.65, 3: 0.8} +weight_labels = {1: "Weak", 2: "Moderate", 3: "Strong"} # Create arc data for geom_path arc_data = [] @@ -66,57 +80,94 @@ distance = abs(end - start) height = 0.08 * distance - # Generate points along the arc (semi-circle) + # Generate points along the arc n_points = 50 t = np.linspace(0, np.pi, n_points) arc_x = x_start + (x_end - x_start) * (1 - np.cos(t)) / 2 arc_y = y_baseline + height * np.sin(t) - # Line width based on weight - line_size = 1.5 + weight * 1.0 + line_size = 1.0 + weight * 1.2 + color = weight_colors[weight] + alpha = weight_alphas[weight] + tooltip_text = f"{nodes[start]} \u2194 {nodes[end]}" + strength = weight_labels[weight] for i in range(n_points): - arc_data.append({"x": arc_x[i], "y": arc_y[i], "edge_id": edge_id, "weight": weight, "size": line_size}) + arc_data.append( + { + "x": arc_x[i], + "y": arc_y[i], + "edge_id": edge_id, + "size": line_size, + "color": color, + "alpha": alpha, + "connection": tooltip_text, + "strength": strength, + } + ) arc_df = pd.DataFrame(arc_data) -# Node data -node_df = pd.DataFrame({"x": x_positions, "y": [y_baseline] * n_nodes, "name": nodes}) +# Node data with size based on total connection weight +max_conn = max(connections) +node_sizes = [6 + 10 * (c / max_conn) for c in connections] +node_df = pd.DataFrame( + {"x": x_positions, "y": [y_baseline] * n_nodes, "name": nodes, "node_size": node_sizes, "connections": connections} +) + +# Baseline segment data +baseline_df = pd.DataFrame({"x": [x_positions[0]], "xend": [x_positions[-1]], "y": [y_baseline], "yend": [y_baseline]}) # Label data (positioned below nodes) -label_df = pd.DataFrame({"x": x_positions, "y": [y_baseline - 0.05] * n_nodes, "name": nodes}) +label_df = pd.DataFrame({"x": x_positions, "y": [y_baseline - 0.045] * n_nodes, "name": nodes}) -# Create plot +# Plot plot = ( ggplot() - # Draw arcs with semi-transparency for overlapping connections - + geom_path(data=arc_df, mapping=aes(x="x", y="y", group="edge_id", size="size"), color="#306998", alpha=0.6) + # Subtle baseline + + geom_segment(data=baseline_df, mapping=aes(x="x", y="y", xend="xend", yend="yend"), color="#D0D8E0", size=0.8) + # Arcs with weight-based color, transparency, and tooltips + + geom_path( + data=arc_df, + mapping=aes(x="x", y="y", group="edge_id", size="size", color="color", alpha="alpha"), + tooltips=layer_tooltips().line("@connection").line("Strength: @strength"), + ) + + scale_size_identity() + + scale_color_identity() + + scale_alpha_identity() + # Nodes sized by connection weight with tooltips + + geom_point( + data=node_df, + mapping=aes(x="x", y="y", size="node_size"), + color="#1A3A5C", + fill="#FFD43B", + stroke=1.5, + shape=21, + tooltips=layer_tooltips().line("@name").line("Connections: @connections"), + ) + scale_size_identity() - # Draw nodes - + geom_point(data=node_df, mapping=aes(x="x", y="y"), size=10, color="#FFD43B", fill="#FFD43B", stroke=2, shape=21) - # Add node labels + # Node labels + geom_text( - data=label_df, mapping=aes(x="x", y="y", label="name"), size=14, color="#306998", fontface="bold", vjust=1 + data=label_df, mapping=aes(x="x", y="y", label="name"), size=16, color="#1A3A5C", fontface="bold", vjust=1 ) # Styling - + xlim(-0.05, 1.05) + + xlim(-0.06, 1.06) + ylim(-0.15, 0.85) - + labs(title="Character Interactions · arc-basic · letsplot · pyplots.ai") + + labs(title="Character Interactions \u00b7 arc-basic \u00b7 letsplot \u00b7 pyplots.ai") + theme( axis_title=element_blank(), axis_text=element_blank(), axis_ticks=element_blank(), axis_line=element_blank(), panel_grid=element_blank(), - panel_background=element_blank(), - plot_title=element_text(size=24, face="bold"), + panel_background=element_rect(fill="white", color="white"), + plot_background=element_rect(fill="white", color="white"), + plot_title=element_text(size=24, face="bold", color="#1A3A5C"), legend_position="none", ) + ggsize(1600, 900) ) -# Save as PNG (scale 3x to get 4800 x 2700 px) +# Save ggsave(plot, "plot.png", path=".", scale=3) - -# Save as HTML for interactive viewing ggsave(plot, "plot.html", path=".") diff --git a/plots/arc-basic/metadata/letsplot.yaml b/plots/arc-basic/metadata/letsplot.yaml index cdce9fd1cb..0c2b7bb2fe 100644 --- a/plots/arc-basic/metadata/letsplot.yaml +++ b/plots/arc-basic/metadata/letsplot.yaml @@ -1,16 +1,16 @@ library: letsplot specification_id: arc-basic created: '2025-12-23T08:49:14Z' -updated: '2025-12-23T09:04:29Z' -generated_by: claude-opus-4-5-20251101 +updated: '2026-02-23T12:00:00+00:00' +generated_by: claude-opus-4-6 workflow_run: 20455965726 issue: 0 -python_version: 3.13.11 +python_version: '3.14.3' library_version: 4.8.2 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot.html -quality_score: 92 +quality_score: null impl_tags: dependencies: [] techniques: From cc5afceee3f298baafe37c2ee4b24d03820a7e2e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:34:49 +0000 Subject: [PATCH 2/8] chore(letsplot): update quality score 87 and review feedback for arc-basic --- plots/arc-basic/implementations/letsplot.py | 4 +- plots/arc-basic/metadata/letsplot.yaml | 268 ++++++++++---------- 2 files changed, 143 insertions(+), 129 deletions(-) diff --git a/plots/arc-basic/implementations/letsplot.py b/plots/arc-basic/implementations/letsplot.py index 0cc7fd1dea..18403f9933 100644 --- a/plots/arc-basic/implementations/letsplot.py +++ b/plots/arc-basic/implementations/letsplot.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai arc-basic: Basic Arc Diagram Library: letsplot 4.8.2 | Python 3.14.3 -Quality: /100 | Updated: 2026-02-23 +Quality: 87/100 | Updated: 2026-02-23 """ import numpy as np diff --git a/plots/arc-basic/metadata/letsplot.yaml b/plots/arc-basic/metadata/letsplot.yaml index 0c2b7bb2fe..1de3fd31e2 100644 --- a/plots/arc-basic/metadata/letsplot.yaml +++ b/plots/arc-basic/metadata/letsplot.yaml @@ -1,179 +1,188 @@ library: letsplot specification_id: arc-basic created: '2025-12-23T08:49:14Z' -updated: '2026-02-23T12:00:00+00:00' +updated: '2026-02-23T21:34:49Z' generated_by: claude-opus-4-6 workflow_run: 20455965726 issue: 0 -python_version: '3.14.3' +python_version: 3.14.3 library_version: 4.8.2 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot.html -quality_score: null +quality_score: 87 impl_tags: dependencies: [] techniques: - layer-composition + - hover-tooltips - html-export patterns: - data-generation - iteration-over-groups - - matrix-construction dataprep: [] styling: + - minimal-chrome - alpha-blending + - edge-highlighting review: strengths: - - Excellent visual design with clear proportional arc heights showing connection - distances - - Smart use of semi-transparency (alpha=0.6) for overlapping arcs - - Weight-based line thickness provides additional dimension - - Clean minimalist styling with hidden axes appropriate for arc diagrams - - Realistic character interaction scenario matches spec applications - - Well-structured code following KISS principles + - Clean cohesive blue monochromatic palette with yellow node accents creating effective + visual contrast + - 'Correct visual hierarchy: node size by connection weight, arc thickness/color/height + by edge weight' + - Comprehensive data covering all arc diagram features (short/long-range, varied + weights, overlapping arcs) + - Interactive tooltips via layer_tooltips showing connection details and strength + - Well-structured deterministic code with clean minimal chrome (all spines/axes/grid + removed) weaknesses: - - Node labels could be slightly larger for optimal readability at high resolution - - Does not leverage lets-plot specific interactive features (could use tooltips - on hover) - image_description: The plot displays a well-executed arc diagram visualizing character - interactions. Ten nodes (Alice, Bob, Carol, David, Eve, Frank, Grace, Henry, Iris, - Jack) are arranged horizontally along a baseline, represented as yellow circular - markers. Blue semi-transparent arcs curve above the baseline connecting related - characters. Arc heights are proportional to the distance between connected nodes - - short-range connections (like Alice-Bob) have low arcs while long-range connections - (like Alice-Jack) have tall arcs spanning nearly the full width. Arc thickness - varies based on connection weight, with stronger connections appearing thicker. - The title "Character Interactions · arc-basic · letsplot · pyplots.ai" appears - at the top left in bold. Node labels are displayed below each node in bold blue - text. The design uses a clean white background with no axis lines or grid. + - Title format includes non-standard prefix before required spec-id format, no weight + legend + - Weight-1 arcs are faint (alpha=0.5 with light blue) reducing visibility + - Wasted vertical space below node labels (ylim extends too far) + - Node label font size (16pt) could be larger for optimal readability at full resolution + 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 from left to right. Each node is rendered as a yellow circle + (#FFD43B) with a dark blue (#1A3A5C) outline, with sizes varying by total connection + weight — Alice and David are the largest. Arcs connect node pairs above the baseline + using a blue monochromatic palette: light blue (#93B8CC, alpha 0.5) for weight-1 + connections, medium blue (#306998, alpha 0.65) for weight-2, and dark blue (#1A3A5C, + alpha 0.8) for weight-3. Arc height is proportional to the distance between connected + nodes — the Alice-Jack arc spans the full width and reaches the highest point. + Arc thickness also scales with weight. A subtle gray baseline connects all nodes. + Node labels appear in bold dark blue text below the baseline. The title "Character + Interactions · arc-basic · letsplot · pyplots.ai" is positioned in the upper left + in bold dark blue. The background is clean white with no axes, spines, or grid + lines.' criteria_checklist: visual_quality: - score: 36 - max: 40 + score: 27 + max: 30 items: - id: VQ-01 name: Text Legibility - score: 9 - max: 10 + score: 7 + max: 8 passed: true - comment: Title and labels are clearly readable. Font sizes are appropriate - for the output resolution. Labels could be slightly larger for optimal readability. + comment: Title explicitly set to 24pt, node labels to 16pt bold. All readable; + labels could be slightly larger (18-20pt). - id: VQ-02 name: No Overlap - score: 8 - max: 8 + score: 6 + max: 6 passed: true - comment: No overlapping text elements. Node labels are well-spaced and arcs - do not obscure labels. + comment: No overlapping text or elements. Labels well-spaced below baseline, + arcs above. - id: VQ-03 name: Element Visibility - score: 7 - max: 8 + score: 5 + max: 6 passed: true - comment: Nodes are clearly visible with good sizing. Arcs use appropriate - alpha (0.6) for overlapping connections. Some thinner arcs could be slightly - more visible. + comment: Most elements well-sized. Weight-1 arcs (alpha=0.5, light blue) are + somewhat faint. Smaller nodes appear small. - id: VQ-04 name: Color Accessibility - score: 5 - max: 5 + score: 4 + max: 4 passed: true - comment: Blue (#306998) and yellow (#FFD43B) provide excellent contrast. Colorblind-safe - combination. + comment: Blue monochromatic scheme with yellow accents. Fully colorblind-safe. - id: VQ-05 - name: Layout Balance - score: 5 - max: 5 + name: Layout & Canvas + score: 3 + max: 4 passed: true - comment: Excellent use of canvas space. Arcs fill the upper portion well, - nodes centered horizontally. + comment: Good horizontal utilization. Some wasted vertical space below node + labels. - id: VQ-06 - name: Axis Labels - score: 0 - max: 2 - passed: true - comment: N/A for arc diagrams (axes are hidden by design), but no descriptive - subtitle or legend explaining the visualization. - - id: VQ-07 - name: Grid & Legend + name: Axis Labels & Title score: 2 max: 2 passed: true - comment: Appropriately no grid for this diagram type. Legend hidden as connection - weights are shown via line thickness. + comment: Descriptive title present. Axes appropriately hidden for arc diagram. + design_excellence: + score: 14 + max: 20 + items: + - id: DE-01 + name: Aesthetic Sophistication + score: 5 + max: 8 + passed: true + comment: Custom cohesive blue palette with yellow node accents, intentional + color hierarchy by weight. Above defaults but not publication-level. + - id: DE-02 + name: Visual Refinement + score: 5 + max: 6 + passed: true + comment: All spines, axes, and grid removed. Clean white background. Subtle + gray baseline. Well-polished minimal chrome. + - id: DE-03 + name: Data Storytelling + score: 4 + max: 6 + passed: true + comment: Visual hierarchy through node size, arc thickness/color, and arc + height. Alice and David naturally stand out. spec_compliance: - score: 24 - max: 25 + score: 14 + max: 15 items: - id: SC-01 name: Plot Type - score: 8 - max: 8 - passed: true - comment: Correct arc diagram implementation with nodes on horizontal axis - and curved arcs above. - - id: SC-02 - name: Data Mapping score: 5 max: 5 passed: true - comment: Nodes correctly positioned, edges correctly drawn between specified - pairs. - - id: SC-03 + comment: Correct arc diagram with nodes on horizontal line and curved arcs + above, height proportional to node distance. + - id: SC-02 name: Required Features - score: 5 - max: 5 + score: 4 + max: 4 passed: true - comment: 'All spec features present: arc height proportional to distance, - semi-transparent overlapping arcs, readable node labels, weight-based line - thickness.' - - id: SC-04 - name: Data Range + comment: 'All spec features present: arcs, weight-based thickness/color, semi-transparency, + readable labels, proportional arc height.' + - id: SC-03 + name: Data Mapping score: 3 max: 3 passed: true - comment: All nodes and connections visible within the plot area. - - id: SC-05 - name: Legend Accuracy - score: 1 - max: 2 - passed: true - comment: No explicit legend for weights, but thickness variation is intuitive. - Could benefit from a brief explanation. - - id: SC-06 - name: Title Format + comment: 10 nodes correctly positioned, 15 edges correctly mapped with proper + weight encoding. + - id: SC-04 + name: Title & Legend score: 2 - max: 2 - passed: true - comment: 'Title follows exact format: "Character Interactions · arc-basic - · letsplot · pyplots.ai"' + max: 3 + passed: false + comment: Title adds non-standard prefix before required format. No weight + legend. data_quality: - score: 19 - max: 20 + score: 15 + max: 15 items: - id: DQ-01 name: Feature Coverage - score: 7 - max: 8 + score: 6 + max: 6 passed: true - comment: Shows both short-range and long-range connections, varying weights - (1-3), multiple connections per node. Could include isolated node to show - full feature range. + comment: Shows short/long-range connections, three weight levels, overlapping + arcs, varied node connectivity. - id: DQ-02 name: Realistic Context - score: 7 - max: 7 + score: 5 + max: 5 passed: true - comment: Character interactions in a story chapter is a perfect real-world - application matching the spec's narrative flow example. + comment: Character interactions in a story chapter — real, neutral, comprehensible + scenario. - id: DQ-03 name: Appropriate Scale - score: 5 - max: 5 + score: 4 + max: 4 passed: true - comment: 10 nodes with 15 edges is appropriate scale for readability as per - spec (10-50 nodes typical). + comment: 10 nodes in recommended range, 15 edges at reasonable density, weights + 1-3. code_quality: score: 10 max: 10 @@ -183,42 +192,47 @@ review: score: 3 max: 3 passed: true - comment: 'Clean linear structure: imports → data → arc generation → plot → - save. No unnecessary functions or classes.' + comment: 'Flat script: imports, data, plot, save. No functions or classes.' - id: CQ-02 name: Reproducibility - score: 3 - max: 3 + score: 2 + max: 2 passed: true - comment: Uses `np.random.seed(42)` for reproducibility. + comment: All data is deterministic (hard-coded nodes, edges, weights). - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: All imports are used. Explicit imports from lets_plot. + comment: All imports are used; no unused imports. - id: CQ-04 - name: No Deprecated API - score: 1 - max: 1 + name: Code Elegance + score: 2 + max: 2 passed: true - comment: Uses current lets-plot API. + comment: Well-structured, readable code with appropriate complexity. - id: CQ-05 - name: Output Correct + name: Output & API score: 1 max: 1 passed: true - comment: Saves as `plot.png` and `plot.html`. - library_features: - score: 3 - max: 5 + comment: Saves as plot.png with scale=3. Current lets_plot API. + library_mastery: + score: 7 + max: 10 items: - - id: LF-01 + - id: LM-01 + name: Idiomatic Usage + score: 4 + max: 5 + passed: true + comment: Good grammar-of-graphics usage with layered geoms, aes mappings, + scale_*_identity(), theme customization. + - id: LM-02 name: Distinctive Features score: 3 max: 5 passed: true - comment: Uses ggplot2 grammar correctly with geom_path, geom_point, geom_text, - and scale_size_identity. However, does not leverage any lets-plot specific - interactive features or advanced capabilities beyond basic ggplot2 syntax. - verdict: APPROVED + comment: Uses layer_tooltips() for hover information and HTML export via ggsave + — distinctive letsplot features. + verdict: REJECTED From fdf183825e4a86692ec37c4c30745c648da688cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:39:40 +0000 Subject: [PATCH 3/8] fix(letsplot): address review feedback for arc-basic Attempt 1/3 - fixes based on AI review --- plots/arc-basic/implementations/letsplot.py | 43 ++++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/plots/arc-basic/implementations/letsplot.py b/plots/arc-basic/implementations/letsplot.py index 18403f9933..470b6d3a15 100644 --- a/plots/arc-basic/implementations/letsplot.py +++ b/plots/arc-basic/implementations/letsplot.py @@ -1,4 +1,4 @@ -""" pyplots.ai +"""pyplots.ai arc-basic: Basic Arc Diagram Library: letsplot 4.8.2 | Python 3.14.3 Quality: 87/100 | Updated: 2026-02-23 @@ -66,8 +66,8 @@ connections[t] += w # Arc color intensity by weight -weight_colors = {1: "#93B8CC", 2: "#306998", 3: "#1A3A5C"} -weight_alphas = {1: 0.5, 2: 0.65, 3: 0.8} +weight_colors = {1: "#7FAABB", 2: "#306998", 3: "#1A3A5C"} +weight_alphas = {1: 0.6, 2: 0.7, 3: 0.85} weight_labels = {1: "Weak", 2: "Moderate", 3: "Strong"} # Create arc data for geom_path @@ -121,6 +121,30 @@ # Label data (positioned below nodes) label_df = pd.DataFrame({"x": x_positions, "y": [y_baseline - 0.045] * n_nodes, "name": nodes}) +# Legend data: small line segments showing weight encoding +legend_x = 0.88 +legend_y_start = 0.78 +legend_spacing = 0.06 +legend_line_len = 0.07 +legend_lines = pd.DataFrame( + { + "x": [legend_x] * 3, + "xend": [legend_x + legend_line_len] * 3, + "y": [legend_y_start - i * legend_spacing for i in range(3)], + "yend": [legend_y_start - i * legend_spacing for i in range(3)], + "color": [weight_colors[3], weight_colors[2], weight_colors[1]], + "size": [1.0 + 3 * 1.2, 1.0 + 2 * 1.2, 1.0 + 1 * 1.2], + "alpha": [weight_alphas[3], weight_alphas[2], weight_alphas[1]], + } +) +legend_text_df = pd.DataFrame( + { + "x": [legend_x + legend_line_len + 0.015] * 3, + "y": [legend_y_start - i * legend_spacing for i in range(3)], + "label": ["Strong (3)", "Moderate (2)", "Weak (1)"], + } +) + # Plot plot = ( ggplot() @@ -148,12 +172,19 @@ + scale_size_identity() # Node labels + geom_text( - data=label_df, mapping=aes(x="x", y="y", label="name"), size=16, color="#1A3A5C", fontface="bold", vjust=1 + data=label_df, mapping=aes(x="x", y="y", label="name"), size=20, color="#1A3A5C", fontface="bold", vjust=1 + ) + # Weight legend + + geom_segment( + data=legend_lines, + mapping=aes(x="x", y="y", xend="xend", yend="yend", color="color", size="size", alpha="alpha"), + tooltips="none", ) + + geom_text(data=legend_text_df, mapping=aes(x="x", y="y", label="label"), size=14, color="#1A3A5C", hjust=0) # Styling + xlim(-0.06, 1.06) - + ylim(-0.15, 0.85) - + labs(title="Character Interactions \u00b7 arc-basic \u00b7 letsplot \u00b7 pyplots.ai") + + ylim(-0.08, 0.85) + + labs(title="arc-basic \u00b7 letsplot \u00b7 pyplots.ai") + theme( axis_title=element_blank(), axis_text=element_blank(), From 16d4e2d30a3e98482a3a77ce6338d8fd5de005e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:45:51 +0000 Subject: [PATCH 4/8] chore(letsplot): update quality score 88 and review feedback for arc-basic --- plots/arc-basic/implementations/letsplot.py | 4 +- plots/arc-basic/metadata/letsplot.yaml | 140 ++++++++++---------- 2 files changed, 71 insertions(+), 73 deletions(-) diff --git a/plots/arc-basic/implementations/letsplot.py b/plots/arc-basic/implementations/letsplot.py index 470b6d3a15..0b1b05a944 100644 --- a/plots/arc-basic/implementations/letsplot.py +++ b/plots/arc-basic/implementations/letsplot.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai arc-basic: Basic Arc Diagram Library: letsplot 4.8.2 | Python 3.14.3 -Quality: 87/100 | Updated: 2026-02-23 +Quality: 88/100 | Updated: 2026-02-23 """ import numpy as np diff --git a/plots/arc-basic/metadata/letsplot.yaml b/plots/arc-basic/metadata/letsplot.yaml index 1de3fd31e2..1516914e52 100644 --- a/plots/arc-basic/metadata/letsplot.yaml +++ b/plots/arc-basic/metadata/letsplot.yaml @@ -1,7 +1,7 @@ library: letsplot specification_id: arc-basic created: '2025-12-23T08:49:14Z' -updated: '2026-02-23T21:34:49Z' +updated: '2026-02-23T21:45:51Z' generated_by: claude-opus-4-6 workflow_run: 20455965726 issue: 0 @@ -10,11 +10,12 @@ library_version: 4.8.2 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot.html -quality_score: 87 +quality_score: 88 impl_tags: dependencies: [] techniques: - layer-composition + - custom-legend - hover-tooltips - html-export patterns: @@ -27,38 +28,34 @@ impl_tags: - edge-highlighting review: strengths: - - Clean cohesive blue monochromatic palette with yellow node accents creating effective - visual contrast - - 'Correct visual hierarchy: node size by connection weight, arc thickness/color/height - by edge weight' - - Comprehensive data covering all arc diagram features (short/long-range, varied - weights, overlapping arcs) - - Interactive tooltips via layer_tooltips showing connection details and strength - - Well-structured deterministic code with clean minimal chrome (all spines/axes/grid - removed) + - Cohesive monochromatic blue palette with intentional yellow accent creates professional + appearance + - Visual hierarchy through node size, arc height, and weight encoding effectively + communicates connectivity patterns + - All spec requirements fully met with appropriate data context (character interactions) + - Clean code structure with deterministic data and proper lets-plot API usage + - Interactive tooltips on arcs and nodes leverage lets-plot distinctive capabilities weaknesses: - - Title format includes non-standard prefix before required spec-id format, no weight - legend - - Weight-1 arcs are faint (alpha=0.5 with light blue) reducing visibility - - Wasted vertical space below node labels (ylim extends too far) - - Node label font size (16pt) could be larger for optimal readability at full resolution + - Legend text at size=14 is slightly small relative to other text elements + - Bottom portion of canvas has excess whitespace below node labels + - Weak (weight-1) arcs could have slightly better contrast against white background 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 from left to right. Each node is rendered as a yellow circle - (#FFD43B) with a dark blue (#1A3A5C) outline, with sizes varying by total connection - weight — Alice and David are the largest. Arcs connect node pairs above the baseline - using a blue monochromatic palette: light blue (#93B8CC, alpha 0.5) for weight-1 - connections, medium blue (#306998, alpha 0.65) for weight-2, and dark blue (#1A3A5C, - alpha 0.8) for weight-3. Arc height is proportional to the distance between connected - nodes — the Alice-Jack arc spans the full width and reaches the highest point. - Arc thickness also scales with weight. A subtle gray baseline connects all nodes. - Node labels appear in bold dark blue text below the baseline. The title "Character - Interactions · arc-basic · letsplot · pyplots.ai" is positioned in the upper left - in bold dark blue. The background is clean white with no axes, spines, or grid - lines.' + a horizontal baseline on a clean white background. Arcs curve above the baseline + connecting pairs of nodes, with arc height proportional to the distance between + connected nodes — the Alice-Jack arc spans the full width and is the tallest. + Arcs use a monochromatic blue color scheme with three levels: Strong connections + (weight 3) are thick dark navy (#1A3A5C), Moderate (weight 2) are medium blue + (#306998), and Weak (weight 1) are thin light blue (#7FAABB) with varying transparency. + Nodes are rendered as yellow-filled circles (#FFD43B) with dark blue outlines, + sized proportionally to total connection weight — Alice and David appear as the + largest hubs. Bold dark navy labels sit below each node. A manual legend in the + upper right shows the three weight categories with matching line samples. The + title "arc-basic · letsplot · pyplots.ai" appears in bold dark text at the top + left.' criteria_checklist: visual_quality: - score: 27 + score: 26 max: 30 items: - id: VQ-01 @@ -66,68 +63,68 @@ review: score: 7 max: 8 passed: true - comment: Title explicitly set to 24pt, node labels to 16pt bold. All readable; - labels could be slightly larger (18-20pt). + comment: Title at size=24 bold, node labels at size=20 bold, all clearly readable. + Legend text at size=14 is slightly below recommended 16pt minimum. - id: VQ-02 name: No Overlap - score: 6 + score: 5 max: 6 passed: true - comment: No overlapping text or elements. Labels well-spaced below baseline, - arcs above. + comment: No actual overlapping text, but Carol and David labels are quite + close together. All labels remain readable. - id: VQ-03 name: Element Visibility score: 5 max: 6 passed: true - comment: Most elements well-sized. Weight-1 arcs (alpha=0.5, light blue) are - somewhat faint. Smaller nodes appear small. + comment: Arcs well-differentiated by thickness and color. Weak arcs somewhat + faint at 0.6 alpha with lightest blue. - id: VQ-04 name: Color Accessibility score: 4 max: 4 passed: true - comment: Blue monochromatic scheme with yellow accents. Fully colorblind-safe. + comment: Monochromatic blue scheme is inherently colorblind-safe. Yellow accent + nodes provide strong contrast. - id: VQ-05 name: Layout & Canvas score: 3 max: 4 passed: true - comment: Good horizontal utilization. Some wasted vertical space below node - labels. + comment: Good horizontal usage. Some wasted vertical space below the labels. - id: VQ-06 name: Axis Labels & Title score: 2 max: 2 passed: true - comment: Descriptive title present. Axes appropriately hidden for arc diagram. + comment: Axes appropriately hidden. Title follows required format. design_excellence: - score: 14 + score: 15 max: 20 items: - id: DE-01 name: Aesthetic Sophistication - score: 5 + score: 6 max: 8 passed: true - comment: Custom cohesive blue palette with yellow node accents, intentional - color hierarchy by weight. Above defaults but not publication-level. + comment: Strong design with cohesive monochromatic blue palette and intentional + yellow accent. Clear typographic hierarchy. Above defaults but not publication-ready. - id: DE-02 name: Visual Refinement score: 5 max: 6 passed: true - comment: All spines, axes, and grid removed. Clean white background. Subtle - gray baseline. Well-polished minimal chrome. + comment: All chrome removed, clean white background, subtle baseline, well-crafted + manual legend. Minor excess whitespace at bottom. - id: DE-03 name: Data Storytelling score: 4 max: 6 passed: true - comment: Visual hierarchy through node size, arc thickness/color, and arc - height. Alice and David naturally stand out. + comment: Visual hierarchy through node size, arc height, and weight encoding. + Alice and David emerge as hubs. Long-range vs short-range clearly visible. spec_compliance: - score: 14 + score: 15 max: 15 items: - id: SC-01 @@ -136,28 +133,28 @@ review: max: 5 passed: true comment: Correct arc diagram with nodes on horizontal line and curved arcs - above, height proportional to node distance. + above. - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: 'All spec features present: arcs, weight-based thickness/color, semi-transparency, - readable labels, proportional arc height.' + comment: 'All spec requirements present: ordered nodes, curved arcs, weight-based + styling, semi-transparency, readable labels, color coding.' - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: 10 nodes correctly positioned, 15 edges correctly mapped with proper - weight encoding. + comment: Nodes correctly positioned, arcs connect specified pairs, heights + proportional to distance. - id: SC-04 name: Title & Legend - score: 2 + score: 3 max: 3 - passed: false - comment: Title adds non-standard prefix before required format. No weight - legend. + passed: true + comment: Title follows required format. Manual legend accurately represents + weight categories. data_quality: score: 15 max: 15 @@ -167,8 +164,8 @@ review: score: 6 max: 6 passed: true - comment: Shows short/long-range connections, three weight levels, overlapping - arcs, varied node connectivity. + comment: Shows short-range, long-range, varying weights, multiple hubs, diverse + connectivity patterns. - id: DQ-02 name: Realistic Context score: 5 @@ -181,8 +178,7 @@ review: score: 4 max: 4 passed: true - comment: 10 nodes in recommended range, 15 edges at reasonable density, weights - 1-3. + comment: 10 nodes, 15 edges, weights 1-3 — good density and clear differentiation. code_quality: score: 10 max: 10 @@ -192,31 +188,32 @@ review: score: 3 max: 3 passed: true - comment: 'Flat script: imports, data, plot, save. No functions or classes.' + comment: Clean Imports → Data → Plot → Save structure with no functions or + classes. - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: All data is deterministic (hard-coded nodes, edges, weights). + comment: All data is deterministic, hardcoded nodes and edges. - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: All imports are used; no unused imports. + comment: All imports are used. - id: CQ-04 name: Code Elegance score: 2 max: 2 passed: true - comment: Well-structured, readable code with appropriate complexity. + comment: Appropriate complexity for custom visualization. No fake functionality. - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Saves as plot.png with scale=3. Current lets_plot API. + comment: Saves as plot.png with ggsave(scale=3). Uses current lets-plot API. library_mastery: score: 7 max: 10 @@ -226,13 +223,14 @@ review: score: 4 max: 5 passed: true - comment: Good grammar-of-graphics usage with layered geoms, aes mappings, - scale_*_identity(), theme customization. + comment: Proper ggplot grammar with layered geoms, aes mappings, scale_*_identity(), + and theme system. Manual arc calculation is appropriate since lets-plot + lacks native arc geom. - id: LM-02 name: Distinctive Features score: 3 max: 5 passed: true - comment: Uses layer_tooltips() for hover information and HTML export via ggsave - — distinctive letsplot features. + comment: Uses layer_tooltips() for interactive hover on arcs and nodes. Exports + both PNG and HTML. verdict: REJECTED From 821fed8d367f552680886447d3df1bfc8e66c141 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:51:18 +0000 Subject: [PATCH 5/8] fix(letsplot): address review feedback for arc-basic Attempt 2/3 - fixes based on AI review --- plots/arc-basic/implementations/letsplot.py | 25 ++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/plots/arc-basic/implementations/letsplot.py b/plots/arc-basic/implementations/letsplot.py index 0b1b05a944..9e9c96a14c 100644 --- a/plots/arc-basic/implementations/letsplot.py +++ b/plots/arc-basic/implementations/letsplot.py @@ -1,4 +1,4 @@ -""" pyplots.ai +"""pyplots.ai arc-basic: Basic Arc Diagram Library: letsplot 4.8.2 | Python 3.14.3 Quality: 88/100 | Updated: 2026-02-23 @@ -66,8 +66,8 @@ connections[t] += w # Arc color intensity by weight -weight_colors = {1: "#7FAABB", 2: "#306998", 3: "#1A3A5C"} -weight_alphas = {1: 0.6, 2: 0.7, 3: 0.85} +weight_colors = {1: "#6A9BB5", 2: "#306998", 3: "#1A3A5C"} +weight_alphas = {1: 0.7, 2: 0.75, 3: 0.9} weight_labels = {1: "Weak", 2: "Moderate", 3: "Strong"} # Create arc data for geom_path @@ -122,8 +122,8 @@ label_df = pd.DataFrame({"x": x_positions, "y": [y_baseline - 0.045] * n_nodes, "name": nodes}) # Legend data: small line segments showing weight encoding -legend_x = 0.88 -legend_y_start = 0.78 +legend_x = 0.82 +legend_y_start = 0.76 legend_spacing = 0.06 legend_line_len = 0.07 legend_lines = pd.DataFrame( @@ -144,6 +144,7 @@ "label": ["Strong (3)", "Moderate (2)", "Weak (1)"], } ) +legend_title_df = pd.DataFrame({"x": [legend_x], "y": [legend_y_start + 0.05], "label": ["Connection Strength"]}) # Plot plot = ( @@ -180,10 +181,18 @@ mapping=aes(x="x", y="y", xend="xend", yend="yend", color="color", size="size", alpha="alpha"), tooltips="none", ) - + geom_text(data=legend_text_df, mapping=aes(x="x", y="y", label="label"), size=14, color="#1A3A5C", hjust=0) + + geom_text(data=legend_text_df, mapping=aes(x="x", y="y", label="label"), size=16, color="#1A3A5C", hjust=0) + + geom_text( + data=legend_title_df, + mapping=aes(x="x", y="y", label="label"), + size=16, + color="#1A3A5C", + fontface="bold", + hjust=0, + ) # Styling - + xlim(-0.06, 1.06) - + ylim(-0.08, 0.85) + + xlim(-0.06, 1.12) + + ylim(-0.04, 0.85) + labs(title="arc-basic \u00b7 letsplot \u00b7 pyplots.ai") + theme( axis_title=element_blank(), From 32ecc5da7b6e94b1d3b6e731b9c75192549470a4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 21:57:26 +0000 Subject: [PATCH 6/8] chore(letsplot): update quality score 89 and review feedback for arc-basic --- plots/arc-basic/implementations/letsplot.py | 4 +- plots/arc-basic/metadata/letsplot.yaml | 137 ++++++++++---------- 2 files changed, 73 insertions(+), 68 deletions(-) diff --git a/plots/arc-basic/implementations/letsplot.py b/plots/arc-basic/implementations/letsplot.py index 9e9c96a14c..98b956a87b 100644 --- a/plots/arc-basic/implementations/letsplot.py +++ b/plots/arc-basic/implementations/letsplot.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai arc-basic: Basic Arc Diagram Library: letsplot 4.8.2 | Python 3.14.3 -Quality: 88/100 | Updated: 2026-02-23 +Quality: 89/100 | Updated: 2026-02-23 """ import numpy as np diff --git a/plots/arc-basic/metadata/letsplot.yaml b/plots/arc-basic/metadata/letsplot.yaml index 1516914e52..44e70725a5 100644 --- a/plots/arc-basic/metadata/letsplot.yaml +++ b/plots/arc-basic/metadata/letsplot.yaml @@ -1,7 +1,7 @@ library: letsplot specification_id: arc-basic created: '2025-12-23T08:49:14Z' -updated: '2026-02-23T21:45:51Z' +updated: '2026-02-23T21:57:26Z' generated_by: claude-opus-4-6 workflow_run: 20455965726 issue: 0 @@ -10,7 +10,7 @@ library_version: 4.8.2 preview_url: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/arc-basic/letsplot/plot.html -quality_score: 88 +quality_score: 89 impl_tags: dependencies: [] techniques: @@ -28,76 +28,80 @@ impl_tags: - edge-highlighting review: strengths: - - Cohesive monochromatic blue palette with intentional yellow accent creates professional - appearance - - Visual hierarchy through node size, arc height, and weight encoding effectively - communicates connectivity patterns - - All spec requirements fully met with appropriate data context (character interactions) - - Clean code structure with deterministic data and proper lets-plot API usage - - Interactive tooltips on arcs and nodes leverage lets-plot distinctive capabilities + - Professional blue monochromatic palette with yellow node accents creates a distinctive, + polished look + - All spec requirements fully implemented including proportional arc height, weight + encoding, and semi-transparency + - Interactive tooltips leveraging lets-plot distinctive layer_tooltips feature + - Clean, minimal design with no visual clutter (all axes/grid/spines removed) + - 'Good data storytelling through visual hierarchy: node sizing reveals hub characters, + arc height shows connection range' weaknesses: - - Legend text at size=14 is slightly small relative to other text elements - - Bottom portion of canvas has excess whitespace below node labels - - Weak (weight-1) arcs could have slightly better contrast against white background + - Node labels Carol/David and Grace/Henry are very close together, reducing readability + - Some low-connectivity nodes (Eve, Grace) are relatively small + - Manual legend construction is verbose + - Some vertical canvas space underutilized below the node labels 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 on a clean white background. Arcs curve above the baseline - connecting pairs of nodes, with arc height proportional to the distance between - connected nodes — the Alice-Jack arc spans the full width and is the tallest. - Arcs use a monochromatic blue color scheme with three levels: Strong connections - (weight 3) are thick dark navy (#1A3A5C), Moderate (weight 2) are medium blue - (#306998), and Weak (weight 1) are thin light blue (#7FAABB) with varying transparency. - Nodes are rendered as yellow-filled circles (#FFD43B) with dark blue outlines, - sized proportionally to total connection weight — Alice and David appear as the - largest hubs. Bold dark navy labels sit below each node. A manual legend in the - upper right shows the three weight categories with matching line samples. The - title "arc-basic · letsplot · pyplots.ai" appears in bold dark text at the top - left.' + a horizontal baseline. Curved arcs connect pairs of nodes above the baseline, + with arc height proportional to the distance between connected nodes — the Alice-Jack + arc spanning the full width is the tallest. Arcs are rendered in a blue monochromatic + palette: dark navy (#1A3A5C) for strong (weight 3) connections, medium blue (#306998) + for moderate (weight 2), and light steel blue (#6A9BB5) for weak (weight 1). Arc + thickness also increases with weight. Nodes are yellow-filled circles (#FFD43B) + with dark blue outlines, sized proportionally to total connection weight — Alice, + Bob, Carol, and David appear largest. Bold dark blue node labels sit below the + baseline. A custom legend in the upper-right labeled "Connection Strength" shows + three line samples for Strong (3), Moderate (2), and Weak (1). The title "arc-basic + · letsplot · pyplots.ai" appears top-left in bold dark blue. The background is + clean white with no axes, grid, or spines.' criteria_checklist: visual_quality: - score: 26 + score: 27 max: 30 items: - id: VQ-01 name: Text Legibility - score: 7 + score: 8 max: 8 passed: true - comment: Title at size=24 bold, node labels at size=20 bold, all clearly readable. - Legend text at size=14 is slightly below recommended 16pt minimum. + comment: 'All font sizes explicitly set: title=24, labels=20, legend=16. All + text clearly readable.' - id: VQ-02 name: No Overlap score: 5 max: 6 passed: true - comment: No actual overlapping text, but Carol and David labels are quite - close together. All labels remain readable. + comment: Carol/David and Grace/Henry labels very close together, nearly touching + but not overlapping. - id: VQ-03 name: Element Visibility score: 5 max: 6 passed: true - comment: Arcs well-differentiated by thickness and color. Weak arcs somewhat - faint at 0.6 alpha with lightest blue. + comment: Arcs well differentiated. Low-connectivity nodes (Eve, Grace) are + noticeably small. - id: VQ-04 name: Color Accessibility score: 4 max: 4 passed: true - comment: Monochromatic blue scheme is inherently colorblind-safe. Yellow accent - nodes provide strong contrast. + comment: Blue monochromatic palette with yellow accents is fully colorblind-safe. + Redundant encoding via thickness and color. - id: VQ-05 name: Layout & Canvas score: 3 max: 4 passed: true - comment: Good horizontal usage. Some wasted vertical space below the labels. + comment: Good horizontal spread. Some underutilized vertical space below labels + and in upper-left quadrant. - id: VQ-06 name: Axis Labels & Title score: 2 max: 2 passed: true - comment: Axes appropriately hidden. Title follows required format. + comment: Axes appropriately hidden for arc diagram. Title in correct format. + Node labels serve as identifiers. design_excellence: score: 15 max: 20 @@ -107,22 +111,22 @@ review: score: 6 max: 8 passed: true - comment: Strong design with cohesive monochromatic blue palette and intentional - yellow accent. Clear typographic hierarchy. Above defaults but not publication-ready. + comment: 'Strong design: cohesive blue monochromatic palette with yellow accent + for nodes. Clearly above library defaults.' - id: DE-02 name: Visual Refinement score: 5 max: 6 passed: true - comment: All chrome removed, clean white background, subtle baseline, well-crafted - manual legend. Minor excess whitespace at bottom. + comment: 'Very clean: all axes/grid/spines removed, subtle gray baseline, + white background. Custom-styled legend.' - id: DE-03 name: Data Storytelling score: 4 max: 6 passed: true - comment: Visual hierarchy through node size, arc height, and weight encoding. - Alice and David emerge as hubs. Long-range vs short-range clearly visible. + comment: 'Good visual hierarchy: node sizing reveals hub characters, arc height + shows connection range, thickness/color guides weight interpretation.' spec_compliance: score: 15 max: 15 @@ -132,29 +136,29 @@ review: score: 5 max: 5 passed: true - comment: Correct arc diagram with nodes on horizontal line and curved arcs - above. + comment: 'Correct arc diagram: nodes along horizontal line with curved arcs + above.' - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: 'All spec requirements present: ordered nodes, curved arcs, weight-based - styling, semi-transparency, readable labels, color coding.' + comment: 'All spec features present: proportional arc height, semi-transparency, + readable labels, color-coded edges, thickness encoding.' - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: Nodes correctly positioned, arcs connect specified pairs, heights - proportional to distance. + comment: Nodes correctly positioned, arcs connect correct pairs, height/thickness/color + correctly mapped. - id: SC-04 name: Title & Legend score: 3 max: 3 passed: true - comment: Title follows required format. Manual legend accurately represents - weight categories. + comment: Title in correct format. Custom legend clearly shows connection strength + encoding. data_quality: score: 15 max: 15 @@ -164,21 +168,21 @@ review: score: 6 max: 6 passed: true - comment: Shows short-range, long-range, varying weights, multiple hubs, diverse - connectivity patterns. + comment: Shows short/medium/long-range connections, varied weights, varied + node connectivity, overlapping arcs. - id: DQ-02 name: Realistic Context score: 5 max: 5 passed: true - comment: Character interactions in a story chapter — real, neutral, comprehensible - scenario. + comment: Character interactions in a story chapter — real, comprehensible, + neutral scenario matching spec application. - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: 10 nodes, 15 edges, weights 1-3 — good density and clear differentiation. + comment: 10 nodes, 15 edges, weights 1-3 provide good density for readability. code_quality: score: 10 max: 10 @@ -188,32 +192,34 @@ review: score: 3 max: 3 passed: true - comment: Clean Imports → Data → Plot → Save structure with no functions or - classes. + comment: 'Linear flow: imports → data → arc generation → node data → legend + data → plot → save. No functions or classes.' - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: All data is deterministic, hardcoded nodes and edges. + comment: All data is deterministic (hardcoded nodes, edges, positions). - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: All imports are used. + comment: All imports used. Specific imports from lets_plot. - id: CQ-04 name: Code Elegance score: 2 max: 2 passed: true - comment: Appropriate complexity for custom visualization. No fake functionality. + comment: Clean parametric arc generation. Well-organized sections. Appropriate + complexity. - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Saves as plot.png with ggsave(scale=3). Uses current lets-plot API. + comment: Saves as plot.png via ggsave with scale=3. Uses current lets-plot + API. library_mastery: score: 7 max: 10 @@ -223,14 +229,13 @@ review: score: 4 max: 5 passed: true - comment: Proper ggplot grammar with layered geoms, aes mappings, scale_*_identity(), - and theme system. Manual arc calculation is appropriate since lets-plot - lacks native arc geom. + comment: 'Good ggplot grammar: geom_path for arcs, geom_point for nodes, identity + scales, theme(). Manual legend is verbose but necessary.' - id: LM-02 name: Distinctive Features score: 3 max: 5 passed: true - comment: Uses layer_tooltips() for interactive hover on arcs and nodes. Exports - both PNG and HTML. + comment: Uses layer_tooltips() with custom .line() formatting for interactive + hover — a distinctive lets-plot feature. HTML export alongside PNG. verdict: REJECTED From 00a10d617af0976c3658e3daee1dc4322998f8a1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 22:03:49 +0000 Subject: [PATCH 7/8] fix(letsplot): address review feedback for arc-basic Attempt 3/3 - fixes based on AI review --- plots/arc-basic/implementations/letsplot.py | 33 +++++++++++---------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/plots/arc-basic/implementations/letsplot.py b/plots/arc-basic/implementations/letsplot.py index 98b956a87b..fcac090d03 100644 --- a/plots/arc-basic/implementations/letsplot.py +++ b/plots/arc-basic/implementations/letsplot.py @@ -1,7 +1,6 @@ -""" pyplots.ai +"""pyplots.ai arc-basic: Basic Arc Diagram Library: letsplot 4.8.2 | Python 3.14.3 -Quality: 89/100 | Updated: 2026-02-23 """ import numpy as np @@ -55,9 +54,9 @@ (8, 9, 2), # Iris-Jack ] -# Node positions along x-axis -x_positions = np.linspace(0, 1, n_nodes) -y_baseline = 0.08 +# Node positions along x-axis — wider spacing for label readability +x_positions = np.linspace(0, 1.3, n_nodes) +y_baseline = 0.06 # Count connections per node for visual hierarchy connections = [0] * n_nodes @@ -108,9 +107,9 @@ arc_df = pd.DataFrame(arc_data) -# Node data with size based on total connection weight +# Node data with size based on total connection weight (higher floor for peripheral nodes) max_conn = max(connections) -node_sizes = [6 + 10 * (c / max_conn) for c in connections] +node_sizes = [9 + 7 * (c / max_conn) for c in connections] node_df = pd.DataFrame( {"x": x_positions, "y": [y_baseline] * n_nodes, "name": nodes, "node_size": node_sizes, "connections": connections} ) @@ -119,11 +118,11 @@ baseline_df = pd.DataFrame({"x": [x_positions[0]], "xend": [x_positions[-1]], "y": [y_baseline], "yend": [y_baseline]}) # Label data (positioned below nodes) -label_df = pd.DataFrame({"x": x_positions, "y": [y_baseline - 0.045] * n_nodes, "name": nodes}) +label_df = pd.DataFrame({"x": x_positions, "y": [y_baseline - 0.04] * n_nodes, "name": nodes}) # Legend data: small line segments showing weight encoding -legend_x = 0.82 -legend_y_start = 0.76 +legend_x = 1.1 +legend_y_start = 0.72 legend_spacing = 0.06 legend_line_len = 0.07 legend_lines = pd.DataFrame( @@ -155,7 +154,7 @@ + geom_path( data=arc_df, mapping=aes(x="x", y="y", group="edge_id", size="size", color="color", alpha="alpha"), - tooltips=layer_tooltips().line("@connection").line("Strength: @strength"), + tooltips=layer_tooltips().title("@connection").line("Strength|@strength"), ) + scale_size_identity() + scale_color_identity() @@ -168,7 +167,7 @@ fill="#FFD43B", stroke=1.5, shape=21, - tooltips=layer_tooltips().line("@name").line("Connections: @connections"), + tooltips=layer_tooltips().title("@name").line("Total weight|@connections"), ) + scale_size_identity() # Node labels @@ -191,9 +190,12 @@ hjust=0, ) # Styling - + xlim(-0.06, 1.12) - + ylim(-0.04, 0.85) - + labs(title="arc-basic \u00b7 letsplot \u00b7 pyplots.ai") + + xlim(-0.05, 1.48) + + ylim(-0.01, 0.82) + + labs( + title="arc-basic \u00b7 letsplot \u00b7 pyplots.ai", + subtitle="Character interactions in a story chapter \u2014 node size reflects connection strength", + ) + theme( axis_title=element_blank(), axis_text=element_blank(), @@ -203,6 +205,7 @@ panel_background=element_rect(fill="white", color="white"), plot_background=element_rect(fill="white", color="white"), plot_title=element_text(size=24, face="bold", color="#1A3A5C"), + plot_subtitle=element_text(size=16, color="#4A6B82"), legend_position="none", ) + ggsize(1600, 900) From 67eecf903930b68dd0a7bb718a34bec7dca07787 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 22:11:02 +0000 Subject: [PATCH 8/8] chore(letsplot): update quality score 89 and review feedback for arc-basic --- plots/arc-basic/implementations/letsplot.py | 3 +- plots/arc-basic/metadata/letsplot.yaml | 131 ++++++++++---------- 2 files changed, 65 insertions(+), 69 deletions(-) diff --git a/plots/arc-basic/implementations/letsplot.py b/plots/arc-basic/implementations/letsplot.py index fcac090d03..2ec4bd977e 100644 --- a/plots/arc-basic/implementations/letsplot.py +++ b/plots/arc-basic/implementations/letsplot.py @@ -1,6 +1,7 @@ -"""pyplots.ai +""" pyplots.ai arc-basic: Basic Arc Diagram Library: letsplot 4.8.2 | Python 3.14.3 +Quality: 89/100 | Updated: 2026-02-23 """ import numpy as np diff --git a/plots/arc-basic/metadata/letsplot.yaml b/plots/arc-basic/metadata/letsplot.yaml index 44e70725a5..9fd0be51cc 100644 --- a/plots/arc-basic/metadata/letsplot.yaml +++ b/plots/arc-basic/metadata/letsplot.yaml @@ -1,7 +1,7 @@ library: letsplot specification_id: arc-basic created: '2025-12-23T08:49:14Z' -updated: '2026-02-23T21:57:26Z' +updated: '2026-02-23T22:11:01Z' generated_by: claude-opus-4-6 workflow_run: 20455965726 issue: 0 @@ -28,33 +28,33 @@ impl_tags: - edge-highlighting review: strengths: - - Professional blue monochromatic palette with yellow node accents creates a distinctive, - polished look - - All spec requirements fully implemented including proportional arc height, weight - encoding, and semi-transparency - - Interactive tooltips leveraging lets-plot distinctive layer_tooltips feature - - Clean, minimal design with no visual clutter (all axes/grid/spines removed) - - 'Good data storytelling through visual hierarchy: node sizing reveals hub characters, - arc height shows connection range' + - 'Excellent spec compliance with all required features: proportional arc heights, + semi-transparency, weight-based color/thickness encoding, and readable labels' + - Thoughtful custom blue palette with yellow node highlights creates a cohesive + professional color scheme + - Triple visual encoding (node size + arc thickness + arc color) enables effective + data storytelling + - Clean code with deterministic data and appropriate KISS structure + - Uses distinctive letsplot features (layer_tooltips, HTML export) for added interactivity weaknesses: - - Node labels Carol/David and Grace/Henry are very close together, reducing readability - - Some low-connectivity nodes (Eve, Grace) are relatively small - - Manual legend construction is verbose - - Some vertical canvas space underutilized below the node labels + - Subtitle font at 16pt appears slightly small relative to the overall design; could + be 18-20pt + - Upper-left canvas area is underutilized creating mild visual imbalance + - Weak (weight=1) arcs are somewhat thin/light reducing their visual prominence + - Library mastery could be pushed further with additional distinctive letsplot features 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. Curved arcs connect pairs of nodes above the baseline, with arc height proportional to the distance between connected nodes — the Alice-Jack - arc spanning the full width is the tallest. Arcs are rendered in a blue monochromatic - palette: dark navy (#1A3A5C) for strong (weight 3) connections, medium blue (#306998) - for moderate (weight 2), and light steel blue (#6A9BB5) for weak (weight 1). Arc - thickness also increases with weight. Nodes are yellow-filled circles (#FFD43B) - with dark blue outlines, sized proportionally to total connection weight — Alice, - Bob, Carol, and David appear largest. Bold dark blue node labels sit below the - baseline. A custom legend in the upper-right labeled "Connection Strength" shows - three line samples for Strong (3), Moderate (2), and Weak (1). The title "arc-basic - · letsplot · pyplots.ai" appears top-left in bold dark blue. The background is - clean white with no axes, grid, or spines.' + arc spans the full width and rises highest. Arcs vary in thickness and color intensity + by connection weight: dark navy/thick for "Strong (3)", medium blue for "Moderate + (2)", and lighter blue/thin for "Weak (1)". Nodes are yellow-filled circles with + dark blue outlines, sized proportionally to total connection weight (Alice and + David appear largest). A manually constructed legend titled "Connection Strength" + in the upper right shows three weight levels. The title reads "arc-basic · letsplot + · pyplots.ai" in bold dark blue, with a lighter subtitle "Character interactions + in a story chapter — node size reflects connection strength". White background, + no axes or grid.' criteria_checklist: visual_quality: score: 27 @@ -62,46 +62,44 @@ review: items: - id: VQ-01 name: Text Legibility - score: 8 + score: 7 max: 8 passed: true - comment: 'All font sizes explicitly set: title=24, labels=20, legend=16. All - text clearly readable.' + comment: All font sizes explicitly set (title=24, labels=20, legend=16). Subtitle + at 16pt readable but slightly small relative to design. - id: VQ-02 name: No Overlap - score: 5 + score: 6 max: 6 passed: true - comment: Carol/David and Grace/Henry labels very close together, nearly touching - but not overlapping. + comment: No overlapping text. Node labels well-spaced via linspace. - id: VQ-03 name: Element Visibility score: 5 max: 6 passed: true - comment: Arcs well differentiated. Low-connectivity nodes (Eve, Grace) are - noticeably small. + comment: Nodes visible as yellow dots with dark outlines. Weak arcs somewhat + thin but discernible. - id: VQ-04 name: Color Accessibility score: 4 max: 4 passed: true - comment: Blue monochromatic palette with yellow accents is fully colorblind-safe. - Redundant encoding via thickness and color. + comment: Monochromatic blue palette with yellow highlights. No colorblind + issues. - id: VQ-05 name: Layout & Canvas score: 3 max: 4 passed: true - comment: Good horizontal spread. Some underutilized vertical space below labels - and in upper-left quadrant. + comment: Plot fills ~60% of canvas. Upper-left has some unused space. - id: VQ-06 name: Axis Labels & Title score: 2 max: 2 passed: true - comment: Axes appropriately hidden for arc diagram. Title in correct format. - Node labels serve as identifiers. + comment: Axes appropriately hidden for network diagram. Title and subtitle + provide context. design_excellence: score: 15 max: 20 @@ -111,22 +109,22 @@ review: score: 6 max: 8 passed: true - comment: 'Strong design: cohesive blue monochromatic palette with yellow accent - for nodes. Clearly above library defaults.' + comment: Custom blue palette with yellow node highlights. Bold title/subtitle + hierarchy. Clearly above defaults. - id: DE-02 name: Visual Refinement score: 5 max: 6 passed: true - comment: 'Very clean: all axes/grid/spines removed, subtle gray baseline, - white background. Custom-styled legend.' + comment: All chrome removed. Subtle baseline. Manual legend. Generous whitespace. + Very clean. - id: DE-03 name: Data Storytelling score: 4 max: 6 passed: true - comment: 'Good visual hierarchy: node sizing reveals hub characters, arc height - shows connection range, thickness/color guides weight interpretation.' + comment: 'Triple encoding: node size, arc thickness, arc color. Alice clearly + most connected. Long vs short range visible.' spec_compliance: score: 15 max: 15 @@ -136,29 +134,29 @@ review: score: 5 max: 5 passed: true - comment: 'Correct arc diagram: nodes along horizontal line with curved arcs - above.' + comment: Correct arc diagram with nodes along horizontal line and curved 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, color-coded edges, thickness encoding.' + comment: 'All spec features present: proportional arc heights, semi-transparency, + color-coded edges, weight-based thickness.' - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: Nodes correctly positioned, arcs connect correct pairs, height/thickness/color - correctly mapped. + comment: Nodes correctly positioned. Arcs connect correct pairs with height + proportional to distance. - id: SC-04 name: Title & Legend score: 3 max: 3 passed: true - comment: Title in correct format. Custom legend clearly shows connection strength - encoding. + comment: Title matches required format. Manual legend accurately shows weight + levels. data_quality: score: 15 max: 15 @@ -168,21 +166,21 @@ review: score: 6 max: 6 passed: true - comment: Shows short/medium/long-range connections, varied weights, varied - node connectivity, overlapping arcs. + comment: Shows short/long range connections, all weight levels, varying node + sizes from hub to peripheral. - id: DQ-02 name: Realistic Context score: 5 max: 5 passed: true - comment: Character interactions in a story chapter — real, comprehensible, - neutral scenario matching spec application. + comment: Character interactions in a story chapter. Neutral, real-world scenario. - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: 10 nodes, 15 edges, weights 1-3 provide good density for readability. + comment: 10 nodes (within recommended range), 15 edges, weights 1-3. Sensible + for domain. code_quality: score: 10 max: 10 @@ -192,34 +190,31 @@ review: score: 3 max: 3 passed: true - comment: 'Linear flow: imports → data → arc generation → node data → legend - data → plot → save. No functions or classes.' + comment: Imports → Data → Arc generation → Plot → Save. No functions or classes. - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: All data is deterministic (hardcoded nodes, edges, positions). + comment: All data deterministic. No random generation. - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: All imports used. Specific imports from lets_plot. + comment: All imports used. No unused imports. - id: CQ-04 name: Code Elegance score: 2 max: 2 passed: true - comment: Clean parametric arc generation. Well-organized sections. Appropriate - complexity. + comment: Clean arc generation loop. Appropriate complexity. - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Saves as plot.png via ggsave with scale=3. Uses current lets-plot - API. + comment: Saves as plot.png via ggsave with scale=3. Current API. library_mastery: score: 7 max: 10 @@ -229,13 +224,13 @@ review: score: 4 max: 5 passed: true - comment: 'Good ggplot grammar: geom_path for arcs, geom_point for nodes, identity - scales, theme(). Manual legend is verbose but necessary.' + comment: 'Good ggplot grammar: geom_path, geom_point, geom_text. Uses scale_*_identity() + for pre-computed aesthetics.' - id: LM-02 name: Distinctive Features score: 3 max: 5 passed: true - comment: Uses layer_tooltips() with custom .line() formatting for interactive - hover — a distinctive lets-plot feature. HTML export alongside PNG. + comment: Uses layer_tooltips() for interactive hover and exports HTML. Distinctive + letsplot features. verdict: REJECTED