Published
Edited
Mar 22, 2018
Insert cell
Insert cell
pr = require('https://unpkg.com/propel').catch(() => window.propel)
Insert cell
pr.range(10).data()
Insert cell
{
const { grad, linspace, plot } = pr;
const f = x => x.tanh();
const x = linspace(-4, 4, 200);

// no currentOutputHandler :(
plot(x, f(x),
x, grad(f)(x),
x, grad(grad(f))(x),
x, grad(grad(grad(f)))(x),
x, grad(grad(grad(grad(f))))(x))
return md`🤔 how to make plot() work?`
}
Insert cell
image = pr.imread("https://avatars0.githubusercontent.com/u/7001?v=4&s=120")
Insert cell
reduced = image.reduceMean([2], true)
Insert cell
Insert cell
createCanvas(
new ImageData(Uint8ClampedArray.from(await reduced.data()), image.basic.shape[0]/2, image.basic.shape[1]/2)
)
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