Published
Edited
Oct 25, 2021
61 forks
8 stars
Insert cell
Insert cell
viewof zoom = Inputs.range([10, 100], {value: 25, transform: Math.log, label: "Zoom"})
Insert cell
shader({width, height: 200, iTime: true, visibility, inputs: {size: viewof zoom}})`

mat2 rotate2d(float a) {
return mat2(cos(a), -sin(a), sin(a), cos(a));
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 p = (fragCoord.xy - iResolution.xy / 2.0) * rotate2d(iTime / 10.0);
float k = float(mod(p.x, size * 2.0) < size == mod(p.y, size * 2.0) < size);
fragColor = vec4(0.0, 0.105, 0.255, k + 0.75);
}

`
Insert cell
import {shader} from "@mbostock/shader"
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