Skip to main content
Public

Share visualization

Loading preview…

87. D3 Resort

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

87. D3 Resort

0
Aamakanju@nyit.edu
Last edited Feb 23, 2026
Created on Feb 23, 2026

Animated bar chart shows a dataset of 20 values as vertical bars that re-sort between ascending and descending order when clicked. Built with D3.js version 4.5.0, the SVG visualization uses `d3.scaleBand` for the x-axis, `d3.scaleLinear` for the y-axis, and a transition with `duration(1000)` to animate bar repositioning. Each bar’s fill color is derived from its value via an RGB string, and click events toggle the `sortBars` function, which applies `d3.ascending` or `d3.descending` ordering.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed