Published
Edited
Apr 11, 2020
Fork of Hammer GLSL
Insert cell
Insert cell
Insert cell
projection = d3.geoBottomley().fitSize([width, height], { type: "Sphere" })
Insert cell
// Image Source: https://www.flickr.com/photos/vitroids/2811419692/
image = d3
.image("https://farm4.staticflickr.com/3138/2811419692_d101c2e926_b.jpg", {
crossOrigin: "anonymous"
})
.then(d => Object.assign(d, { style: "max-height:100px" }))
Insert cell
glproj = `
float sinPsi = ${projection.fraction()},
x1 = x * sinPsi,
y1 = halfPi - y,
rho = sqrt(x1 * x1 + y1 * y1),
eta = atan(x1, y1);
lambda = rho / sin(rho) * eta / sinPsi;
phi = halfPi - rho;
if (abs(lambda) > pi) transparent = true;
`
Insert cell
height = width * 0.52
Insert cell
import { reglCanvas, createDrawCommand, regl } with {
width,
height,
projection,
glproj,
image
} from "@fil/phytoplankton"
Insert cell
d3 = require("d3-fetch", "d3-geo", "d3-geo-projection@2", "d3-timer")
Insert cell
import { checkbox, radio } 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