Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Refactored Bar Chart

Public visualization

Viewing a saved revision (read-only)

fcaf7ec56bec4900a039509f5a72bf21

Refactored Bar Chart

0 stars1🌍 Public
JJohn Patrick Banas
Last edited Sep 11, 2021
Created on Sep 11, 2021

This bar chart displays the population of ten countries, with country names on the vertical axis and population values on the horizontal axis. The visualization builds on React and D3 v7, using `scaleBand` for the categorical y-axis and `scaleLinear` for the quantitative x-axis. The chart is modularized into separate components for the bottom axis, left axis, and bar marks, with a custom `useData` hook that loads CSV data via `d3.csv`. The SVG rendering is driven by a React state-managed data pipeline.

AI-generated description

A program that loads in some data about CSS colors using D3 utilities, and uses React state to keep track of the data. This particular fork has been modularized to create seperate modules for the X-Axis (AxisBottom.js) and the Y-Axis (AxisLeft.js), as well as the bars for the barchart (Marks.js). The data being rendered is also moved to its own file (useData.js) which is a customized useHook instantiation.