Skip to main content
100%

Order

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jan 29, 2012

This example demonstrates how a user can reorder a list of five items (A–E) through clicks. The initial list is rendered as an HTML `<ul>` using D3’s `d3.select` and `selectAll` chains, with each item bound to the first row of a hardcoded 5×5 string array. Clicking an item triggers the `reorder` function, which calls `.data()` on the existing `li` nodes with that click’s corresponding row, then applies D3’s `.order()` to smoothly animate the reordered elements.

AI-generated description
gpl-3.0 Licensed

Similar vizzes