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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more