act3_q1
✓ Published0🌍 Public
This example visualizes the relationship between horsepower and weight for five car models using a scatter plot. The data is hard-coded as an array of JavaScript objects, mapping each car's horsepower to the x-axis and weight to the y-axis. Built with D3 v7, it renders SVG circles whose positions are determined by linear scales (`d3.scaleLinear`), and their fill colors are mapped via a sequential plasma color scale based on horsepower. The chart includes labeled axes and uses D3’s axis functions for tick marks.
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