Public
Edited
May 9, 2023
Insert cell
Insert cell
data = d3.csv("https://raw.githubusercontent.com/Josh-Everts/MIMS-Capstone/main/visualizations/emissions_year_explore/per_cap_emission_t2.csv")
//data = FileAttachment("per_cap_emission_t2.csv").csv({typed: true})
Insert cell
us_data = data.slice(0,31)
Insert cell
function checkYear(year) {
if (selectedYear !== null) {
return year === Number(selectedYear);
}
}
Insert cell
Insert cell
us_years = [1991, 1998, 2007, 2009]
Insert cell
us_values = [19, 20.3, 19, 16.8]
Insert cell
ca_years = [1990, 2002, 2009, 2012, 2018, 2020]
Insert cell
ca_values = [16.4, 13.6, 12.1, 11.4, 10.4, 9.3]
Insert cell
year_data.findIndex(checkYear)
Insert cell
Insert cell
Insert cell
Insert cell
width
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
policy_data = d3.json("https://raw.githubusercontent.com/Josh-Everts/MIMS-Capstone/main/visualizations/emissions_year_explore/policyOverview_reformat.json")
//policy_data = FileAttachment("PolicyOverview_reformat").json()
Insert cell
Insert cell
Insert cell
bar_data = Array(30).fill(20)
Insert cell
year_data = Array.from(Array(2021).keys()).slice(1990)
Insert cell
//data2 = d3.csv("https://raw.githubusercontent.com/Josh-Everts/MIMS-Capstone/main/visualizations/emissions_year_explore/year_bars.csv")
data2 = FileAttachment("test_year_bar@1.csv").csv({typed: true})
Insert cell
data3 = data2.slice(0, 31)
Insert cell
d3 = require("d3@5.8")
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