Skip to main content
100%

Dynamic Size Example

✓ Published0🌍 Public
CCurran Kelleher
Last edited Oct 12, 2017
Created on Oct 12, 2017

This example demonstrates a responsive nested box layout that reflows dynamically as the browser window resizes. It uses the `d3-boxes` library to compute rectangular regions from a hierarchical layout specification, with configurable size weights for individual nodes and layers. The visualization renders SVG rectangles, diagonal cross-lines, and text labels for each box, with colors assigned via `d3.scaleOrdinal` and `d3.schemeCategory10`. The chart container fills the viewport using CSS positioning, and a resize event listener triggers a full redraw that recomputes all box dimensions from the updated `clientWidth` and `clientHeight`.

AI-generated description

An example of d3-boxes in action. Responds to resize.

forked from <a href='http://bl.ocks.org/curran/'>curran</a>'s block: <a href='http://bl.ocks.org/curran/3a68b0c81991e2e94b19'>Responding to Resize</a>

mit Licensed

Similar vizzes