Activity 6_Q 3
✓ Published0🌍 Public
A scatter plot visualizes the relationship between flipper length and body mass for three penguin species (Adelie, Chinstrap, Gentoo), using colors to distinguish species and a custom legend. The code loads CSV data via `d3.csv`, parses numeric values, and draws circles with `d3.selectAll` and `append`. Axes are created with `d3.axisBottom` and `d3.axisLeft`, while scales use `d3.scaleLinear` and `d3.scaleOrdinal` for color mapping. The SVG canvas fills the viewport, with labels rotated and positioned through D3 attributes.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed