Activity6_question-3
✓ Published0🌍 Public
This example displays a scatter plot of car data, showing the relationship between BMI (on the x-axis) and age (on the y-axis), with points colored by smoking status via a Tableau10 ordinal color scale. The visualization loads a CSV file from a GitHub repository using D3’s `csv` function, then applies linear scales with `scaleLinear` and renders circles as SVG elements. Axes are generated with `axisLeft` and `axisBottom`, while a legend is manually constructed to map colors to the smoking categories. The chart fills the browser window using `window.innerWidth` and `window.innerHeight`.
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