Pathetic Bar Chart
✓ Published1🌍 Public
This example shows a horizontal bar chart of the top 10 countries by population, but only displays the bars without axes, labels, or a scale, creating a deliberately “pathetic” visualization. The chart uses React’s state and effect hooks to fetch and preprocess CSV data from a GitHub gist via `d3.csv`, filtering down to the first ten records. D3’s `scaleBand` and `scaleLinear` map country names and population values to screen coordinates, and each bar is rendered as an SVG `<rect>` with width proportional to its population. The `width` and `height` properties are fixed at 960 and 500 pixels, with no margin handling.
AI-generated descriptionBasic D3 bar chart (with React). It includes basic rendering, filtering data before visualization, and the margin convention.
MIT Licensed