iconAssign: a value as a row of icons
| Team | Wins |
|---|---|
| KC | 15 |
| LAC | 11 |
| DEN | 10 |
| LV | 4 |
| BUF | 13 |
| MIA | 8 |
| NYJ | 5 |
| NE | 4 |
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";
// reactablefmtr icon_assign with buckets: each team's wins as its fifth of the column, out of five stars.
const spec = defineTable<Standing>()
.columns((c) => [
c.text("team"),
c.iconAssign("wins", { label: "Wins", buckets: 5, icon: "star", fill: "#D6AF36", showValues: "right" }),
])
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, STANDINGS);
Tags: kind · iconAssign · icon_assign · reactablefmtr. All sdvtables examples.