{"version":"1.0","type":"rich","title":"The margin convention","description":"This example demonstrates the D3 margin convention by rendering a horizontal bar chart of the top 10 most populous countries in 2020, using data from the UN Population 2019 dataset. The code uses React state and the `useEffect` hook to load and parse the CSV via `d3.csv`, then applies `scaleBand` and `scaleLinear` for layout. It shows how to apply margins by translating an SVG `<g>` group with `margin.top` and `margin.left`, drawing gridlines from `xScale.ticks()` and styled `<rect>` elements for each bar. Rendering relies on React’s virtual DOM and SVG output.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/0c19e540c416473cb7064d130d5d3401?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}