Skip to main content
Public

Share visualization

Loading preview…

Working with food 2

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

Working with food 2

0
RRyan Offstein
Last edited Sep 23, 2025
Created on Sep 23, 2025

This visualization displays nutrient data for various foods on a logarithmic scatter plot from the US Department of Agriculture's FoodData Central database. It plots the carbohydrate content against protein content for items like hummus and grape tomatoes. The implementation uses React with D3.js v7, employing `scaleLog`, `axisBottom`, and `axisLeft` APIs to render the axes. The `viz` function filters data points to those with positive values for the logarithmic scale, then draws circles with `join('circle')` to represent each food item.

AI-generated description

React D3 Logarithmic Scatter Plot

This project demonstrates a React application using D3.js to create a logarithmic scatter plot.

Running the Project

  1. Clone the repository:

Comments

Sign in to join the discussion.

MIT Licensed