Public
Edited
Mar 26
1 fork
5 stars
Insert cell
Insert cell
Insert cell
wtf.fetch('Template:Cartier_Horse_of_the_Year').then(doc => doc.template('navbox'))
Insert cell
Insert cell
wtf.fetch('2018–19_Toronto_Raptors_season').then(doc=> doc.section('Roster').json())
Insert cell
Insert cell
wtf.fetch('Template:Toronto Raptors roster').then(doc=>doc.json())
Insert cell
Insert cell
wtf.fetch('Template:Toronto Raptors roster').then(doc => {
let data = doc.templates('player2')
return data.map(t => {
let obj = t.json()
return `* ${obj.first || ''} ${obj.last || ''}`
}).join('\n')
})
Insert cell
Insert cell
wtf.fetch('National_Basketball_Association').then(doc=>{
let table= doc.section('teams').tables()[0]
//grab just the text-information
let rows= table.keyValue()
//rows with team names
rows=rows.filter(r => r.Team)
//render it as we like
return rows.map(r=> r.Team +', '+r.Capacity).join('\n')
})
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
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