This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
A static website that tests Benford's Law against large, publicly available datasets. Hosted on Cloudflare Pages at testingbenfordslaw.com. No build step required for basic development — it's a simple static site with jQuery, JSON data files, and pre-compiled CSS/JS.
index.html— Single-page app, all UI lives herejs/app.js— Main application logic (compiled from CoffeeScript), handles chart rendering, dataset loading, URL routing via pushStatejs/coffee/app.coffee— CoffeeScript source; edit this, notjs/app.jsjs/datasets/index.json— Registry of all datasets (key = filename slug, value = display name)js/datasets/*.json— Individual dataset files withvalues(digit 1-9 percentages),num_records,min_value,max_value,sourcecss/sass/screen.scss— Sass source; edit this, notcss/screen.cssconfig.rb— Compass configuration_redirects— Cloudflare Pages rewrite config (all routes → index.html for client-side routing)
Compile CoffeeScript (watch mode):
coffee --watch -o js/ --compile js/coffee/*.coffee
Compile Sass (watch mode):
compass watch
Compile production CSS:
compass compile --output-style compressed --force
- Add a key/value entry to
js/datasets/index.json - Create a matching JSON file in
js/datasets/with this structure:
{
"values": { "1": 30.1, "2": 17.6, ... "9": 4.6 },
"num_records": "38,670,514",
"min_value": "1",
"max_value": "4,706,631",
"source": "https://..."
}Values are percentages of leading digit frequency (1-9). num_records, min_value, and max_value are formatted strings (with commas). source must be a URL.