Skip to main content

logoPlugin

[
  "init",
  "destroy",
  "draw"
]
import { loadLeague } from "@sportsdataverse/sdvplot";
import { logoPlugin } from "@sportsdataverse/sdvplot/uplot";

await loadLeague("nfl");
// the 2024 Chiefs and Bills: points for (x) against points against (y)
const rows = [
{ team: "KC", pf: 385, pa: 326 },
{ team: "BUF", pf: 525, pa: 368 },
];
const plugin = logoPlugin(rows, { x: "pf", y: "pa", team: "team", league: "nfl", height: 0.15 });
// in the browser: new uPlot({ width: 640, height: 320, series, plugins: [plugin] }, data, element)
Object.keys(plugin.hooks);

Tags: docstring · logoPlugin. All sdvplot examples.