Skip to main content
Public

Share visualization

Loading preview…

Bubble Sort rAF

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Bubble Sort rAF

0
MMTR
Last edited Apr 5, 2022
Created on Apr 5, 2022
Forked from Bubble Sort

This visualization demonstrates the Bubble Sort algorithm animating a shuffled array of 50 bars, rendered as SVG rectangles inside a single group. The bars are color-coded blue and repositioned via `d3.scaleBand` and `d3.scaleLinear` as the algorithm steps through each comparison and swap. It uses D3 v6 with a React framework, advancing through precomputed array snapshots using `requestAnimationFrame`. Keyboard arrow keys allow stepping forward or backward through the recorded states, while clicking a circle reinitializes the data with a fresh shuffle.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed