nba-stats

NBA stats legacy shot coordinates (LOC_X, LOC_Y). The middle of the free-throw line is (0, 190) in tenths of a foot; the arrows show which way x (blue) and y (orange) grow.

NBA basketball courtDrawn as: a basketball court, 94 by 50 feet, with its keys, three-point lines, free-throw circles and the centre circle. Data: 1 x grows. 1 y grows. 1 the middle of the free-throw line. 2 axes.1 x grows1 y grows1 the middle of the free-throw linethe middle of the free-throw line: 0, 1902 axesxy

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

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

const svg = drawKyogijo({
  sport: "nba",
  layers: [
    {
      kind: "arrows",
      name: "x grows",
      from: "nba-stats",
      data: [{ x: 0, y: 190, x2: 60, y2: 190 }],
      style: { width: 1.2, color: "var(--ky-layer-home)" },
    },
    {
      kind: "arrows",
      name: "y grows",
      from: "nba-stats",
      data: [{ x: 0, y: 190, x2: 0, y2: 302.8 }],
      style: { width: 1.2, color: "var(--ky-layer-away)" },
    },
    {
      kind: "points",
      name: "the middle of the free-throw line",
      from: "nba-stats",
      data: [{ x: 0, y: 190, title: "the middle of the free-throw line: 0, 190" }],
      style: { size: 4, shape: "star" },
    },
    {
      kind: "text",
      name: "axes",
      from: "nba-stats",
      data: [{ x: 78, y: 190, text: "x" }, { x: 0, y: 347.92, text: "y" }],
      style: { size: 4 },
    },
  ],
});

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.