Public
Edited
Jul 16, 2023
1 star
Insert cell
Insert cell
Insert cell
cityTest
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
evaluate_compressed_size("aa")
Insert cell
evaluate_compressed_size("aaaaaaa")
Insert cell
evaluate_compressed_size("aaaaaab")
Insert cell
cityTraining = tidy.tidy(
cityLabelText,
tidy.mutate({
lengthTraining: (d) => evaluate_compressed_size(d.text.trim().toLowerCase())
})
)
Insert cell
cityTest = tidy.tidy(
cityTraining,
tidy.mutate({
lengthTest: (d) => evaluate_compressed_size(test),
lengthTrainingTest: (d) =>
evaluate_compressed_size(`${d.text.trim()} ${test.toLowerCase()}`.trim()),
score: (d) =>
(d.lengthTrainingTest - Math.min(d.lengthTest, d.lengthTraining)) /
Math.max(d.lengthTest, d.lengthTraining),
scoreAlt: (d) => (d.lengthTrainingTest - d.lengthTraining) / d.lengthTest
})
)
Insert cell
Insert cell
import { evaluate_compressed_size } from "@fil/hello-fflate"
Insert cell
tidy = import("https://unpkg.com/@tidyjs/tidy@2.5.2/dist/es/index.js?module")
Insert cell
import { cityLabelText } from "@ijlyttle/wikipedia-most-populous-cities"
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