Trafalgar Ships
✓ Published0🌍 Public
This visualization displays the complement (crew size) of ships that fought in the Battle of Trafalgar as horizontal bars on a categorical scale. React manages the data state, using `useEffect` to load a CSV file once via `d3.csv`, while D3’s `scaleBand` and `scaleLinear` position the rectangles. The SVG is rendered with React, and hover effects adjust opacity on each ship’s bar.
AI-generated descriptionA program that loads in some data about css named colors using d3 utilities and uses React state to keep track of that data.
Using useEffect from React stops the data from loading repeatedly with every state change. Without this it will re-load constantly.
Use React to render the data onto the page as a radial burst.
MIT Licensed