Published
Edited
Mar 30, 2022
1 fork
45 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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more