Public
Edited
Apr 30, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {Copier} from "@mbostock/copier"
Insert cell
Insert cell
data = aapl.slice(0,14)
Insert cell
Insert cell
Insert cell
// input: number[]
function encodeNumberArrayString(input) {
const buffer = new ArrayBuffer(input.length * 4);
const view = new DataView(buffer);
input.forEach((i, idx) => {
view.setFloat32(idx * 4, i)
})
return btoaUrlSafe(
new Uint8Array(buffer)
.reduce((data, byte) => data + String.fromCharCode(byte), '')
)
}
Insert cell
// s: string
function btoaUrlSafe(s) {
return btoa(s).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '')
}
Insert cell
lz77 = require('lz77')
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