Skip to main content
Public

Share visualization

Loading preview…

Fork of Food Scatter Plot with React & D3

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Fork of Food Scatter Plot with React & D3

1
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

Comments

Sign in to join the discussion.

MIT Licensed