Public
Edited
Apr 24, 2023
Insert cell
md`# Assignment 1 - California Native Pop.`
Insert cell
Insert cell
Insert cell
states = FileAttachment("GEOG3540_Assignment_1_California.json").json()
Insert cell
states_features = topojson.feature(states, states.objects.GEOG3540_Assignment_1_California)
Insert cell
csv_data = d3.csvParse(await FileAttachment("GEOG3540_Assignment_1_California_Census.csv").text(),({COUNTYFP10, Native, Total}) => [COUNTYFP10, [+Native/+Total]])
Insert cell
//this is how to take the values of a variable (column) from all variables you created from the csv file
nativepct = Array.from(csv_data.values(), d => d[1][0])
Insert cell
//this is how you map the id column to the values. We will use this for joining with topojson later.
data = Object.assign(new Map(csv_data), {title: ["Native Population in California"]})
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more