## A function to emulate P5.js map() function using D3
functionmap(value,start1,stop1,start2,stop2){
returnd3.scaleLinear()
.domain([start1,stop1])
.range([start2,stop2])(value)
}
functionbool(){
returnMath.random()>0.5;// random bool
}
import{Vector}from"@esperanc/2d-geometry-utils"
a=newVector(10,20)
b=newVector(1,20)
a.add(b)
PI=Math.PI
TAU=PI*2
functionrecursiveRandom(count){
letn=1;
while(count>0){
n*=Math.random();
count--;
}
returnn
}
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.