Published
Edited
Apr 8, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
colorScale = {
let colors = d3.schemeCategory10;
return d3.scaleOrdinal()
.range(colors)
.domain(inData)
;
}
Insert cell
Insert cell
PrimeTest = {
return function(num) {
var prime = num != 1;
for(var i=2; i<Math.sqrt(num); i++) {
if(num % i == 0) {
prime = false;
break;
}
}
return prime;
}
}
Insert cell
d3=require("d3@5")
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