StatsHub Docs

Build-Ups

A Poisson match-up calculator with its inputs in the query string, and a one-second animation over maths that finishes instantly.

/build-ups · src/composed/build-ups

Predicts how many shots each player will take in a match-up.

The model is not in the component

lib/poisson.ts — pure, module-level, testable without React. What is left in the composed file is genuinely stateful, and that is the whole point of the split: the maths is checkable against fixed inputs, and the component is about what the reader chose.

The inputs are in the URL

The two expected values live in the query string, so a calculation is a link someone can send. That is the reason this board reaches for nuqs at all — it is not a filter, it is the input to a model, and the output is only meaningful alongside it.

The animation is deliberate

There is a one-second run animation over maths that completes instantly.

That is not padding for its own sake: a result that appears in the same frame as the click reads as though nothing was computed, and users re-click. The delay is a statement that work happened. It is called out here because the natural instinct on finding it is to delete it.

On this page