Skip to main content
100%

Fork of Fork of Scatter Plot with Missing Data

✓ Published0🌍 Public
Ttejasreddy214@gmail.com
Last edited Apr 26, 2024
Created on Apr 26, 2024

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 description

A 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

Similar vizzes