{"version":"1.0","type":"rich","title":"D3 Margin Convention - forked from responsive starter","description":"This example demonstrates the D3 margin convention, a reusable pattern for structuring SVG charts with explicit padding around the plotting area. A component function applies the margin to an SVG, translating a container `g` element and returning the computed inner dimensions. It then renders a single rounded rectangle that fills this inner space, resizing dynamically on window resize events. The code uses D3 v5’s selection methods, including `merge` for efficient updates, and a custom `marginConvention` helper for managing layout.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/c397d27b48e24798a7e0e41726a0641c?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}