Published
Edited
Jul 18, 2020
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function create() {
let result = '';
for (const letter of acronym) {
if (letter === " "){
continue;
}
result += ' ';
result += pick(data.get(letter.toLowerCase())).toLowerCase();
}
return result.trim();
}
Insert cell
function pick(list) {
return list[Math.floor(Math.random() * list.length)];
}
Insert cell
words = [].concat.apply([], [...data.values()])
Insert cell
data = FileAttachment('letters.json')
.json()
.then(
d =>
new Map(
Object.entries(d).map(([k, v]) => [k, v.filter(w => !w.includes(' '))])
)
)
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