Public
Edited
Dec 19, 2022
Paused
1 fork
1 star
Insert cell
Insert cell
Type Markdown, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
canvas = {
let blue = await FileAttachment("Blue_Marble_2002.png").image();
const context = DOM.context2d(blue.width, blue.height);
context.drawImage(blue, 0, 0, blue.width, blue.height);
let canvas = context.canvas;
canvas.style = "max-width:100%;"
return canvas
}
Insert cell
function get_pixel(long, lat) {
canvas.width, canvas.height
canvas.getContext('2d').getImageData(2559, 1279, 1, 1).data
}
Insert cell
function get_pixel_deg(long, lat) {
canvas.width, canvas.height
canvas.getContext('2d').getImageData(2559, 1279, 1, 1).data
}
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