Public
Edited
Feb 4
Insert cell
Insert cell
Insert cell
Insert cell
x = 1 + 2
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
loups-guerriers.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
data
X
created_at
Y
tweet_frequency
Color
type
Size
tweet_count
Facet X
Facet Y
Mark
Auto
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
Plot.plot({
color: { legend: true },
marks: [
Plot.dot(data, {
x: "created_at",
y: "tweet_frequency",
stroke: "type",
r: "tweet_count",
tip: true
})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
age = 26
Insert cell
Insert cell
Insert cell
10 + 1
Insert cell
"10" + "1"
Insert cell
42 === 21 + 21
Insert cell
data
Insert cell
Insert cell
dateOfBirth = new Date("1997-10-24")
Insert cell
Insert cell
Insert cell
Insert cell
awesomeArray = [42, 101, 97, 1515]
Insert cell
awesomeArray[0]
Insert cell
awesomeArray[awesomeArray.length - 1]
Insert cell
Insert cell
doubleAwesomeArray = awesomeArray.map((d) => d * 2)
Insert cell
Insert cell
Insert cell
Insert cell
awesomeArray.filter((d) => d > 100)
Insert cell
Insert cell
awesomeArray.sort((a, b) => b - a)
Insert cell
awesomeArray.sort(d3.descending)
Insert cell
awesomeArray.every((d) => d < 10000)
Insert cell
Insert cell
Insert cell
Insert cell
teacher = ({
name: "Tom",
age: 26,
jsWizard: true,
occupations: ["Datajournaliste aux Échos", "Professeur à Sciences Po"]
})
Insert cell
Insert cell
Insert cell
teacher.occupations[0]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
h2g2Characters.filter((d) => d.gender === "M").length
Insert cell
mostIntelligentCharacters = h2g2Characters
.sort((a, b) => d3.descending(a.iq, b.iq))
.map((d) => d.name)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
loups-guerriers.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
d3.greatest(data, (d) => d.tweet_count)
Insert cell
d3.quantile(data, 0.9, (d) => d.followers_count)
Insert cell
Insert cell
Insert cell
d3.sort(data, (d) => d.created_at)
Insert cell
d3.sort(data, (a, b) => d3.descending(a.created_at, b.created_at))
Insert cell
Insert cell
Insert cell
Insert cell
d3.groups(data, (d) => d.type)
Insert cell
data1 = d3.rollups(data, (v) => v.length, (d) => d.type)
Insert cell
data1
X
0
Y
1
Color
Size
Facet X
Facet Y
Mark
bar
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
d3.rollups(data, (v) => d3.mean(v, (d) => d.followers_count), (d) => d.type)
Insert cell
d3.rollups(data, (v) => d3.mean(v, (d) => d.tweet_frequency), (d) => d.type)
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