Skip to content

feat(echarts): implement choropleth-basic - #11189

Merged
MarkusNeusinger merged 6 commits into
mainfrom
implementation/choropleth-basic/echarts
Sep 2, 2026
Merged

feat(echarts): implement choropleth-basic#11189
MarkusNeusinger merged 6 commits into
mainfrom
implementation/choropleth-basic/echarts

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Implementation: choropleth-basic - javascript/echarts

Implements the javascript/echarts version of choropleth-basic.

File: plots/choropleth-basic/implementations/javascript/echarts.js

Parent Issue: #3069


🤖 impl-generate workflow

@claude

claude Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): Warm off-white background (#FAF8F1-consistent). Title "choropleth-basic · javascript · echarts · anyplot.ai" is centered at the top in dark ink text and clearly readable. The plot is a tile-grid cartogram of the 50 US states + DC — each state a colored square arranged in its approximate real-world grid position, with bold white abbreviation labels centered on every tile. Tile colors follow a continuous green→blue Imprint sequential ramp representing renewable-electricity-share (%); three tiles (RI, DE, WV) render as solid muted gray to indicate missing data. A horizontal continuous colorbar legend sits at bottom-center, labeled "17%" and "55.7%" in soft ink gray. All text is clearly readable against the light background.

Dark render (plot-dark.png): Warm near-black background (#1A1A17-consistent). Same title, now rendered in light ink text, fully legible. Same tile grid and legend; the data colors are pixel-identical to the light render (confirmed tile-by-tile) — only the chrome (title/legend text color, tile gutter borders, and the muted no-data gray) flips to its theme-adaptive value. All text is clearly readable against the dark background — no dark-on-dark failures observed.

Both renders pass the theme-readability check.

Score: 84/100

Category Score Max
Visual Quality 28 30
Design Excellence 11 20
Spec Compliance 13 15
Data Quality 14 15
Code Quality 10 10
Library Mastery 8 10
Total 84 100

Visual Quality (28/30)

  • VQ-01: Text Legibility (7/8)
  • VQ-02: No Overlap (6/6)
  • VQ-03: Element Visibility (6/6)
  • VQ-04: Color Accessibility (2/2)
  • VQ-05: Layout & Canvas (3/4)
  • VQ-06: Axis Labels & Title (2/2)
  • VQ-07: Palette Compliance (2/2)

Design Excellence (11/20)

  • DE-01: Aesthetic Sophistication (5/8) - Thoughtful sequential colormap and legend hierarchy, above a bare default but not publication-tier
  • DE-02: Visual Refinement (4/6) - Clean tile gutters, generous whitespace, no chartjunk; not maximally polished
  • DE-03: Data Storytelling (2/6) - South/west "boost" in the data is too subtle vs. the random range; the color pattern reads as near-random rather than telling a clear geographic story

Spec Compliance (13/15)

  • SC-01: Plot Type (4/5) - Correct choropleth concept via a recognized tile-grid cartogram substitute, but no real geographic shapes/projection
  • SC-02: Required Features (3/4) - Legend and missing-data handling present; the spec's "appropriate map projection" note is not met
  • SC-03: Data Mapping (3/3)
  • SC-04: Title & Legend (3/3)

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6)
  • DQ-02: Realistic Context (5/5)
  • DQ-03: Appropriate Scale (4/4)

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3)
  • CQ-02: Reproducibility (2/2)
  • CQ-03: Clean Imports (2/2)
  • CQ-04: Code Elegance (2/2)
  • CQ-05: Output & API (1/1)

Library Mastery (8/10)

  • LM-01: Idiomatic Usage (5/5) - Canonical echarts.registerMap + continuous visualMap + map series pipeline
  • LM-02: Distinctive Features (3/5) - Custom registerMap GeoJSON usage is genuinely echarts-specific but not maximally distinctive

Score Caps Applied

  • None

Strengths

  • Creative, honestly-documented tile-grid cartogram substitute for the missing offline US GeoJSON boundaries, keeping every state (including small ones like RI/DE) equally legible
  • Correct sequential Imprint colormap (t.seq, green→blue) for the single-polarity renewable-share data, with a continuous visualMap legend showing accurate min/max labels
  • Missing-data states (RI, DE, WV) render in the theme-adaptive muted anchor, exactly matching the spec's "handle missing data gracefully" requirement
  • Deterministic fixed-seed LCG for reproducible data; idiomatic ECharts pattern via echarts.registerMap + continuous visualMap + map series
  • Both themes are fully theme-correct — background, title, legend text, and tile gutters all adapt, while the data-driven tile colors stay pixel-identical between light and dark

