Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3 Scatter Plot Template

Public visualization

D3 Scatter Plot Template

0 stars2🌍 Public
CCurran Kelleher
Last edited Nov 4, 2021
Created on Oct 30, 2021

This D3 scatter plot template visualizes the relationship between horsepower and weight for a set of automobiles, with each point representing a vehicle. The code loads CSV data from a remote URL and renders circles using D3’s scales (`d3.scaleLinear`), axes (`d3.axisLeft`, `d3.axisBottom`), and selection methods. It imports modules such as `d3-selection`, `d3-scale`, `d3-array`, and `d3-axis`, and uses the `create` function to build an SVG with margins and responsive dimensions based on the window size.

AI-generated description

Scatter plot with D3.

Makes use of Rollup so that we can author the code using ES modules.

Inspired by the patterns found in Observable: D3 Charts

Comments

Sign in to join the discussion.

MIT Licensed