Public
Edited
Dec 5, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
regression = counts
? ss.linearRegression(counts.map((o) => [-Math.log(o.s), Math.log(o.cnt)]))
: 0
Insert cell
counts = {
if (input_image) {
let image_width = (await input_image.image()).width;
let image_height = (await input_image.image()).height;
let image_url = await input_image.url();
let canvas = d3
.create("canvas")
.attr("width", image_width)
.attr("height", image_height)
.style("display", "none");
let ctx = canvas.node().getContext("2d");
let img = new Image();
img.src = image_url;
ctx.drawImage(img, 0, 0);
return box_count(canvas.node());
}
}
Insert cell
import { box_count } from "@mcmcclur/box-counting-dimension-examples"
Insert cell
MathJax = require("https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js").catch(
() => window["MathJax"]
)
Insert cell
ss = require("simple-statistics")
Insert cell
images = Promise.all([
FileAttachment("julia513.png"),
FileAttachment("spiral513.png"),
FileAttachment("tree1025@1.png")
])
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