A legend of its own

NHL hockey rinkDrawn as: an ice hockey rink, 200 by 85 feet with rounded corners, with its red and blue lines, face-off circles, creases and goal nets. Data: Heat map of 360 shots. Count in 169 cells, from 1 to 4. Highest: 167.5, 7.5 (4), 167.5, 17.5 (4), 182.5, 17.5 (4). Shots. 1 to 4Heat map of 360 shotsCount in 169 cells, from 1 to 4. Highest: 167.5, 7.5 (4), 167.5, 17.5 (4), 182.5, 17.5 (4).Shots1 to 4Count1234

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 shots = Array.from({ length: 360 }, (_, i) => { const t = i * 2.399963; const r = 4 + 54 * Math.sqrt((i % 120) / 120); return { x: 189 - r * Math.abs(Math.cos(t)) * 1.1, y: 42.5 + r * Math.sin(t) * 0.7 }; });
const svg = drawKyogijo({
  sport: "nhl",
  layers: [
    { kind: "heatmap", id: "heat", name: "shots", data: shots, bins: [40, 17] },
    { kind: "legend", for: "heat", title: "Shots", position: "bottom" },
  ],
});

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.