Published
Edited
Apr 10, 2020
Insert cell
Insert cell
size = 16
Insert cell
blank = {
let c = document.createElement('canvas')
c.width = size
c.height = size
let cx = c.getContext('2d')
cx.fillRect(0,0,size,size)
return c
}
Insert cell
blank_size = blank.toDataURL().length
Insert cell
noise = {
let cc = document.createElement('canvas')
cc.width = size
cc.height = size
let ccx = cc.getContext('2d')
for (let r=0; r<size;r++) {
for (let c=0; c<size;c++) {
let rgb = [...Array(3)].map(n => Math.floor(Math.random() * 256)).join(',')
ccx.fillStyle = 'rgb(' + rgb + ')'
ccx.fillRect(c, r, 1, 1)
}
}
return cc
}
Insert cell
noise_size = noise.toDataURL().length
Insert cell
md`so 130 to 1366. ${(1366-130)/2} midpont: ${(1366-130)/2 + 130}`
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more