Skip to main content
100%

ICE-6: Rendering Marks and Channels with React & D3

✓ Published0🌍 Public
Kkarumanchimanasa
Last edited Mar 3, 2023
Created on Mar 3, 2023

This example uses React and D3 v5 to render a horizontal bar chart of basic costs for 15 countries from a CSV dataset. It shows categorical marks as SVG rectangles positioned by a D3 `scaleBand` and `scaleLinear`, with axes drawn manually using gridlines and tick labels. The code imports D3 functions like `csv`, `scaleBand`, `scaleLinear`, and `max` within a React component, using hooks such as `useState` and `useEffect` to load data. All marks and channels are rendered declaratively as SVG elements.

AI-generated description

A bare minimum HTML page.

MIT Licensed

Similar vizzes