Skip to content

feat(plotnine): implement parallel-categories-basic#2852

Merged
github-actions[bot] merged 6 commits intomainfrom
implementation/parallel-categories-basic/plotnine
Dec 30, 2025
Merged

feat(plotnine): implement parallel-categories-basic#2852
github-actions[bot] merged 6 commits intomainfrom
implementation/parallel-categories-basic/plotnine

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: parallel-categories-basic - plotnine

Implements the plotnine version of parallel-categories-basic.

File: plots/parallel-categories-basic/implementations/plotnine.py


🤖 impl-generate workflow

github-actions Bot and others added 2 commits December 30, 2025 21:53
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 30, 2025

AI Review - Attempt 1/3

Image Description

The plot displays a parallel categories diagram visualizing customer journey data across four dimensions: Channel (Online, Store, Mobile), Product (Electronics, Clothing, Home), Customer (New, Returning), and Outcome (Purchased, Abandoned). The visualization uses gray rectangular nodes for each category with white count labels inside them. Curved ribbons connect categories between adjacent dimensions, colored by outcome - yellow/gold for "Purchased" and blue for "Abandoned". The title "Customer Journey · parallel-categories-basic · plotnine · pyplots.ai" is displayed at the top. Dimension labels appear above each column of nodes, and category labels are positioned to the left of the first dimension and right of the last dimension. A legend on the right shows the outcome color mapping. The overall layout uses a clean white background with good spacing between elements.

Quality Score: 88/100

Criteria Checklist

Visual Quality (35/40 pts)

  • VQ-01: Text Legibility (9/10) - Title is large and bold, dimension labels are clear, category labels readable. Node count labels are slightly small but legible.
  • VQ-02: No Overlap (8/8) - No overlapping text elements, all labels are clearly separated.
  • VQ-03: Element Visibility (7/8) - Ribbons are well-sized with good alpha transparency (0.5), nodes are appropriately sized. Some ribbons crossing could be slightly clearer.
  • VQ-04: Color Accessibility (4/5) - Yellow/blue color scheme is colorblind-friendly. Could benefit from higher contrast between the two colors.
  • VQ-05: Layout Balance (5/5) - Excellent use of canvas space, plot fills appropriate area with balanced margins.
  • VQ-06: Axis Labels (0/2) - N/A for this plot type (no traditional axes), but dimension labels serve this purpose well. Giving 0 as technically no axis labels.
  • VQ-07: Grid & Legend (2/2) - No grid (appropriate for this plot type), legend is well-positioned on the right.

Spec Compliance (23/25 pts)

  • SC-01: Plot Type (8/8) - Correct parallel categories plot with vertical axes and width-proportional ribbons.
  • SC-02: Data Mapping (5/5) - Four categorical dimensions correctly mapped: Channel → Product → Customer Type → Outcome.
  • SC-03: Required Features (4/5) - Ribbons show observation flow, colored by outcome. Missing interactive highlighting (but not possible in static plotnine).
  • SC-04: Data Range (3/3) - All categories visible with appropriate sizing.
  • SC-05: Legend Accuracy (2/2) - Legend correctly labels "Purchased" and "Abandoned" with matching colors.
  • SC-06: Title Format (1/2) - Title includes spec-id, library, and pyplots.ai but prepends "Customer Journey" which deviates from the expected format.

Data Quality (18/20 pts)

  • DQ-01: Feature Coverage (7/8) - Shows multiple channels, product categories, customer types, and outcomes with varying flow widths. Good demonstration of ribbon crossings and path diversity.
  • DQ-02: Realistic Context (7/7) - Customer journey through e-commerce is a perfect, neutral real-world scenario.
  • DQ-03: Appropriate Scale (4/5) - Count values (15-187) are realistic for customer journey data. Total counts per category are sensible.

Code Quality (9/10 pts)

  • CQ-01: KISS Structure (3/3) - Follows imports → data → plot → save structure. More complex than typical due to custom polygon calculation, but necessary for this plot type.
  • CQ-02: Reproducibility (3/3) - Uses np.random.seed(42).
  • CQ-03: Clean Imports (1/2) - One unused import: coord_cartesian is imported but could be considered necessary for the xlim/ylim settings.
  • CQ-04: No Deprecated API (1/1) - Uses current plotnine API.
  • CQ-05: Output Correct (1/1) - Saves as plot.png with dpi=300.

Library Features (3/5 pts)

  • LF-01: Uses distinctive library features (3/5) - Uses plotnine's ggplot grammar (geom_polygon, geom_rect, geom_text, theme system). However, parallel categories is not a native plotnine plot type - this is a creative workaround using polygons to simulate the visualization rather than using a native geom.

Strengths

  • Excellent visual implementation of parallel categories using plotnine's polygon and rect geoms as building blocks
  • Clean, professional appearance with well-balanced layout and appropriate use of transparency for ribbons
  • Realistic customer journey scenario with meaningful data that demonstrates the plot type's purpose
  • Smooth curved ribbons using cubic interpolation create an elegant flow visualization
  • Good color scheme (Python blue/yellow) that is colorblind-accessible

Weaknesses

  • Title format deviates from spec by prepending "Customer Journey" instead of using pure "{spec-id} · {library} · pyplots.ai" format
  • Category labels for middle dimensions (Product, Customer) are not displayed beside nodes, only counts shown inside
  • Some ribbon crossings create visual complexity that could be reduced by reordering categories

