🌍 Public
Viewing a saved revision (read-only)
2e99a334aaf14642bac750deb5a45d2f
Fork of Marginsdrb
This example demonstrates how margins define the inner rectangle of a visualization, reserving space for axes while constraining the area for marks. It uses D3.js version 7.9.0, specifically the `select` API, to render an SVG that fills the container. The code calculates the inner width and height by subtracting fixed 50-pixel margins from the container dimensions, then draws a gray rectangle (`#B5B5B5`) positioned at those margin offsets. The rendered output is a static filled rectangle, serving as a template for layout structure.
AI-generated descriptionWe define the "inner rectangle" for our visualizations using margins! These are important for
- Defining where the marks go for our data visualizations
- Giving space for the axes