🌍 Public
Viewing a saved revision (read-only)
4b01b5502c754b0084142a758bfdbdd4
Bar graph
This example shows a horizontal bar graph that compares the protein content of various food items, with each item’s name on the y-axis and protein grams on the x-axis. The visualization uses React to manage the component state and D3 v6 scales (`scaleBand`, `scaleLinear`) and axes (`axisBottom`, `axisLeft`) to render the SVG chart. Data is loaded asynchronously from a CSV file using D3’s `csv` method, and bars are drawn as SVG rectangles with a fixed color.
AI-generated descriptionA bare minimum HTML page.