Public
Edited
Jan 1, 2024
Fork of Baton
1 fork
Insert cell
Insert cell
{
const width = 600,
height = 200,
r = 75;

function clear(app) {
app.append(cm.clear, { fill: cm.rgb(255) });
}

function draw(app) {
const theta = app.prop("frameCount") / 50;
const x = r * Math.cos(theta);
const y = r * Math.sin(theta);
const group = app.append(cm.group, {
x: width / 2,
y: height / 2
});
group.append(cm.link, { x: 0, y: 0, x1: x, y1: y });
group.append(cm.circle, { x, y, r: 10, fill: "#000" });
}

function dispose(app) {
invalidation.then(() => app.dispose());
}

return cm
.app({ width, height })
.on("update", clear)
.on("update", draw)
.call(dispose)
.call(frame)
.start()
.node();
}
Insert cell
function frame(app) {
app.node().style.border = "solid #000 1px";
}
Insert cell
cm = require("@charming-art/charming@0.0.6")
Insert cell
import { quote } from "@pearmini/charming-shared"
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