Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Another fork of responsive axes

Public visualization

Viewing a saved revision (read-only)

ae2a04e9ba6d4cb387369157c9250e6a

Another fork of responsive axes

0 stars0🌍 Public
Ccoreyfnolan@gmail.com
Last edited Mar 28, 2024
Created on Mar 28, 2024
Forked from Responsive Axes

This example demonstrates a data visualization with responsive axes that maintain consistent tick mark density as the viewport resizes. The chart displays a simple, abstract dataset within a gray inner rectangle, featuring labeled X and Y axes. The core behavior is achieved by using a ResizeObserver to track container dimensions, which then dynamically recalculates the number of axis ticks based on the available inner width and height. The implementation relies on D3.js functions like `scaleLinear`, `axisBottom`, `axisLeft`, and custom modules for axis and label rendering, ensuring the tick spacing remains visually uniform across different screen sizes.

AI-generated description

A viz container with responsive axes that have consistent tick mark density. Try opening in full screen mode and resizing!

Challenge

  • Use this technique to make the axes on your viz responsive