Published
Edited
Oct 18, 2019
1 fork
Insert cell
md`# Iat 355`
Insert cell
d3 = require('d3@5')
Insert cell
VegaLite = require('vega-embed@5')
Insert cell
commoditiesRaw = d3.csv("https://raw.githubusercontent.com/EnderPicture/355-WorkingFiles/master/afdb-commodity-prices-2016-xlsx-1.csv", d => {
return{
name: d["Indicator Code"],
date: d["Date"].split("M")[0]+"."+d["Date"].split("M")[1]+".1",
unit: d["Unit"],
value: d["Value"],
}
})
Insert cell
md`Cleaning Data`
Insert cell
VegaLite({
width: 500,
height: 500,
data: {values: commoditiesRaw},
mark: "line",
encoding: {
x: {field: "date", type: "temporal", timeUnit:"yearquartermonth"},
y: {field: "value",type: "quantitative", scale: {type: "sqrt"}},
color: {field: "name", type: "nominal"}
}
})
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