Skip to content

feat(bokeh): implement scatter-regression-lowess#6632

Merged
MarkusNeusinger merged 4 commits into
mainfrom
implementation/scatter-regression-lowess/bokeh
May 14, 2026
Merged

feat(bokeh): implement scatter-regression-lowess#6632
MarkusNeusinger merged 4 commits into
mainfrom
implementation/scatter-regression-lowess/bokeh

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: scatter-regression-lowess - python/bokeh

Implements the python/bokeh version of scatter-regression-lowess.

File: plots/scatter-regression-lowess/implementations/python/bokeh.py

Parent Issue: #2855


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 14, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): Warm off-white background (#FAF8F1) with dark text throughout. Title "scatter-regression-lowess · bokeh · anyplot.ai" is clearly visible in the INK color. Axis labels "Temperature (°C)" and "Enzyme Activity (%)" and all tick labels are readable. Scatter points in teal (#009E73, Okabe-Ito position 1) with alpha=0.6 transparency show data density. The orange LOWESS curve (#D55E00, position 2) is the clear focal point with its thick line (5px) standing out against the background. Grid is subtle at 10% opacity. Legend in top right shows "Data Points" and "LOWESS Fit" with excellent readability. All chrome elements use proper INK/INK_SOFT tokens. Legibility verdict: PASS — excellent contrast on light surface, all text readable, data colors distinct.

Dark render (plot-dark.png): Warm near-black background (#1A1A17) with light text throughout. Title visible in light INK color (#F0EFE8), axis and tick labels visible in INK_SOFT (#B8B7B0) — all readable against dark surface. The teal and orange data colors are identical to the light render — only the chrome (background, text, axis lines, grid) has adapted to the dark theme. Scatter points and LOWESS curve both stand out clearly. No dark-on-dark failures detected. Brand green (#009E73) is clearly visible and readable on both surfaces. Legibility verdict: PASS — theme adaptation is flawless, no contrast issues.

Both renders achieve perfect theme-readability. Chrome colors properly use theme tokens while Okabe-Ito data colors remain constant across themes.

Score: 88/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 7 10
Total 88 100

Visual Quality (30/30)

  • VQ-01: Text Legibility (8/8) — Title 28pt, axis labels 22pt, tick labels 18pt all explicitly set and readable in both themes with proper INK tokens
  • VQ-02: No Overlap (6/6) — Clear spacing, legend well-placed, no text collisions, points show density through alpha
  • VQ-03: Element Visibility (6/6) — Scatter markers (size=18) and LOWESS line (5px) both clearly visible
  • VQ-04: Color Accessibility (2/2) — Okabe-Ito palette (#009E73 + #D55E00), colorblind-safe, good contrast
  • VQ-05: Layout & Canvas (4/4) — 4800×2700 landscape, generous margins, balanced proportions
  • VQ-06: Axis Labels & Title (2/2) — Title format correct, axes labeled with units (°C, %)
  • VQ-07: Palette Compliance (2/2) — Okabe-Ito colors correct, backgrounds #FAF8F1/#1A1A17, both renders theme-correct, no chrome issues

Design Excellence (11/20)

  • DE-01: Aesthetic Sophistication (4/8) — Professional execution with clear visual hierarchy; standard Okabe-Ito palette (not custom); no exceptional flourishes
  • DE-02: Visual Refinement (3/6) — Grid explicitly styled (10% alpha); whitespace adequate; spines use bokeh defaults rather than intentional customization
  • DE-03: Data Storytelling (4/6) — LOWESS curve is clear focal point; scatter points provide context; non-linear enzyme kinetics relationship visually obvious

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Scatter plot with LOWESS regression curve, correct
  • SC-02: Required Features (4/4) — All spec requirements present: scatter points (alpha 0.6), LOWESS curve (frac=0.4), axis labels with units, title, legend
  • SC-03: Data Mapping (3/3) — X (10-50°C) and Y (~20-90%) correctly mapped, axes show all data
  • SC-04: Title & Legend (3/3) — Format "scatter-regression-lowess · bokeh · anyplot.ai" correct, legend labels clear

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Non-linear relationship fully demonstrated; bell-shaped enzyme activity curve visible
  • DQ-02: Realistic Context (5/5) — Enzyme kinetics data plausible, ranges (10-50°C, 20-90%) sensible for domain, no bias
  • DQ-03: Appropriate Scale (4/4) — Data fills plot well, axes not squashed, sensible value ranges

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Straightforward top-to-bottom code, no unnecessary functions/classes
  • CQ-02: Reproducibility (2/2) — np.random.seed(42) set for deterministic output
  • CQ-03: Clean Imports (2/2) — All imports used (os, time, Path, numpy, bokeh, selenium, statsmodels); no unused dependencies
  • CQ-04: Code Elegance (2/2) — Clear variable names, appropriate complexity; HoverTool is legitimate bokeh interactivity (not fake UI)
  • CQ-05: Output & API (1/1) — Correctly outputs plot-light.png, plot-dark.png, plot-light.html, plot-dark.html

Library Mastery (7/10)

  • LM-01: Idiomatic Usage (4/5) — ColumnDataSource used correctly, high-level plotting API, theme tokens properly applied throughout
  • LM-02: Distinctive Features (3/5) — HoverTool with custom formatted tooltips is bokeh-specific; interactive HTML generation; could explore callbacks or extensions for deeper feature use

Score Caps Applied

  • None

Strengths

  • Perfect visual quality across both light and dark renders with zero legibility failures
  • Okabe-Ito palette correctly applied creating strong color hierarchy (brand green for data, vermillion for fit)
  • Clean, reproducible code with explicit seed and proper use of bokeh patterns (ColumnDataSource, HoverTool)
  • Realistic enzyme kinetics data clearly demonstrates non-linear relationship with smooth LOWESS fit
  • All specification requirements met without deviation; title format, legend, axis labels all present and correct

Weaknesses

  • Design excellence at professional baseline — no custom aesthetics beyond style guide defaults (DE-01=4 instead of 5+)
  • Spines not explicitly styled; relies on bokeh defaults rather than intentional visual refinement
  • Library mastery solid but not advanced — HoverTool is good but could explore callbacks or custom extensions for deeper bokeh sophistication

Issues Found

None critical.

  1. Design Excellence (DE-01, DE-02) at baseline: Good professional execution but limited visual sophistication. To push beyond 90, consider: explicit spine control (if design calls for it), more sophisticated legend styling, or custom visual refinements that go beyond the default style guide.

AI Feedback for Next Attempt

This is a strong, clean implementation that meets all requirements with consistently high execution. Visual quality is flawless, theme adaptation is perfect, and the code is professional. Current score of 88/100 reflects excellent technical work without exceptional design flourishes. Future implementations in this series could reach 92+ by adding subtle visual refinements: intentional spine styling decisions, more sophisticated use of bokeh's layout system, or custom visual enhancements that elevate the aesthetic beyond baseline.

Verdict: APPROVED ✓

@github-actions github-actions Bot added quality:88 Quality score: 88/100 ai-rejected Quality not OK, triggers update labels May 14, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels May 14, 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 14, 2026

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): Plot rendered on #FAF8F1 warm off-white surface. Title "scatter-regression-lowess · bokeh · anyplot.ai" is clearly visible in dark text (28pt). Axis labels "Temperature (°C)" and "Enzyme Activity (%)" are readable with units at 22pt. Tick labels at 18pt are sharp. Scatter points in brand green #009E73 with alpha 0.6 show good density without crowding across 200 data points. LOWESS curve in vermillion #D55E00 is smooth and visually distinct from scatter. Legend in top-right with "Data Points" and "LOWESS Fit" labels. Both x and y grid lines at 10% alpha are subtle and supportive. All text is fully readable against the light background - PASS legibility.

Dark render (plot-dark.png): Plot rendered on #1A1A17 warm near-black surface. Title clearly visible in light text against dark background. Axis labels sharp and readable in adapted light color #F0EFE8. Tick labels in secondary light #B8B7B0 are fully legible. Scatter points identical green #009E73 (matching light render perfectly). LOWESS curve identical vermillion #D55E00 (matching light render - data colors correctly preserved). Legend has light text on elevated dark background #242420. Grid lines visible at 10% alpha. No dark-on-dark issues detected - all text properly theme-adapted. PASS legibility. Data colors match light render perfectly, confirming correct theme implementation.

Score: 90/100

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

Visual Quality (30/30)

  • VQ-01: Text Legibility (8/8) - All font sizes explicitly set: title 28pt, axis labels 22pt, tick labels 18pt. Perfectly readable at 4800×2700 in both themes
  • VQ-02: No Overlap (6/6) - Zero overlapping text elements, all fully readable
  • VQ-03: Element Visibility (6/6) - Scatter markers (size 18) appropriately adapted to 200 data points with alpha 0.6; line width 5 clearly visible
  • VQ-04: Color Accessibility (2/2) - Okabe-Ito palette ensures CVD-safe contrast; good luminance separation
  • VQ-05: Layout & Canvas (4/4) - Perfect layout: plot fills appropriate portion, balanced margins, optimal legend placement
  • VQ-06: Axis Labels & Title (2/2) - Descriptive with units; title format correct
  • VQ-07: Palette Compliance (2/2) - First series #009E73, second #D55E00; backgrounds correct; theme-adaptive chrome perfect in both renders

Design Excellence (10/20)

  • DE-01: Aesthetic Sophistication (4/8) - Well-configured library defaults with Okabe-Ito palette applied correctly. No exceptional custom touches beyond standard configuration
  • DE-02: Visual Refinement (4/6) - Good: Grid subtle (10% alpha), outline refined, elevated legend background, generous whitespace
  • DE-03: Data Storytelling (2/6) - Enzyme peak pattern is evident but lacks visual hierarchy or emphasis to guide viewer to the insight

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct scatter plot with LOWESS regression curve overlay
  • SC-02: Required Features (4/4) - All features present: scatter, LOWESS curve, visual distinction, moderate smoothing (frac=0.4), transparency (alpha=0.6), axis labels, title
  • SC-03: Data Mapping (3/3) - X/Y correctly mapped; data range fully visible
  • SC-04: Title & Legend (3/3) - Title format perfect: spec-id · library · anyplot.ai; legend labels clear

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - Shows all aspects: non-linear relationship, varying density, bell-curve peak pattern
  • DQ-02: Realistic Context (5/5) - Real-world plausible enzyme activity scenario, scientifically sound and neutral
  • DQ-03: Appropriate Scale (4/4) - Enzyme activity 20-90% realistic, temperature range 10-50°C plausible

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - Imports → Data generation → Plot → Save; no functions/classes
  • CQ-02: Reproducibility (2/2) - np.random.seed(42) set for deterministic data
  • CQ-03: Clean Imports (2/2) - All imports used
  • CQ-04: Code Elegance (2/2) - Clean, Pythonic, no over-engineering or fake functionality
  • CQ-05: Output & API (1/1) - Correct output naming (plot-{THEME}.html/.png) and current API

Library Mastery (10/10)

  • LM-01: Idiomatic Usage (5/5) - Expert idiomatic use: figure() API, ColumnDataSource pattern, HoverTool, proper theme-token styling
  • LM-02: Distinctive Features (5/5) - HoverTool for interactive tooltips, ColumnDataSource binding, Selenium PNG export workaround

Score Caps Applied

  • None

Strengths

  • Flawless theme adaptation: both light and dark renders perfectly readable with correct background colors and all text colors properly adapted
  • Excellent library mastery: idiomatic ColumnDataSource, HoverTool interactivity, Selenium PNG export workaround
  • Perfect visual quality: all text explicitly sized with zero overlaps, perfect palette compliance, appropriate element sizing
  • Complete spec compliance: all required features present with LOWESS smoothing, scatter transparency, visually distinct curve
  • High-quality data: realistic enzyme scenario with factually correct scales and non-linear bell-curve pattern

Weaknesses

  • Design Excellence (DE-03) is minimal: data displays clearly but lacks visual hierarchy or emphasis to guide viewer's attention to the peak activity insight at ~35°C. Consider adding visual emphasis through color intensity, size variation, or strategic annotations in future improvements

AI Feedback for Next Attempt

Not applicable — implementation is approved. Score of 90/100 meets the quality threshold for first review.

Verdict: APPROVED

@github-actions github-actions Bot added quality:90 Quality score 90/100 ai-approved Quality OK, ready for merge and removed quality:88 Quality score: 88/100 labels May 14, 2026
@MarkusNeusinger MarkusNeusinger merged commit a46ec2c into main May 14, 2026
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/scatter-regression-lowess/bokeh branch May 14, 2026 01:21
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:90 Quality score 90/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant