Function: logoMarker()
logoMarker(
o):MuiMarkerSlot
Defined in: packages/sdvplot/src/mui.ts:390
Team logos as a scatter's points: <ScatterChart slots={{ marker: logoMarker({ league, teams }) }}>. Point i is
drawn as the logo of teams[i] (or teams[seriesId][i]), centred on the point and twice the series'
markerSize tall, in px: set markerSize on the series. MUI's tooltip, highlight (1.2 times as tall) and fade
(0.3 opacity) keep working. A team with no logo draws nothing and warns once, as sdvplot/echarts does.
Synchronous: call it after loadLeague(league). Build it once (module scope or useMemo): a new slot on every
render remounts the points.
Parameters
o
Returns
Example
import { ScatterChart } from "@mui/x-charts/ScatterChart";
import { loadLeague } from "@sportsdataverse/sdvplot";
import { logoMarker } from "@sportsdataverse/sdvplot/mui";
await loadLeague("nfl");
const rows = [
{ team: "KC", pf: 385, pa: 326 },
{ team: "LAC", pf: 402, pa: 301 },
{ team: "DEN", pf: 425, pa: 311 },
];
const marker = logoMarker({ league: "nfl", teams: rows.map((r) => r.team) });
<ScatterChart
width={400}
height={300}
series={[{ data: rows.map((r) => ({ x: r.pf, y: r.pa })), markerSize: 14 }]}
slots={{ marker }}
/>;