Reusable Scatterplot
✓ Published0🌍 Public
A reusable scatterplot function visualizes calorie intake against body weight for five individuals, encoding each person as a violet circle with a text label. The chart constructs an SVG renderer using D3 v6, employing `d3.scaleLinear` for both axes and `d3.axisBottom` and `d3.axisLeft` for gridlines. The data is hardcoded as an array of objects with person, weight, and calories fields, and the function accepts both the dataset and a container selector, demonstrating a modular approach to D3 chart creation.
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