Skip to main content
100%

Scatter Plot with Missing Data

✓ Published0🌍 Public
Mmelissastrong89@gmail.com
Last edited Mar 15, 2025
Created on Mar 15, 2025

This scatter plot displays penguin bill length versus flipper length, filtering out any records with missing values in either dimension. The chart uses D3 to render axes, labels, and semi-transparent circles over a gray plotting area. The dataset comes from the `@curran/penguins` package, and the filtering logic leverages JavaScript’s `Array.filter` and the `isNaN` function to exclude incomplete rows, ensuring only fully observed data points are plotted.

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))),
);
MIT Licensed

Similar vizzes