Skip to main content
100%

Margins

✓ Published2🌍 Public
SSubhendu Karmakar
Last edited Jan 31, 2024
Created on Jan 31, 2024
Forked from Circles with D3

This example demonstrates how margins frame a visualization’s drawing area. A single gray rectangle sits inside an SVG canvas, inset by a uniform 22-pixel margin on all sides. The code uses D3’s `select` to create the SVG and computes the inner dimensions by subtracting the margin from the container’s size. The rectangle is rendered with `attr` for positioning and fill, showing the reserved space around the plot region.

AI-generated description

D3 Margins

MIT Licensed

Similar vizzes