Skip to content

[codex] add distribution chart intents#2

Merged
tmusser merged 2 commits into
mainfrom
codex/distribution-chart-intents
Jul 3, 2026
Merged

[codex] add distribution chart intents#2
tmusser merged 2 commits into
mainfrom
codex/distribution-chart-intents

Conversation

@tmusser

@tmusser tmusser commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

This PR expands chart-contract beyond trend, rank, and compare charts with first-class distribution intents:

  • Chart.histogram()
  • Chart.boxplot()
  • Chart.violin()

It also adds distribution-specific audit rules so these charts do not just render - they declare and check the sample-size, grouping, unit, binning, and density-shape assumptions behind the claim.

Why

Distribution charts are where beautiful visuals can quietly smuggle weak claims.

Histograms can imply shape from arbitrary bins. Boxplots can hide thin group sizes. Violin plots can make low-sample data look more precise than it is. This PR keeps those visual forms aligned with the repo's core promise: claim-first, audited analytical charts.

What changed

  • Added public distribution chart constructors.
  • Added Altair renderers for histogram, boxplot, and violin intents.
  • Added distribution audit rules for numeric value fields, sample size, grouped sample size, histogram bins, and violin sample-size risk.
  • Added deterministic distribution chart examples.
  • Updated README, audit rule docs, roadmap, and example outputs.

Validation

  • python -m pytest -q
  • python examples/bad_to_good_chart.py
  • python examples/distribution_charts.py
  • python -m py_compile src/chart_contract/*.py src/chart_contract/renderers/*.py
  • git diff --check

tmusser added 2 commits July 3, 2026 18:03
Add first-class histogram, boxplot, and violin support with distribution-specific audit rules, examples, docs, and updated Vega-Lite outputs.
Reference the generated value field in the violin tooltip and revert unrelated example-output churn back to the repo baseline.
@tmusser tmusser marked this pull request as ready for review July 3, 2026 22:14
@tmusser tmusser merged commit 04db6dd into main Jul 3, 2026
2 checks passed
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.

1 participant