Skip to content

feat(makie): implement waveform-audio#8299

Merged
MarkusNeusinger merged 6 commits into
mainfrom
implementation/waveform-audio/makie
Jun 3, 2026
Merged

feat(makie): implement waveform-audio#8299
MarkusNeusinger merged 6 commits into
mainfrom
implementation/waveform-audio/makie

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Jun 3, 2026

Implementation: waveform-audio - julia/makie

Implements the julia/makie version of waveform-audio.

File: plots/waveform-audio/implementations/julia/makie.jl

Parent Issue: #4563


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jun 3, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): The plot displays an earthquake seismogram on a warm off-white (#FAF8F1) background. A filled band in Imprint brand green (#009E73) at 75% opacity shows the min/max amplitude envelope over 30 seconds of simulated seismic data. The waveform begins with a flat low-noise floor, shows moderate P-wave oscillations arriving around 5 s, a brief quiet period, then a large S-wave arrival at ~10 s with peak amplitude near ±0.85, decaying gradually to silence by ~22 s. A thin dark gray horizontal zero reference line crosses the center. Y-axis grid lines are very subtle (12% opacity). Top and right spines are removed; left and bottom spines are dark gray. Title, axis labels (Amplitude / Time (seconds)), and tick labels are all dark on the light background and fully readable. Legibility verdict: PASS.

Dark render (plot-dark.png): The same seismogram on a warm near-black (#1A1A17) background. The Imprint green waveform envelope is visually identical to the light render — data colors unchanged. Title and axis labels render in off-white (#F0EFE8), tick labels in light gray (#B8B7B0), and the zero line in light gray — no dark-on-dark issues. Grid lines remain subtle and the spines adapt correctly to the dark chrome. Legibility verdict: PASS.

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

Score: 89/100

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

Visual Quality (29/30)

  • VQ-01: Text Legibility (8/8) — All sizes explicitly set: titlesize=20, xlabelsize=14, ylabelsize=14, xticklabelsize=12, yticklabelsize=12. Well-proportioned; title fills ~70% of width as expected for the mandated format. Both themes fully readable.
  • VQ-02: No Overlap (6/6) — No text or data overlaps in either render.
  • VQ-03: Element Visibility (6/6) — Band fill at alpha=0.75 is well-adapted to the dense waveform; prominent P-wave and S-wave features are clearly visible.
  • VQ-04: Color Accessibility (2/2) — Single-series in brand green with good contrast on both backgrounds; CVD-safe.
  • VQ-05: Layout & Canvas (4/4) — Canvas gate passed (3200×1800); plot fills ~60% of canvas with balanced margins; no clipping.
  • VQ-06: Axis Labels & Title (1/2) — X-axis: Time (seconds) is descriptive with units ✓. Y-axis: Amplitude is descriptive but lacks the (normalized) qualifier; spec explicitly states normalized amplitude.
  • VQ-07: Palette Compliance (2/2) — Single series uses #009E73 (Imprint brand green); light bg #FAF8F1, dark bg #1A1A17; all chrome tokens (INK, INK_SOFT, PAGE_BG) correctly applied in both renders.

Design Excellence (12/20)

  • DE-01: Aesthetic Sophistication (4/8) — Clean, well-configured implementation following the anyplot style guide. Semi-transparent envelope fill adds visual depth; spines removed; Y-only grid. Doesn't transcend the style guide defaults into something exceptional — looks like a well-configured library output.
  • DE-02: Visual Refinement (4/6) — Spines removed (top/right), very subtle Y-grid at 0.12 opacity, generous whitespace, appropriate semi-transparent fill. Good refinement visible; not quite at "every detail polished" level.
  • DE-03: Data Storytelling (4/6) — The seismogram scenario tells a genuinely compelling story: quiet noise → P-wave arrival → S-wave with peak amplitude → gradual decay. Visual hierarchy emerges naturally from the data. However, no active design emphasis (annotations, highlighted regions) to actively guide the viewer to the P/S-wave arrivals.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct waveform plot using filled area (band!) with min/max envelope rendering for dense data.
  • SC-02: Required Features (4/4) — Filled envelope area ✓, semi-transparent fill ✓, zero reference line ✓, time in seconds on X-axis ✓, amplitude -1 to +1 on Y-axis ✓, min/max envelope for dense data ✓, synthetic data ✓.
  • SC-03: Data Mapping (3/3) — X: time 0–30 s; Y: amplitude -1.1 to +1.1 (with slight headroom); all data visible.
  • SC-04: Title & Legend (3/3) — Title Earthquake Seismogram · waveform-audio · julia · makie · anyplot.ai follows the optional-prefix format exactly. No legend needed for single-series plot.

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Shows all aspects: noise floor, exponentially-decaying P-wave burst, brief quiet, large S-wave arrival with different frequency and amplitude, gradual decay.
  • DQ-02: Realistic Context (5/5) — Earthquake seismogram is a real, neutral scientific scenario. P-wave and S-wave arrivals are physically accurate domain elements.
  • DQ-03: Appropriate Scale (4/4) — Normalized amplitude ±1 is standard; 30 s at 1000 Hz is realistic; P-wave amplitude 0.3 < S-wave amplitude 0.85 is physically correct.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Flat script: imports → theme tokens → data generation → envelope computation → plot → save. No functions or classes.
  • CQ-02: Reproducibility (2/2) — Random.seed!(42) set.
  • CQ-03: Clean Imports (2/2) — CairoMakie (plotting), Colors (colorant literals), Random (seed), Statistics (mean for envelope midpoints). All actually used.
  • CQ-04: Code Elegance (2/2) — Clean, idiomatic Julia with array comprehensions for envelope computation. No over-engineering, no fake UI.
  • CQ-05: Output & API (1/1) — Saves as plot-$(THEME).png; uses current Makie API (size= instead of deprecated resolution=).

Library Mastery (8/10)

  • LM-01: Idiomatic Usage (5/5) — band! for filled envelopes, hlines! for reference lines, Figure/Axis layout system, RGBAf for transparent grid color, (BRAND, 0.75) tuple syntax for color+alpha — all idiomatic Makie patterns.
  • LM-02: Distinctive Features (3/5) — band!(ax, t_env, amp_min, amp_max) is a distinctively elegant Makie primitive for this use case; the (color, alpha) tuple syntax and RGBAf construction are Makie-specific. Doesn't use more advanced Makie features (recipes, theming system, Observables, compound layouts).

Score Caps Applied

  • None — no caps triggered. DE-01=4 and DE-02=4 (both > 2), so the 75-cap does not apply.

Strengths

  • Exemplary spec compliance and data quality: all required waveform features present, physically realistic seismogram with distinct P/S-wave arrivals
  • Perfect code quality: clean KISS structure, reproducible, all imports used, current Makie API
  • Idiomatic band! usage cleanly implements the filled min/max envelope technique specified
  • Theme tokens applied correctly throughout; both renders are fully readable with no dark-on-dark failures
  • Seismogram scenario is a natural real-world fit for the waveform-audio spec and tells a compelling story

Weaknesses

  • Y-axis label is Amplitude — add (normalized) qualifier to match spec language and earn the second VQ-06 point, e.g., ylabel = "Normalized Amplitude"
  • Design excellence could be elevated: consider annotating the P-wave and S-wave arrival events with subtle text labels to actively guide the viewer and push DE-03 from 4 to 6
  • Aesthetic sophistication (DE-01) is currently at well-configured-default level (4/8); adding even one distinctive visual touch (e.g., a thin stroke outline on the band, or a subtle amplitude-region shading for the noise floor) would raise the polish level

Issues Found

  1. VQ-06 PARTIAL: Y-axis label missing (normalized) qualifier
    • Fix: Change ylabel = "Amplitude" to ylabel = "Normalized Amplitude"
  2. DE-03 MODERATE: Seismogram story is clear from data but no active design guidance to P/S-wave events
    • Fix: Add two concise text! annotations like "P" and "S" near the arrival peaks, or draw subtle vertical dashed reference lines at t=5 s and t=10 s in INK_SOFT
  3. DE-01 MODERATE: Visual sophistication at configured-default level
    • Fix: One or two targeted enhancements — e.g., a thin strokecolor on the band outline, or a subtle second-layer fill at lower alpha for the noise floor region — would lift polish without adding complexity

AI Feedback for Next Attempt

Three targeted improvements will push this from 89 to ≥ 90: (1) rename Y-axis label to "Normalized Amplitude"; (2) add two small text! annotations at the P-wave (t≈5 s) and S-wave (t≈10 s) arrival points using INK_SOFT color — this actively guides the viewer and raises DE-03 to 6; (3) add a thin band outline stroke (strokecolor = (BRAND, 0.9), strokewidth = 1) to lift DE-01 polish slightly. Do not change the data or color scheme — the seismogram scenario, Imprint palette, and theme tokens are all correct.

Verdict: REJECTED

@github-actions github-actions Bot added quality:89 Quality score 89/100 ai-rejected Quality not OK, triggers update labels Jun 3, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels Jun 3, 2026
Attempt 1/3 - fixes based on AI review
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented Jun 3, 2026

🔧 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 Jun 3, 2026

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): Warm off-white (#FAF8F1) background. The plot shows a seismogram-style waveform with three distinct phases: a flat noise floor (0–5 s), a moderate P-wave burst (5–8 s), and a larger S-wave oscillation (10–22 s) that decays exponentially. The waveform is rendered as a filled envelope using brand green (#009E73) at 0.72 opacity with faint outline strokes. A subtle noise-floor band at ±0.03 amplitude is drawn in 8% green. Dashed gray vertical lines mark P-wave (5 s) and S-wave (10 s) arrivals with small text annotations at (5.3, 0.95) and (10.3, 0.95). Y-axis labels are [-1.0, -0.5, 0.0, 0.5, 1.0]. Title, axis labels, and tick labels are all dark on the light background. All text is readable against the light background (PASS).

Dark render (plot-dark.png): Warm near-black (#1A1A17) background. The identical seismogram data is rendered — waveform fill color and stroke are the same brand green (#009E73), confirming data colors are theme-invariant. Chrome flips correctly: title and axis labels render in light (#F0EFE8), tick labels and annotation text in secondary light (#B8B7B0). The zero reference line, annotation dashes, and wave labels remain visible. No dark-on-dark failure observed — all text reads clearly on the near-black surface (PASS).

Both paragraphs required and provided. Both renders pass legibility checks.

Score: 93/100

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

Visual Quality (29/30)

  • VQ-01: Text Legibility (7/8) — All font sizes explicitly set (titlesize=20, xlabelsize=14, ylabelsize=14, xticklabelsize=12, yticklabelsize=12, annotation fontsize=11). Both themes fully readable. Minor: annotation labels at fontsize=11 are compact when rendered at ~400px mobile scale.
  • VQ-02: No Overlap (6/6) — P-wave and S-wave annotations are well-spaced horizontally; no element overlaps.
  • VQ-03: Element Visibility (6/6) — Min/max envelope using band!() is the ideal approach for 30,000-sample dense waveform; clearly visible in both themes.
  • VQ-04: Color Accessibility (2/2) — Single series in brand green; good contrast on both surfaces; no red-green sole-distinction issue.
  • VQ-05: Layout & Canvas (4/4) — Canvas gate passed (3200×1800). Nothing clipped; generous margins; proportions clean.
  • VQ-06: Axis Labels & Title (2/2) — "Time (seconds)" and "Normalized Amplitude" are descriptive with units.
  • VQ-07: Palette Compliance (2/2) — Single series uses #009E73 (brand green) as first series. Backgrounds are #FAF8F1 (light) / #1A1A17 (dark). All chrome tokens correctly adaptive.

Design Excellence (15/20)

  • DE-01: Aesthetic Sophistication (6/8) — Above defaults: noise floor band, semi-transparent layered fill with outline strokes, arrival annotations with dashed vertical markers, seismogram narrative context with realistic synthetic data. Intentional opacity layering (0.08 → 0.55 → 0.72) creates depth.
  • DE-02: Visual Refinement (4/6) — Top/right spines removed, y-grid only (sensible for time series), annotation lines at 35% opacity so they don't compete with data. Clean composition.
  • DE-03: Data Storytelling (5/6) — Excellent narrative arc: silence → P-wave transient → dominant S-wave → exponential decay. Annotations guide the viewer to the two key seismic events. The visual flow reads naturally left-to-right with clear focal emphasis on the S-wave body.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct: waveform as filled area envelope, symmetric around zero.
  • SC-02: Required Features (4/4) — Filled band ✓; semi-transparent fill ✓; horizontal zero-line ✓; time in seconds ✓; y-axis -1 to +1 ✓; min/max envelope for dense waveform ✓; synthetic data ✓.
  • SC-03: Data Mapping (3/3) — Time (0–30 s) on X; normalized amplitude (-1 to +1) on Y; full data range shown.
  • SC-04: Title & Legend (3/3) — Title is "Earthquake Seismogram · waveform-audio · julia · makie · anyplot.ai" — optional descriptive prefix + mandatory format. Language correctly listed as "julia".

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — All waveform aspects shown: noise floor, transient P-wave onset, larger S-wave body, exponential damping envelope — complete seismogram lifecycle.
  • DQ-02: Realistic Context (5/5) — Earthquake seismogram is a real-world, neutral application domain. P-wave at 5 s, S-wave at 10 s, sample rate of 1000 Hz, 30-second clip — all geophysically plausible.
  • DQ-03: Appropriate Scale (4/4) — Amplitude normalized to [-1, +1]; S-wave peak ~0.85 is realistic for normalized seismic data; 30,000 samples at 1000 Hz is a natural short-record length.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Flat, linear top-to-bottom script; no functions or classes.
  • CQ-02: Reproducibility (2/2) — Random.seed!(42) set at top.
  • CQ-03: Clean Imports (2/2) — CairoMakie, Colors, Random, Statistics — all four are actually used (Statistics for mean() in envelope computation).
  • CQ-04: Code Elegance (2/2) — Appropriate complexity; no fake interactivity; layer composition is clean.
  • CQ-05: Output & API (1/1) — Saves as plot-$(THEME).png ✓; uses size = (Makie 0.22+ API) ✓; no HTML (correct for static CairoMakie).

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) — band!() for filled envelope, hlines!(), vlines!(), text!() all used idiomatically. RGBAf() for alpha-transparent theme-adaptive colors. Full Figure/Axis chrome token wiring is textbook.
  • LM-02: Distinctive Features (4/5) — band!() is the signature Makie primitive for area-between-curves; the layered composition system (band → lines → hlines → vlines → text) showcases Makie's recipe composability. Minor deduction: no advanced Makie features (Observables, custom recipes, Layoutables beyond Axis).

Score Caps Applied

  • None — no caps triggered.

Strengths

  • Min/max envelope with band!() is the correct Makie idiom for dense waveform visualization; avoids aliasing while preserving visual density.
  • Layered opacity system (noise floor 8% → outline 55% → fill 72%) creates professional visual depth without clutter.
  • Seismogram context delivers a complete, coherent data story with clearly annotated P-wave and S-wave arrivals.
  • Perfect spec compliance: all required waveform features present.
  • Full theme-adaptive chrome wiring — dark render reads cleanly with zero dark-on-dark failures.

Weaknesses

  • P-wave and S-wave annotation labels (fontsize=11) are small at mobile scale (~400 px rendering); consider bumping to fontsize=12–13 for marginal readability gain.
  • Noise-floor band at 8% opacity on dark background is nearly invisible — a minor missed opportunity for consistent visual depth across themes.

Issues Found

  1. VQ-01 MINOR: Annotation text at fontsize=11 is compact when plot is scaled to ~400px mobile width.
    • Fix: Increase annotation fontsize from 11 to 13 for better mobile legibility.

AI Feedback for Next Attempt

Implementation is strong. Only marginal improvements possible: increase P/S-wave annotation fontsize from 11 to 13 for mobile readability, and consider raising the noise floor band opacity on dark theme from 0.08 to 0.12 so it remains subtly visible.

Verdict: APPROVED

@github-actions github-actions Bot added quality:93 Quality score 93/100 ai-approved Quality OK, ready for merge and removed quality:89 Quality score 89/100 labels Jun 3, 2026
@MarkusNeusinger MarkusNeusinger merged commit fe61b47 into main Jun 3, 2026
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/waveform-audio/makie branch June 3, 2026 01:50
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:93 Quality score 93/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant