Skip to content

Commit 32285a0

Browse files
alexnodelandclaude
andauthored
docs: Fugue Explorables — interactive, data-first documentation rehaul (#39)
* docs: Fugue Explorables — interactive data-first docs rehaul Adds an Explorables section: six interactive pages in the tradition of Bret Victor's explorable explanations and 3Blue1Brown's visual math, built on a shared dependency-free canvas library (docs/fugue-viz.js, ~5k lines total, no CDNs, no build step, theme-aware, reduced-motion safe, seeded/reproducible). Every widget centers on live data: draggable observations with priors and posteriors updating in real time. Metropolis and HMC share one Bayesian linear regression as twin-panel views (data space with posterior spaghetti <-> parameter space with the sampler), with live split-R-hat/ESS implementing the 0.2.0 diagnostics math in JS. The monad page performs a Normal-mean model one effect at a time over a draggable dataset with its exact conjugate posterior. SMC shows the filtering distribution and mean band over its particle cloud. Also a 0.2.0 truth pass over all existing pages: fixed broken prob! snippets (raw for-loops the macro cannot parse), a duplicate-address hierarchical sample that would panic, a fabricated ScoreGivenTrace API, dead example references, wrong repo URLs, and stale memory- subsystem claims; every remaining snippet verified against src/. Fixes a live site bug: default-theme was "dark", which is not an mdbook theme name, so light-OS visitors got the light CSS fallback while the html class claimed dark; now navy, and the viz library detects dark/light from mdbook's --bg token instead of class names. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DEAKcbnLVP8iSXub2Pqor2 * docs: alive everywhere — autoplay, ambient micro-widgets across all pages Every widget now autoplays when scrolled into view (pausing offscreen; reduced-motion gets a rich pre-rendered frame, never an empty axis) and heroes pre-warm so first paint already shows a running system. Adds docs/viz/inline.js: ten parameterized ambient micro-widgets (dist-strip, posterior-morph, trace-ticker, rhat-spark, shrinkage, regression-mini, mixture-resp, logistic-boundary, elbo-climb, abc-eps) with real math inside (split-R-hat and ESS ported from src/inference/diagnostics.rs, EM responsibilities, conjugate updates), embedded at the point of discussion across ~20 pages — including a deliberately unconverged rhat-spark on debugging-models and a live partial-pooling shrinkage widget on hierarchical-models. Removes all "new in 0.2.0"-style callouts (13 sites incl. the distributions widget's selector group) — version history lives in the CHANGELOG, not the docs. Browser-verified: all 25 widget-bearing pages animate on arrival, zero console errors, zero >50ms long tasks during ambient play on the busiest pages, reduced-motion renders rich static frames (fixed a resize race that blanked paused micro-widgets). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DEAKcbnLVP8iSXub2Pqor2 * docs: touch-grade smoothness pass + in-page support figures Fixes the root cause of mobile bugginess: .fv-canvas set touch-action: none on EVERY canvas, so thumb swipes over any figure ate page scroll. Canvases now default to pan-y; full gesture capture is opt-in via a shared FV.drag manager (pointer capture, claims the gesture only when the touch actually hits a draggable, >=22px hit inflation on coarse pointers, grab halo). Killed the same class in inline.js (unconditional preventDefault on touchmove) and in every hero's hand-rolled drag code; monad's machinery strip no longer steals scroll swipes as Steps; flash decay is time-based; layouts audited at 390px and 320px. Adds docs/viz/minis.js — eight page-support figures woven into the explorables' explanation sections: autocorrelation decay and a live sigma-sweep on Metropolis, the double-well momentum-vs-random-walk strip and a divergence-cliff scatter on HMC, an animated bind-chain on the monad page, sequential-update small multiples on Anatomy, an ESS timeline on SMC, and a natural-return-types flow on Distributions. Mobile-verified via emulated 390x844 touch contexts with CDP touch events: swipe-over-widget scrolls the page, point-drags move points without scrolling, zero console errors, zero >50ms long tasks; full desktop regression green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DEAKcbnLVP8iSXub2Pqor2 * docs: rhat-spark rewrite — real split-R̂ on trailing window, chains visibly converge Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018yo1jdkckG7yQ9eBqLbaDB * docs: rhat-spark — make the collapse visually read (envelope must shrink) Starts at ±3.4 stationary SDs with thin warmup threads (SD 0.32), a held separated phase, then a smoothstep funnel onto the shared band. Before, starts ±2.2 with SD 0.65 meant the merged band spanned nearly the same pixels as the separated chains — nothing visibly converged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018yo1jdkckG7yQ9eBqLbaDB --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 2595cfa commit 32285a0

43 files changed

Lines changed: 9412 additions & 183 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/book.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ text-direction = "ltr"
1010
create-missing = true
1111

1212
[output.html]
13-
default-theme = "dark"
13+
# "navy" is mdbook's dark theme; the previous value "dark" is not a real
14+
# mdbook theme name, so light-OS visitors silently got the light CSS fallback
15+
# while the html class still claimed dark.
16+
default-theme = "navy"
17+
preferred-dark-theme = "navy"
1418
git-repository-url = "https://github.com/alexnodeland/fugue"
1519
site-url = "/fugue/"
16-
additional-css = ["./mdbook-admonish.css"]
17-
additional-js = ["mermaid.min.js", "mermaid-init.js"]
20+
additional-css = ["./mdbook-admonish.css", "fugue-viz.css"]
21+
additional-js = ["mermaid.min.js", "mermaid-init.js", "fugue-viz.js", "viz/anatomy.js", "viz/monad.js", "viz/metropolis.js", "viz/hmc.js", "viz/smc.js", "viz/distributions.js", "viz/inline.js", "viz/minis.js"]
1822

1923
[output.html.fold]
2024
enable = true

0 commit comments

Comments
 (0)