Skip to content

feat(makie): implement bar-stacked-labeled - #10802

Merged
MarkusNeusinger merged 8 commits into
mainfrom
implementation/bar-stacked-labeled/makie
Aug 26, 2026
Merged

feat(makie): implement bar-stacked-labeled#10802
MarkusNeusinger merged 8 commits into
mainfrom
implementation/bar-stacked-labeled/makie

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Implementation: bar-stacked-labeled - julia/makie

Implements the julia/makie version of bar-stacked-labeled.

File: plots/bar-stacked-labeled/implementations/julia/makie.jl

Parent Issue: #3504


🤖 impl-generate workflow

@claude

claude Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): Warm off-white background (#FAF8F1). Bold dark title "bar-stacked-labeled · julia · makie · anyplot.ai", "Quarter" (x) and "Revenue ($M)" (y) axis labels in dark ink, tick labels in soft gray, subtle horizontal gridlines at y=5/10. Four stacked bars (Q1-Q4), bottom-to-top green (#009E73, Subscriptions) / lavender (#C475FD, Services) / blue (#4467A3, Hardware), with bold-styled total labels ($8.7M-$11.9M) above each stack with clear headroom. Legend at right, unframed. All text is clearly readable against the light background — no light-on-light issues.

Dark render (plot-dark.png): Warm near-black background (#1A1A17). Same title, axis labels, and ticks now rendered in light/off-white ink, clearly legible. Data colors (green/lavender/blue) are byte-identical to the light render — only chrome flipped. Total labels render in light ink above each stack with no clipping. All text is clearly readable against the dark background — no dark-on-dark failures anywhere (title, axis labels, ticks, legend, total labels all read correctly).

Both paragraphs are required. A review that only describes one render is invalid.

Score: 85/100

Category Score Max
Visual Quality 28 30
Design Excellence 13 20
Spec Compliance 15 15
Data Quality 14 15
Code Quality 9 10
Library Mastery 6 10
Total 85 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 (13/20)

  • DE-01: Aesthetic Sophistication (5/8) - Close to the default skeleton; total labels claimed "bold" in a comment but aren't actually bold in code
  • DE-02: Visual Refinement (4/6) - Spines removed, subtle grid, generous whitespace
  • DE-03: Data Storytelling (4/6) - Total labels give a clear focal point and legible growth trend

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5)
  • SC-02: Required Features (4/4)
  • 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 (9/10)

  • CQ-01: KISS Structure (3/3)
  • CQ-02: Reproducibility (2/2)
  • CQ-03: Clean Imports (2/2)
  • CQ-04: Code Elegance (1/2) - Comment claims bold total labels, code doesn't set font=:bold
  • CQ-05: Output & API (1/1)

Library Mastery (6/10)

  • LM-01: Idiomatic Usage (4/5) - barplot! with stack is the recommended idiomatic approach
  • LM-02: Distinctive Features (2/5) - Only basic text!/Legend beyond the core call; no distinctive Makie feature used

Score Caps Applied

  • None

Strengths

  • Data mapping is numerically correct end-to-end: each total label is the exact sum of its stacked segments (e.g. Q1 = 5.2+2.1+1.4 = $8.7M)
  • Correct Imprint palette usage: first series (Subscriptions) is brand green #009E73, canonical order for the rest, byte-identical data colors between light/dark
  • Theme-adaptive chrome fully threaded through (title/axis/tick/spine/grid all token-driven), no dark-on-dark or light-on-light failures
  • Total-label headroom computed programmatically (ylims!(ax, 0, maximum(totals) * 1.16)) after all text/legend calls — no clipping even for the tallest total
  • Correct canonical title format; canvas gate passed (3200×1800 landscape)
  • Clean KISS script, no unused imports, deterministic hard-coded data

Weaknesses

  • The comment above the total-label loop claims labels are "bold and larger than any other text," but the text! call only sets fontsize=19 — no font=:bold is passed, so labels render in regular weight in both renders, contradicting the code's own stated intent and the spec's suggestion to give totals extra visual weight
  • Design execution is competent but generic — closely follows the standard Imprint styling skeleton without an extra visual-hierarchy touch that would lift it past a solid baseline
  • Library-mastery features are basic (a single barplot! with stack, a manually built Legend) — little that showcases a distinctive Makie capability
  • Only 3 stacked components (low end of the spec's recommended 2-5 range) — an extra product line would add richness without changing the story

Issues Found

  1. CQ-04 / DE-01 MEDIUM: Total labels are documented as bold but rendered in regular weight
    • Fix: Add font = :bold (or Makie's bold-face syntax) to the text! call for total labels so they visually stand apart from tick/axis text as intended
  2. LM-02 LOW: Generic usage beyond the core barplot! call
    • Fix: Consider rich() for mixed-weight/mixed-size total-label text (would also resolve the bold-label gap), or another distinctive Makie touch

AI Feedback for Next Attempt

Make the total labels genuinely bold (e.g. font = :bold in the text! call, or rich() for mixed styling) to match both the code's own comment and the spec's suggestion to visually separate totals from other text. Beyond that fix, consider one added design touch (e.g. a distinctive Makie-specific text/annotation feature) to lift Design Excellence and Library Mastery past a solid-but-generic baseline. Data mapping, palette compliance, theme adaptation, and spec compliance are all correct — keep those as-is.

Verdict: REJECTED

@github-actions github-actions Bot added quality:85 Quality score 85/100 ai-rejected Quality not OK, triggers update labels Aug 26, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels Aug 26, 2026
Attempt 1/4 - fixes based on AI review
@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

claude Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): Warm off-white background (#FAF8F1). Bold, dark title bar-stacked-labeled · julia · makie · anyplot.ai is clearly legible; Quarter / Revenue ($M) axis labels have units and are readable; subtle y-only gridlines. Four quarterly stacked bars (Q1-Q4) render in Imprint green (#009E73, Subscriptions), lavender (#C475FD, Services), and blue (#4467A3, Hardware), with bold $X.XM total labels above each stack. All text is readable against the light background — no legibility failures. However, the implementation declares a 4th stacked component ("Support") that never appears: the legend lists only 3 entries, and pixel measurement confirms the blue "Hardware" segment's height equals Hardware+Support combined in every quarter (e.g. Q1 blue segment ≈ $1.4M = 0.9+0.5).

Dark render (plot-dark.png): Warm near-black background (#1A1A17). Title, axis labels, and tick labels all flip to light/white tones — no dark-on-dark failures. Data colors are identical to the light render (verified #009E73 / #C475FD / #4467A3 unchanged). Same bug reproduces identically: the ochre #BD8233 reserved for "Support" was found in 0 pixels of this render, and the legend again omits it.

Both renders are theme-legible; the issue below is a data-rendering correctness bug, not a theme-adaptation failure.

Score: 75/100

Category Score Max
Visual Quality 26 30
Design Excellence 15 20
Spec Compliance 8 15
Data Quality 12 15
Code Quality 9 10
Library Mastery 5 10
Total 75 100

Visual Quality (26/30)

  • VQ-01: Text Legibility (7/8)
  • VQ-02: No Overlap (6/6)
  • VQ-03: Element Visibility (3/6) - The 'Hardware' segment silently merges with the invisible 'Support' segment; two logical data elements collapse into one indistinguishable rectangle
  • VQ-04: Color Accessibility (2/2)
  • VQ-05: Layout & Canvas (4/4)
  • VQ-06: Axis Labels & Title (2/2)
  • VQ-07: Palette Compliance (2/2)

Design Excellence (15/20)

  • DE-01: Aesthetic Sophistication (6/8) - Custom Imprint palette, thoughtful rich() typographic hierarchy on totals
  • DE-02: Visual Refinement (5/6) - Subtle grid, spines removed, generous whitespace
  • DE-03: Data Storytelling (4/6) - Bold total labels create a clear focal point on the Q1-Q4 growth trend

Spec Compliance (8/15)

  • SC-01: Plot Type (5/5)
  • SC-02: Required Features (2/4) - Multi-component stacking is broken: 1 of 4 declared components never renders as its own segment
  • SC-03: Data Mapping (0/3) - The 'Support' series' data is not visible anywhere on the chart
  • SC-04: Title & Legend (1/3) - Title format exactly correct, but legend omits 'Support'

Data Quality (12/15)

  • DQ-01: Feature Coverage (3/6) - 3 of 4 declared stacked components are correctly represented; the 4th is invisible due to the rendering bug
  • DQ-02: Realistic Context (5/5)
  • DQ-03: Appropriate Scale (4/4)

Code Quality (9/10)

  • CQ-01: KISS Structure (3/3)
  • CQ-02: Reproducibility (2/2)
  • CQ-03: Clean Imports (2/2)
  • CQ-04: Code Elegance (1/2) - Manually pre-computed per-element color vector alongside stack= deviates from the library's documented colormap-based multi-series pattern
  • CQ-05: Output & API (1/1)

Library Mastery (5/10)

  • LM-01: Idiomatic Usage (2/5) - Deviates from the documented barplot! stack+colormap pattern in prompts/library/makie.md, very likely the root cause of the missing 4th segment
  • LM-02: Distinctive Features (3/5) - rich() compound bold/soft text styling on total labels is a genuinely Makie-distinctive technique

Score Caps Applied

  • None (no cap threshold triggered — VQ-03=3, SC-01=5, DQ-02=5, DE-01=6, CQ-04=1)

Strengths

  • Theme-adaptive chrome is threaded cleanly through Figure/Axis with correct tokens in both renders
  • Total labels use rich() to mix bold/oversized value text with a smaller, softer unit suffix — a genuinely library-distinctive touch
  • Realistic, plausible quarterly SaaS revenue scenario with a sensible growth trend across Q1-Q4
  • First categorical series is the mandated Imprint green, canonical palette order preserved, correct light/dark background tokens
  • ylims! is deliberately set last so label headroom survives any autolimits reset triggered by the legend/text calls

Weaknesses

  • CRITICAL data-rendering bug: product_lines declares 4 components (Subscriptions, Services, Hardware, Support) and the total labels correctly sum all 4 ($8.7M/$9.4M/$10.6M/$11.9M match), but the stacked bars only draw 3 visually distinct segments. Pixel-level measurement on both plot-light.png and plot-dark.png confirms the "Hardware" (blue, #4467A3) segment's height equals Hardware+Support combined in every quarter (Q1: blue segment ≈ $1.4M = 0.9+0.5; Q2 ≈ $1.3M = 0.8+0.5; Q3 ≈ $1.5M = 0.9+0.6; Q4 ≈ $1.6M = 0.9+0.7). The ochre #BD8233 reserved for "Support" was found in zero pixels across either render, and the Legend lists only 3 entries, omitting "Support" entirely. This silently misrepresents the data — a reader comparing the blue segment to the "Hardware" legend swatch would believe it represents only Hardware's value.
  • Likely root cause: color = colors passes a raw pre-computed per-element color vector alongside stack = stack, instead of the pattern prompts/library/makie.md documents for multi-series categorical color: color = stack, colormap = IMPRINT_PALETTE[1:n_product]. Switch to that pattern (or otherwise empirically verify all 4 stack groups render as 4 separate rectangles with 4 matching legend entries) before resubmitting.
  • Legend is incomplete as a direct symptom of the bug above — re-verify it shows all 4 swatches once the stacking bug is fixed.

Issues Found

  1. SC-03 CRITICAL: One of four declared stacked components ("Support") never renders as a distinct segment — its value is silently absorbed into the adjacent "Hardware" segment with the same color, and the legend omits it.
    • Fix: use color = stack, colormap = IMPRINT_PALETTE[1:n_product] in the barplot! call instead of a manually pre-computed color vector; re-render and visually confirm 4 distinct colored segments per bar and 4 legend entries before resubmitting.
  2. LM-01 MEDIUM: The color/stack combination deviates from the library's documented idiomatic multi-series pattern, which is the likely root cause of issue Add workflow diagram for new prototype discovery #1.
    • Fix: same as above — adopt the colormap-based approach from prompts/library/makie.md.

AI Feedback for Next Attempt

Fix the critical stacking bug first: switch barplot! to color = stack, colormap = IMPRINT_PALETTE[1:n_product] instead of a manually built color vector, so all 4 declared product lines (including "Support") render as distinct, correctly colored, correctly legended segments. Re-render both themes and visually confirm 4 stacked colors + 4 legend entries before resubmitting — everything else about this implementation (theme chrome, total-label typography, data realism) is solid and should carry over unchanged.

Verdict: REJECTED

@github-actions github-actions Bot added quality:75 Quality score 75/100 ai-rejected Quality not OK, triggers update and removed quality:85 Quality score 85/100 labels Aug 26, 2026
@github-actions github-actions Bot added ai-attempt-2 Second repair attempt and removed ai-rejected Quality not OK, triggers update labels Aug 26, 2026
Attempt 2/4 - fixes based on AI review
@github-actions

Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 2/4

Applied fixes based on AI review feedback.

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


🤖 impl-repair

@claude

claude Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

AI Review - Attempt 3/3

Image Description

Light render (plot-light.png): Warm off-white #FAF8F1 background. Four stacked bars (Q1–Q4) built from four components — Subscriptions (#009E73 green, bottom segment), Services (#C475FD lavender), Hardware (#4467A3 blue), and Support (#BD8233 ochre, top segment). A bold total-value label ("$8.7M", "$9.4M", "$10.6M", "$11.9M") sits directly above each stack, with the trailing "M" rendered smaller and softer via rich() mixed-weight text. Title "bar-stacked-labeled · julia · makie · anyplot.ai" is centered and dark ink on the light surface. Axis labels ("Quarter" / "Revenue ($M)") and tick labels are dark/soft-ink and clearly legible. A subtle y-only gridline sits at 5 and 10. Legend on the right lists the four components top-to-bottom in the same order as the stack bottom-to-top, with no frame, matching background. All text is readable against the light background — no light-on-light issues.

Dark render (plot-dark.png): Warm near-black #1A1A17 background. Same stack composition and identical data colors (green/lavender/blue/ochre segments, verified pixel-identical to the light render). Title, axis labels, tick labels, legend text, and total labels all flip to light ink (#F0EFE8/#B8B7B0) and remain clearly legible against the dark surface — no dark-on-dark failures observed anywhere (title, ticks, legend, and total labels are all light-colored on the near-black background). Gridlines remain subtle. Both renders pass the theme-readability checklist.

Score: 90/100

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

Visual Quality (28/30)

  • VQ-01: Text Legibility (7/8) - All chrome and total labels legible in both themes; title is legible but noticeably undersized (see VQ-05)
  • VQ-02: No Overlap (6/6) - No collisions between total labels, gridlines, legend, or bars
  • VQ-03: Element Visibility (6/6) - Bar segments and colors clearly distinguishable at this data density (4 categories × 4 series)
  • VQ-04: Color Accessibility (2/2) - Imprint palette provides adequate hue separation, no red-green-only encoding
  • VQ-05: Layout & Canvas (3/4) - Measured pixel-exact: title spans only ~30% of the plot width (849px of a 2814px axis span) vs. the ~50–70% target (and well below the ~70–85% this exact mandated title text typically fills) — titlesize (20) is too small for the 3200×1800 canvas relative to the rest of the chrome. Nothing is clipped or overlapping; canvas confirmed exactly 3200×1800.
  • VQ-06: Axis Labels & Title (2/2) - "Revenue ($M)" includes units, "Quarter" is descriptive
  • VQ-07: Palette Compliance (2/2) - First series is #009E73; remaining series follow canonical Imprint order (lavender/blue/ochre); backgrounds are correct #FAF8F1/#1A1A17; data colors identical across themes

Design Excellence (13/20)

  • DE-01: Aesthetic Sophistication (5/8) - Genuine typographic hierarchy in the total labels (bold value + smaller/softer unit via rich()), custom Imprint palette; undercut by the undersized title reducing overall visual weight
  • DE-02: Visual Refinement (4/6) - Top/right spines removed, y-only subtle grid, generous whitespace, no-frame legend blended into background
  • DE-03: Data Storytelling (4/6) - Bold total labels create a clear focal point and make the Q1→Q4 growth trend immediately readable without mental arithmetic (the spec's stated goal); segment ordering (largest at bottom) is sensible but unremarkable

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct stacked bar chart
  • SC-02: Required Features (4/4) - Total labels placed directly above each stack, consistent one-decimal $X.XM format, adequate headroom (ylims! set to max(totals)*1.16) so labels never crowd the plot top
  • SC-03: Data Mapping (3/3) - X = quarter category, Y = stacked revenue by component, all data visible
  • SC-04: Title & Legend (3/3) - Title exactly matches {spec-id} · julia · makie · anyplot.ai; legend labels match component names and are ordered to match the stack

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - Shows categories, stacked components, and computed totals — every aspect of the "stacked bar with total labels" plot type
  • DQ-02: Realistic Context (5/5) - Quarterly SaaS revenue by product line is plausible, neutral, and matches one of the spec's suggested applications
  • DQ-03: Appropriate Scale (4/4) - $0.5M–$7.3M segment values, $8.7M–$11.9M totals with a believable quarter-over-quarter growth curve

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - Flat script, no functions/classes
  • CQ-02: Reproducibility (2/2) - Fully deterministic (hardcoded data, no RNG needed)
  • CQ-03: Clean Imports (2/2) - Only CairoMakie and Colors, both used
  • CQ-04: Code Elegance (2/2) - Appropriately concise, no fake UI or simulated interactivity
  • CQ-05: Output & API (1/1) - Saves plot-$(THEME).png via current save(...; px_per_unit = 2) API

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) - Uses barplot! with the native stack=/color=/colormap= keywords — the idiomatic Makie stacking API — plus the high-level Axis/Legend grammar
  • LM-02: Distinctive Features (4/5) - rich() mixed-weight/size inline text for the total labels is a genuinely Makie-specific feature; stops short of 5/5 since no other distinctive Makie capability (e.g. layout composition, custom recipes) is exercised

Score Caps Applied

  • None

Strengths

  • Pixel-verified: canvas is exactly 3200×1800, and data colors are identical between light and dark renders — only chrome flips, as required
  • Total labels use genuine typographic hierarchy (rich() bold-oversized value + smaller/softer unit) rather than uniform text, directly serving the spec's "eliminate mental arithmetic" goal
  • Clean, idiomatic use of Makie's native stack= keyword on barplot! rather than manually cumsum-ing segment heights
  • ylims! is set last with explicit headroom (max(totals) * 1.16) specifically to protect label space from being clobbered by autolimits — a subtle correctness detail called out in the code's own comment

Weaknesses

  • Title is disproportionately small: measured at only ~30% of the plot/axis width (849px / 2814px) against the style guide's ~50–70% target for this canvas size. Increase titlesize from 20 toward ~26–28 so the mandated title carries appropriate visual weight on the 3200×1800 landscape canvas.
  • Y-axis has only two gridlines (5 and 10) across a 0–~13.8 range — slightly sparse for reading intermediate values off the chart.

Issues Found

  1. VQ-05 MODERATE: Title occupies only ~30% of the axis width, well under the expected ~50–70% (or ~70–85% for this exact mandated title text) for a 3200×1800 landscape canvas
    • Fix: Raise titlesize from 20 to ~26–28 to bring the title's proportional width in line with the style guide

AI Feedback for Next Attempt

Implementation is strong overall — correct stacked-bar mechanics, clean theme-adaptive chrome, and a nicely designed total-label treatment. The one concrete fix: bump titlesize (currently 20) up to roughly 26–28 so the title fills closer to the target 50–70% of the plot width on the 3200×1800 canvas instead of the current ~30%.

Verdict: APPROVED

@github-actions github-actions Bot added quality:90 Quality score 90/100 ai-approved Quality OK, ready for merge and removed quality:75 Quality score 75/100 labels Aug 26, 2026
@MarkusNeusinger
MarkusNeusinger merged commit daf83ab into main Aug 26, 2026
3 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the implementation/bar-stacked-labeled/makie branch August 26, 2026 19:38
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 ai-attempt-2 Second repair attempt quality:90 Quality score 90/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant