Function: teamColorScale()
teamColorScale(
league,o?):ScaleOrdinal<string,string,string>
Defined in: packages/sdvplot/src/d3/index.ts:170
A d3 ordinal scale from team (id or abbr) to team colour; anything unresolved maps to naValue (default "grey").
Parameters
league
"aaf" | "ahl" | "cfb" | "cricket" | "echl" | "mbb" | "milb" | "mlb" | "nba" | "nbagl" | "ncaa_baseball" | "ncaa_mhockey" | "ncaa_softball" | "ncaa_whockey" | "nfl" | "nhl" | "ohl" | "phf" | "pwhl" | "qmjhl" | "soccer" | "ufl" | "usfl" | "ushl" | "wbb" | "whl" | "wnba" | "xfl"
o?
idSystem?
naValue?
string
season?
values?
readonly Value[]
which?
Returns
ScaleOrdinal<string, string, string>
Example
import { loadLeague } from "@sportsdataverse/sdvplot";
import { teamColorScale } from "@sportsdataverse/sdvplot/d3";
await loadLeague("nba");
const color = teamColorScale("nba", { values: ["LAL", "BOS"] });
["LAL", "BOS", "not a team"].map(color);