Layer-Based Architecture
Build complex visualizations by stacking layers - rink rendering, shot charts, heatmaps, and custom overlays.
A comprehensive D3.js library for creating beautiful, interactive hockey data visualizations with minimal effort
Install via npm:
npm install d3-hockey d3Create your first visualization:
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,
});