Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Shot Distance Bar Plot

Public visualization

Shot Distance Bar Plot

0 stars2🌍 Public
Yyc4004
Last edited Dec 14, 2021
Created on Dec 12, 2021

This interactive bar plot displays the distribution of NBA shot distances across four game periods, with stacked bars showing the total shot count for each distance. Users can switch between periods using buttons, which trigger a smooth 2-second animation that updates the bar heights, axes, and total counts. The visualization leverages D3 v7’s `scaleBand`, `scaleLinear`, and `scaleOrdinal` for layout and color, while transitions via D3’s `transition().duration()` animate changes. Data is fetched from a remote CSV using `d3.csv`, and the stacked bars are generated using `d3.stack()`.

AI-generated description

This bar plot shows the distribution of shooting distance in four periods of NBA games.

Comments

Sign in to join the discussion.

MIT Licensed