Skip to main content
100%

Scrolytelling the Penrose triangle

✓ Published0🌍 Public
KKcnarf
Last edited Jul 27, 2018
Created on Jul 18, 2018

This interactive scrollytelling example uses a sticky visualization panel alongside scrolling text to show step-by-step instructions for drawing a Penrose triangle, then explores variations like resizing or distorting the shape. The animation is driven by a scroll-linked `refresh` function that sequences scenes via `onEnter`, `animate`, and `onExit` callbacks. To maintain consistent pacing across segments of varying lengths, the code maps vertical scroll position to a non-linear timeline using `d3.scaleLinear()` with extra intermediate domain-range pairs, as described in tonyhschu's scroll-linked demo. The final SVG is rendered and animated with D3 v5.

AI-generated description

This block experiments scrolly telling with D3.

I apply the technique described by tonyhschu in its Small Scroll-linked Animation Demo block.

The main loop is available through the refresh function (loc #246). The entire story is composed of severall animations/scenes, executed in sequence. Configurations of animations are available right after the main loop, each possibly defining onEnter, animate and onExit callbacks.

A tricky thing was to convert a linear vertical scrolling, to a non-linear animation. For instance, in the main animation (explaining how to hand drawn a Penrose triangle), it takes the same amount of vertical scroll to draw tiny segments (e.i. first, second and fourth segments) and longer ones (i.e. third and fifth ones). Hence, the animation must go faster than normal to draw longer segments. To do so, I use a d3.scaleLinear() with many values. Standard use case sets the domain and range both with 2 values (start and stop mapping). But one can set these props with EXTRA VALUES in order to set INTERMEDIATE MAPPINGS ! (see this tweet).

The use case is a step by step animated explanation on how to draw a Penrose triangle (and some derivatives, at the end of the story).

Acknowledgments to :

mit Licensed

Similar vizzes

Loading thumbnail…

scrollytest5

This scrolling visualization demonstrates a scrollytelling narrative with an interactive SVG/WebGL canvas. It uses D3's dsv module to load and parse data, with sections of the page triggering graphical transitions as the user scrolls. The rendering combines SVG for crisp text and UI elements with WebGL for high-performance drawing of data points, while d3.graph-scroll.js coordinates the scroll events to update the visualization. The animation and scroll-driven interactivity are central to the piece, guiding the viewer through a structured, sequential exploration of the data. The example is built with Blockbuilder.org and is part of a series of experimental scroll-driven visualizations.This is a data visualization example titled **scrollytest5**, created by 35degrees. It is a scroll-driven (scrollytelling) visualization built with D3, using a combination of SVG and WebGL for rendering, with animation. It is part of a series of blocks exploring scroll-based interactions. The visualization uses D3 v4 and the d3-dsv module for data loading, and includes a custom graph-scroll helper for scroll-triggered animations. It is licensed under MIT. --- **Scrollytest5** is an interactive scrollytelling visualization from the D3 block gallery. It uses a scroll-driven narrative to guide viewers through a data story, with visual elements rendered in both SVG and WebGL and animated in response to scroll position. The project builds upon a series of earlier "scrollytest" experiments, iterating on scroll-based storytelling techniques. It leverages the D3.js library, specifically d3-dsv for data parsing, and includes a helper library (graph-scroll.js) to manage the scroll-triggered state changes. The example demonstrates how to create a seamless, engaging, scroll-driven data narrative within the D3.js ecosystem.Here is a concise description for the visualization gallery: This block, titled **scrollytest5**, is an interactive data-driven scrolling visualization. It uses the D3.js framework with SVG and WebGL rendering to create a scroll-driven narrative experience. The visualization leverages a graph-scroll library to animate and transition between different states or scenes as the user scrolls, building upon a series of earlier scrollytest iterations. Built with Blockbuilder.org, it is a part of the author's exploration of scroll-based storytelling with D3. The project is licensed under MIT.

335degrees
75% match