{"version":"1.0","type":"rich","title":"Margin Convention","description":"This example demonstrates the D3 margin convention, a common pattern for reserving space around a chart’s plotting area. It loads UN population data from a CSV file and renders horizontal bars for the top 10 countries, with bar widths proportional to their 2020 population. The React app uses `useState` and `useEffect` to fetch and parse the data with `d3.csv`, then constructs SVG rectangles using `scaleBand` for the y-axis and `scaleLinear` for the x-axis. A margin object defines offsets, and a `<g>` transform aligns the chart within the SVG.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/65d36a08fbac4082aae56534ccd2cf51?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}