Public
Edited
Jul 7, 2023
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.lineY(aapl, {x: "Date", y: "Close"})
]
})
Insert cell
workbook = FileAttachment("UK Divorces.xlsx").xlsx()
Insert cell
sheet1 = workbook.sheet("By Decree")
Insert cell
Inputs.table(sheet1)
Insert cell
file = FileAttachment("UKDivorces@1.csv")
Insert cell
data= d3.csvParse(await file.text())
Insert cell
filteredData = data.filter(d => d.Year >= 1974)
Insert cell
finalData = filteredData.map(d => { d['Male'] = +d['Male'].replace(/,/g, ''); d['Female'] = +d['Female'].replace(/,/g, ''); d['Total'] = +d['Total'].replace(/,/g, ''); return d })
Insert cell
dataToUse = filteredData.map(d => { d['MalePoT'] = d['Male']/d['Total']; d['FemalePoT'] = d['Female']/d['Total']; return d })
Insert cell
Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.lineY(filteredData, {x: "Year", y: "Total"})
]
})
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