Skip to main content
100%

Basketball Court

✓ Published1🌍 Public
MMichael Bergerson
Last edited Feb 13, 2021
Created on Feb 13, 2021

This example renders a regulation NBA basketball court as a static SVG diagram using React and D3 v6. It shows the court’s full layout, including the key, three-point arc, free-throw circle, and backboard, all scaled to real court dimensions. The code uses `scaleLinear` for coordinate mapping, `lineRadial` to generate arc paths, and `Math.atan` to compute the three-point line angle. The implementation derives geometry from an Observable notebook by Will Hou, drawing all markings with styled SVG primitives and path elements.

AI-generated description

React basketball court component made from https://observablehq.com/@willhoup/drawing-an-nba-court

MIT Licensed

Similar vizzes