🌍 Public
Viewing a saved revision (read-only)
f125bf93755d4cf5bd9b7ed8fe2b11cc
Fork of Responding to Resize
This example demonstrates how to create a D3.js visualization that responds to browser resizing. The code uses the `d3.select` API to append an SVG element to a fixed-position `#chart` div. On every resize event, the `redraw` function extracts the calculated `clientWidth` and `clientHeight` from the container, then adjusts the SVG's attributes and re-renders two intersecting lines into a green X mark. This approach uses CSS for layout sizing while relying on JavaScript event handling and the `merge` API for simple data updates.
AI-generated description