Public
Edited
Aug 22, 2023
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
shape = {
const shape = svg`<path d="${snake}">`;
document.body.append(shape); // for getTotalLength
const l = shape.getTotalLength();
const di = l / Math.floor(l) / 2;
const points = [];
for (let i = 0; i < l; i += di) {
const { x, y } = shape.getPointAtLength(i);
points.push([x, y]);
}
points.push(points[0]);
shape.remove();
return flubber.toCircle(d3.line()(points), 11, 11, 10);
}
Insert cell
color = d3.interpolateHcl("steelblue", "orange")
Insert cell
flubber = require("flubber@0.4")
Insert cell
import { Scrubber } from "@mbostock/scrubber"
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