Public
Edited
May 1, 2022
Insert cell
Insert cell
function attackStrength(a1) {
return Number.parseInt(a1.damage) / a1.cost.length;
}
Insert cell
Plot.plot({
color: {
legend: true
},
marks: [
Plot.dot(attacks, Plot.binX({y: "mean"}, {x: "date", y: "strength"})),
Plot.dot(attacks, Plot.binX({y: "median"}, {x: "date", y: "strength"}))
]
})
Insert cell
attacks = sets.flatMap(s => s.cards.map(c => ({...c, date: new Date(s.releaseDate)})))
.filter(c => c.supertype === "Pokémon")
.filter(c => c.attacks !== undefined)
.flatMap(c => c.attacks.map(a => ({...a, date: c.date, strength: attackStrength(a)})))
Insert cell
Insert cell
sets.find(s => s.cards.some(c => c.attacks === undefined)).cards.find(c => c.attacks === undefined)
Insert cell
sets = Promise.all((await zip.file("pokemon-tcg-data-2.8/sets/en.json").json()).map(async set => ({ ...set, cards: await zip.file(`pokemon-tcg-data-2.8/cards/en/${set.id}.json`).json()})))
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