Published unlisted
Edited
Jan 20, 2021
1 fork
Insert cell
Insert cell
csvData= `Date,key1,key2,key3\n2020-08-17T00:00-0500,11.34833333333333,-1.1275,-0.73833333333333\n2019-08-17T00:00-0500,1.34333,-2.1275,-2.73333`
Insert cell
passed = d3.csvParse(csvData, function(d,y) {
console.log(y)
let keyNames = ['key1','key2','key3']
let keyData = [d.key1,d.key2,d.key3]
let groupYear = ['y1','y2']
let ddd = []
for(let i=0;i<3;i++){
ddd.push({
name: keyNames[i],
value: keyData[i], // d.key1,
date: new Date(d.Date),
groupName: groupYear[y]
})
}
return ddd
});

Insert cell
d3=require('d3')
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