{"id":50364102,"url":"https://github.com/andyed/reading-doppler","last_synced_at":"2026-05-30T03:02:40.962Z","repository":{"id":346365544,"uuid":"1189599994","full_name":"andyed/reading-doppler","owner":"andyed","description":"Paragraph-level reading time tracker. Measures absorption, not just visibility.","archived":false,"fork":false,"pushed_at":"2026-04-20T04:10:10.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T05:36:18.491Z","etag":null,"topics":["analytics","clicksense","content-metrics","scroll-tracking","web-analytics"],"latest_commit_sha":null,"homepage":"https://andyed.github.io/reading-doppler/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andyed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-23T13:38:26.000Z","updated_at":"2026-04-20T04:10:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/andyed/reading-doppler","commit_stats":null,"previous_names":["andyed/reading-depth","andyed/reading-doppler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andyed/reading-doppler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyed%2Freading-doppler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyed%2Freading-doppler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyed%2Freading-doppler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyed%2Freading-doppler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andyed","download_url":"https://codeload.github.com/andyed/reading-doppler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyed%2Freading-doppler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33678271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","clicksense","content-metrics","scroll-tracking","web-analytics"],"created_at":"2026-05-30T03:02:39.945Z","updated_at":"2026-05-30T03:02:40.953Z","avatar_url":"https://github.com/andyed.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ReadingDoppler\n\n![reading doppler — paragraph dwell, decomposed by viewport band](assets/brand/social-header.png)\n\nParagraph-level reading tracker with viewport-band decomposition. Measures how long each paragraph sits in the top, middle, or bottom third of the viewport — a Doppler-like signature of attention as the reader scrolls.\n\nShips as a standalone JS library plus a PostHog adapter. No bundler required.\n\n## Install\n\n```bash\nnpm install reading-doppler\n```\n\nOr drop the IIFE build into any page:\n\n```html\n\u003cscript src=\"dist/reading-doppler.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  const rd = new window.ReadingDopplerLib.ReadingDoppler({\n    onFlush(paragraphs, meta) {\n      console.log(meta.flush_number, paragraphs);\n    }\n  });\n  rd.observe(document.querySelector('.prose'));\n  window.addEventListener('beforeunload', () =\u003e rd.destroy());\n\u003c/script\u003e\n```\n\nESM:\n\n```js\nimport { ReadingDoppler, createPostHogAdapter } from 'reading-doppler';\n\nconst rd = new ReadingDoppler({\n  onFlush: createPostHogAdapter(window.posthog).onFlush,\n});\nrd.observe(document.querySelector('article'));\n```\n\n## What it emits\n\nEach paragraph flushes with:\n\n| Field | Meaning |\n|---|---|\n| `id` | Stable paragraph ID (`data-rd-id`, or position + first 4 words) |\n| `words`, `expected_ms` | Word count + expected dwell at 238 WPM (Brysbaert 2019) |\n| `visible_ms`, `absorption` | `visible_ms / expected_ms` (v0.1 contract, unchanged) |\n| `rd_top_ms` | Cumulative ms with paragraph center in top third of viewport |\n| `rd_mid_ms` | …middle third |\n| `rd_bot_ms` | …bottom third |\n| `rd_any_ms` | Any viewport intersection (tall-paragraph safe) |\n| `paragraph_index`, `paragraph_position_frac` | DOM-order index and fraction of total |\n\nSummary (emitted on `destroy`) additionally carries:\n\n- `rd_viewport_band_basis_px` — live `window.innerHeight` at summary capture\n- `rd_viewport_h` — `innerHeight` recorded at construction time\n- `rd_viewport_band_schema` — `reading-doppler-vpbands-v1`\n\nIf the two basis values differ, the viewport resized mid-session; downstream analyses wanting basis-stable bands should filter on sessions where they match.\n\n## The Doppler motif\n\nAs a reader scrolls, each paragraph shifts through the viewport's top/mid/bot thirds. Cumulative ms per band is the signature of how the eye dwelled relative to the motion — high `rd_top_ms` is \"reading\"; high `rd_bot_ms` is \"scrolling past.\"\n\nThe band math is a verbatim port of [approach-retreat](https://github.com/andyed/approach-retreat)'s `computeViewportBandsPure`, which in turn mirrors the Python reference `viewport_ms_for_trial` used in the AdSERP eye-tracking calibration. JS↔Python parity is enforced by `scripts/test_viewport_bands_parity.{js,py}` — all 24 fields (6 synthetic paragraphs × 4 bands) match Δ=0.\n\n## Raw ms only — no scoring baked in\n\nThe library does not score, weight, or normalize bands against `expected_ms`. That posture is deliberate:\n\n- The discriminative coefficient across bands is **rank-dependent** in the AdSERP corpus (`vt_top = +2.02` at P0, dropping to +0.21 by P5, CI crossing 0). Whether the same gradient holds in reading content is an empirical question, not an assumption.\n- Different corpora (reference docs vs essays vs recipes) may want different weightings.\n- The `absorption` field from v0.1 is retained, but no band-weighted absorption is synthesized.\n\nCalibration posture and pending empirical work are documented in [`docs/validation/viewport-bands.md`](docs/validation/viewport-bands.md).\n\n## Family\n\nPart of a trio of behavioral-measurement libraries:\n\n- [**approach-retreat**](https://github.com/andyed/approach-retreat) — cursor dynamics on search results (the original home of `computeViewportBandsPure`).\n- [**clicksense**](https://github.com/andyed/clicksense) — motor behavior around clicks, click confidence.\n- **reading-doppler** — paragraph dwell decomposed by viewport band.\n\nSame palette, same 8:1 contrast commitment, same \"brand glyph literally diagrams the behavioral model\" convention.\n\n## Development\n\n```bash\nnode build.js             # rebuild dist/reading-doppler.js (IIFE)\nnpm run test:parity       # JS + Python parity check on band math\npython3 scripts/brand.py  # regenerate brand assets\nnpx serve test            # visual test page with debug panel\n```\n\nNo bundler, no TypeScript, no test runner. The build is a 40-line string-munger; the parity test is the release gate.\n\n## License\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyed%2Freading-doppler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandyed%2Freading-doppler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyed%2Freading-doppler/lists"}