🌍 Public
Viewing a saved revision (read-only)
c8bafc4497424742b25b9d6e98d846f1
Coding Challenge #114: Bubble Sort Visualization
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 descriptionThis is the Coding Challenge #114: Bubble Sort Visualization from The Coding Train.