Fork of Fork of Scatter Plot with Missing Data
✓ Published0🌍 Public
This example shows a scatter plot of penguin bill length versus flipper length, filtered to exclude any data points with missing values for either measurement. The visualization renders gray circles on a light background with labeled axes. The code filters the penguin dataset using `Array.filter` with `isNaN` checks before passing the cleaned data to the visualization function. It leverages D3's `scaleLinear` and `axisLeft`, along with custom axis label utilities, to construct the chart within an SVG container.
AI-generated descriptionA demonstration of how to filter the out missing data, leveraging Array.filter and isNaN.
const filteredData = data.filter(
(d) => !(isNaN(xValue(d)) || isNaN(yValue(d))),
);
MIT Licensed