Skip to main content
100%

Coding Challenge #114: Bubble Sort Visualization

✓ Published0🌍 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
MIT Licensed

Similar vizzes