Skip to content

feat(plotly): implement box-basic#1361

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

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

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: box-basic - plotly

Implements the plotly version of box-basic.

File: plots/box-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 5 box plots showing salary distributions across departments (Engineering, Marketing, Sales, HR, Finance). Each box uses a different color: Engineering (muted blue), Marketing (yellow), Sales (blue), HR (light yellow), Finance (gray). The title "box-basic · plotly · pyplots.ai" is centered at the top. The Y-axis shows "Annual Salary ($)" with values ranging from $0 to $140,000, formatted with dollar signs and commas. The X-axis shows "Department" with 5 category labels. Each box shows the median line, quartile box, and whiskers. Outliers are visible as individual points - notably two outliers in Sales (one very high ~$147k, one very low $5k) and one in Engineering ($57k). The background is clean white with subtle horizontal gridlines.

Quality Score: 91/100

Criteria Checklist

Visual Quality (37/40 pts)

  • VQ-01: Text Legibility (10/10) - Title at 32pt, axis labels at 24pt, tick fonts at 20pt - all clearly readable
  • VQ-02: No Overlap (8/8) - No overlapping text elements, category labels well-spaced
  • VQ-03: Element Visibility (8/8) - Box plots well-sized with clear median lines, whiskers, and visible outlier points
  • VQ-04: Color Accessibility (4/5) - Colors are distinguishable, though yellow boxes (Marketing, HR) are somewhat similar
  • VQ-05: Layout Balance (5/5) - Good proportions, adequate margins, no cut-off content
  • VQ-06: Axis Labels (2/2) - Y-axis has "Annual Salary ($)" with unit, X-axis has "Department"
  • VQ-07: Grid & Legend (0/2) - Grid is subtle (good), but no legend present (acceptable since showlegend=False and colors are decorative)

Spec Compliance (25/25 pts)

  • SC-01: Plot Type (8/8) - Correct box plot type
  • SC-02: Data Mapping (5/5) - Categories on X-axis, values on Y-axis
  • SC-03: Required Features (5/5) - Median line shown, outliers displayed as points, whiskers present, different colors per category
  • SC-04: Data Range (3/3) - Full data range shown including outliers
  • SC-05: Legend Accuracy (2/2) - Legend disabled appropriately (categories labeled on x-axis)
  • SC-06: Title Format (2/2) - Correct format "box-basic · plotly · pyplots.ai"

Data Quality (19/20 pts)

  • DQ-01: Feature Coverage (8/8) - Shows outliers (especially in Sales), different distributions (Engineering highest, HR lowest), varying spreads (Sales widest, HR narrowest)
  • DQ-02: Realistic Context (7/7) - Salary by department is a real, comprehensible scenario with plausible relationships
  • DQ-03: Appropriate Scale (4/5) - Mostly realistic salaries, though the $5k outlier in Sales is unrealistically low for annual salary

Code Quality (10/10 pts)

  • CQ-01: KISS Structure (3/3) - Simple linear structure: imports → data → plot → save
  • CQ-02: Reproducibility (3/3) - np.random.seed(42) is set
  • CQ-03: Clean Imports (2/2) - Only numpy and plotly.graph_objects used
  • CQ-04: No Deprecated API (1/1) - Current API usage
  • CQ-05: Output Correct (1/1) - Saves as plot.png and plot.html

Library Features (0/5 pts)

  • LF-01: Uses distinctive library features (0/5) - Basic go.Box usage without leveraging Plotly-specific features like hover templates, annotations, or interactive elements that would be visible in the HTML output

Strengths

  • Excellent text sizing with title at 32pt and axis labels at 24pt for high readability at 4800x2700
  • Clean, professional appearance with plotly_white template
  • Well-chosen realistic scenario (salary distributions by department) that demonstrates box plot features
  • Good feature coverage showing outliers, varying medians, and different distribution spreads
  • Proper dollar formatting on Y-axis with tickformat="$,.0f"
  • Generates both PNG and HTML outputs for interactivity

Weaknesses

  • The $5k outlier in Sales is unrealistically low for annual salary data (could use clipping or adjust distribution)
  • Does not leverage Plotly-specific features like custom hover templates or quartile annotations
  • VQ-07: Grid/Legend scored 0/2 since no legend is present (though acceptable for this use case)

Verdict: APPROVED

@github-actions github-actions Bot added the quality:91 Quality score 91/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 c052e0e into main Dec 23, 2025
@github-actions github-actions Bot deleted the implementation/box-basic/plotly branch December 23, 2025 00:40
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:91 Quality score 91/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants