Scroll-Driven Navigation
interactionAlso known as: scroll navigation, scroll-linked position, scroll-to-explore, scroll panning
Description
Scroll-driven navigation maps the vertical (or horizontal) scroll position of the page directly to a continuous navigation parameter in the visualization — typically time, geographic position, or position along a ranked list. Unlike scrollytelling, which triggers discrete state changes at waypoints, scroll-driven navigation provides a continuous, proportional mapping: scrolling 30% of the way down the page means you are 30% of the way through the data space.
This pattern leverages the most universal interaction on the web — scrolling — and converts it into a data exploration primitive. The user’s scroll position might control the current year displayed on a timeline, the camera latitude on a map flyover, or the position along a ranked list of items. The visualization stays sticky in the viewport while a progress indicator or contextual labels update to reflect the current position within the data space.
Scroll-driven navigation is particularly effective for data that has a natural ordering (time, rank, geography along a path) and where the user benefits from smooth traversal rather than jumping between discrete states. The continuous mapping creates a sense of “scrubbing through” the data, similar to scrubbing through a video timeline. The main design challenge is calibrating the scroll-to-data mapping so that the pace feels natural — too fast and the user overshoots interesting regions, too slow and traversal becomes tedious.
When to Use
- When the data has a natural linear ordering (time, rank, distance along a path) that the user wants to traverse smoothly.
- When the visualization represents a large data space that benefits from continuous exploration rather than discrete jumps.
- In long-form articles or data stories where the reader’s scroll should directly control what data is visible.
- When the audience is accustomed to web scrolling and you want zero-learning-curve navigation.
- For panoramic or wide visualizations (wide timelines, long ranked lists) that cannot fit in one viewport.
When NOT to Use
- When the data does not have a meaningful linear ordering — scroll-mapping would feel arbitrary.
- When the user needs to jump quickly between distant parts of the data space — scrolling is slow for random access.
- When the page already uses scroll for other content and hijacking scroll for the visualization would frustrate users.
- On pages with mixed content where scroll should mean “read more text,” not “navigate the chart.”
- When the visualization has discrete meaningful states — scrollytelling with step triggers is a better fit.
How It Works
- The visualization is placed in a sticky container that remains fixed in the viewport.
- A tall scroll container (often several viewport heights) wraps the visualization, providing the scroll runway.
- A scroll listener computes a normalized progress value (0 to 1) based on how far the user has scrolled.
- The progress value maps to a data position — for example,
progress * (maxYear - minYear) + minYearfor a timeline. - The visualization updates continuously to reflect the current data position: the time cursor moves, the map pans, or the highlighted item shifts.
- A progress indicator (timeline, minimap, or progress bar) shows the user where they are in the overall data space.
- Scrolling in either direction moves forward or backward through the data, with smooth transitions.
Variations
- Scroll-to-time: Scroll position maps to a date on a timeline. Commonly used in historical data stories and annual reviews.
- Scroll-to-geography: Scroll position drives a camera flyover of a geographic path (e.g., scrolling follows a river, a migration route, or a road trip).
- Scroll-to-rank: Scroll position moves through a ranked list, highlighting one item at a time with its associated data.
- Horizontal scroll navigation: The scroll axis is horizontal, often used for wide timelines or Gantt-like charts.
- Scroll with momentum: The mapping includes easing so that quick scrolls produce smooth, decelerating navigation.
- Scroll with detents: The continuous mapping has slight “sticky” zones at important data points (e.g., major events on a timeline), causing a brief pause.
Code Reference
// Scroll-driven timeline navigation
const scrollContainer = document.querySelector(".scroll-runway");
const totalHeight = scrollContainer.scrollHeight - window.innerHeight;
const yearScale = d3.scaleLinear()
.domain([0, totalHeight])
.range([1960, 2024])
.clamp(true);
window.addEventListener("scroll", () => {
const scrollY = window.scrollY;
const currentYear = Math.round(yearScale(scrollY));
// Update visualization to show data for currentYear
updateChart(currentYear);
d3.select("#year-label").text(currentYear);
d3.select("#progress-bar")
.style("width", `${(scrollY / totalHeight) * 100}%`);
});