Skip to content

feat(bokeh): implement lollipop-grouped#7148

Merged
MarkusNeusinger merged 5 commits into
mainfrom
implementation/lollipop-grouped/bokeh
May 17, 2026
Merged

feat(bokeh): implement lollipop-grouped#7148
MarkusNeusinger merged 5 commits into
mainfrom
implementation/lollipop-grouped/bokeh

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: lollipop-grouped - python/bokeh

Implements the python/bokeh version of lollipop-grouped.

File: plots/lollipop-grouped/implementations/python/bokeh.py

Parent Issue: #3485


🤖 impl-generate workflow

github-actions Bot added 2 commits May 17, 2026 22:27
Regen from quality 92. Addressed:
- Fixed module shadowing issue with bokeh.py filename (sys.path workaround)
- Migrated from deprecated export_png to Selenium headless Chrome
- Updated to Okabe-Ito palette with #009E73 as first series
- Implemented proper theme-adaptive chrome (light/dark)
- Fixed ANYPLOT_THEME environment variable handling
- Corrected output filenames to plot-{THEME}.png/html
- Updated title format with Language identifier (Python)
- Fixed docstring to use "anyplot.ai" instead of "pyplots.ai"
- Improved legend and axis styling for 4800×2700 px canvas
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 17, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): The plot displays a grouped lollipop chart on a warm off-white background (#FAF8F1). The title "lollipop-grouped · Python · bokeh · anyplot.ai" is clearly visible at the top in dark text. The x-axis is labeled "Region" with category names (North, South, East, West) positioned at group centers. The y-axis is labeled "Revenue ($ Million)" with a range from 0 to 105. Four product lines (Electronics, Clothing, Food, Home) are represented with distinct Okabe-Ito colors: green (#009E73), orange (#D55E00), blue (#0072B2), and pink (#CC79A7). Each category shows 4 lollipops side-by-side with thin colored stems and circular markers. The legend in the top-right displays series names with appropriately sized text. Subtle y-axis grid lines aid readability. All text is readable and properly sized (title 28pt, labels 22pt, ticks 18pt).

Dark render (plot-dark.png): The same plot rendered on a warm near-black background (#1A1A17). All chrome elements (title, axis labels, tick labels, grid lines, legend) have adapted to light colors (#F0EFE8 for primary, #B8B7B0 for secondary). Critically, the data colors remain identical to the light render—the green electronics series is #009E73 in both, as are all other product lines. No "dark-on-dark" contrast issues are visible; all text is clearly readable against the dark background. The legend background (#242420) provides appropriate elevation. Grid lines remain subtle and visible. The layout and data presentation are identical to the light render, confirming proper theme adaptation.

Score: 86/100

Category Score Max
Visual Quality 30 30
Design Excellence 9 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 7 10
Total 86 100

Visual Quality (30/30)

  • VQ-01: Text Legibility (8/8) - All font sizes explicitly set; title 28pt, labels 22pt, ticks 18pt; perfectly readable in both themes
  • VQ-02: No Overlap (6/6) - No overlapping text; category labels well-positioned at group centers; all labels fully readable
  • VQ-03: Element Visibility (6/6) - Markers (size=45) and stems (line_width=8) optimally sized for 16 lollipops; clear visual hierarchy
  • VQ-04: Color Accessibility (2/2) - Okabe-Ito palette is CVD-safe; good luminance contrast; no red-green as sole signal
  • VQ-05: Layout & Canvas (4/4) - Plot fills 60-70% of canvas; balanced margins; nothing cut off; legend appropriately placed
  • VQ-06: Axis Labels & Title (2/2) - Y-axis has units ("Revenue ($ Million)"); spec-compliant title format
  • VQ-07: Palette Compliance (2/2) - First series is #009E73; colors follow Okabe-Ito order; backgrounds are #FAF8F1/#1A1A17; both renders theme-correct

Design Excellence (9/20)

  • DE-01: Aesthetic Sophistication (4/8) - Well-configured library defaults; uses Okabe-Ito correctly; clean organization; but no distinctive design innovation or FiveThirtyEight-level sophistication
  • DE-02: Visual Refinement (3/6) - Subtle y-axis grid (α=0.10); legend has background styling; but spines all visible (default); minimal customization beyond defaults
  • DE-03: Data Storytelling (2/6) - Data clearly shows Electronics leading; color creates hierarchy; but no emphasized focal point or narrative emphasis through visual design

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Perfect grouped lollipop chart; thin stems, circular markers, side-by-side positioning with offsets
  • SC-02: Required Features (4/4) - All required elements present: stems, markers, grouping, legend
  • SC-03: Data Mapping (3/3) - X/Y correctly assigned; categories on x-axis; revenue on y-axis; all 16 data points visible
  • SC-04: Title & Legend (3/3) - Title matches spec format; legend labels match data series

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - All lollipop chart aspects represented; multiple series with varied values; good distribution across categories
  • DQ-02: Realistic Context (5/5) - Quarterly revenue by product/region; real business scenario; neutral, plausible, comprehensible
  • DQ-03: Appropriate Scale (4/4) - Values (35–91M) are realistic; y-axis range (0–105) appropriate; proportions make sense

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - Imports → Data → Plot → Save; no functions/classes; straightforward
  • CQ-02: Reproducibility (2/2) - np.random.seed(42) set; deterministic data generation
  • CQ-03: Clean Imports (2/2) - All imports used: numpy, bokeh, selenium; no unused dependencies
  • CQ-04: Code Elegance (2/2) - Clean, Pythonic; appropriate complexity; no fake functionality
  • CQ-05: Output & API (1/1) - Saves as plot-{THEME}.png and plot-{THEME}.html; current API

Library Mastery (7/10)

  • LM-01: Idiomatic Usage (4/5) - Good use of p.scatter(), p.line(), ColumnDataSource; manual legend construction appropriate; theme tokens applied correctly
  • LM-02: Distinctive Features (3/5) - Uses Legend/LegendItem, Selenium PNG export, theme-adaptive chrome; some distinctive features but not groundbreaking

Score Caps Applied

  • None — all thresholds exceeded

Strengths

  • Perfect visual quality: readable text in both themes, no overlap, optimal element sizing
  • Flawless spec compliance: correct plot type, all required features, proper data mapping
  • Strong technical execution: clean code, reproducible, idiomatic Bokeh usage
  • Excellent data quality: realistic business context, comprehensive feature coverage, appropriate scale
  • Perfect theme adaptation: data colors identical across light/dark; chrome properly theme-switched

Weaknesses

  • Limited design sophistication: uses correct defaults but no distinctive aesthetic choices
  • Minimal visual refinement: spines remain visible, grid could be more carefully styled
  • No visual storytelling: data displayed clearly but lacks emphasis or narrative highlight through design

Issues Found

  1. DE-01 LOW (4/8): Generic defaults

    • The plot executes the spec perfectly but applies minimal design thinking beyond library defaults. While technically excellent, it lacks the aesthetic sophistication that would distinguish it as publication-ready design.
  2. DE-02 LOW (3/6): Minimal visual refinement

    • Spines remain on all sides (standard Bokeh); legend could be more minimal (frame/border could be removed). Grid is subtle which is good, but overall styling reflects defaults rather than intentional customization.
  3. DE-03 LOW (2/6): No visual storytelling

    • The plot clearly displays data but doesn't guide the viewer's eye toward insights. Electronics' dominance is obvious but not emphasized through color intensity, size variation, or focal-point design.

AI Feedback for Next Attempt

Design excellence improvements (though not required for approval at 86/100):

  • Remove top/right spines for cleaner L-shaped frame
  • Consider removing legend frame/border for minimal aesthetic
  • Add subtle emphasis to the Electronics series (leading product) through slightly increased saturation or size
  • Refine grid styling: consider x-axis grid for grouped context, or remove grid entirely and rely on y-axis only

Verdict: APPROVED

Reasoning: Score of 86/100 exceeds the Review 1 threshold (≥80 for Attempt 1). Visual Quality is flawless (30/30), Spec Compliance is perfect (15/15), Data Quality is excellent (15/15), and Code Quality is perfect (10/10). Design Excellence is the only area below ideal (9/20), but the core implementation is publication-ready and technically exemplary. This implementation is ready to merge.

@github-actions github-actions Bot added quality:86 Quality score 86/100 ai-rejected Quality not OK, triggers update labels May 17, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 1/4

Applied fixes based on AI review feedback.

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


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 17, 2026

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): Background is warm off-white (#FAF8F1). Title "lollipop-grouped · Python · bokeh · anyplot.ai" and axis labels "Region" and "Revenue ($ Million)" are in dark text (INK token), completely readable against the light surface. Category names (North, South, East, West) and y-axis tick labels are in softer gray (INK_SOFT token), clearly visible. Legend in top-right has elevated background (#FFFDF6) with dark text labels. Data colors are Okabe-Ito palette in correct order: #009E73 (Electronics), #D55E00 (Clothing), #0072B2 (Food), #CC79A7 (Home). Thin colored stems with circular markers arranged in four groups. Y-axis has subtle 10% opacity grid lines. All text and data elements are distinct and legible.

Dark render (plot-dark.png): Background is warm near-black (#1A1A17). Title and axis labels in light text (INK #F0EFE8), tick labels in gray (INK_SOFT #B8B7B0), both clearly visible against dark surface with no contrast failures. Data colors are identical to light render—#009E73, #D55E00, #0072B2, #CC79A7—with only chrome (background, text, grid) flipping between themes. Legend has dark elevated background (#242420) with light text, properly contrasted. Grid lines visible and subtle. No dark-on-dark text failures detected.

Score: 86/100

Category Score Max
Visual Quality 30 30
Design Excellence 11 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 5 10
Total 86 100

Visual Quality (30/30)

  • VQ-01: Text Legibility (8/8) - Font sizes 28pt (title), 22pt (axes), 18pt (ticks) properly scaled for 4800×2700. All readable in both themes.
  • VQ-02: No Overlap (6/6) - Lollipops well-spaced in grouped layout, no collisions.
  • VQ-03: Element Visibility (6/6) - All markers/stems clearly visible. Alpha appropriate (0.85 stems, 0.95 markers).
  • VQ-04: Color Accessibility (2/2) - Okabe-Ito palette is colorblind-safe.
  • VQ-05: Layout & Canvas (4/4) - Good proportions, nothing cut off, generous margins.
  • VQ-06: Axis Labels & Title (2/2) - Format correct, labels descriptive.
  • VQ-07: Palette Compliance (2/2) - First series #009E73, canonical order, backgrounds #FAF8F1/#1A1A17, both renders theme-correct.

Design Excellence (11/20)

  • DE-01: Aesthetic Sophistication (5/8) - Okabe-Ito palette and theme tokens present (good fundamentals), but straightforward without distinctive polish. Markers have white edges but no beyond-default refinements.
  • DE-02: Visual Refinement (4/6) - L-shaped frame, subtle 10% grid, generous whitespace, well-styled legend. Good baseline refinement.
  • DE-03: Data Storytelling (2/6) - Data presented clearly but lacks visual hierarchy or focal point. No emphasis to guide viewer or reveal insight.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Grouped lollipop chart with 4 categories and 4 series implemented correctly.
  • SC-02: Required Features (4/4) - Thin stems, circular markers, distinct colors per series, legend all present.
  • SC-03: Data Mapping (3/3) - X=regions, Y=revenue values, all data correctly mapped.
  • SC-04: Title & Legend (3/3) - Title format correct, legend labels match series names.

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - Shows all aspects of grouped lollipop type with 4 regions and 4 product lines.
  • DQ-02: Realistic Context (5/5) - Revenue by region/product is realistic and neutral.
  • DQ-03: Appropriate Scale (4/4) - Values 35-91 sensible for millions; y-axis 0-105 appropriate.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - Straightforward loop-based multi-series approach, no unnecessary abstractions.
  • CQ-02: Reproducibility (2/2) - Uses np.random.seed(42).
  • CQ-03: Clean Imports (2/2) - Only necessary imports; path-shadowing workaround documented.
  • CQ-04: Code Elegance (2/2) - No fake UI, appropriate complexity.
  • CQ-05: Output & API (1/1) - Saves plot-{THEME}.png and plot-{THEME}.html; uses Bokeh 3.9.0 current API.

Library Mastery (5/10)

  • LM-01: Idiomatic Usage (4/5) - ColumnDataSource, figure creation, scatter/line methods used idiomatically. Custom x-axis ticks show good understanding plus workaround pattern.
  • LM-02: Distinctive Features (1/5) - Bokeh is interactive but no distinctive features leveraged (no hover tooltips, callbacks, selection). Treats as static renderer.

Score Caps Applied

  • None

Strengths

  • Excellent text legibility across both light and dark themes with proper 4800×2700 font sizing
  • Correct Okabe-Ito palette usage with first series as #009E73, maintaining perfect color consistency between renders
  • Proper theme-adaptive chrome tokens applied to all elements (backgrounds, text colors, grid lines, legend)
  • Clean, readable code with deterministic seeding and idiomatic Bokeh patterns
  • Well-structured grouped lollipop layout with clear visual separation between categories and series

Weaknesses

  • LM-02 LOW: No interactive features leveraged despite using Bokeh (an interactive library) — consider adding hover tooltips to show exact values
  • DE-01/DE-03 LOW: Minimal design sophistication — follows defaults without distinctive visual enhancements or data storytelling emphasis

Issues Found

  1. LM-02 INTERACTIVE LIBRARY: Bokeh supports hover tooltips, click callbacks, and selection tools, but implementation uses none
    • Fix: Add HoverTool to display revenue values on mouseover; this is a distinctive Bokeh feature that enhances usability
  2. DE-01 AESTHETIC DESIGN: Straightforward styling without distinctive visual refinement
    • Fix: Consider removing y-axis line for a cleaner look, use subtle box shadow or border radius on legend, or add emphasis to highest-performing series

AI Feedback for Next Attempt

If aiming for >90: Add Bokeh's HoverTool for interactive tooltips (distinctive library feature + UX improvement). For design, consider minimal visual refinements: remove y-axis spine, add soft shadow to legend, or use subtle color emphasis for top performer. These changes would elevate DE-01 and LM-02 without affecting spec compliance.

Verdict: APPROVED

@github-actions github-actions Bot added the ai-approved Quality OK, ready for merge label May 17, 2026
@MarkusNeusinger MarkusNeusinger merged commit a422946 into main May 17, 2026
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/lollipop-grouped/bokeh branch May 17, 2026 22:36
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:86 Quality score 86/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant