Function: headshotMark()
headshotMark(
rows,o):G2ImageMark
Defined in: packages/sdvplot/src/g2.ts:259
ESPN player headshots as a G2 image mark, from the row's player field; an id with no headshot draws nothing and
warns once. idSystem: "gsis" needs loadGsis() first.
Parameters
rows
readonly Row[]
o
Returns
Example
import { headshotMark } from "@sportsdataverse/sdvplot/g2";
// Patrick Mahomes (ESPN id 3139477) at his 2024 passing yards and touchdowns, 40 px tall
const rows = [{ qb: "3139477", yards: 3928, tds: 26 }];
headshotMark(rows, { x: "yards", y: "tds", player: "qb", league: "nfl", size: 40 }).data;