Published
Edited
Mar 30, 2022
1 fork
46 stars
Insert cell
Insert cell
untyped = d3.csv(url)
Insert cell
untyped[0]
Insert cell
Insert cell
"95.35" + "98.84" // concatenation
Insert cell
95.35 + 98.84 // addition
Insert cell
Insert cell
typed = d3.csv(url, ({date, close}) => ({date: new Date(date), close: +close}))
Insert cell
typed[0]
Insert cell
Insert cell
auto = d3.csv(url, d3.autoType)
Insert cell
auto[0]
Insert cell
Insert cell
d3.autoType({date: "2007-04-23", close: "93.24"})
Insert cell
Insert cell
new Date("2007")
Insert cell
Insert cell
+"2007"
Insert cell
Insert cell
d3.autoType({date: "2007"})
Insert cell
Insert cell
d3.autoType({date: "2007-01-01"}).date.toISOString()
Insert cell
d3.autoType({date: "2007-01-01T00:00"}).date.toISOString()
Insert cell
new Date("2007-01-01T00:00:00Z")
Insert cell
new Date("2007-01-01T00:00:00")
Insert cell
Insert cell
d3.autoType({id: "06075"})
Insert cell
Insert cell
d3.autoType([
"$1.00", // currency symbol
"(123)", // parenthesis
"1,234", // comma
"12px" // suffix
])
Insert cell
Insert cell
d3.autoType([
"January 1, 2018", // not YYYY-MM-DD
"TRUE" // not lowercase
])
Insert cell
Insert cell
Insert cell
url = FileAttachment("aapl.csv").url()
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