🌍 Public
Viewing a saved revision (read-only)
c0a6bbf4687c4176bf7e8a26fe53993f
the margin convention
This example shows a horizontal bar chart of the top 10 countries by projected 2020 population, loaded as CSV via D3’s `csv` utility. It demonstrates the margin convention by rendering an SVG with a left offset of 200 pixels, using `scaleBand` for the y-axis and `scaleLinear` for the x-axis, with gridlines from `xScale.ticks()`. React manages the state and renders each `<rect>`, `<line>`, and `<text>` element, while D3 provides the data parsing and scales.
AI-generated descriptionA program that loads in some data about CSS named colors using D3 utilities, and uses React to render the data as a radial burst!