Skip to main content

logoDots

[
  {
    "id": "sdv-logo-mff7au",
    "x": "pf",
    "y": "pa",
    "r": 22.627416997969522,
    "fill": "url(#sdv-logo-mff7au)",
    "fillOpacity": 1
  },
  {
    "id": "sdv-logo-mcsoyo",
    "x": "pf",
    "y": "pa",
    "r": 22.627416997969522,
    "fill": "url(#sdv-logo-mcsoyo)",
    "fillOpacity": 1
  }
]
import { loadLeague } from "@sportsdataverse/sdvplot";
import { logoDots } from "@sportsdataverse/sdvplot/tanstack";

await loadLeague("nfl");
const rows = [
{ team: "KC", pf: 385, pa: 326 },
{ team: "LAC", pf: 402, pa: 301 },
];
const logos = logoDots(rows, { x: "pf", y: "pa", team: "team", league: "nfl", size: 32 });
// defineChart({ marks: logos.map((d) => dot(d.data, d.options)), ... }) and
// mountChart(el, { definition, renderSvg: withPatterns(renderChartSvg, logos), ... })
logos.map((d) => d.options);

Tags: docstring · logoDots. All sdvplot examples.