Weaknesses

  • No real geographic boundaries or map projection are used — the spec explicitly asks for "an appropriate map projection (e.g. Albers Equal Area for US)"; the uniform square-tile grid, while a legitimate cartogram variant, is a real departure from a choropleth's shape-encoded regions
  • Data storytelling is weak: the south/west "renewable potential" boost in the underlying data is small relative to the 38-point random range, so the resulting color pattern reads as near-random rather than showing a clear geographic trend
  • Canvas utilization is moderate — the tile grid + legend fill noticeably less than half of the landscape canvas; the tiles could be scaled up to use more of the available width/height
  • LM-02: registerMap + continuous visualMap is solid idiomatic usage but not a deeply distinctive echarts-only capability in the static PNG

Issues Found

  1. DE-03 LOW: Data pattern doesn't tell a clear geographic story
    • Fix: Increase the south/west boost magnitude relative to the random component (or reduce the random spread) so the color trend is visually perceptible across the map, giving the reader an immediate takeaway
  2. VQ-05 / SC-01 MEDIUM: Canvas utilization is moderate and no real map projection is used
    • Fix: Consider enlarging layoutSize/tile dimensions to use more of the landscape canvas; keep the tile-grid approach (it's a sound accommodation for the offline-GeoJSON constraint) but note the trade-off clearly, or explore whether a small embedded GeoJSON simplification could restore real state shapes

AI Feedback for Next Attempt

Keep the tile-grid cartogram — it's a sound, well-documented accommodation for the offline-GeoJSON constraint. Focus repairs on Design Excellence: strengthen the underlying data pattern so higher-renewable states visually cluster (currently near-random due to a modest boost vs. a 38-point random range), and consider slightly enlarging the tile grid / layoutSize to use more of the canvas. A short annotation or callout on the highest/lowest state would also sharpen the story.

Verdict: REJECTED

@github-actions github-actions Bot added quality:84 Quality score 84/100 ai-rejected Quality not OK, triggers update labels Sep 2, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels Sep 2, 2026
Attempt 1/4 - fixes based on AI review
@github-actions

github-actions Bot commented Sep 2, 2026

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

claude Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): Warm off-white background (#FAF8F1-consistent). Title "choropleth-basic · javascript · echarts · anyplot.ai" is centered at the top in dark ink text, clearly readable. The plot is a tile-grid cartogram of the 50 US states + DC, each a colored square in its approximate real-world grid position with bold white abbreviation labels. Tile colors follow the continuous green→blue Imprint sequential ramp (imprint_seq) for renewable-electricity-share (%); the color pattern now visibly clusters — cool green in the northeast (ME, NY, VT, WI, MI) fading to blue in the south/west (TX, LA, FL, AZ, CA) — a clear, immediately readable geographic trend. Three tiles (RI, DE, WV) render as solid muted gray for missing data. A new top-right callout reads "Highest: TX 57.5% / Lowest: ME 14.4%" in soft ink gray, reinforcing the story. A horizontal continuous colorbar legend sits at bottom-center labeled "14.4%"/"57.5%". All text is clearly readable against the light background.

Dark render (plot-dark.png): Warm near-black background (#1A1A17-consistent). Same title, now in light ink text, fully legible. Same tile grid, callout, and legend; the data colors are pixel-identical to the light render (confirmed tile-by-tile, including the green→blue gradient direction) — only chrome (text color, tile gutter borders, muted no-data gray) flips to its theme-adaptive value. All text is clearly readable against the dark background — no dark-on-dark failures observed. Brand green #009E73 reads well on both surfaces.

Both renders pass the theme-readability check.

Score: 89/100

Category Score Max
Visual Quality 28 30
Design Excellence 15 20
Spec Compliance 13 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 8 10
Total 89 100

Visual Quality (28/30)

  • VQ-01: Text Legibility (7/8)
  • VQ-02: No Overlap (6/6)
  • VQ-03: Element Visibility (6/6)
  • VQ-04: Color Accessibility (2/2)
  • VQ-05: Layout & Canvas (3/4) - layoutSize raised 84%→92%, tile grid + legend now span ~51% width but whitespace on left/right is balanced; still short of "fills most of the canvas"
  • VQ-06: Axis Labels & Title (2/2)
  • VQ-07: Palette Compliance (2/2)

Design Excellence (15/20)

  • DE-01: Aesthetic Sophistication (6/8) - Thoughtful sequential ramp, typographic hierarchy, and the new highest/lowest callout push this clearly above a configured default
  • DE-02: Visual Refinement (4/6) - Clean tile gutters, generous whitespace, no chartjunk; unchanged from attempt 1
  • DE-03: Data Storytelling (5/6) - Fixed: the strengthened south/west boost (now dominating the random jitter) makes the geographic trend immediately visible, and the new "Highest/Lowest" annotation sharpens the takeaway at a glance

Spec Compliance (13/15)

  • SC-01: Plot Type (4/5) - Correct choropleth concept via a recognized tile-grid cartogram substitute for the offline-GeoJSON constraint; still no real geographic shapes/projection (unchanged, per attempt-1 guidance to keep this accommodation)
  • SC-02: Required Features (3/4) - Legend and missing-data handling present; "appropriate map projection" note still not met
  • SC-03: Data Mapping (3/3)
  • SC-04: Title & Legend (3/3)

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - Full value range, no-data states, and now an explicit highest/lowest callout together cover the choropleth's key features
  • DQ-02: Realistic Context (5/5)
  • DQ-03: Appropriate Scale (4/4)

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3)
  • CQ-02: Reproducibility (2/2)
  • CQ-03: Clean Imports (2/2)
  • CQ-04: Code Elegance (2/2)
  • CQ-05: Output & API (1/1)

Library Mastery (8/10)

  • LM-01: Idiomatic Usage (5/5) - Canonical echarts.registerMap + continuous visualMap + map series + graphic overlay pipeline
  • LM-02: Distinctive Features (3/5) - Custom registerMap GeoJSON usage is genuinely echarts-specific but not maximally distinctive

Score Caps Applied

  • None

Strengths

  • Fixed the core attempt-1 weakness: the south/west boost now dominates the random jitter (spans ~0-46 vs. ±9 noise), so the tile colors show a clear, immediately readable green(northeast)→blue(southwest) geographic gradient instead of near-random noise
  • New "Highest: TX 57.5% / Lowest: ME 14.4%" callout directly reinforces the geographic story and adds a concrete data point for the reader
  • layoutSize increase (84%→92%) gives the tile grid more presence on the canvas
  • Missing-data states (RI, DE, WV) still render correctly in the theme-adaptive muted anchor
  • Both themes remain fully theme-correct — background, title, legend text, callout, and tile gutters all adapt while data-driven tile colors stay pixel-identical between light and dark
  • Deterministic fixed-seed LCG, clean idiomatic ECharts code, no regressions from attempt 1

Weaknesses

  • Canvas utilization is still moderate: the tile grid + legend span only ~51% of the canvas width even after the layoutSize bump; there's noticeable balanced-but-empty margin on both sides. Consider whether the tile cartogram itself could be stretched non-uniformly (wider tiles, tighter row/col packing) rather than only scaling layoutSize
  • No real geographic boundaries or map projection are used — the spec asks for "an appropriate map projection (e.g. Albers Equal Area for US)"; the tile-grid cartogram remains a legitimate, well-documented accommodation for the offline-GeoJSON constraint (kept per attempt-1 guidance) but this is the one recurring spec gap
  • LM-02: registerMap + continuous visualMap + graphic overlay is solid idiomatic usage but still not a deeply distinctive echarts-only capability in the static PNG

Issues Found

  1. VQ-05 LOW: Canvas still only ~51% width utilization despite the layoutSize increase
    • Fix: If further repair is needed, try widening individual tile cells (increase the grid's aspect ratio or layoutSize further) rather than only scaling the whole grid uniformly, so the map claims more of the 16:9 canvas
  2. SC-01/SC-02 LOW: No real map projection (spec explicitly requests one)
    • Fix (optional, only if a future attempt wants to close this gap): explore whether a small embedded/simplified US-states GeoJSON could ship inline in the snippet to restore real shapes; otherwise the tile-grid cartogram is an accepted trade-off

AI Feedback for Next Attempt

This attempt fixed both attempt-1 blockers (weak data storytelling and canvas utilization) and comfortably clears the review-2 threshold. If a future attempt wants to push higher, the remaining gaps are: (1) canvas width utilization is still moderate, and (2) the map projection requirement from the spec is unmet (tile-grid cartogram is an accepted trade-off for now, given the offline-GeoJSON constraint).

Verdict: APPROVED

@github-actions github-actions Bot added quality:89 Quality score 89/100 ai-approved Quality OK, ready for merge and removed quality:84 Quality score 84/100 labels Sep 2, 2026
@MarkusNeusinger
MarkusNeusinger merged commit 2a647b2 into main Sep 2, 2026
3 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the implementation/choropleth-basic/echarts branch September 2, 2026 16:03
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:89 Quality score 89/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant