Published
Edited
May 3, 2022
3 forks
Importers
18 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// experiments are an array of objects with a name and a function to run.
experiments = [
{
name: "D3 Sum",
run: () => d3.sum(values)
},
{
name: "Loop Sum (with for of)",
run: () => {
let sum = 0;
for (const v of values) {
sum += v;
}
return sum;
}
},
{
name: "For Loop Sum",
run: () => {
let sum = 0;
for (let i = 0; i < values.length; i++) {
sum += values[i];
}
return sum;
}
},
{
name: "Reduce Sum",
run: () => values.reduce((a, b) => a + b, 0)
}
]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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