Skip to content

📜 Add inequality visualization technical documentation#5957

Draft
paarriagadap wants to merge 16 commits into
masterfrom
docs-inequality-visualization
Draft

📜 Add inequality visualization technical documentation#5957
paarriagadap wants to merge 16 commits into
masterfrom
docs-inequality-visualization

Conversation

@paarriagadap
Copy link
Copy Markdown
Contributor

@paarriagadap paarriagadap commented Apr 21, 2026

Summary

Adds a technical companion document for the global inequality visualization (the income-plots bespoke component in owid-grapher) at docs/analyses/inequality_visualization/index.md, registers it in the docs nav and on the analyses landing page, and adds a reusable Claude Code skill that captures the patterns used to produce it.

The new doc

Sections covered:

  • Data sources: PIP 1000-binned global distribution (with the full 218-country list in a collapsible block) and the WDI series used for currency conversion.
  • Methodology: minor ETL processing applied to the 1000-binned data, and the Gaussian KDE parameters used to produce the smoothed distribution curves (including a note on why the chart uses a log₂ scale).
  • Share of population below a poverty line: the per-country and population-weighted aggregation used to compute the below-line share from the 1000 bins.
  • Currency: how International Dollars get converted to a user-selected local currency, including the PPP × CPI factor derivation and the PIP-vs-WDI reconciliation rules from etl/steps/data/external/owid_grapher/latest/int_dollar_conversions.py.
  • Time interval, Colors, Limitations, References.

The doc is now registered in zensical.toml and has a card on docs/analyses/index.md.

The new skill (create-analysis-doc)

Prompts the user for the title, scripts, external data sources, and optional article URL, then drafts a doc to ai/<short_name>.md following a canonical five-section skeleton (Introduction, Data sources, Methodology, Limitations, References) with guidance on when to add extra H2 sections. Covers style conventions (mkdocs-material admonitions, collapsible blocks, tables, worked examples), writing principles (lead with intuition, explain why, flag approximations), and the deployment flow (draft in ai/ → copy to docs/analyses/ → register in zensical.toml → add landing-page card → PR).

Marked as metadata.internal: true per CLAUDE.md convention.

Follow-ups (not in this PR)

  • Fill in the [TODO: article URL] placeholder in the Introduction once the accompanying article URL is finalized.

Test plan

  • Run make docs.serve locally, visit http://localhost:9010/analyses/inequality_visualization/ and confirm the page renders cleanly under Zensical/mkdocs-material.
  • Verify the new entry appears in the nav sidebar and that the landing page (/analyses/) shows the new card with a working Methodology button.
  • Check that the collapsible country list expands correctly.
  • Check that all external links resolve (PIP, WDI indicators, ICP, OWID international-dollars article, GitHub source links).
  • Confirm the create-analysis-doc skill is picked up by Claude Code (appears in the skills registry) and that a test invocation prompts for inputs as designed.

Companion document for the income-plots bespoke visualization in owid-grapher. Covers PIP 1000-binned distribution data, PPP/CPI currency conversion logic, KDE methodology, and share-below-line computation.
@paarriagadap
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@owidbot
Copy link
Copy Markdown
Contributor

owidbot commented Apr 21, 2026

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-docs-inequality-visualizatio

chart-diff: ✅ No charts for review.

Edited: 2026-04-21 14:52:04 UTC
Execution time: 5.00 seconds

Captures lessons from drafting the inequality visualization doc: canonical section structure, admonition/collapsible patterns, writing principles (lead with intuition, explain why, flag approximations), and the ai/ → docs/analyses/ → PR workflow.
Add the doc to zensical.toml under Technical publications and add a card to docs/analyses/index.md following the existing pattern.

Also enhance the create-analysis-doc skill: concrete template for the landing-page card (plus extra-button patterns for notebooks, Colab, data downloads), and explicit note that nav + landing-page registration is required for the doc to appear on docs.owid.io.
Unescape markdown artefacts from Google Doc export (\!\!\! admonitions, escaped brackets and equals signs), put admonition content on its own indented line so mkdocs-material renders the callouts, indent the country list under the ??? block so it actually collapses, drop the literal ** wrapping on headings, and normalize "international dollars" to lowercase except when sentence-initial.
Adds `status: new` frontmatter so the page shows the "Recently added" badge in the docs sidebar, matching the slavery analysis.
Demote Share of population below a poverty line, Currency, Time interval, and Colors to H3 under Methodology, and their children accordingly. All four describe methodological choices and belong together in the doc outline.
@paarriagadap
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a4681e0f4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .claude/skills/create-analysis-doc/SKILL.md Outdated
Unescape `\!\!\!` admonitions and move their content onto an indented line so mkdocs-material renders the callouts. Indent the 218-country list under the ??? quote block so it actually collapses (was previously wrapped in a fenced code block). Drop the ** wrapping on headings, unescape `\[`, `\]`, `\.`, `\=`, `\~`, `\_`, `\)`, fold the "How accurate is this?" paragraph and cross-check into a single note, and tidy the author line.
Restructure the data-sources skeleton around "Data source: <provider>" with an optional Data processing sub-section. Rename the generic Methodology placeholder to encourage project-specific naming. Offer two Limitations layouts (flat list vs. two-tier prose+bullets). Add first-person voice and optional source-code excerpts to the style conventions. Add two conditional writing principles: pair approximations with cross-checks inside the same callout, and add "what changes / what doesn't" invariance callouts for user-facing toggles. Add parameter-sensitivity subsections to the "when to add extra H2 sections" list. Every new pattern is gated on an explicit trigger so it doesn't bloat docs without the matching concern.
Unescaped $...$ pairs in body text render as inline math under Zensical/mkdocs-material. Escape all monetary dollar signs with a backslash (\$3, \$1,000, \$0.25) in the three affected paragraphs. Code-block dollar signs are left alone since code blocks bypass markdown processing. Also record the rule in the create-analysis-doc skill so future docs apply the escape from the start.
KaTeX auto-render was pairing any two $ signs on a paragraph and rendering the content between them as italic math — which wrecks prose in a site where monetary amounts appear constantly ("between $1 and $2" became math). Drop $...$ from the delimiter list in docs/javascripts/katex.js; inline math now requires \(...\). Update the only existing inline-math use in docs/guides/demo.md to the new syntax, and unescape the \$ workaround I added earlier in the inequality viz doc since it's no longer needed. Update the create-analysis-doc skill accordingly.
Keep the single !!! note admonition at the top (the repo-pointer) so the "note" styling signals its role as a pointer, and downgrade the two mid-body callouts ("How accurate is this?" and "What changes when you switch currency...") to !!! info. Leaves the Top-income coverage warning untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants