Public
Edited
May 27, 2023
Insert cell
Insert cell
Insert cell
leagueChart(aggregateData(matchesItaly),interestingTeams).node()
Insert cell
aggregateData(matchesItaly)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
leagueChart(aggregateData(matchesPremierLeague), interestingTeamsPremier).node()
Insert cell
aggregateData(matchesPremierLeague)
Insert cell
Insert cell
Insert cell
leagueChart(
aggregateData(matchesLaLiga),
interestingTeamsLaLiga,
// (a,b) => (a.team === 'Barcelona' ? 1 : -1),
// [
// {
// text: 'Xavi diventa allenatore →',
// x: 12,
// y: 69,
// align: 'left',
// top: 'bottom',
// }
// ]
)
// .size(440,550)
.node()
Insert cell
aggregateData(matchesLaLiga)
Insert cell
Insert cell
Insert cell
{
const bundesligaChart = leagueChart(
bundesligaData,
interestingTeamsBundesliga,
)
bundesligaChart.add(
chrt.line()
.data(borussiaBayern, d => {
})
.stroke('#ddd')
.fill('#ffff00')
.area()
)
return bundesligaChart.node()
}
Insert cell
bundesligaData = aggregateData(matchesBundesliga);
Insert cell
borussiaBayern = bundesligaData['Dortmund'].rollingPoints.reduce((acc,d,i) => {
const b = bundesligaData['Bayern Munich'].rollingPoints[i];
acc.push({
// y0: Math.min(d,b),
y: Math.max(d,b),
x: i,
})
return acc;
},[])
Insert cell
interestingTeamsBundesliga = ({
'Bayern Munich': {
stroke: '#cc0033',
strokeWidth: 3,
label: 'Bayern Munich',
align: 'start',
offset: [0,0],
// symbol: '✱'
},
// D10402
// Union Berlin
// 'Union Berlin': {
// stroke: '#d20303',
// strokeWidth: 3,
// label: 'Union Berlin',
// align: 'start',
// offset: [0,13],
// // symbol: '✱'
// },
'Dortmund': {
stroke: '#000',
strokeWidth: 3,
label: 'Dortmund',
align: 'start',
offset: [0,0],
// symbol: '✱'
},
// 'Freiburg': {
// stroke: '#000',
// strokeWidth: 3,
// label: 'Freiburg',
// align: 'start',
// offset: [0,0],
// // symbol: '✱'
// },
// 'RB Leipzig': {
// stroke: '#bc0505',
// strokeWidth: 3,
// label: 'RB Leipzig',
// align: 'start',
// offset: [0,0],
// // symbol: '✱'
// },
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
<style>
svg {
font-size:11px;
font-family: sans-serif;
overflow: visible;
// border: 1px solid #eee;
}
.footnote {
font-size:11px;
font-family: sans-serif;
color:#666;
}
.annotation-xavi {
font-size:12px;
font-family: sans-serif;
font-weight: bold;
}
</style>
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