Verdict: REJECTED

@github-actions github-actions Bot added the quality:88 Quality score: 88/100 label Dec 30, 2025
@github-actions github-actions Bot added ai-rejected Quality not OK, triggers update ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels Dec 30, 2025
- Fix title format to use pure spec-id format (no "Customer Journey" prefix)
- Add category labels for middle dimensions (Product, Customer) below nodes
- Reorder customer categories (Returning before New) to reduce ribbon crossings

Attempt 1/3 - fixes based on AI review
@github-actions
Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 1/3

Applied fixes based on AI review feedback.

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


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 30, 2025

AI Review - Attempt 2/3

Image Description

The plot displays a parallel categories diagram showing customer journey data across four categorical dimensions: Channel (Online, Store, Mobile), Product (Electronics, Clothing, Home), Customer (Returning, New), and Outcome (Purchased, Abandoned). The ribbons connecting categories are colored by outcome - yellow (#FFD43B) for Purchased and blue (#306998) for Abandoned, with 50% transparency. Gray rectangular nodes represent each category with white count labels inside (e.g., 1087 for Online, 1126 for Electronics). Dimension labels appear at the top (Channel, Product, Customer, Outcome). Category labels are positioned: left side for first dimension, right side for last dimension, and below nodes for middle dimensions. The layout uses 16:9 aspect ratio with the title "parallel-categories-basic · plotnine · pyplots.ai" at top center. The legend on the right shows Outcome colors.

Quality Score: 90/100

Criteria Checklist

Visual Quality (37/40 pts)

  • VQ-01: Text Legibility (9/10) - Title at 24pt is clear, dimension labels at 14pt readable, category labels at 9-10pt readable but slightly small for middle dimensions
  • VQ-02: No Overlap (8/8) - No overlapping text elements, category labels well positioned
  • VQ-03: Element Visibility (8/8) - Ribbons clearly visible with appropriate alpha (0.5), nodes well-sized
  • VQ-04: Color Accessibility (5/5) - Yellow vs blue is colorblind-safe (not red-green), good contrast
  • VQ-05: Layout Balance (5/5) - Plot fills canvas well, balanced margins, legend positioned appropriately
  • VQ-06: Axis Labels (0/2) - No axis labels (but appropriate for this plot type that uses dimension labels instead)
  • VQ-07: Grid & Legend (2/2) - No grid (appropriate), legend well-placed on right

Spec Compliance (23/25 pts)

  • SC-01: Plot Type (8/8) - Correct parallel categories with width-proportional ribbons
  • SC-02: Data Mapping (5/5) - Four categorical dimensions correctly mapped with flow connections
  • SC-03: Required Features (4/5) - Has ribbons showing flow, coloring by outcome, category labels. Minor: could show more visual emphasis on ribbon width proportionality
  • SC-04: Data Range (3/3) - All categories and dimensions displayed
  • SC-05: Legend Accuracy (2/2) - Legend correctly shows Purchased/Abandoned colors
  • SC-06: Title Format (2/2) - Uses correct format: "parallel-categories-basic · plotnine · pyplots.ai"

Data Quality (18/20 pts)

  • DQ-01: Feature Coverage (7/8) - Shows multiple dimensions, varied path flows, both outcomes. Good variation in ribbon widths showing different path frequencies
  • DQ-02: Realistic Context (7/7) - Customer journey through e-commerce is realistic and neutral
  • DQ-03: Appropriate Scale (4/5) - Counts are reasonable (12-187 per path), totals make sense for customer data

Code Quality (9/10 pts)

  • CQ-01: KISS Structure (3/3) - Linear structure: imports → data → calculation → plot → save
  • CQ-02: Reproducibility (3/3) - Uses np.random.seed(42)
  • CQ-03: Clean Imports (1/2) - coord_cartesian imported but could use xlim/ylim in theme instead
  • CQ-04: No Deprecated API (1/1) - Current plotnine API
  • CQ-05: Output Correct (1/1) - Saves as plot.png

Library Features (3/5 pts)

  • LF-01: Uses plotnine grammar of graphics (3/5) - Effectively uses geom_polygon for ribbons, geom_rect for nodes, geom_text and annotate for labels. This is a custom implementation since plotnine doesn't have native parallel categories support, demonstrating creative use of basic geoms.

Strengths

  • Creative implementation of parallel categories using plotnine's basic geoms (geom_polygon, geom_rect)
  • Smooth cubic interpolation for ribbon curves creates professional appearance
  • Clear visual distinction between outcomes with yellow/blue color scheme
  • Effective use of transparency (alpha=0.5) for overlapping ribbons
  • Well-organized data structure with explicit path counts
  • Category labels positioned intelligently (left/right/below based on dimension position)
  • Counts displayed inside nodes for quantitative reference

Weaknesses

  • Middle dimension category labels (Product, Customer) positioned below nodes are slightly smaller (9pt) and could be harder to read
  • Some imports may be unused (coord_cartesian could be replaced with theme settings)

Verdict: APPROVED

@github-actions github-actions Bot added the quality:90 Quality score 90/100 label Dec 30, 2025
@github-actions github-actions Bot added the ai-approved Quality OK, ready for merge label Dec 30, 2025
@github-actions github-actions Bot merged commit e82efb1 into main Dec 30, 2025
3 checks passed
@github-actions github-actions Bot deleted the implementation/parallel-categories-basic/plotnine branch December 30, 2025 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants