Skip to main content

Function: cellsVsLeague()

cellsVsLeague(player, league, minLeague?): CellVsLeague[]

Defined in: packages/sdvplot/src/shots/aggregate.ts:200

Player cells with the league FG% of the SAME cell (the player is binned on the index's own lattice, so the centres are equal); a cell the league shot fewer than minLeague times from falls back to its zone's league rate (aggregate.ts:155-165; blazing-the-nets main).

Parameters​

player​

readonly ShotRow[]

league​

LeagueIndex

minLeague?​

number = LEAGUE_PRIOR_ATTEMPTS

Returns​

CellVsLeague[]

Example​

import { cellsVsLeague, leagueIndex } from "@sportsdataverse/sdvplot/shots";

// Brooklyn shots from the sportsdataverse-data nba_stats_shots release, 2025-26
const made = { x_legacy: 0, y_legacy: 0, shot_distance: 0, shot_value: 2, shot_result: "Made" };
const missed = { ...made, shot_result: "Missed" };
cellsVsLeague([made], leagueIndex([made, missed], 15));