Skip to main content

delta: the change from one column to another

AFC, 2024
TeamPFPoint diff.
KC385▲ 59
LAC402▲ 101
DEN425▲ 114
LV309▼ 125
BUF525▲ 157
MIA345▼ 19
NYJ338▼ 66
NE289▼ 128
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

// delta(from, to) shows to - from: here points for minus points against, green up and red down.
const spec = defineTable<Standing>()
.columns((c) => [
c.text("team"),
c.int("pf", { label: "PF" }),
c.delta("pa", "pf", { label: "Point diff.", decimals: 0, arrows: true }),
])
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: kind · delta · gt_delta. All sdvtables examples.