Fork of Fork of Fork of ICE-6: Rendering Marks and Channels with React & D3
✓ Published1🌍 Public
99176371431
Last edited Mar 9, 2023
Created on Mar 9, 2023
This example visualizes the top 20 songs from a Spotify dataset, encoding song tempo on the y-axis and duration on the x-axis with red bars. The React component loads CSV data via d3.csv, then uses d3.scaleBand and d3.scaleLinear to map values to SVG rectangles. Axis ticks are rendered manually with mapped text and line elements, while d3.max computes the domain for the linear scale. The chart uses React hooks (useState, useEffect) to manage async data fetching and conditional rendering for the loading state.
AI-generated descriptionReact Starter code.
MIT Licensed