Week 4 Iteration
This scatter plot visualizes the relationship between calories and average rating for 80 different cereals. Each point's color encodes sodium content using d3.interpolateLab, transitioning from green (low sodium) to red (high sodium), revealing that high-sodium cereals tend to cluster around average calorie values rather than showing a linear trend. Users can hover over individual points to see the cereal's name through a tooltip div. The visualization uses D3.js with a linear scale for both axes and data from a CSV file.
AI-generated descriptionA simple scatter plot with D3 showing the 80 Cereals dataset.
This iterates on the previous version of the visualization in two ways.
First, a color channel is introduced, interpolated between green and red. Greener data points have less sodium, while redder points had more. I was expecting to see a more linear correlation between calories and sodium, however oddly it seemed that the highest concentration of high-sodium cereals had an "average" calorie value.
Second, the user is now able to mouse over individual points on the graph to see the name of the cereal in question.