Skip to main content

Function: logoIcons()

logoIcons<T>(league, teams, o?): UnovisIcons<T>

Defined in: packages/sdvplot/src/unovis.ts:241

Team logos for a Unovis Graph's nodes: nodeIcon: (n) => logos(n.team), with svgDefs: logos.svgDefs on the container. Unovis draws each icon as a <use> of the logo's <symbol>, nodeIconSize px across, the logo fitted inside, uncut; a node's fill shows round it. A team with no logo has no icon, with one warning. Every value naming a team finds its logo (12, "12" and "KC").

Type Parameters​

T​

T

Parameters​

league​

"aaf" | "ahl" | "ajhl" | "bchl" | "cchl" | "cebl" | "cfb" | "cfl" | "chl" | "cricket" | "easl" | "echl" | "f1" | "fiba" | "gojhl" | "iihf" | "kijhl" | "lba" | "mbb" | "mhl" | "milb" | "mjhl" | "mlb" | "nba" | "nbagl" | "nbl" | "ncaa_baseball" | "ncaa_mhockey" | "ncaa_softball" | "ncaa_whockey" | "nfl" | "nhl" | "nojhl" | "ohl" | "ojhl" | "phf" | "pwhl" | "qmjhl" | "sjhl" | "soccer" | "sphl" | "ufl" | "usfl" | "ushl" | "vijhl" | "wbb" | "whl" | "wnba" | "xfl"

teams​

readonly T[]

o?​

UnovisLogoOptions = {}

Returns​

UnovisIcons<T>

Example​

import { loadLeague } from "@sportsdataverse/sdvplot";
import { logoIcons } from "@sportsdataverse/sdvplot/unovis";

await loadLeague("nfl");
const logos = logoIcons("nfl", ["KC", "LV"], { variant: "dark" });
// new SingleContainer(el, { component: new Graph({ nodeIcon: (n) => logos(n.team), nodeIconSize: 28 }),
// svgDefs: logos.svgDefs }, data)
[logos("KC"), logos.range];