🌍 Public
Viewing a saved revision (read-only)
faaa9eafd1964e9aaa190780e33bd7b2
Responsive Viz Container
This example demonstrates a responsive visualization container that adapts to its parent element’s size using ResizeObserver. The code creates an SVG rectangle that fills the available width and height, with margins and an inner gray fill. It uses d3.select for DOM manipulation and the viz function to render the rectangle based on the observed dimensions. The container re-renders whenever its size changes, ensuring the visualization stays aligned with its layout.
AI-generated descriptionA responsive visualization container that uses ResizeObserver.
Challenge
- Make one of your visualizations responsive using this pattern