feat(palette): adopt imprint — new categorical palette + named API + frontend rebuild#7692
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the previous variant D palette (PR #7617) with imprint — anyplot's new 8-hue colourblind-safe categorical palette + 3 semantic anchors (amber for warning, theme-adaptive neutral and muted). Tuned for warm-paper rendering, validated against deuteranopia / protanopia / tritanopia, sits in the academic-publishing family next to Okabe-Ito, Paul Tol "muted", and ColorBrewer Set2.
Full design rationale:
docs/reference/palette-variants-v3/decision-rationale.md. Earlier variants (v1, v2, expert reviews) preserved underdocs/reference/palette-variants-*/for design archaeology.What's in this PR
Phase 1 — Backend foundation (
core/)core/palette.py— single source of truth: 8 categorical hexes in hybrid-v3 sort order, 3 semantic anchors, named API (palette.green,palette.semantic.bad, …), sequential cmapimprint_seq(green→blue) + theme-adaptive diverging cmapimprint_div_{light,dark}(red↔midpoint↔blue), matplotlib registration.core/images.pyrefactored — drops old 7 ANYPLOT_* constants, re-imports fromcore/palette.py.LIBRARY_COLORSrebuilt with library-brand-match strategy.Phase 2 — Prompt system (18 files)
prompts/default-style-guide.md— full Color Philosophy rewrite with 8-hex hybrid-v3 table, new Semantic anchors section, series-count guidance with concrete ΔE_CVD numbers, optional outline pattern.ANYPLOT_PALETTElists updated to 8 hexes +ANYPLOT_AMBER, cmaps renamed with new endpoints.Phase 3 — Style guide doc
docs/reference/style-guide.mdSection 4.1 rewritten as "The imprint Palette" with hue table, semantic-anchors table, hybrid-v3 sort rationale. Status colours (§4.5) and plot-only colours (§4.6) remapped onto imprint. CSS variables + Python implementation reference updated.Phase 5a — Frontend palette page (
/palette)app/src/pages/PalettePage.tsxcompletely rebuilt across 5 iterations: real chroma wheel (CSS conic-gradient OKLCH + chroma fade) with hover tooltips, compare-with toggle (Okabe-Ito / Tol muted / ColorBrewer Set2 / anyplot previous), compact 4×2 slot grid with click-to-copy hex, sort toggle (imprint default ↔ CVD-optimal max-min) with inline trade-off info, semantic anchors cards, continuous cmaps gradient strips, copy snippets in 4 languages (Python / R / Julia / JS) with OKLCH toggle, collapsible WCAG audit + palette history.theme/index.ts—colors.okabe→colors.imprint, semantic colours remapped.styles/tokens.css—--ok-*→--imprint-*, code-syntax theme rebuilt for both light and dark.components/PaletteStrip.tsx— 8-hex imprint set, optionalhexesprop.Phase 5b — Frontend consumers
LandingPage.tsx—CLUSTER_PALETTE+ 7-Okabe swatch row swapped (now click-to-copy),palette_okabe_itoanalytics event gone.MapPage.tsx—CLUSTER_COLORSrebuilt with 8 imprint hexes.AboutPage.tsx,ScienceNote.tsx— palette prose reframed around imprint.CodeShowcase.tsx,CodeHighlighter.tsx— syntax hexes updated,okabeItoTheme→imprintTheme.LandingPage.test.tsx— drops the gone Okabe-Ito tracking-event test.Final audit sweep
docs/reference/plausible.md(gone event row),.serena/memories/style_guide.md(Color section),scripts/style-variants.yaml(palette_tableau map),scripts/palette-analysis.py+docs/reference/anyplot-landing-mockup.html(HISTORICAL markers). Historical / comparison references (Okabe-Ito as family-neighbour, variant-D hexes as auto-reject signals in VQ-07, palette-variants exploration scripts) preserved intact.Intentionally NOT in this PR (Phase 4)
7 plot implementations under
plots/**/implementations/python/*.pystill hardcode the old variant-D palette inline. Per the design discussion these stay untouched and will pick up imprint via the next/regencycle, when the new prompts kick in.Validation
yarn tsc --noEmit— cleanyarn lint— 0 errors (2 pre-existing warnings, neither palette-related)yarn test --run— 507 / 507 passing/,/palette,/map,/aboutTest plan
/palettepage renders the chroma wheel, palette grid, semantic anchors, cmap previews, collapsibles/and/palette🤖 Generated with Claude Code