Problem: Cross-references between Bible verses form a rich web of connections, but traditional cross-reference lists are flat and fail to show the larger network structure. Users can't see how verses connect to each other across books and testaments.
Solution: An interactive force-directed graph that visualizes cross-reference networks. Users start with a focal verse and explore outward by clicking nodes, discovering how verses connect across the entire Bible. Built with a custom Canvas-based physics engine — no external libraries.
Not included: A static list of cross-references (that's the sidebar feature). This is the interactive graph exploration experience.
An interactive network graph where each node is a verse and each edge is a cross-reference connection. Users explore by clicking nodes to expand the network.
User flow:
/crossrefs/[book]/[chapter]/[verse] (e.g., John 3:16)Keyboard shortcuts:
R — reset graph with selected node as new rootV — jump to the selected verse in the readerBackspace — go back in the breadcrumb exploration trailEdge cases:
prefers-reduced-motion: runs physics to completion in one batch instead of animatingGraph rendering: Pure HTML5 Canvas — no SVG, no D3, no external library.
Node colors by Bible section:
Node sizes: Unexpanded = 8px, expanded = 12px.
Interaction: Pan via mouse drag, zoom via scroll wheel. Click nodes to expand/select.
Side panel: Shows selected verse reference, text preview, and action buttons.
Physics engine (crossRefPhysics.ts):
dt / 16.67 (targeting 60fps)Data:
cross_references — 432,949 rows, votes range -31 to 1268GET /api/crossrefs/[bookId]/[chapter]/[verse]?minVotes=N — returns up to 30 refsmax-age=86400, s-maxage=604800Tier gate: crossRefGraph (Pro+)
Components:
CrossRefGraph.svelte — Canvas rendering and interactioncrossRefPhysics.ts — physics simulation engineCrossRefPanel.svelte — side panel for selected node detailsFiles:
apps/web/src/routes/(app)/crossrefs/[book]/[chapter]/[verse]/+page.svelte + +page.server.tsapps/web/src/lib/components/bible/CrossRefGraph.svelteapps/web/src/lib/components/bible/crossRefPhysics.tsapps/web/src/lib/components/bible/CrossRefPanel.svelteapps/web/src/routes/api/crossrefs/[bookId]/[chapter]/[verse]/+server.tsapps/web/src/lib/server/queries/cross-refs.tsCurrent: DONE Milestone: v2 Priority: High — signature Pro feature and visual differentiator
History:
Dependencies: