Skip to main content
100%

Trafalgar Ships

✓ Published0🌍 Public
Ttomahawk-jupiter
Last edited Jun 12, 2021
Created on Jun 12, 2021

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 description

A 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

Similar vizzes