Assignment 2: Bar Graph (Working Version)
This bar graph displays total marijuana new users aged 18–25 for each U.S. state plus Washington, D.C., using horizontal bars scaled by value. The visualization loads data from a CSV file via p5.js’s `loadTable` in `preload`, then draws the chart in `setup` and `draw` with canvas rectangles and lines. State names appear on the left, with corresponding numeric labels at each bar’s end. The code uses p5.js 1.4.0 for rendering, with axes, tick marks, and a title generated programmatically on a 1500×1500 canvas.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
Edited the CSV file to only contain two columns: States and Total Marijuana New Users Aged 18-25. I also reduced the States column in the orginial drugs.csv to only contain the first 50 instances of the state + DC.