const{i,j}=cartesianToHex(mouseX,mouseY,scale,centerX,centerY);// Get nearest hex grid coordinates
const[x,y]=hexToCartesian(i,j,scale,centerX,centerY);// Convert back to Cartesian for actual point position
return{x,y,i,j};// Return both Cartesian and grid coordinates
}
polygonTemplates=({
"turtle":[
[3,0],
[2,1],
[1,2],
[-1,1],
[-1,2],
[-2,2],
[-3,0],
[-2,-1],
[-3,-2],
[-3,-3],
[-1,-2],
[0,-3],
[1,-2],
[2,-2]
],
"hat":[
[1,0],
[2,0],
[3,1],
[2,2],
[0,1],
[0,2],
[-1,2],
[-2,2],
[-3,1],
[-2,0],
[-3,-2],
[-2,-2],
[-2,-3],
[0,-2]
]
})
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.