{"id":49922501,"url":"https://github.com/chris-santiago/ferrum","last_synced_at":"2026-06-05T00:02:06.047Z","repository":{"id":358182560,"uuid":"1237222482","full_name":"chris-santiago/ferrum","owner":"chris-santiago","description":"Ferrum is a statistical visualization library for Python: a grammar-first charting system that unifies exploratory plots, statistical graphics, interactive views, and model diagnostics, backed by a Rust engine. Built in 10 days by one human and an agentic Claude framework.","archived":false,"fork":false,"pushed_at":"2026-06-01T11:25:31.000Z","size":76204,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-01T13:13:33.179Z","etag":null,"topics":["altair","data-visualization","ggplot2","grammar-of-graphics","machine-learning","matplotlib","plotly","plotnine","plotting","python","rust","seaborn","statistical-graphics"],"latest_commit_sha":null,"homepage":"http://ferrumviz.com/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chris-santiago.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-13T01:48:36.000Z","updated_at":"2026-06-01T11:25:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chris-santiago/ferrum","commit_stats":null,"previous_names":["chris-santiago/ferrum"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/chris-santiago/ferrum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-santiago%2Fferrum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-santiago%2Fferrum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-santiago%2Fferrum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-santiago%2Fferrum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chris-santiago","download_url":"https://codeload.github.com/chris-santiago/ferrum/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-santiago%2Fferrum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33924834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["altair","data-visualization","ggplot2","grammar-of-graphics","machine-learning","matplotlib","plotly","plotnine","plotting","python","rust","seaborn","statistical-graphics"],"created_at":"2026-05-16T21:01:08.172Z","updated_at":"2026-06-05T00:02:06.038Z","avatar_url":"https://github.com/chris-santiago.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/site/assets/images/hero-strip.png\" alt=\"Ferrum chart examples: linear model, decision boundary, pairplot, SHAP beeswarm\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eFerrum\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eGrammar-of-graphics statistical visualization for Python, with a Rust core.\u003c/p\u003e\n\nFerrum builds every chart — scatter plot, faceted histogram, ROC curve, SHAP beeswarm — from the same grammar of data, encodings, marks, scales, and statistical transforms. The declaration layer is Python; the computation engine is Rust compiled via PyO3.\n\n## Install\n\nFor 'batteries included'-- ML diagnostic plots and interactive Jupyter rendering:\n\n```bash\npip install ferrum-viz[all]   # recommended — optional deps for fitted-model diagnostics (scikit-learn), SHAP, and Jupyter interactive\n```\n\nFor a lean install without optional extras:\n\n```bash\npip install ferrum-viz\n```\n\n## Quickstart\n\n```python\nimport ferrum as fm\nimport polars as pl\n\ndf = pl.DataFrame({\"x\": [1, 2, 3, 4], \"y\": [2, 4, 3, 5], \"group\": [\"a\", \"a\", \"b\", \"b\"]})\n\nchart = fm.Chart(df).mark_point().encode(x=\"x\", y=\"y\", color=\"group:N\")\nchart.save(\"scatter.svg\")\nchart.to_png()  # raster output, no display server needed\n```\n\n## Key features\n\n- **One chart model** — scatter plots, statistical graphics, and ML diagnostics share the same grammar and compose with `+`, `|`, `\u0026`.\n- **Stat transforms in the pipeline** — KDE, LOESS, bootstrap CIs, binning, and aggregations are declared in the chart spec and computed in Rust.\n- **Model diagnostics as charts** — `fm.roc_chart(model, X, y)`, `fm.confusion_matrix_chart(...)`, `fm.shap_chart(...)` return regular `Chart` objects.\n- **Zero system dependencies** — no Cairo, no X11, no display server. Renders anywhere `pip install` works.\n- **DataFrame pluralism** — polars, pandas, modin, cuDF, dask, ibis, and pyarrow all work through `Chart(data)`.\n- **Interactive rendering** — `chart.interactive()` switches to a GPU-backed WASM renderer with selections, zoom/pan, linked views, and tooltips. Backed by `anywidget` for Jupyter.\n\n## Themes\n\nTwelve built-in themes — from warm cream (Paper Ink, the default) to dark, publication, and editorial styles.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/site/guide/img/theme-grid.png\" alt=\"All 12 Ferrum themes\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n## Performance\n\n**200,000-point scatter benchmark** (median of 3 runs, Apple M-series):\n\n| Metric | Ferrum | plotnine | seaborn | Altair | Plotly |\n|---|---|---|---|---|---|\n| SVG render | **27 ms** | 7.56 s | 1.95 s | 2.86 s | 2.51 s |\n| SVG file size | 590 KB | 137 MB | 32.6 MB | 57.8 MB | 267 KB |\n| PNG render | **78 ms** | 2.35 s | 119 ms | — | 2.50 s |\n| Interactive HTML | **4.9 MB** | — | — | 14.3 MB | 9.8 MB |\n\nAt 1M points, Altair OOMs and plotnine takes 39 s. Ferrum renders in 57 ms. [Full benchmarks →](https://ferrumviz.com/guide/concepts/performance-scale/)\n\n## How Ferrum compares\n\n|  | Ferrum | plotnine | seaborn | Altair | Plotly |\n|---|---|---|---|---|---|\n| Grammar | Layered, typed encodings, faceting | ggplot2 port, full GoG | Convenience helpers | Vega-Lite declarative | Imperative traces |\n| Diagnostics | 44 helpers, 28 visualizers | — | — | — | — |\n| Composition | `+` `\\|` `\u0026` operators | `+` layers, facets only | Manual subplots | `\\|` `\u0026` (Vega-Lite) | `make_subplots` |\n| Interactivity | WASM/GPU, selections, linked views | matplotlib backends | matplotlib backends | Vega-Lite selections | Plotly.js |\n| Scale ceiling | 10M+ rows | ~100k marks | ~100k marks | ~5k rows | ~500k marks |\n| DataFrames | polars, pandas, modin, cuDF, dask, ibis | pandas only | pandas only | pandas, polars | pandas, polars |\n| System deps | None | matplotlib | matplotlib | None | None |\n| Backend | Rust (SVG, raster, WASM) | matplotlib | matplotlib | Vega-Lite (V8) | Plotly.js (kaleido) |\n\n[Detailed migration guides →](https://ferrumviz.com/comparison/plotnine/) for plotnine, seaborn, yellowbrick, and scikit-plot.\n\n## Examples\n\n```python\n# Layer a LOESS trend on a scatter plot\npoints = fm.Chart(df).mark_point(opacity=0.6).encode(x=\"x\", y=\"y\", color=\"group:N\")\ntrend = fm.Chart(df).mark_smooth(method=\"loess\").encode(x=\"x\", y=\"y\", color=\"group:N\")\nchart = points + trend\n\n# Compose diagnostics into a model report\nsource = fm.ModelSource(model, X_test, y_test)\nreport = (fm.roc_chart(source) | fm.confusion_matrix_chart(source)) \u0026 fm.importance_chart(source)\nreport.save(\"model_report.svg\")\n\n# Figure-level helpers\nfm.displot(df, x=\"value\", hue=\"group\", kind=\"kde\")\nfm.catplot(df, x=\"species\", y=\"measurement\", kind=\"violin\")\nfm.pairplot(df, vars=[\"a\", \"b\", \"c\"], hue=\"label\")\n```\n\n## Architecture\n\n| Layer | Role |\n|---|---|\n| `src/ferrum/` | Python declaration API — Chart, encodings, marks, themes, plots |\n| `crates/ferrum-core/` | Rust computation engine — transforms, scales, rendering |\n| Arrow CDI | Zero-copy data transport between Python and Rust via `pyo3-arrow` |\n\n## Development\n\nRequires Python 3.10+, Rust toolchain, and [maturin](https://www.maturin.rs/).\n\n```bash\nuv sync\nunset CONDA_PREFIX \u0026\u0026 uv run --no-sync maturin develop   # build Rust extension\nuv run pytest                                            # run tests\n```\n\n## How this was built\n\n\u003e [!NOTE]\n\u003e **Built in 10 days** by one human and an agentic Claude framework.\n\u003e 975 commits · 103k lines · 3,829 tests · 12 phases · 13 agents · 16 skills\n\u003e\n\u003e [Read the retrospective →](design-docs/development-meta-analysis.md)\n\n## Documentation\n\nFull docs at [ferrumviz.com](https://ferrumviz.com).\n\n## License\n\nSee [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-santiago%2Fferrum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris-santiago%2Fferrum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-santiago%2Fferrum/lists"}