Skip to main content
100%

Dynamic Size Example

✓ Published0🌍 Public
AAlainRo
Last edited Nov 1, 2017
Created on Oct 29, 2017

This example demonstrates a nested layout of colored rectangles that dynamically resizes with the browser window, each labeled with a name and marked with an X. It shows how a hierarchical box layout is computed and rendered using the `d3.boxes` API, which recursively splits available space based on a tree structure with size weights. The page also embeds a small Vega-Lite bar chart inside the “BC” box using `vegaEmbed`. The SVG is drawn with D3 v4, and a `redraw()` function recalculates positions and dimensions on every window resize.

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>

forked from <a href='http://bl.ocks.org/curran/'>curran</a>'s block: <a href='http://bl.ocks.org/curran/ad6d4eaa6cf39bf58769697307ec5f3a'>Demo of d3-boxes</a>

mit Licensed

Similar vizzes