All examples By author By category About

curran

Responding to Resize

Check out my video course: D3.js in Motion. Learn D3 fast!

This example shows how to make a D3 visualization that fills up the size of the page at the time it is loaded AND whenever the page is resized by the user. This is necessary when, for example, you want to be able to load your visualization "full screen" and give users the ability to size the window however they want to. This example was created to address this question on the D3 Google Group: Any advice for setting width in iframes with D3?.

To experience the resize behavior, run this example full-screen and resize the browser.