Skip to main content

Function: headshotDots()

headshotDots<R, X, Y>(rows, o): TanstackImageDot<R, X, Y>[]

Defined in: packages/sdvplot/src/tanstack.ts:318

ESPN player headshots as TanStack dot marks, from the row's player field. A gsis id with no headshot draws nothing and warns once; an ESPN id's URL is built without checking the image exists, so an id ESPN has no photo for keeps its dot, unpainted, with no warning. idSystem: "gsis" needs loadGsis() first. As logoDots otherwise.

Type Parameters​

R​

R extends object

X​

X extends string

Y​

Y extends string

Parameters​

rows​

readonly R[]

o​

TanstackHeadshotOptions<X, Y>

Returns​

TanstackImageDot<R, X, Y>[]

Example​

import { headshotDots } from "@sportsdataverse/sdvplot/tanstack";

// Patrick Mahomes (ESPN id 3139477) at his 2024 passing yards and touchdowns, 40 px tall
const rows = [{ qb: "3139477", yards: 3928, tds: 26 }];
headshotDots(rows, { x: "yards", y: "tds", player: "qb", league: "nfl", size: 40 })[0]?.pattern;