Comparing '70s Cars' Weight vs MPG. [An Interaction Design by Hails].
✓ Published0🌍 Public
HHails
Last edited Mar 27, 2022
Created on Mar 27, 2022
This visualization compares the weight and miles-per-gallon of 1970s automobiles, with each car represented as a circle colored by its model year. It is built using the vega-lite-api, which wraps vega-lite in JavaScript, and the resulting chart renders as SVG via vega’s renderer. The code loads data asynchronously with d3.csv, then encodes the x-position from the quantitative Weight field, the y-position from MPG, and uses a nominal color scale for Year. Tooltips display each car’s name via the vega-tooltip Handler, with custom font sizing in the config for readability.
AI-generated descriptionA visualization constructed using the vega-lite-api.
MIT Licensed