Skip to main content
100%

Responsive Axes

✓ Published1🌍 Public
DDonald Bagwell
Last edited Apr 14, 2024
Created on Apr 14, 2024
Forked from Axis Labels

This example demonstrates a responsive scatterplot layout with axes that adapt to the container’s dimensions. It shows labeled x and y axes with tick marks dynamically recalculated based on the available plotting area, alongside a shaded inner region. The code uses D3.js v7 and a ResizeObserver to track container size changes, triggering updates to the SVG’s width and height. It relies on d3.scaleLinear for positioning, d3.axisBottom and d3.axisLeft for rendering ticks, and modular functions for reusable axis and label components.

AI-generated description

Creating circles with D3.

Challenge

  • Fork this example
  • Modify it
  • Maybe make it Halloween themed
  • Maybe make it Christmas themed
  • Be creative
MIT Licensed

Similar vizzes