Published
Edited
Feb 10, 2021
5 forks
14 stars
Insert cell
Insert cell
Insert cell
team = new Set([
"Noah",
"Emma",
"Liam",
"Sophia",
"Jacob",
"Olivia",
"Mason",
"Isabella",
"William",
"Ava",
"Ethan",
"Mia",
"Michael",
"Abigail",
"Alexander",
"Emily",
"James",
"Madison",
"Elijah",
"Charlotte"
])
Insert cell
Insert cell
ooo = new Set(["Liam", "Ava", "Elijah"])
Insert cell
Insert cell
seed = d3.utcDay()
Insert cell
inOffice = difference(team, ooo)
Insert cell
shuffledTeam = d3.shuffler(d3.randomLcg(seed))(Array.from(inOffice))
Insert cell
difference = (set1, set2) => {
const diff = new Set();
for (let val of set1) {
if (!set2.has(val)) diff.add(val);
}
return diff;
}
Insert cell
d3 = require("d3-array@^2.7", "d3-random@^2.2.2", "d3-time@2")
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