Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Coding Challenge #114: Bubble Sort Visualization

Public visualization

Viewing a saved revision (read-only)

e7ff5fbab9c14ddfa04e686807867041

Coding Challenge #114: Bubble Sort Visualization

0 stars0🌍 Public
RRubens
Last edited Oct 6, 2018
Created on Sep 5, 2018
Forked from Cars report

A bubble sort visualization renders 30 random-height vertical bars as SVG line elements on a light green background. The code uses d3-selection’s `selectAll`, `enter`, `merge`, and `exit` to update the bars. After one second, the values are sorted descending via native JavaScript `Array.sort`, swapping the bar heights in place. D3 v5’s `attr` setter maps each line’s x-position from its index and y2 from its value.

AI-generated description