Skip to main content
๐ŸŒ Public

Share visualization

Send this visualization to others.

Food Project work

Public visualization

Viewing a saved revision (read-only)

09c833cef85d4c20bffdb1647225baa2

Food Project work

0 stars0๐ŸŒ Public
RRyan Offstein
Last edited Oct 19, 2025
Created on Sep 23, 2025

This example displays a scatterplot of food items from a USDA Foundation Foods dataset, comparing carbohydrate content on the x-axis against protein on the y-axis. The visualization uses logarithmic scales to accommodate the wide range of values across foods like hummus, black beans, and peanut butter. Built with React and D3 v7, the code handles data filtering and axis rendering through the `scaleLog`, `axisBottom`, and `axisLeft` APIs. Circles are positioned using the `selectAll` join pattern within the `viz.js` module, with labels and tick styling configured through attributes.

AI-generated description