Variable: appendLogos
constappendLogos:AppendTeamMarks
Defined in: packages/sdvplot/src/d3/index.ts:112
Append <g class="sdv-logos"> of team logos at (x, y) through the caller's scale functions. Needs
loadLeague(league) first.
Example
import { loadLeague } from "@sportsdataverse/sdvplot";
import { appendLogos } from "@sportsdataverse/sdvplot/d3";
import * as d3 from "d3";
await loadLeague("nfl");
const x = d3.scaleLinear([250, 550], [0, 480]);
const y = d3.scaleLinear([280, 420], [240, 0]);
const svg = d3.select(document.createElement("div")).append("svg").attr("viewBox", [0, 0, 480, 240]);
appendLogos(svg, [385, 525, 425], [326, 368, 311], ["KC", "BUF", "DEN"], {
league: "nfl",
x: (v) => x(Number(v)),
y: (v) => y(Number(v)),
frameHeight: 240,
height: 0.2,
});
svg.node();