Skip to content

feat(plotly): implement heatmap-basic#1381

Merged
github-actions[bot] merged 4 commits intomainfrom
implementation/heatmap-basic/plotly
Dec 23, 2025
Merged

feat(plotly): implement heatmap-basic#1381
github-actions[bot] merged 4 commits intomainfrom
implementation/heatmap-basic/plotly

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: heatmap-basic - plotly

Implements the plotly version of heatmap-basic.

File: plots/heatmap-basic/implementations/plotly.py


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Dec 23, 2025

AI Review - Attempt 1/3

Image Description

The plot displays a heatmap showing monthly sales data across 8 product categories (Electronics, Clothing, Food, Books, Sports, Home, Beauty, Toys) for all 12 months (Jan-Dec). The heatmap uses a red-blue diverging colorscale (RdBu_r), where deep red indicates high values (~100+ $K) and deep blue indicates low values (near 0 or negative). Each cell contains a numeric annotation showing the exact value. The title "heatmap-basic · plotly · pyplots.ai" is centered at the top. The x-axis shows "Month" and the y-axis shows "Category". A colorbar on the right indicates "Sales ($K)" with values ranging from approximately 0 to 100. The layout is clean with good proportions, and all text is clearly readable.

Quality Score: 92/100

Criteria Checklist

Visual Quality (37/40 pts)

  • VQ-01: Text Legibility (10/10) - Title at 32pt, axis labels at 24pt, tick labels at 18pt, cell annotations at 14pt - all perfectly readable
  • VQ-02: No Overlap (8/8) - No overlapping text elements anywhere
  • VQ-03: Element Visibility (8/8) - Cell sizes are well-proportioned, annotations clearly visible within cells
  • VQ-04: Color Accessibility (5/5) - RdBu_r is a colorblind-safe diverging colormap with good contrast
  • VQ-05: Layout Balance (4/5) - Good proportions, slight room for improvement in margins
  • VQ-06: Axis Labels (1/2) - "Month" and "Category" are descriptive but lack units (though units aren't really applicable here)
  • VQ-07: Grid & Legend (1/2) - Colorbar is well-placed with title and readable ticks; no grid lines (appropriate for heatmap)

Spec Compliance (24/25 pts)

  • SC-01: Plot Type (8/8) - Correct heatmap visualization
  • SC-02: Data Mapping (5/5) - X=months (columns), Y=categories (rows), color=values - correctly implemented
  • SC-03: Required Features (5/5) - Uses diverging colormap ✓, value annotations ✓, colorbar legend ✓
  • SC-04: Data Range (3/3) - All data visible within axes
  • SC-05: Legend Accuracy (1/2) - Colorbar title "Sales ($K)" is accurate but could be more descriptive
  • SC-06: Title Format (2/2) - Correctly uses "heatmap-basic · plotly · pyplots.ai"

Data Quality (18/20 pts)

  • DQ-01: Feature Coverage (7/8) - Shows variation across categories and months with seasonal patterns (summer/holiday boosts); includes one negative value (-2 in Beauty/Mar)
  • DQ-02: Realistic Context (7/7) - Monthly retail sales by category is a plausible real-world scenario
  • DQ-03: Appropriate Scale (4/5) - Values 0-106 $K are reasonable for retail sales, though some randomness leads to slight inconsistencies

Code Quality (10/10 pts)

  • CQ-01: KISS Structure (3/3) - Simple imports → data → plot → save structure, no functions/classes
  • CQ-02: Reproducibility (3/3) - Uses np.random.seed(42)
  • CQ-03: Clean Imports (2/2) - Only numpy and plotly.graph_objects used
  • CQ-04: No Deprecated API (1/1) - Uses current Plotly API
  • CQ-05: Output Correct (1/1) - Saves as plot.png and plot.html

Library Features (3/5 pts)

  • LF-01: Uses distinctive library features (3/5) - Uses go.Heatmap with proper configuration, texttemplate for annotations, plotly_white template; could leverage more Plotly-specific features like hover customization

Strengths

  • Excellent text legibility with well-chosen font sizes for all elements
  • Perfect implementation of spec requirements: diverging colormap, cell annotations, and colorbar
  • Realistic business scenario with seasonal patterns visible in the data
  • Clean KISS code structure following plotly library guidelines exactly
  • Good use of RdBu_r colormap which is colorblind-accessible

Weaknesses

  • Axis labels could be more descriptive (e.g., "Product Category" instead of just "Category")
  • Colorbar title could include more context (e.g., "Monthly Sales ($K)")
  • Could leverage additional Plotly features like custom hover templates for enhanced interactivity

Verdict: APPROVED

@github-actions github-actions Bot added the quality:92 Quality score 92/100 label Dec 23, 2025
@github-actions github-actions Bot added the ai-approved Quality OK, ready for merge label Dec 23, 2025
@github-actions github-actions Bot merged commit eb8089e into main Dec 23, 2025
0 of 3 checks passed
@github-actions github-actions Bot deleted the implementation/heatmap-basic/plotly branch December 23, 2025 00:51
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 quality:92 Quality score 92/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants