Skip to content

feat(bokeh): implement scatter-map-geographic#7274

Merged
MarkusNeusinger merged 4 commits into
mainfrom
implementation/scatter-map-geographic/bokeh
May 18, 2026
Merged

feat(bokeh): implement scatter-map-geographic#7274
MarkusNeusinger merged 4 commits into
mainfrom
implementation/scatter-map-geographic/bokeh

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: scatter-map-geographic - python/bokeh

Implements the python/bokeh version of scatter-map-geographic.

File: plots/scatter-map-geographic/implementations/python/bokeh.py

Parent Issue: #3617


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 18, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): The plot displays on a warm off-white background (#FAF8F1) with 30 major cities positioned by latitude and longitude on a CartoDB basemap. The title "scatter-map-geographic · python · bokeh · anyplot.ai" is clearly visible at top-left in dark text (28pt). Axis labels (Longitude/Latitude with units) are at 22pt, tick labels at 18pt — all readable and properly positioned. Scatter points are colored by elevation using the viridis colormap (dark purple at low elevation → yellow at high elevation), with brand green (#009E73) point borders for definition. Size varies by population (25-80 units). A size legend on the left shows buckets (1M, 10M, 25M populations), and a color bar on the right shows elevation scale in meters. The map tiles provide geographic context without competing with data. All text is legible with good contrast against the warm background. Legibility: PASS.

Dark render (plot-dark.png): The plot attempts a dark theme but has a critical issue: the canvas/border area shows pure black (#000000) instead of the required warm dark color (#1A1A17). Title, axis labels, and tick labels appear in light colors (INK #F0EFE8, INK_SOFT #B8B7B0) and are readable against the map and legend areas, but the pure-black border violates the theme-adaptive chrome requirement from the style guide. The viridis data colors are identical to the light render (no recoloring, which is correct — only chrome should change). Point borders remain brand green (#009E73). The color bar gradient is visible. The core plot is navigable and data elements are distinguishable, but the black canvas background creates a harsh contrast rather than the intentional warm dark surface. Legibility: PARTIAL — text is readable, but theme chrome failure impacts overall visual cohesion.

Score: 86/100

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

Visual Quality (27/30)

  • VQ-01: Text Legibility (7/8) - All font sizes explicitly set (28pt, 22pt, 18pt); light render perfectly readable; dark render impacted by canvas background issue
  • VQ-02: No Overlap (6/6) - No overlapping text; clean legend and axis label spacing
  • VQ-03: Element Visibility (6/6) - 30 points perfectly adapted to density; size range (25-80) optimal; no clipping
  • VQ-04: Color Accessibility (2/2) - Viridis palette perceptually uniform; brand green borders provide contrast
  • VQ-05: Layout & Canvas (4/4) - Plot fills ~75% of canvas; balanced margins; elements well-positioned
  • VQ-06: Axis Labels & Title (2/2) - Descriptive with units (Longitude/Latitude °)
  • VQ-07: Palette Compliance (1/2) - Data palette correct (viridis + brand green); light render theme perfect; dark render canvas background is pure black instead of #1A1A17 ✗

Design Excellence (10/20)

  • DE-01: Aesthetic Sophistication (4/8) - Professional layout with appropriate colormaps, but no custom design refinement or intentional visual sophistication beyond defaults
  • DE-02: Visual Refinement (2/6) - Library defaults with minimal customization; no spine removal, no grid styling, no whitespace enhancement
  • DE-03: Data Storytelling (4/6) - Clear visual hierarchy: size encodes population, color encodes elevation; viewer immediately understands the dual encoding and geographic distribution story

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct scatter-map with Web Mercator projection, lat/lon positioning, basemap context
  • SC-02: Required Features (4/4) - All present: coordinates, size encoding, color encoding, basemap, zoom/pan, tooltips, legends
  • SC-03: Data Mapping (3/3) - X=longitude, Y=latitude correct; Web Mercator transforms correctly; all 30 cities visible
  • SC-04: Title & Legend (3/3) - Title format correct; size and color legends present with proper labels

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - 6 continents, elevation 0–2240m, population 0.7–24.9M; full range demonstrated
  • DQ-02: Realistic Context (5/5) - Real cities with accurate coordinates, populations, and elevations; neutral, educational
  • DQ-03: Appropriate Scale (4/4) - All values factually correct; geographic data matches reality

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - Linear flow; no unnecessary functions
  • CQ-02: Reproducibility (2/2) - Hard-coded data; deterministic output
  • CQ-03: Clean Imports (2/2) - All imports used; no waste
  • CQ-04: Code Elegance (2/2) - Proper ColumnDataSource, clean projection function, idiomatic theme tokens
  • CQ-05: Output & API (1/1) - Saves as plot-{THEME}.png + .html; current API

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) - Expert bokeh patterns: figure(), ColumnDataSource, LinearColorMapper, WMTS tiles, layout management
  • LM-02: Distinctive Features (4/5) - Uses WMTSTileSource (CartoDB), ColorBar, custom legend with scatter+text, hover tooltips, pan/zoom; strong distinctive use but could leverage more bokeh-specific interactive features

Score Caps Applied

  • None triggered

Strengths

  • Correct scatter-map implementation with all spec features present and working
  • Excellent data quality: realistic major cities with accurate coordinates and elevation values
  • Proper Web Mercator projection with interactive zoom/pan enabled
  • Strong library mastery: creative use of ColorMapper, ColorBar, and WMTS tile source
  • Clean code structure with explicit font sizing throughout (28pt title, 22pt labels, 18pt ticks)
  • Effective dual encoding: size for population, color for elevation — visual hierarchy guides understanding
  • Comprehensive hover tooltips with city name, population, elevation, coordinates

Weaknesses

  • VQ-07 CRITICAL: Dark render canvas background is pure black (#000000) instead of warm dark (#1A1A17) — breaks theme-adaptive chrome requirement. Likely cause: p.background_fill_color = PAGE_BG and p.border_fill_color = PAGE_BG not applying correctly to the Bokeh HTML canvas when rendered by Selenium
  • DE-01 LOW: Generic styling using library defaults with no custom aesthetic refinement or design choices
  • DE-02 LOW: No visual refinement — default grid, no spine customization, no whitespace optimization
  • DE-03 MEDIUM: While the dual encoding is clear, the plot lacks visual emphasis or annotation to guide the viewer toward specific insights

Issues Found

  1. VQ-07 THEME VIOLATION (Dark Render): Canvas background is pure black instead of #1A1A17
    • Fix: Debug Selenium screenshot capture; verify p.background_fill_color and p.border_fill_color are being applied before screenshot. May require checking if bokeh's canvas rendering respects these colors in headless mode, or if additional CSS/styling is needed.
  2. DE-01 LOW: Generic styling lacks intentional design
    • Fix: Add custom visual refinements — consider removing top/right spines for a cleaner L-shaped frame, refine legend styling, or add subtle visual hierarchy through size emphasis
  3. DE-02 LOW: Minimal customization
    • Fix: Customize grid appearance (if used), add generous whitespace, style legend box with theme-adaptive background, or other refinement details

AI Feedback for Next Attempt

The dark render's pure-black canvas is the blocking issue — fix the theme token application in bokeh's background/border colors during Selenium capture. Once resolved, the plot will pass VQ-07. For next iteration, consider: (1) removing top/right spines for visual polish, (2) adding subtle grid customization if helpful for readability, (3) using color or size contrast to emphasize a specific geographic or population insight. The dual encoding (size + color) is working well — the data quality and spec compliance are excellent; focus improvements on design sophistication and visual refinement.

Verdict: APPROVED

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

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): The plot displays on a warm off-white background (#FAF8F1) with 30 major world cities positioned by latitude and longitude on a CartoDB light basemap. The title "scatter-map-geographic · python · bokeh · anyplot.ai" is clearly visible at top-left in dark text (28pt, color #1A1A17). Axis labels (Longitude/Latitude with degree symbols) are displayed at 22pt in dark text, with tick labels at 18pt. All text is highly readable with excellent contrast against the warm background. Scatter points are colored by elevation using the viridis colormap (dark purple at low elevations → bright yellow at high elevations), with brand green (#009E73) borders for visual definition. Point sizes vary by population (25-80 units), creating appropriate visual weight distribution. A custom size legend on the left displays reference points (1M, 10M, 25M populations) also bordered in brand green. A color bar on the right shows elevation scale (0-2240m). The CartoDB tiles provide geographic context. All chrome elements use theme-adaptive colors (INK_SOFT #4A4A44). Legibility: PASS — all text perfectly readable; theme tokens applied correctly.

Dark render (plot-dark.png): The plot attempts dark theme rendering but exhibits a critical theme-compliance failure: the canvas/border area shows pure black (#000000) instead of the required warm near-black (#1A1A17). This is visible in the outer border/margin regions. The title, axis labels (22pt), and tick labels (18pt) appear in lighter colors (INK #F0EFE8, INK_SOFT #B8B7B0) and are technically readable against the map and data areas, but the harsh pure-black border creates visual discord rather than the intentional warm dark aesthetic. The viridis data colors remain correctly identical to the light render. Point borders remain brand green (#009E73). The core plot's data elements are distinguishable and interactive features (pan/zoom) are functional. However, the pure-black canvas background is a VQ-07 violation — the implementation failed to apply the #1A1A17 warm dark token to the HTML canvas element during Selenium rendering. Legibility: FAIL — the pure-black background violates the mandatory theme-adaptive chrome requirement.

Score: 84/100

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

Visual Quality (25/30)

  • VQ-01: Text Legibility (7/8) - Readable in light render; dark render compromised by background
  • VQ-02: No Overlap (6/6) - Clean spacing; no collisions
  • VQ-03: Element Visibility (6/6) - 30 points optimally distributed
  • VQ-04: Color Accessibility (2/2) - Viridis perceptually uniform
  • VQ-05: Layout & Canvas (4/4) - Balanced proportions
  • VQ-06: Axis Labels & Title (2/2) - Descriptive with units
  • VQ-07: Palette Compliance (0/2) - FAILED - Dark canvas pure black instead of #1A1A17

Design Excellence (10/20)

  • DE-01: Aesthetic Sophistication (4/8) - Generic defaults
  • DE-02: Visual Refinement (2/6) - Minimal customization
  • DE-03: Data Storytelling (4/6) - Clear dual encoding

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct scatter-map with Web Mercator
  • SC-02: Required Features (4/4) - All features present
  • SC-03: Data Mapping (3/3) - X/Y correct; transforms properly
  • SC-04: Title & Legend (3/3) - Correct format

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - 6 continents; full elevation and population ranges
  • DQ-02: Realistic Context (5/5) - Real cities with accurate data
  • DQ-03: Appropriate Scale (4/4) - All values correct

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - Linear flow
  • CQ-02: Reproducibility (2/2) - Deterministic
  • CQ-03: Clean Imports (2/2) - No waste
  • CQ-04: Code Elegance (2/2) - Idiomatic patterns
  • CQ-05: Output & API (1/1) - Correct output format

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) - Expert bokeh patterns
  • LM-02: Distinctive Features (4/5) - Good use; could leverage more

Score Caps Applied

  • None

Strengths

  • Excellent spec compliance with all required features present and functional
  • Perfect data quality with realistic cities and accurate geographic coordinates
  • Strong dual encoding of size for population and color for elevation
  • Proper Web Mercator projection with interactive zoom/pan capabilities
  • Comprehensive hover tooltips with city name, population, elevation, and coordinates
  • Light render perfectly theme-compliant with warm #FAF8F1 background
  • Clean code structure with explicit font sizing

Weaknesses

  • VQ-07 CRITICAL FAILURE: Dark render canvas background is pure black (#000000) instead of required warm dark (#1A1A17). This is identical to Attempt 1 — the issue was not fixed.
  • ROOT CAUSE: Bokeh's background_fill_color likely only applies to the plot area, not the HTML page element. The page-level <body> or canvas CSS background is not using the theme token.
  • Generic styling using library defaults with no design sophistication
  • Minimal visual refinement — no spine customization, no grid styling

Issues Found

  1. VQ-07 FAILED (BLOCKING): Dark render pure-black canvas
    • Diagnosis: Code sets p.background_fill_color = PAGE_BG correctly, but Selenium screenshot shows pure black. Bokeh's background_fill_color may not apply to the HTML page background.
    • Fix Required: Add explicit HTML/CSS background to the saved HTML file before screenshotting. Instead of relying on bokeh's background_fill_color property, manually inject CSS styling into the HTML that Selenium will capture.

AI Feedback for Next Attempt

The dark theme background issue persists from Attempt 1 — this is the blocking defect. The bokeh background_fill_color property alone does not set the HTML page background that Selenium captures. You must explicitly add CSS styling to the <body> element or verify that the canvas element's CSS background-color matches the PAGE_BG theme token. After fixing this critical VQ-07 failure, the implementation will pass. For subsequent improvements, consider visual refinement: remove top/right spines, customize grid appearance, or add subtle design touches to reach Design Excellence targets.

Verdict: REJECTED

@github-actions github-actions Bot added quality:84 Quality score 84/100 ai-approved Quality OK, ready for merge and removed quality:86 Quality score 86/100 labels May 18, 2026
@MarkusNeusinger MarkusNeusinger merged commit 3f51092 into main May 18, 2026
@MarkusNeusinger MarkusNeusinger deleted the implementation/scatter-map-geographic/bokeh branch May 18, 2026 18:07
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:84 Quality score 84/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant