Skip to main content

Function: LogoPoint()

LogoPoint(props): ReactElement<unknown, string | JSXElementConstructor<any>> | null

Defined in: packages/sdvplot/src/react/victory.tsx:150

Team logos as a Victory scatter's points: <VictoryScatter dataComponent={<LogoPoint league team />}>. Each point draws the logo of its datum's team field, centred on the point and as tall as the point it replaces (twice the scatter's size, in px: set size on the VictoryScatter). A team with no logo draws nothing and warns once, as sdvplot/echarts does. Victory's event handlers (tooltips, voronoi) stay on the image. Synchronous: call it after loadLeague(league). Needs nothing from victory itself, so it also renders on the server.

Parameters​

props​

LogoPointProps

Returns​

ReactElement<unknown, string | JSXElementConstructor<any>> | null

Example​

import { loadLeague } from "@sportsdataverse/sdvplot";
import { LogoPoint } from "@sportsdataverse/sdvplot/react";
import { VictoryChart, VictoryScatter } from "victory";

await loadLeague("nfl");
const rows = [
{ team: "KC", pf: 385, pa: 326 },
{ team: "LAC", pf: 402, pa: 301 },
{ team: "DEN", pf: 425, pa: 311 },
];
<VictoryChart domainPadding={30}>
<VictoryScatter data={rows} x="pf" y="pa" size={14} dataComponent={<LogoPoint league="nfl" team="team" />} />
</VictoryChart>;