Published
Edited
Feb 5, 2018
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function set_difference(s1, s2) {
var result = d3.set();
s1.each(function (d) { // For each element in the first set...
if (!s2.has(d)) { // if the current element is not in the second set...
result.add(d); // then add the current element to the result set.
}
});
return result;
}
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