mlbam

MLBAM and Statcast hit coordinates (hc_x, hc_y). First base is (150.88, 172.81) in pixels; the arrows show which way x (blue) and y (orange) grow.

Baseball fieldDrawn as: a baseball field, with a 90-foot infield, the mound, the foul lines and the outfield fence. Data: 1 x grows. 1 y grows. 1 first base. 2 axes.1 x grows1 y grows1 first basefirst base: 150.88, 172.812 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: "mlb",
  layers: [
    {
      kind: "arrows",
      name: "x grows",
      from: "mlbam",
      data: [{ x: 150.88, y: 172.81, x2: 180.88, y2: 172.81 }],
      style: { width: 1.2, color: "var(--ky-layer-home)" },
    },
    {
      kind: "arrows",
      name: "y grows",
      from: "mlbam",
      data: [{ x: 150.88, y: 172.81, x2: 150.88, y2: 202.81 }],
      style: { width: 1.2, color: "var(--ky-layer-away)" },
    },
    {
      kind: "points",
      name: "first base",
      from: "mlbam",
      data: [{ x: 150.88, y: 172.81, title: "first base: 150.88, 172.81" }],
      style: { size: 4, shape: "star" },
    },
    {
      kind: "text",
      name: "axes",
      from: "mlbam",
      data: [{ x: 189.88, y: 172.81, text: "x" }, { x: 150.88, y: 214.81, 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.