Skip to content

d3-hockeyProduction-ready hockey visualization

A comprehensive D3.js library for creating beautiful, interactive hockey data visualizations with minimal effort

Quick Start

Install via npm:

bash
npm install d3-hockey d3

Create your first visualization:

typescript
import { Rink } from "d3-hockey";

// Simplified shot data
const shots = [
  { coordinates: { x: 75, y: 10 }, player: "Ovechkin" },
  { coordinates: { x: 80, y: -5 }, player: "Backstrom" },
  { coordinates: { x: 70, y: 15 }, player: "Green" },
];

// Create a rink and add shot data
new Rink("#container").width(1000).height(425).render().addEvents(shots, {
  id: "shots",
  color: "#FF4C00",
  radius: 5,
});