Published
Edited
Jul 29, 2020
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
chart(theta)
Insert cell
Insert cell
function chart(theta) {
const context = DOM.context2d(width, height);
context.fillStyle = "black";
context.fillRect(0, 0, width, height);

const a = 15; // limit the Moiré due to canvas drawing(?)

hex.context(context);

context.lineWidth = radius / 3;

context.beginPath();
context.strokeStyle = "rgb(200, 150, 90)";
hex.angle(a).mesh();
context.stroke();

context.beginPath();
context.strokeStyle = "rgb(50, 100, 180)";
hex.angle(a + theta).mesh();
context.stroke();

return context.canvas;
}
Insert cell
hex = d3
.hexbin()
.radius(radius)
.size([width, height])
Insert cell
height = width
Insert cell
d3 = require("d3@6.0.0-rc.1", "https://files-j4recrlwm.vercel.app/d3-hexbin.js")
Insert cell
import { radians } from "@fil/math"
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