Earthquake magnitude

import csv
def setup():
size(800, 1000)
with open("quakes.csv") as f:
reader = csv.reader(f)
header = # Skip the header row.
global magnitudes
magnitudes = []
for row in reader:
magnitude = float(row[4])
def draw():
y = 0
for magnitude in magnitudes:
aboveEdge = y
belowEdge = y+20
if aboveEdge < mouseY and mouseY < belowEdge:
if magnitude*scalar>70:
fill(242, 47, 21)
rect(50, y, magnitude*scalar*2,20)
fill(21, 131, 241)
rect(50, y, magnitude*scalar,20)
fill(219, 219, 221)
rect(50, y, magnitude*scalar,20)
y +=20

If the magnitute is greater than 7, it is destructive. Highlight it with red color and double the length of bars.

Like what you read? Give Hui Liu a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.