Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Food Scatter Plot with React & D3

Public visualization

Viewing a saved revision (read-only)

be8102a6e065492d935375c40b35b175

Fork of Food Scatter Plot with React & D3

0 stars1🌍 Public
RRyan Offstein
Last edited Sep 23, 2025
Created on Sep 23, 2025

This example plots foods from a USDA Foundation Foods dataset on a log-log scatter plot, comparing carbohydrate and protein content in grams. The React app loads the data with d3.json, then formats nutrient amounts before passing them to a reusable D3 visualization function. The viz module applies d3.scaleLog for both axes, draws axes with d3.axisBottom and d3.axisLeft, and renders food items as steelblue circles. The chart filters out non-positive nutrient values to accommodate the logarithmic scale.

AI-generated description