sdvplot-js docs ยท View source

Playing surfaces

Every court, field, rink, pitch and sheet sporty draws, as Observable Plot marks; a league's surface in a team's colours; and real events moved onto each surface with toSurfaceFrame.

Every sport

Pick a sport, then one of its rule sets (each league's dimensions are its own: an NBA three-point line is not a FIBA one). Show picks how much of the surface to draw (a half court, one zone, the whole thing), and Rotation turns it. A rotated surface is drawn upright, so a vertical court is narrower than a horizontal one.

has rule set, display ranges and features (from to ).

In a team's colours

surface(league, { team }) from @sportsdataverse/sdvplot/plot paints a team's primary and secondary colours on the surface its league plays on ( leagues have one). Centre logo puts the team's logo at centre court.

Real events on each surface

Every data source has its own coordinates. toSurfaceFrame(rows, { from }) moves rows from a named frame into the surface's own (feet from the centre, for most surfaces), adding surface_x and surface_y. Pick a game; Marks draws each event as a dot in its team's colour, or a logo for each made shot, goal or touchdown.

events, of them scoring; filled dots scored, white dots did not. Hover an event for what it was.