Skip to main content
100%

Responsive Axes

✓ Published8🌍 Public
CCurran Kelleher
Last edited Jun 24, 2019
Created on Jun 24, 2019

This example demonstrates automatically resizing axes to fit the browser window, updating tick marks and labels as the viewport dimensions change. The visualization uses D3 v5 and SVG rendering, with linear scales mapping a 0–1 domain to the available inner width and height. A `d3.axisBottom` and `d3.axisLeft` generate the ticks, while a custom margin convention calculates the plotting area. The `render` function listens for window resize events, re-computing the scales and re-rendering the axes.

AI-generated description
MIT Licensed

Similar vizzes