Skip to content

feat(altair): implement ridgeline-basic#9793

Merged
MarkusNeusinger merged 4 commits into
mainfrom
implementation/ridgeline-basic/altair
Jul 25, 2026
Merged

feat(altair): implement ridgeline-basic#9793
MarkusNeusinger merged 4 commits into
mainfrom
implementation/ridgeline-basic/altair

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Implementation: ridgeline-basic - python/altair

Implements the python/altair version of ridgeline-basic.

File: plots/ridgeline-basic/implementations/python/altair.py

Parent Issue: #923


🤖 impl-generate workflow

github-actions Bot added 2 commits July 25, 2026 03:55
Regen from quality 87. Addressed:
- Canvas: was 4479x2328 (undersized/overshoot vs contract); now sized
  view + facet spacing to land under target then PAD-only to exact
  3200x1800, per the current altair.md Canvas hard rule (scale_factor
  4.0, PAD-only block, no crop).
- Custom non-Imprint stroke #306998 replaced with theme-adaptive
  INK_SOFT (no custom hexes).
- Blues Vega scheme (forbidden continuous cmap) replaced with a
  12-step interpolation of the Imprint imprint_seq colormap
  (#009E73 -> #4467A3) for the ordered month ridges.
- Font sizes aligned to the scale-based family defaults (title 16px,
  axis label 10px, axis title 12px, header 12px) per the current
  Visual Sizing Defaults table.

Kept: transform_density + configure_facet negative-spacing structure,
seasonal temperature dataset, both-theme legibility.
@claude

claude Bot commented Jul 25, 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 "Monthly Temperature Distribution · ridgeline-basic · altair · anyplot.ai" centered at top. Twelve row labels (Jan–Dec) in soft-dark ink, right-aligned left of each ridge. X-axis "Temperature (°C)" with tick labels −15 to 40 in dark/soft-dark ink at the bottom. All text confirmed legible with generous, unclipped margins on every edge (verified via pixel crops of all four borders). Twelve stacked, partially-overlapping KDE density curves (one per month, chronological top-to-bottom), filled with a smooth Imprint-sequential gradient from brand green #009E73 (Jan) to blue #4467A3 (Dec), each with a thin soft-ink stroke outline. Ridge shapes track the seasonal cycle realistically (cold/left-shifted in Jan/Dec, warm/right-shifted in Jul/Aug).

Dark render (plot-dark.png): Warm near-black background (#1A1A17). Same layout; title, row labels, and axis text now render in light ink (#F0EFE8 primary / #B8B7B0 secondary) — clearly legible against the dark surface, no dark-on-dark failures. Data colors are pixel-identical to the light render (green→blue gradient unchanged); only chrome (background, text, baseline strokes) flipped for the theme, as required.

Both renders pass the theme-readability checklist — no light-on-light or dark-on-dark issues, no edge clipping (AR-09 clear).

Score: 93/100

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

Visual Quality (29/30)

  • VQ-01: Text Legibility (7/8) — all sizes explicitly set, matches style-guide defaults, legible in both themes, no overflow
  • VQ-02: No Overlap (6/6) — no collisions in either render
  • VQ-03: Element Visibility (6/6) — density curves clearly visible, fillOpacity + stroke give good definition
  • VQ-04: Color Accessibility (2/2) — CVD-safe gradient, ink stroke around each fill
  • VQ-05: Layout & Canvas (4/4) — balanced margins, verified no cut-off content on any edge
  • VQ-06: Axis Labels & Title (2/2) — "Temperature (°C)" with units; Y-axis correctly shows group labels per spec
  • VQ-07: Palette Compliance (2/2) — first ridge exactly #009E73, gradient is the canonical imprint_seq two-stop range, theme-correct chrome in both renders

Design Excellence (15/20)

  • DE-01: Aesthetic Sophistication (6/8) - Thoughtful gradient encoding of month order, clean typography, clearly above a configured default
  • DE-02: Visual Refinement (5/6) - No grid, minimal chrome, generous whitespace; per-row baseline stroke is the only un-refined touch
  • DE-03: Data Storytelling (4/6) - Row order + color gradient make the seasonal cycle immediately visible, but no explicit annotation of peak/insight

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — correct ridgeline/joy plot via row-faceted density curves
  • SC-02: Required Features (4/4) — stacked partial-overlap curves, Y-axis group labels, chronological order, color differentiation
  • SC-03: Data Mapping (3/3) — X=temperature, Y=density→row position, all 12 groups fully visible
  • SC-04: Title & Legend (3/3) — title matches this spec's established convention; no legend needed since row labels already identify groups

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6) — 12 distributions vary in both mean and spread
  • DQ-02: Realistic Context (5/5) — neutral, comprehensible monthly-climate scenario
  • DQ-03: Appropriate Scale (4/4) — values realistic for a temperate seasonal cycle

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3)
  • CQ-02: Reproducibility (2/2) — np.random.seed(42)
  • CQ-03: Clean Imports (2/2)
  • CQ-04: Code Elegance (2/2)
  • CQ-05: Output & API (1/1) — plot-{THEME}.png + .html via current API

Library Mastery (10/10)

  • LM-01: Idiomatic Usage (5/5) — expert use of transform_density + alt.Row faceting + negative configure_facet(spacing=...), Altair's recommended ridgeline pattern
  • LM-02: Distinctive Features (5/5) — transform_density is a Vega-Lite-native declarative KDE transform unique to Altair's grammar

Score Caps Applied

  • None

Strengths

  • Idiomatic Altair technique: transform_density (declarative KDE) + alt.Row faceting + negative configure_facet(spacing=-13) is the canonical, distinctive way to build a ridgeline in this library
  • Imprint sequential gradient (#009E73#4467A3) correctly applied across the 12 chronologically-ordered ridges, first ridge exactly #009E73
  • Canvas gate passes exactly at 3200×1800; all four edges verified clipping-free
  • Theme-adaptive chrome threaded consistently through axis/header/title/view config — both renders fully legible
  • Realistic monthly temperature data with per-month variation in mean and spread

Weaknesses

  • Ridge overlap (~46%, spacing=-13 vs row height=28) sits slightly below the spec's "typically 50-70%" guidance — a bit more negative spacing (e.g. -16 to -18) would give a more classic joy-plot silhouette
  • The green-to-blue gradient is decorative/redundant with row order — no caption or label ties it to "month progression"
  • Design stays fairly minimal/flat; a small refinement (subtle alternating row shading, mean-value tick per ridge) would push Aesthetic Sophistication closer to publication-ready

Issues Found

  1. DE-03 MEDIUM: No explicit call-out of the seasonal insight beyond the implicit visual pattern
    • Fix: Not required for approval — optional polish for a future pass could add a subtle annotation on the warmest/coldest month

AI Feedback for Next Attempt

Implementation approved on first review. Optional future polish: tighten ridge overlap slightly (spacing ≈ -16 to -18) for a more dramatic joy-plot silhouette, and consider a subtle design touch (alternating row shading or a mean-tick per ridge) to push Design Excellence further.

Verdict: APPROVED

@github-actions github-actions Bot added quality:93 Quality score 93/100 ai-approved Quality OK, ready for merge labels Jul 25, 2026
@MarkusNeusinger
MarkusNeusinger merged commit d785735 into main Jul 25, 2026
3 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the implementation/ridgeline-basic/altair branch July 25, 2026 04:02
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 quality:93 Quality score 93/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant