Skip to main content
100%

Cars

✓ Published0🌍 Public
Kkmduncan2@dons.usfca.edu
Last edited Jan 30, 2025
Created on Jan 30, 2025

This example visualizes fuel economy data from a CSV file of cars, showing each vehicle’s miles-per-gallon rating as a horizontal bar sorted by row order. The bars, drawn in yellow on a gray background, increase in length proportionally to the fuel efficiency value. The code loads the dataset using p5.js’s `loadTable` with a header row, retrieves the numeric `economy (mpg)` column, and renders the rectangles in the `draw` loop. The visualization uses the p5 canvas API with `createCanvas`, `rect`, and `fill`.

AI-generated description
MIT Licensed

Similar vizzes