Skip to main content

shootingSignature

0.00.10.20.30.40.50.60.70.80.91.005101520253035distance →
import * as Plot from "@observablehq/plot";
import { shootingSignature } from "@sportsdataverse/sdvplot/plot";
import { fgPctByDistance, signaturePoints, vsLeague } from "@sportsdataverse/sdvplot/shots";

const shots = [
{ x_legacy: -1, y_legacy: 7, shot_distance: 1, shot_value: 2, shot_result: "Made" },
{ x_legacy: 0, y_legacy: 0, shot_distance: 0, shot_value: 2, shot_result: "Missed" },
{ x_legacy: -44, y_legacy: 252, shot_distance: 26, shot_value: 3, shot_result: "Made" },
];
// the makes against all three attempts, which stand in for the league (the gallery's uses the 2025-26 league)
const made = fgPctByDistance(shots.filter((s) => s.shot_result === "Made"));
const points = signaturePoints(vsLeague(made, fgPctByDistance(shots)), { minAttempts: 1 });
Plot.plot({ y: { domain: [0, 1] }, marks: shootingSignature(points) });

Tags: docstring · shootingSignature. All sdvplot examples.