🌍 Public
Viewing a saved revision (read-only)
7f4be48a15be4f9794583ed8d5a650a2
Week 5 Interactivity
This bar chart shows the top 10 cereals with the highest sodium content from the 80 Cereals dataset, sorted in descending order and using a fixed y-axis range of 0 to 320. The visualization encodes each cereal name on the x-axis and sodium per serving in milligrams on the y-axis, with light gray highlighting on hover. The code uses D3’s `scaleBand`, `scaleLinear`, `axisLeft`, and the `viz` function from `@curran/axis-labels` to render axes and labels. The chart is implemented with D3’s `selectAll` and `.join()` for SVG element creation, and mouseover events change bar fill colors.
AI-generated descriptionA bar chart showing the top 10 most caloric cereals in the 80 Cereals dataset.