Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Responsive Scatter Plot

Public visualization

Viewing a saved revision (read-only)

e803c7bf29d844c8922fa3f035c78709

Responsive Scatter Plot

0 stars66🌍 Public
CCurran Kelleher
Last edited Oct 9, 2025
Created on Feb 12, 2024

This responsive scatter plot visualizes the relationship between bill length and flipper length in penguins, using data from the `@curran/penguins` package. The plot filters out rows with missing values before rendering circles with opacity and radius determined by the code. Built with D3's `scaleLinear` and `axes` from `@curran/responsive-axes`, it dynamically adjusts its width and height to fit its container using `observeResize`. The chart includes labeled axes, a gray inner rectangle, and updates interactively as the viewport changes.

AI-generated description

A demonstration of how to filter out missing data, leveraging Array.filter and isNaN.

const filteredData = data.filter(
  (d) => !(isNaN(xValue(d)) || isNaN(yValue(d))),
);