Skip to main content
100%

Fork of Fork of Responding to Resize

✓ Published0🌍 Public
Ccharliemok
Last edited Feb 1, 2021
Created on Feb 1, 2021
Forked from Untitled

This example demonstrates a simple responsive chart that dynamically adjusts an SVG to fill the browser viewport. It first extracts the client width and height from its container, then sets the SVG’s `width` and `height` attributes accordingly, and redraws two green diagonal lines to verify the resizing behavior. The visualization uses D3.js v5 to create and update the SVG elements, leveraging a listener for the window’s `resize` event to trigger the redraw. The code relies on the `d3.select` API to bind the chart container and `attr` to update the SVG dimensions.

AI-generated description
MIT Licensed

Similar vizzes