Published
Edited
Oct 7, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
#### Helper
Insert cell
img = await Jimp.read(image.src);
Insert cell
Insert cell
linspace = function(start, stop, nsteps){
let delta = (stop-start)/(nsteps-1)
return d3.range(start, stop+delta, delta).slice(0, nsteps);
}
Insert cell
H = linspace(0, parseFloat(height), img.bitmap.height)
Insert cell
W = linspace(0, parseFloat(width), img.bitmap.width)
Insert cell
closestIndex = function (x, arr) {
var indexArr = arr.map(k => Math.abs(k - x) );
var min = Math.min.apply(Math, indexArr);
return indexArr.indexOf(min);
}
Insert cell
Insert cell
math = require("https://cdnjs.cloudflare.com/ajax/libs/mathjs/5.4.2/math.min.js")
Insert cell
Plotly = require("https://cdn.plot.ly/plotly-latest.min.js")
Insert cell
Jimp = require('https://cdnout.com/jimp/jimp.js')
Insert cell
import {imageInput} from "@mbostock/file-input"
Insert cell
import {slider} from "@jashkenas/inputs"
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