NBA shot chart

NBA shot chartDrawn as: a basketball court, 94 by 50 feet, with its keys, three-point lines, free-throw circles and the centre circle. Data: Zone chart of 140 shots. Field goals made, % in 5 zones, from 25% to 50%. Highest: Left corner 3 (50%), Mid-range (33.3%), Above the break 3 (32.4%). 140 shots. By outcome: Made 47, Missed 93. Key. Made, Missed Key.Zone chart of 140 shotsField goals made, % in 5 zones, from 25% to 50%. Highest: Left corner 3 (50%), Mid-range (33.3%), Above the break 3 (32.4%).Above the break 3: 32.4% (34)Left corner 3: 50% (8)Right corner 3: 25% (4)Mid-range: 33.3% (87)In the paint (non-RA): 28.6% (7)Restricted area (0)50%4/833.3%29/8732.4%11/3428.6%2/725%1/4Legend: Field goals made, %Field goals made, %30%40%50%60%140 shotsBy outcome: Made 47, Missed 93.KeyMade, MissedKeyMadeMissed

The picture above was drawn when the docs were built. The script below draws it again with the published package.

import { nbaShotChart } from "@johnmorrisdotca/kyogijo-stadiums/charts";

const shots = Array.from({ length: 140 }, (_, i) => ({ x: ((i * 97) % 480) - 240, y: (i * 61) % 300, made: i % 3 === 0 }));
const svg = nbaShotChart(shots, { league: 46, minShots: 2 }).draw();

This page imports the package from jsDelivr (major version 0), which serves only versions that have been published to npm. A feature added after the last release is not in it: the page then keeps the picture above and says why. The docs were built from version 0.6.1.